commit stringlengths 40 40 | old_file stringlengths 4 118 | new_file stringlengths 4 118 | old_contents stringlengths 0 2.94k | new_contents stringlengths 1 4.43k | subject stringlengths 15 444 | message stringlengths 16 3.45k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 5 43.2k | prompt stringlengths 17 4.58k | response stringlengths 1 4.43k | prompt_tagged stringlengths 58 4.62k | response_tagged stringlengths 1 4.43k | text stringlengths 132 7.29k | text_tagged stringlengths 173 7.33k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1a73bdd12bbe504e832d18959f588c2f71d02031 | lib_common/src/d1_common/typing.py | lib_common/src/d1_common/typing.py | # This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | Add placeholder for adding type hinting using the new syntax in Python. | Add placeholder for adding type hinting using the new syntax in Python.
| Python | apache-2.0 | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | Add placeholder for adding type hinting using the new syntax in Python. | # This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | <commit_before><commit_msg>Add placeholder for adding type hinting using the new syntax in Python.<commit_after> | # This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | Add placeholder for adding type hinting using the new syntax in Python.# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# L... | <commit_before><commit_msg>Add placeholder for adding type hinting using the new syntax in Python.<commit_after># This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org... | |
0525df595e2252f7165271b62cb52dd0d8eff651 | awx/main/tests/unit/notifications/test_rocketchat.py | awx/main/tests/unit/notifications/test_rocketchat.py | import mock
import pytest
from django.core.mail.message import EmailMessage
import awx.main.notifications.rocketchat_backend as rocketchat_backend
def test_send_messages():
with mock.patch('awx.main.notifications.rocketchat_backend.requests') as requests_mock:
backend = rocketchat_backend.RocketChatBacken... | Add unit test for rocket.chat notifications | Add unit test for rocket.chat notifications
Signed-off-by: Jeandre Le Roux <[email protected]>
| Python | apache-2.0 | wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx | Add unit test for rocket.chat notifications
Signed-off-by: Jeandre Le Roux <[email protected]> | import mock
import pytest
from django.core.mail.message import EmailMessage
import awx.main.notifications.rocketchat_backend as rocketchat_backend
def test_send_messages():
with mock.patch('awx.main.notifications.rocketchat_backend.requests') as requests_mock:
backend = rocketchat_backend.RocketChatBacken... | <commit_before><commit_msg>Add unit test for rocket.chat notifications
Signed-off-by: Jeandre Le Roux <[email protected]><commit_after> | import mock
import pytest
from django.core.mail.message import EmailMessage
import awx.main.notifications.rocketchat_backend as rocketchat_backend
def test_send_messages():
with mock.patch('awx.main.notifications.rocketchat_backend.requests') as requests_mock:
backend = rocketchat_backend.RocketChatBacken... | Add unit test for rocket.chat notifications
Signed-off-by: Jeandre Le Roux <[email protected]>import mock
import pytest
from django.core.mail.message import EmailMessage
import awx.main.notifications.rocketchat_backend as rocketchat_backend
def test_send_messages():
with mo... | <commit_before><commit_msg>Add unit test for rocket.chat notifications
Signed-off-by: Jeandre Le Roux <[email protected]><commit_after>import mock
import pytest
from django.core.mail.message import EmailMessage
import awx.main.notifications.rocketchat_backend as rocketchat_backe... | |
766cc675c52488e658a0884f0e0b5c8b044731b2 | lib/bridgedb/test/test_Storage.py | lib/bridgedb/test/test_Storage.py | #!/usr/bin/env python
"""Unittests for the :mod:`bridgedb.Storage` module."""
from twisted.python import log
from twisted.trial import unittest
import bridgedb.Storage as Storage
from twisted.internet import reactor
from twisted.internet.threads import deferToThread
import os
import threading
from time import sleep
c... | Add unit tests for bridgedb.Storage | Add unit tests for bridgedb.Storage
| Python | bsd-3-clause | mmaker/bridgedb,mmaker/bridgedb,pagea/bridgedb,pagea/bridgedb | Add unit tests for bridgedb.Storage | #!/usr/bin/env python
"""Unittests for the :mod:`bridgedb.Storage` module."""
from twisted.python import log
from twisted.trial import unittest
import bridgedb.Storage as Storage
from twisted.internet import reactor
from twisted.internet.threads import deferToThread
import os
import threading
from time import sleep
c... | <commit_before><commit_msg>Add unit tests for bridgedb.Storage<commit_after> | #!/usr/bin/env python
"""Unittests for the :mod:`bridgedb.Storage` module."""
from twisted.python import log
from twisted.trial import unittest
import bridgedb.Storage as Storage
from twisted.internet import reactor
from twisted.internet.threads import deferToThread
import os
import threading
from time import sleep
c... | Add unit tests for bridgedb.Storage#!/usr/bin/env python
"""Unittests for the :mod:`bridgedb.Storage` module."""
from twisted.python import log
from twisted.trial import unittest
import bridgedb.Storage as Storage
from twisted.internet import reactor
from twisted.internet.threads import deferToThread
import os
import ... | <commit_before><commit_msg>Add unit tests for bridgedb.Storage<commit_after>#!/usr/bin/env python
"""Unittests for the :mod:`bridgedb.Storage` module."""
from twisted.python import log
from twisted.trial import unittest
import bridgedb.Storage as Storage
from twisted.internet import reactor
from twisted.internet.threa... | |
84b31bb02746dec1667cc93a189c6e1c40ffac28 | studygroups/migrations/0015_auto_20150430_0126.py | studygroups/migrations/0015_auto_20150430_0126.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0014_application_accepted_at'),
]
operations = [
migrations.AlterUniqueTogether(
name='studygroup... | Remove unique requirement for study group applications | Remove unique requirement for study group applications
| Python | mit | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles | Remove unique requirement for study group applications | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0014_application_accepted_at'),
]
operations = [
migrations.AlterUniqueTogether(
name='studygroup... | <commit_before><commit_msg>Remove unique requirement for study group applications<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0014_application_accepted_at'),
]
operations = [
migrations.AlterUniqueTogether(
name='studygroup... | Remove unique requirement for study group applications# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0014_application_accepted_at'),
]
operations = [
migrat... | <commit_before><commit_msg>Remove unique requirement for study group applications<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0014_application_accepted_at'),... | |
183faa3b13d933a201f909465f8fcd432d616e04 | tests/basics/class_inherit_mul.py | tests/basics/class_inherit_mul.py | class A:
def __init__(self, x):
print('A init', x)
self.x = x
def f(self):
print(self.x)
def f2(self):
print(self.x)
class B:
def __init__(self, x):
print('B init', x)
self.x = x
def f(self):
print(self.x)
def f3(self):
print(s... | Add testcase for multiple inheritance. | tests: Add testcase for multiple inheritance.
| Python | mit | martinribelotta/micropython,vitiral/micropython,micropython/micropython-esp32,torwag/micropython,rubencabrera/micropython,trezor/micropython,puuu/micropython,neilh10/micropython,xyb/micropython,chrisdearman/micropython,dinau/micropython,slzatz/micropython,praemdonck/micropython,ruffy91/micropython,ChuckM/micropython,he... | tests: Add testcase for multiple inheritance. | class A:
def __init__(self, x):
print('A init', x)
self.x = x
def f(self):
print(self.x)
def f2(self):
print(self.x)
class B:
def __init__(self, x):
print('B init', x)
self.x = x
def f(self):
print(self.x)
def f3(self):
print(s... | <commit_before><commit_msg>tests: Add testcase for multiple inheritance.<commit_after> | class A:
def __init__(self, x):
print('A init', x)
self.x = x
def f(self):
print(self.x)
def f2(self):
print(self.x)
class B:
def __init__(self, x):
print('B init', x)
self.x = x
def f(self):
print(self.x)
def f3(self):
print(s... | tests: Add testcase for multiple inheritance.class A:
def __init__(self, x):
print('A init', x)
self.x = x
def f(self):
print(self.x)
def f2(self):
print(self.x)
class B:
def __init__(self, x):
print('B init', x)
self.x = x
def f(self):
pri... | <commit_before><commit_msg>tests: Add testcase for multiple inheritance.<commit_after>class A:
def __init__(self, x):
print('A init', x)
self.x = x
def f(self):
print(self.x)
def f2(self):
print(self.x)
class B:
def __init__(self, x):
print('B init', x)
... | |
94de257a82a54ed5cb6a4d8c15107e889814b07f | examples/calculations/Gradient.py | examples/calculations/Gradient.py | # Copyright (c) 2015-2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Gradient
========
Use `metpy.calc.gradient`.
This example demonstrates the various ways that MetPy's gradient function
can be utilized.
"""
import numpy as np
import met... | Add example of using gradient. | Add example of using gradient.
| Python | bsd-3-clause | dopplershift/MetPy,ahaberlie/MetPy,Unidata/MetPy,jrleeman/MetPy,ShawnMurd/MetPy,ahaberlie/MetPy,Unidata/MetPy,jrleeman/MetPy,dopplershift/MetPy | Add example of using gradient. | # Copyright (c) 2015-2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Gradient
========
Use `metpy.calc.gradient`.
This example demonstrates the various ways that MetPy's gradient function
can be utilized.
"""
import numpy as np
import met... | <commit_before><commit_msg>Add example of using gradient.<commit_after> | # Copyright (c) 2015-2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Gradient
========
Use `metpy.calc.gradient`.
This example demonstrates the various ways that MetPy's gradient function
can be utilized.
"""
import numpy as np
import met... | Add example of using gradient.# Copyright (c) 2015-2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Gradient
========
Use `metpy.calc.gradient`.
This example demonstrates the various ways that MetPy's gradient function
can be utilized.
"""
... | <commit_before><commit_msg>Add example of using gradient.<commit_after># Copyright (c) 2015-2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Gradient
========
Use `metpy.calc.gradient`.
This example demonstrates the various ways that MetPy's... | |
e8f1f4290b7eb2630cecf7e18da0f3ed2cad58d8 | autobuilder/slack.py | autobuilder/slack.py | import json
from twisted.internet import defer
from twisted.python import log
from buildbot.process.results import CANCELLED, EXCEPTION, FAILURE, SUCCESS, WARNINGS
from buildbot.reporters.notifier import NotifierBase
from buildbot.util import httpclientservice
COLORS = {
CANCELLED: 'warning',
EXCEPTION: 'warn... | Add Slack notifier supporting buildset summaries | Add Slack notifier supporting buildset summaries
| Python | mit | madisongh/autobuilder | Add Slack notifier supporting buildset summaries | import json
from twisted.internet import defer
from twisted.python import log
from buildbot.process.results import CANCELLED, EXCEPTION, FAILURE, SUCCESS, WARNINGS
from buildbot.reporters.notifier import NotifierBase
from buildbot.util import httpclientservice
COLORS = {
CANCELLED: 'warning',
EXCEPTION: 'warn... | <commit_before><commit_msg>Add Slack notifier supporting buildset summaries<commit_after> | import json
from twisted.internet import defer
from twisted.python import log
from buildbot.process.results import CANCELLED, EXCEPTION, FAILURE, SUCCESS, WARNINGS
from buildbot.reporters.notifier import NotifierBase
from buildbot.util import httpclientservice
COLORS = {
CANCELLED: 'warning',
EXCEPTION: 'warn... | Add Slack notifier supporting buildset summariesimport json
from twisted.internet import defer
from twisted.python import log
from buildbot.process.results import CANCELLED, EXCEPTION, FAILURE, SUCCESS, WARNINGS
from buildbot.reporters.notifier import NotifierBase
from buildbot.util import httpclientservice
COLORS = ... | <commit_before><commit_msg>Add Slack notifier supporting buildset summaries<commit_after>import json
from twisted.internet import defer
from twisted.python import log
from buildbot.process.results import CANCELLED, EXCEPTION, FAILURE, SUCCESS, WARNINGS
from buildbot.reporters.notifier import NotifierBase
from buildbot... | |
5a97b4b6327dee09fa32eff68c8a934e85405853 | txircd/modules/extra/connlimit.py | txircd/modules/extra/connlimit.py | from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ConnectionLimit(ModuleData):
implements(IPlugin, IModuleData)
name = "ConnectionLimit"
peerConnections = {}
def hookIRCd(self, ircd):
self.ircd = ircd
... | Implement the connection limit module | Implement the connection limit module
| Python | bsd-3-clause | Heufneutje/txircd,ElementalAlchemist/txircd | Implement the connection limit module | from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ConnectionLimit(ModuleData):
implements(IPlugin, IModuleData)
name = "ConnectionLimit"
peerConnections = {}
def hookIRCd(self, ircd):
self.ircd = ircd
... | <commit_before><commit_msg>Implement the connection limit module<commit_after> | from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ConnectionLimit(ModuleData):
implements(IPlugin, IModuleData)
name = "ConnectionLimit"
peerConnections = {}
def hookIRCd(self, ircd):
self.ircd = ircd
... | Implement the connection limit modulefrom twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ConnectionLimit(ModuleData):
implements(IPlugin, IModuleData)
name = "ConnectionLimit"
peerConnections = {}
def hookIRCd(self... | <commit_before><commit_msg>Implement the connection limit module<commit_after>from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ConnectionLimit(ModuleData):
implements(IPlugin, IModuleData)
name = "ConnectionLimit"
pe... | |
c3009dfd74f61813950160d9a4a826613db75249 | dynd/tests/test_type_pattern_match.py | dynd/tests/test_type_pattern_match.py | import sys
import unittest
from dynd import nd, ndt
class TestTypePatternMatch(unittest.TestCase):
def test_simple(self):
self.assertTrue(ndt.int32.matches(ndt.int32))
self.assertTrue(ndt.int16.matches('T'))
self.assertTrue(ndt.int16.matches('... * T'))
self.assertTrue(ndt.int16.mat... | Add some python tests of the type pattern matching | Add some python tests of the type pattern matching
| Python | bsd-2-clause | insertinterestingnamehere/dynd-python,izaid/dynd-python,izaid/dynd-python,michaelpacer/dynd-python,mwiebe/dynd-python,pombredanne/dynd-python,insertinterestingnamehere/dynd-python,ContinuumIO/dynd-python,izaid/dynd-python,cpcloud/dynd-python,izaid/dynd-python,aterrel/dynd-python,aterrel/dynd-python,aterrel/dynd-python,... | Add some python tests of the type pattern matching | import sys
import unittest
from dynd import nd, ndt
class TestTypePatternMatch(unittest.TestCase):
def test_simple(self):
self.assertTrue(ndt.int32.matches(ndt.int32))
self.assertTrue(ndt.int16.matches('T'))
self.assertTrue(ndt.int16.matches('... * T'))
self.assertTrue(ndt.int16.mat... | <commit_before><commit_msg>Add some python tests of the type pattern matching<commit_after> | import sys
import unittest
from dynd import nd, ndt
class TestTypePatternMatch(unittest.TestCase):
def test_simple(self):
self.assertTrue(ndt.int32.matches(ndt.int32))
self.assertTrue(ndt.int16.matches('T'))
self.assertTrue(ndt.int16.matches('... * T'))
self.assertTrue(ndt.int16.mat... | Add some python tests of the type pattern matchingimport sys
import unittest
from dynd import nd, ndt
class TestTypePatternMatch(unittest.TestCase):
def test_simple(self):
self.assertTrue(ndt.int32.matches(ndt.int32))
self.assertTrue(ndt.int16.matches('T'))
self.assertTrue(ndt.int16.matches... | <commit_before><commit_msg>Add some python tests of the type pattern matching<commit_after>import sys
import unittest
from dynd import nd, ndt
class TestTypePatternMatch(unittest.TestCase):
def test_simple(self):
self.assertTrue(ndt.int32.matches(ndt.int32))
self.assertTrue(ndt.int16.matches('T'))
... | |
71a8209f5b68a8edc663e876b369fd891a79a863 | lucid/misc/convert_matplotlib.py | lucid/misc/convert_matplotlib.py | import io
import numpy as np
from PIL import Image
def matplotlib_to_numpy(plt):
"""Convert a matplotlib plot to a numpy array represent it as an image.
Inputs:
plot - matplotlib plot
Returns:
A numpy array with shape [W, H, 3], representing RGB values between 0 and 1.
"""
f = io.BytesIO()
plt... | Add matplotlib plot -> numpy image util | Add matplotlib plot -> numpy image util
| Python | apache-2.0 | tensorflow/lucid,tensorflow/lucid,tensorflow/lucid,tensorflow/lucid | Add matplotlib plot -> numpy image util | import io
import numpy as np
from PIL import Image
def matplotlib_to_numpy(plt):
"""Convert a matplotlib plot to a numpy array represent it as an image.
Inputs:
plot - matplotlib plot
Returns:
A numpy array with shape [W, H, 3], representing RGB values between 0 and 1.
"""
f = io.BytesIO()
plt... | <commit_before><commit_msg>Add matplotlib plot -> numpy image util<commit_after> | import io
import numpy as np
from PIL import Image
def matplotlib_to_numpy(plt):
"""Convert a matplotlib plot to a numpy array represent it as an image.
Inputs:
plot - matplotlib plot
Returns:
A numpy array with shape [W, H, 3], representing RGB values between 0 and 1.
"""
f = io.BytesIO()
plt... | Add matplotlib plot -> numpy image utilimport io
import numpy as np
from PIL import Image
def matplotlib_to_numpy(plt):
"""Convert a matplotlib plot to a numpy array represent it as an image.
Inputs:
plot - matplotlib plot
Returns:
A numpy array with shape [W, H, 3], representing RGB values between 0 a... | <commit_before><commit_msg>Add matplotlib plot -> numpy image util<commit_after>import io
import numpy as np
from PIL import Image
def matplotlib_to_numpy(plt):
"""Convert a matplotlib plot to a numpy array represent it as an image.
Inputs:
plot - matplotlib plot
Returns:
A numpy array with shape [W, H... | |
32a55869f9b7c1493e00db3f5fc622f5f73dced0 | mecode/devices/efd_pico_pulse.py | mecode/devices/efd_pico_pulse.py | ##############################################################################
#
# For EFD PICO Touch/Pulse controller and jetter
#
##############################################################################
import serial
# Constants
EOT = '\r'
ACK = '<3'
class EFDPicoPulse(object):
def __init__(self, compor... | Add initial picoPulse to devices | Add initial picoPulse to devices
| Python | mit | razeh/mecode,jminardi/mecode | Add initial picoPulse to devices | ##############################################################################
#
# For EFD PICO Touch/Pulse controller and jetter
#
##############################################################################
import serial
# Constants
EOT = '\r'
ACK = '<3'
class EFDPicoPulse(object):
def __init__(self, compor... | <commit_before><commit_msg>Add initial picoPulse to devices<commit_after> | ##############################################################################
#
# For EFD PICO Touch/Pulse controller and jetter
#
##############################################################################
import serial
# Constants
EOT = '\r'
ACK = '<3'
class EFDPicoPulse(object):
def __init__(self, compor... | Add initial picoPulse to devices##############################################################################
#
# For EFD PICO Touch/Pulse controller and jetter
#
##############################################################################
import serial
# Constants
EOT = '\r'
ACK = '<3'
class EFDPicoPulse(object)... | <commit_before><commit_msg>Add initial picoPulse to devices<commit_after>##############################################################################
#
# For EFD PICO Touch/Pulse controller and jetter
#
##############################################################################
import serial
# Constants
EOT = '\... | |
58b1a723af7ba161398dbb6b77096c2974ec311f | pyli.py | pyli.py | import parser
import token
import symbol
import sys
from pprint import pprint
tree = parser.st2tuple(parser.suite(sys.argv[1]))
def convert_readable(tree):
return tuple(((token.tok_name[i]
if token.tok_name.get(i) else
symbol.sym_name[i])
if isinstance(i, i... | Add routine to make the parse tree ammenable | Add routine to make the parse tree ammenable
| Python | mit | thenoviceoof/pyli | Add routine to make the parse tree ammenable | import parser
import token
import symbol
import sys
from pprint import pprint
tree = parser.st2tuple(parser.suite(sys.argv[1]))
def convert_readable(tree):
return tuple(((token.tok_name[i]
if token.tok_name.get(i) else
symbol.sym_name[i])
if isinstance(i, i... | <commit_before><commit_msg>Add routine to make the parse tree ammenable<commit_after> | import parser
import token
import symbol
import sys
from pprint import pprint
tree = parser.st2tuple(parser.suite(sys.argv[1]))
def convert_readable(tree):
return tuple(((token.tok_name[i]
if token.tok_name.get(i) else
symbol.sym_name[i])
if isinstance(i, i... | Add routine to make the parse tree ammenableimport parser
import token
import symbol
import sys
from pprint import pprint
tree = parser.st2tuple(parser.suite(sys.argv[1]))
def convert_readable(tree):
return tuple(((token.tok_name[i]
if token.tok_name.get(i) else
symbol.sym_n... | <commit_before><commit_msg>Add routine to make the parse tree ammenable<commit_after>import parser
import token
import symbol
import sys
from pprint import pprint
tree = parser.st2tuple(parser.suite(sys.argv[1]))
def convert_readable(tree):
return tuple(((token.tok_name[i]
if token.tok_name.ge... | |
46ae9c191abca889eeb601542eb1ea33224b3b94 | scripts/monitoring/cron-send-node-taints-status.py | scripts/monitoring/cron-send-node-taints-status.py | #!/usr/bin/env python
""" Node taints check for OpenShift V3 """
# Adding the ignore because it does not like the naming of the script
# to be different than the class name
# pylint: disable=invalid-name
# pylint: disable=wrong-import-position
# pylint: disable=broad-except
# pylint: disable=line-too-long
import arg... | Add monitor script for taints | Add monitor script for taints
| Python | apache-2.0 | blrm/openshift-tools,blrm/openshift-tools,blrm/openshift-tools,blrm/openshift-tools,blrm/openshift-tools,blrm/openshift-tools | Add monitor script for taints | #!/usr/bin/env python
""" Node taints check for OpenShift V3 """
# Adding the ignore because it does not like the naming of the script
# to be different than the class name
# pylint: disable=invalid-name
# pylint: disable=wrong-import-position
# pylint: disable=broad-except
# pylint: disable=line-too-long
import arg... | <commit_before><commit_msg>Add monitor script for taints<commit_after> | #!/usr/bin/env python
""" Node taints check for OpenShift V3 """
# Adding the ignore because it does not like the naming of the script
# to be different than the class name
# pylint: disable=invalid-name
# pylint: disable=wrong-import-position
# pylint: disable=broad-except
# pylint: disable=line-too-long
import arg... | Add monitor script for taints#!/usr/bin/env python
""" Node taints check for OpenShift V3 """
# Adding the ignore because it does not like the naming of the script
# to be different than the class name
# pylint: disable=invalid-name
# pylint: disable=wrong-import-position
# pylint: disable=broad-except
# pylint: disa... | <commit_before><commit_msg>Add monitor script for taints<commit_after>#!/usr/bin/env python
""" Node taints check for OpenShift V3 """
# Adding the ignore because it does not like the naming of the script
# to be different than the class name
# pylint: disable=invalid-name
# pylint: disable=wrong-import-position
# py... | |
3627c5ce2d35e647f359476e784b067506de44e4 | django_auth_policy/management/commands/unlock_all.py | django_auth_policy/management/commands/unlock_all.py | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django_auth_policy.models import LoginAttempt
class Command(BaseCommand):
help = "Remove all locks on usernames and IP addresses"
def handle(self, *args, **options):
c = LoginAttempt.objects.filte... | Add management command which unlocks all lockout commands | Add management command which unlocks all lockout commands
| Python | bsd-3-clause | mcella/django-auth-policy,mcella/django-auth-policy,Dreamsolution/django-auth-policy,Dreamsolution/django-auth-policy | Add management command which unlocks all lockout commands | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django_auth_policy.models import LoginAttempt
class Command(BaseCommand):
help = "Remove all locks on usernames and IP addresses"
def handle(self, *args, **options):
c = LoginAttempt.objects.filte... | <commit_before><commit_msg>Add management command which unlocks all lockout commands<commit_after> | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django_auth_policy.models import LoginAttempt
class Command(BaseCommand):
help = "Remove all locks on usernames and IP addresses"
def handle(self, *args, **options):
c = LoginAttempt.objects.filte... | Add management command which unlocks all lockout commandsfrom django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django_auth_policy.models import LoginAttempt
class Command(BaseCommand):
help = "Remove all locks on usernames and IP addresses"
def handle(self, ... | <commit_before><commit_msg>Add management command which unlocks all lockout commands<commit_after>from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django_auth_policy.models import LoginAttempt
class Command(BaseCommand):
help = "Remove all locks on usernames... | |
795dfe1df9ca3e0ada86de450e5f7cf2c80fe4e2 | tests/test_context_processors.py | tests/test_context_processors.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from responsive.conf import settings
from responsive.context_processors import device
fro... | Add tests for responsive context_processors | Add tests for responsive context_processors
| Python | bsd-3-clause | mishbahr/django-responsive2,mishbahr/django-responsive2 | Add tests for responsive context_processors | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from responsive.conf import settings
from responsive.context_processors import device
fro... | <commit_before><commit_msg>Add tests for responsive context_processors<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from responsive.conf import settings
from responsive.context_processors import device
fro... | Add tests for responsive context_processors#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from responsive.conf import settings
from resp... | <commit_before><commit_msg>Add tests for responsive context_processors<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from ... | |
3ef65ebffe960e205abe3efd36e5a5690a3ee947 | arcutils/exc.py | arcutils/exc.py | import warnings
class ARCUtilsDeprecationWarning(DeprecationWarning):
@classmethod
def warn(cls, message, stacklevel=2):
warnings.warn(message, cls, stacklevel)
warnings.simplefilter('default', ARCUtilsDeprecationWarning)
| Add a mechanism for deprecating things | Add a mechanism for deprecating things
| Python | mit | PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils | Add a mechanism for deprecating things | import warnings
class ARCUtilsDeprecationWarning(DeprecationWarning):
@classmethod
def warn(cls, message, stacklevel=2):
warnings.warn(message, cls, stacklevel)
warnings.simplefilter('default', ARCUtilsDeprecationWarning)
| <commit_before><commit_msg>Add a mechanism for deprecating things<commit_after> | import warnings
class ARCUtilsDeprecationWarning(DeprecationWarning):
@classmethod
def warn(cls, message, stacklevel=2):
warnings.warn(message, cls, stacklevel)
warnings.simplefilter('default', ARCUtilsDeprecationWarning)
| Add a mechanism for deprecating thingsimport warnings
class ARCUtilsDeprecationWarning(DeprecationWarning):
@classmethod
def warn(cls, message, stacklevel=2):
warnings.warn(message, cls, stacklevel)
warnings.simplefilter('default', ARCUtilsDeprecationWarning)
| <commit_before><commit_msg>Add a mechanism for deprecating things<commit_after>import warnings
class ARCUtilsDeprecationWarning(DeprecationWarning):
@classmethod
def warn(cls, message, stacklevel=2):
warnings.warn(message, cls, stacklevel)
warnings.simplefilter('default', ARCUtilsDeprecationWarning... | |
c11e88c6baa95bcbf72c3a5e09e203a5b74c3bc8 | python/bin/python/pyqt4_symlinks.py | python/bin/python/pyqt4_symlinks.py | #!/usr/bin/env python
import os
import sys
from builtins import FileExistsError
try:
venv = os.environ['VIRTUAL_ENV']
except KeyError:
print('Virtual environment is not detected.')
raise
python_venv_version = sys.version_info[:2]
site_version = str(python_venv_version[0]) + '.' + str(python_venv_version[... | Add Python code for making symlinks for PyQt4 and SIP into a virtualenv | Add Python code for making symlinks for PyQt4 and SIP into a virtualenv
| Python | mit | edwinksl/dotfiles,edwinksl/dotfiles | Add Python code for making symlinks for PyQt4 and SIP into a virtualenv | #!/usr/bin/env python
import os
import sys
from builtins import FileExistsError
try:
venv = os.environ['VIRTUAL_ENV']
except KeyError:
print('Virtual environment is not detected.')
raise
python_venv_version = sys.version_info[:2]
site_version = str(python_venv_version[0]) + '.' + str(python_venv_version[... | <commit_before><commit_msg>Add Python code for making symlinks for PyQt4 and SIP into a virtualenv<commit_after> | #!/usr/bin/env python
import os
import sys
from builtins import FileExistsError
try:
venv = os.environ['VIRTUAL_ENV']
except KeyError:
print('Virtual environment is not detected.')
raise
python_venv_version = sys.version_info[:2]
site_version = str(python_venv_version[0]) + '.' + str(python_venv_version[... | Add Python code for making symlinks for PyQt4 and SIP into a virtualenv#!/usr/bin/env python
import os
import sys
from builtins import FileExistsError
try:
venv = os.environ['VIRTUAL_ENV']
except KeyError:
print('Virtual environment is not detected.')
raise
python_venv_version = sys.version_info[:2]
site... | <commit_before><commit_msg>Add Python code for making symlinks for PyQt4 and SIP into a virtualenv<commit_after>#!/usr/bin/env python
import os
import sys
from builtins import FileExistsError
try:
venv = os.environ['VIRTUAL_ENV']
except KeyError:
print('Virtual environment is not detected.')
raise
python... | |
d0934c5530b2deaffa6a0f76ef997861412442b2 | setup.py | setup.py | from setuptools import setup, find_packages
with open('README.md', 'r') as f:
README = f.read()
setup(name='apigpio',
version='0.0.1',
description='asyncio-based python client for pigpiod',
long_description=README,
classifiers=[
"Development Status :: 3 - Alpha",
"Int... | Add basic python packaing info. | Add basic python packaing info.
| Python | mit | PierreRust/apigpio | Add basic python packaing info. | from setuptools import setup, find_packages
with open('README.md', 'r') as f:
README = f.read()
setup(name='apigpio',
version='0.0.1',
description='asyncio-based python client for pigpiod',
long_description=README,
classifiers=[
"Development Status :: 3 - Alpha",
"Int... | <commit_before><commit_msg>Add basic python packaing info.<commit_after> | from setuptools import setup, find_packages
with open('README.md', 'r') as f:
README = f.read()
setup(name='apigpio',
version='0.0.1',
description='asyncio-based python client for pigpiod',
long_description=README,
classifiers=[
"Development Status :: 3 - Alpha",
"Int... | Add basic python packaing info.from setuptools import setup, find_packages
with open('README.md', 'r') as f:
README = f.read()
setup(name='apigpio',
version='0.0.1',
description='asyncio-based python client for pigpiod',
long_description=README,
classifiers=[
"Development Statu... | <commit_before><commit_msg>Add basic python packaing info.<commit_after>from setuptools import setup, find_packages
with open('README.md', 'r') as f:
README = f.read()
setup(name='apigpio',
version='0.0.1',
description='asyncio-based python client for pigpiod',
long_description=README,
c... | |
048c992ca7c9ebabab9a9f60d9432b99111e573e | stats.py | stats.py | import re
import sqlite3
def open_cloudfront_log_db():
db = sqlite3.connect('cf.db')
return db
def format_size(sz):
abbrevs = (
(1<<50, 'PB'),
(1<<40, 'TB'),
(1<<30, 'GB'),
(1<<20, 'MB'),
(1<<10, 'KB'),
(1, 'B')
)
for factor, suffix in abbrevs:
... | Print total byte count from db | Print total byte count from db
| Python | bsd-2-clause | hortont424/cfwatch | Print total byte count from db | import re
import sqlite3
def open_cloudfront_log_db():
db = sqlite3.connect('cf.db')
return db
def format_size(sz):
abbrevs = (
(1<<50, 'PB'),
(1<<40, 'TB'),
(1<<30, 'GB'),
(1<<20, 'MB'),
(1<<10, 'KB'),
(1, 'B')
)
for factor, suffix in abbrevs:
... | <commit_before><commit_msg>Print total byte count from db<commit_after> | import re
import sqlite3
def open_cloudfront_log_db():
db = sqlite3.connect('cf.db')
return db
def format_size(sz):
abbrevs = (
(1<<50, 'PB'),
(1<<40, 'TB'),
(1<<30, 'GB'),
(1<<20, 'MB'),
(1<<10, 'KB'),
(1, 'B')
)
for factor, suffix in abbrevs:
... | Print total byte count from dbimport re
import sqlite3
def open_cloudfront_log_db():
db = sqlite3.connect('cf.db')
return db
def format_size(sz):
abbrevs = (
(1<<50, 'PB'),
(1<<40, 'TB'),
(1<<30, 'GB'),
(1<<20, 'MB'),
(1<<10, 'KB'),
(1, 'B')
)
for f... | <commit_before><commit_msg>Print total byte count from db<commit_after>import re
import sqlite3
def open_cloudfront_log_db():
db = sqlite3.connect('cf.db')
return db
def format_size(sz):
abbrevs = (
(1<<50, 'PB'),
(1<<40, 'TB'),
(1<<30, 'GB'),
(1<<20, 'MB'),
(1<<10,... | |
92e3464a08fd7c8b38dbae9c3ea15f9f6f2b64ac | ReSId.py | ReSId.py | """
The GLEAM REsidual Source IDentifier program
Created by:
Robin Cook
March 24 2016
Modifications by:
Robin Cook
"""
# Imports
import sys
import os
import numpy as np
import math
# Other Imports
import scipy
import astropy
from optparse import OptionParser
usage = "usage: %prog [options] ... | Include initial option parser framework | Include initial option parser framework | Python | mit | AstroRobin/GLEAM-RESID | Include initial option parser framework | """
The GLEAM REsidual Source IDentifier program
Created by:
Robin Cook
March 24 2016
Modifications by:
Robin Cook
"""
# Imports
import sys
import os
import numpy as np
import math
# Other Imports
import scipy
import astropy
from optparse import OptionParser
usage = "usage: %prog [options] ... | <commit_before><commit_msg>Include initial option parser framework<commit_after> | """
The GLEAM REsidual Source IDentifier program
Created by:
Robin Cook
March 24 2016
Modifications by:
Robin Cook
"""
# Imports
import sys
import os
import numpy as np
import math
# Other Imports
import scipy
import astropy
from optparse import OptionParser
usage = "usage: %prog [options] ... | Include initial option parser framework"""
The GLEAM REsidual Source IDentifier program
Created by:
Robin Cook
March 24 2016
Modifications by:
Robin Cook
"""
# Imports
import sys
import os
import numpy as np
import math
# Other Imports
import scipy
import astropy
from optparse import OptionPar... | <commit_before><commit_msg>Include initial option parser framework<commit_after>"""
The GLEAM REsidual Source IDentifier program
Created by:
Robin Cook
March 24 2016
Modifications by:
Robin Cook
"""
# Imports
import sys
import os
import numpy as np
import math
# Other Imports
import scipy
import ... | |
ae95f79ebced40badfbe7dff72ced0c4436567b1 | context_processors.py | context_processors.py | from django.conf import settings as sett
def settings(request):
my_dict = {
'SB_ROOT': sett.SB_ROOT,
'SITE_URL': sett.SITE_URL,
'SITE_NAME': sett.SITE_NAME,
'SITE_AUTHOR': sett.SITE_AUTHOR,
'PuSH_URL': sett.PUBSUBHUBBUB_URL,
}
return my_dict
| Add context processor for adding in data from the django settings file | Add context processor for adding in data from the django settings file
| Python | mit | kyleconroy/stashboard2 | Add context processor for adding in data from the django settings file | from django.conf import settings as sett
def settings(request):
my_dict = {
'SB_ROOT': sett.SB_ROOT,
'SITE_URL': sett.SITE_URL,
'SITE_NAME': sett.SITE_NAME,
'SITE_AUTHOR': sett.SITE_AUTHOR,
'PuSH_URL': sett.PUBSUBHUBBUB_URL,
}
return my_dict
| <commit_before><commit_msg>Add context processor for adding in data from the django settings file<commit_after> | from django.conf import settings as sett
def settings(request):
my_dict = {
'SB_ROOT': sett.SB_ROOT,
'SITE_URL': sett.SITE_URL,
'SITE_NAME': sett.SITE_NAME,
'SITE_AUTHOR': sett.SITE_AUTHOR,
'PuSH_URL': sett.PUBSUBHUBBUB_URL,
}
return my_dict
| Add context processor for adding in data from the django settings filefrom django.conf import settings as sett
def settings(request):
my_dict = {
'SB_ROOT': sett.SB_ROOT,
'SITE_URL': sett.SITE_URL,
'SITE_NAME': sett.SITE_NAME,
'SITE_AUTHOR': sett.SITE_AUTHOR,
'PuSH_URL': se... | <commit_before><commit_msg>Add context processor for adding in data from the django settings file<commit_after>from django.conf import settings as sett
def settings(request):
my_dict = {
'SB_ROOT': sett.SB_ROOT,
'SITE_URL': sett.SITE_URL,
'SITE_NAME': sett.SITE_NAME,
'SITE_AUTHOR':... | |
96e853995203aae902416b4ba82707161ac6170c | IPython/core/tests/test_prompts.py | IPython/core/tests/test_prompts.py | """Tests for prompt generation."""
import unittest
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
from IPython.core.prompts import PromptManager
from IPython.testing.globalipapp import get_ipython
ip = get_ipython()
class PromptTests(unittest.TestCase):
def setUp(self):
... | Add tests for prompt system. | Add tests for prompt system.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | Add tests for prompt system. | """Tests for prompt generation."""
import unittest
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
from IPython.core.prompts import PromptManager
from IPython.testing.globalipapp import get_ipython
ip = get_ipython()
class PromptTests(unittest.TestCase):
def setUp(self):
... | <commit_before><commit_msg>Add tests for prompt system.<commit_after> | """Tests for prompt generation."""
import unittest
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
from IPython.core.prompts import PromptManager
from IPython.testing.globalipapp import get_ipython
ip = get_ipython()
class PromptTests(unittest.TestCase):
def setUp(self):
... | Add tests for prompt system."""Tests for prompt generation."""
import unittest
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
from IPython.core.prompts import PromptManager
from IPython.testing.globalipapp import get_ipython
ip = get_ipython()
class PromptTests(unittest.TestCas... | <commit_before><commit_msg>Add tests for prompt system.<commit_after>"""Tests for prompt generation."""
import unittest
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
from IPython.core.prompts import PromptManager
from IPython.testing.globalipapp import get_ipython
ip = get_ipyth... | |
2576ad51ffeaecd645d030ca875c82f66ecd5ee8 | learntools/computer_vision/ex3.py | learntools/computer_vision/ex3.py | from learntools.core import *
import tensorflow as tf
class Q1(CodingProblem):
_vars = ['image_condense', 'image_detect', 'image_filter', 'image']
_hint = ""
_solution = CS("""
image_filter = tf.nn.conv2d(
input=image,
filters=kernel,
strides=1,
padding='SAME',
)
""")
def check(self, im... | Add exercise 3 checking code | Add exercise 3 checking code
| Python | apache-2.0 | Kaggle/learntools,Kaggle/learntools | Add exercise 3 checking code | from learntools.core import *
import tensorflow as tf
class Q1(CodingProblem):
_vars = ['image_condense', 'image_detect', 'image_filter', 'image']
_hint = ""
_solution = CS("""
image_filter = tf.nn.conv2d(
input=image,
filters=kernel,
strides=1,
padding='SAME',
)
""")
def check(self, im... | <commit_before><commit_msg>Add exercise 3 checking code<commit_after> | from learntools.core import *
import tensorflow as tf
class Q1(CodingProblem):
_vars = ['image_condense', 'image_detect', 'image_filter', 'image']
_hint = ""
_solution = CS("""
image_filter = tf.nn.conv2d(
input=image,
filters=kernel,
strides=1,
padding='SAME',
)
""")
def check(self, im... | Add exercise 3 checking codefrom learntools.core import *
import tensorflow as tf
class Q1(CodingProblem):
_vars = ['image_condense', 'image_detect', 'image_filter', 'image']
_hint = ""
_solution = CS("""
image_filter = tf.nn.conv2d(
input=image,
filters=kernel,
strides=1,
padding='SAME',
)... | <commit_before><commit_msg>Add exercise 3 checking code<commit_after>from learntools.core import *
import tensorflow as tf
class Q1(CodingProblem):
_vars = ['image_condense', 'image_detect', 'image_filter', 'image']
_hint = ""
_solution = CS("""
image_filter = tf.nn.conv2d(
input=image,
filters=ker... | |
2e18b548bb13a274e94f4d3e36a631f9aa3e79a4 | taskflow/tests/unit/test_utils.py | taskflow/tests/unit/test_utils.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | Add a basic rollback accumlator test. | Add a basic rollback accumlator test.
| Python | apache-2.0 | jessicalucci/TaskManagement,openstack/taskflow,pombredanne/taskflow-1,citrix-openstack-build/taskflow,junneyang/taskflow,varunarya10/taskflow,openstack/taskflow,jessicalucci/TaskManagement,jimbobhickville/taskflow,citrix-openstack-build/taskflow,varunarya10/taskflow,junneyang/taskflow,pombredanne/taskflow-1,jimbobhickv... | Add a basic rollback accumlator test. | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | <commit_before><commit_msg>Add a basic rollback accumlator test.<commit_after> | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | Add a basic rollback accumlator test.# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
... | <commit_before><commit_msg>Add a basic rollback accumlator test.<commit_after># -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in com... | |
324cafc24bae3c9ecb0b06ad8701e2b4c40c75c2 | migration/versions/014_Add_terms_column.py | migration/versions/014_Add_terms_column.py | from sqlalchemy import Boolean, Column, MetaData, Table
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
account = Table('account', meta, autoload=True)
termsc = Column('terms', Boolean, default=False)
termsc.create(account, populate_default=True)
def downgrade(migrate_en... | Add migration for terms column | Add migration for terms column
| Python | agpl-3.0 | johnjohndoe/spendb,CivicVision/datahub,pudo/spendb,johnjohndoe/spendb,USStateDept/FPA_Core,openspending/spendb,pudo/spendb,pudo/spendb,nathanhilbert/FPA_Core,nathanhilbert/FPA_Core,USStateDept/FPA_Core,openspending/spendb,spendb/spendb,nathanhilbert/FPA_Core,openspending/spendb,CivicVision/datahub,CivicVision/datahub,j... | Add migration for terms column | from sqlalchemy import Boolean, Column, MetaData, Table
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
account = Table('account', meta, autoload=True)
termsc = Column('terms', Boolean, default=False)
termsc.create(account, populate_default=True)
def downgrade(migrate_en... | <commit_before><commit_msg>Add migration for terms column<commit_after> | from sqlalchemy import Boolean, Column, MetaData, Table
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
account = Table('account', meta, autoload=True)
termsc = Column('terms', Boolean, default=False)
termsc.create(account, populate_default=True)
def downgrade(migrate_en... | Add migration for terms columnfrom sqlalchemy import Boolean, Column, MetaData, Table
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
account = Table('account', meta, autoload=True)
termsc = Column('terms', Boolean, default=False)
termsc.create(account, populate_default=Tr... | <commit_before><commit_msg>Add migration for terms column<commit_after>from sqlalchemy import Boolean, Column, MetaData, Table
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
account = Table('account', meta, autoload=True)
termsc = Column('terms', Boolean, default=False)
t... | |
bdadf9b67b6f35566d7ff874522aeaf4ee519e24 | tests/test_configure_alt_name.py | tests/test_configure_alt_name.py | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
#todo: merge into test_series
def age_series(**kwargs):
from flexget.plugins.filter.series import Release
from flexget.manager import Session
import datetime
session = Session()
session.query(Release).... | Test for series configure loading alternate name | Test for series configure loading alternate name
| Python | mit | jawilson/Flexget,poulpito/Flexget,dsemi/Flexget,tarzasai/Flexget,X-dark/Flexget,jawilson/Flexget,antivirtel/Flexget,antivirtel/Flexget,vfrc2/Flexget,Flexget/Flexget,thalamus/Flexget,LynxyssCZ/Flexget,ianstalk/Flexget,spencerjanssen/Flexget,patsissons/Flexget,ratoaq2/Flexget,malkavi/Flexget,xfouloux/Flexget,tvcsantos/Fl... | Test for series configure loading alternate name | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
#todo: merge into test_series
def age_series(**kwargs):
from flexget.plugins.filter.series import Release
from flexget.manager import Session
import datetime
session = Session()
session.query(Release).... | <commit_before><commit_msg>Test for series configure loading alternate name<commit_after> | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
#todo: merge into test_series
def age_series(**kwargs):
from flexget.plugins.filter.series import Release
from flexget.manager import Session
import datetime
session = Session()
session.query(Release).... | Test for series configure loading alternate namefrom __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
#todo: merge into test_series
def age_series(**kwargs):
from flexget.plugins.filter.series import Release
from flexget.manager import Session
import datetime
... | <commit_before><commit_msg>Test for series configure loading alternate name<commit_after>from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
#todo: merge into test_series
def age_series(**kwargs):
from flexget.plugins.filter.series import Release
from flexget.manag... | |
50bd84ed86c924fa5b020dd1200ccbfcd95aaf1d | tests/test_requests.py | tests/test_requests.py | # -*- coding: utf-8 -*-
"""
Add comment here
~~~~~~~~~~~~~~~~
Add descripton here
:copyright: (c) 2014 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import os
import shutil
import requests
from unittest import TestCase
from unittest import skip
from autodo... | Add requests test. But now skipping. | Add requests test. But now skipping.
| Python | bsd-3-clause | heavenshell/py-autodoc | Add requests test. But now skipping. | # -*- coding: utf-8 -*-
"""
Add comment here
~~~~~~~~~~~~~~~~
Add descripton here
:copyright: (c) 2014 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import os
import shutil
import requests
from unittest import TestCase
from unittest import skip
from autodo... | <commit_before><commit_msg>Add requests test. But now skipping.<commit_after> | # -*- coding: utf-8 -*-
"""
Add comment here
~~~~~~~~~~~~~~~~
Add descripton here
:copyright: (c) 2014 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import os
import shutil
import requests
from unittest import TestCase
from unittest import skip
from autodo... | Add requests test. But now skipping.# -*- coding: utf-8 -*-
"""
Add comment here
~~~~~~~~~~~~~~~~
Add descripton here
:copyright: (c) 2014 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import os
import shutil
import requests
from unittest import TestCase
f... | <commit_before><commit_msg>Add requests test. But now skipping.<commit_after># -*- coding: utf-8 -*-
"""
Add comment here
~~~~~~~~~~~~~~~~
Add descripton here
:copyright: (c) 2014 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import os
import shutil
import... | |
380a86134a62265eb944d717cad002bbc4197be4 | cjdata/views.py | cjdata/views.py | from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from cjdata.models import Dataset, Category
from cjdata.search.query import sqs
class DatasetDetailView(DetailView):
model = Dataset
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
def get_context_data(se... | from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from cjdata.models import Dataset, Category
from cjdata.search.query import sqs
class DatasetDetailView(DetailView):
model = Dataset
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
def get_context_data(se... | Correct category lookup on url kwarg to use case insensitive. | Correct category lookup on url kwarg to use case insensitive.
| Python | bsd-3-clause | dmc2015/hall-of-justice,dmc2015/hall-of-justice,dmc2015/hall-of-justice,sunlightlabs/hall-of-justice,sunlightlabs/hall-of-justice,sunlightlabs/hall-of-justice | from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from cjdata.models import Dataset, Category
from cjdata.search.query import sqs
class DatasetDetailView(DetailView):
model = Dataset
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
def get_context_data(se... | from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from cjdata.models import Dataset, Category
from cjdata.search.query import sqs
class DatasetDetailView(DetailView):
model = Dataset
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
def get_context_data(se... | <commit_before>from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from cjdata.models import Dataset, Category
from cjdata.search.query import sqs
class DatasetDetailView(DetailView):
model = Dataset
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
def get_... | from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from cjdata.models import Dataset, Category
from cjdata.search.query import sqs
class DatasetDetailView(DetailView):
model = Dataset
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
def get_context_data(se... | from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from cjdata.models import Dataset, Category
from cjdata.search.query import sqs
class DatasetDetailView(DetailView):
model = Dataset
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
def get_context_data(se... | <commit_before>from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from cjdata.models import Dataset, Category
from cjdata.search.query import sqs
class DatasetDetailView(DetailView):
model = Dataset
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
def get_... |
1f495c7faa501efe15fb518ebe0dbf94a83e0f8a | pijobs/fortunejob.py | pijobs/fortunejob.py | import subprocess
from pijobs.scrolljob import SrollJob
class FortuneJob(ScrollJob):
def message(self):
return self.run_cmd('fortune')
def run_cmd(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]
return ou... | Add job to display fortunes. | Add job to display fortunes.
| Python | mit | ollej/piapi,ollej/piapi | Add job to display fortunes. | import subprocess
from pijobs.scrolljob import SrollJob
class FortuneJob(ScrollJob):
def message(self):
return self.run_cmd('fortune')
def run_cmd(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]
return ou... | <commit_before><commit_msg>Add job to display fortunes.<commit_after> | import subprocess
from pijobs.scrolljob import SrollJob
class FortuneJob(ScrollJob):
def message(self):
return self.run_cmd('fortune')
def run_cmd(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]
return ou... | Add job to display fortunes.import subprocess
from pijobs.scrolljob import SrollJob
class FortuneJob(ScrollJob):
def message(self):
return self.run_cmd('fortune')
def run_cmd(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.commun... | <commit_before><commit_msg>Add job to display fortunes.<commit_after>import subprocess
from pijobs.scrolljob import SrollJob
class FortuneJob(ScrollJob):
def message(self):
return self.run_cmd('fortune')
def run_cmd(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=sub... | |
6054b634c79d95e5cd2a4ed5c796d8ffcd1ddcc1 | frigg/builds/migrations/0003_auto_20141029_2158.py | frigg/builds/migrations/0003_auto_20141029_2158.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('builds', '0002_auto_20141028_0710'),
]
operations = [
migrations.AlterModelOptions(
name='build',
options={'... | Add migration for ordering update | Add migration for ordering update
| Python | mit | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | Add migration for ordering update | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('builds', '0002_auto_20141028_0710'),
]
operations = [
migrations.AlterModelOptions(
name='build',
options={'... | <commit_before><commit_msg>Add migration for ordering update<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('builds', '0002_auto_20141028_0710'),
]
operations = [
migrations.AlterModelOptions(
name='build',
options={'... | Add migration for ordering update# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('builds', '0002_auto_20141028_0710'),
]
operations = [
migrations.AlterModelOptions(
nam... | <commit_before><commit_msg>Add migration for ordering update<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('builds', '0002_auto_20141028_0710'),
]
operations = [
migr... | |
f3945fc1227b1650080fc52e63ce3b5ca795aefc | tools/visualization.py | tools/visualization.py | from pathlib import Path
from keras.applications import VGG16
from keras.models import Model
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
from tools.datasets.urban_tribes import load_images
def plot_filter(image_path, layer_name, output_dir):
base_model = VGG16(weights='imagenet'... | Add a convenient function to plot filter | Add a convenient function to plot filter
| Python | mit | xiongliyang219/transfer-learning | Add a convenient function to plot filter | from pathlib import Path
from keras.applications import VGG16
from keras.models import Model
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
from tools.datasets.urban_tribes import load_images
def plot_filter(image_path, layer_name, output_dir):
base_model = VGG16(weights='imagenet'... | <commit_before><commit_msg>Add a convenient function to plot filter<commit_after> | from pathlib import Path
from keras.applications import VGG16
from keras.models import Model
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
from tools.datasets.urban_tribes import load_images
def plot_filter(image_path, layer_name, output_dir):
base_model = VGG16(weights='imagenet'... | Add a convenient function to plot filterfrom pathlib import Path
from keras.applications import VGG16
from keras.models import Model
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
from tools.datasets.urban_tribes import load_images
def plot_filter(image_path, layer_name, output_dir):
... | <commit_before><commit_msg>Add a convenient function to plot filter<commit_after>from pathlib import Path
from keras.applications import VGG16
from keras.models import Model
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
from tools.datasets.urban_tribes import load_images
def plot_filt... | |
c7621bd5c5e48c8d45ae70836b681b715348d0ba | modules/module_oraakkeli.py | modules/module_oraakkeli.py |
import urllib
def command_oraakkeli(bot, user, channel, args):
"""Asks a question from the oracle (http://www.lintukoto.net/viihde/oraakkeli/)"""
if not args: return
args = urllib.quote_plus(args)
answer = getUrl("http://www.lintukoto.net/viihde/oraakkeli/index.php?kysymys=%s&html=0" % args).getCon... |
import urllib
def command_oraakkeli(bot, user, channel, args):
"""Asks a question from the oracle (http://www.lintukoto.net/viihde/oraakkeli/)"""
if not args: return
args = urllib.quote_plus(args)
answer = getUrl("http://www.lintukoto.net/viihde/oraakkeli/index.php?kysymys=%s&html=0" % args).getCon... | Update oracle module for UTF-8 | Update oracle module for UTF-8
git-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@99 dda364a1-ef19-0410-af65-756c83048fb2
| Python | bsd-3-clause | EArmour/pyfibot,nigeljonez/newpyfibot,huqa/pyfibot,aapa/pyfibot,EArmour/pyfibot,rnyberg/pyfibot,rnyberg/pyfibot,lepinkainen/pyfibot,aapa/pyfibot,lepinkainen/pyfibot,huqa/pyfibot |
import urllib
def command_oraakkeli(bot, user, channel, args):
"""Asks a question from the oracle (http://www.lintukoto.net/viihde/oraakkeli/)"""
if not args: return
args = urllib.quote_plus(args)
answer = getUrl("http://www.lintukoto.net/viihde/oraakkeli/index.php?kysymys=%s&html=0" % args).getCon... |
import urllib
def command_oraakkeli(bot, user, channel, args):
"""Asks a question from the oracle (http://www.lintukoto.net/viihde/oraakkeli/)"""
if not args: return
args = urllib.quote_plus(args)
answer = getUrl("http://www.lintukoto.net/viihde/oraakkeli/index.php?kysymys=%s&html=0" % args).getCon... | <commit_before>
import urllib
def command_oraakkeli(bot, user, channel, args):
"""Asks a question from the oracle (http://www.lintukoto.net/viihde/oraakkeli/)"""
if not args: return
args = urllib.quote_plus(args)
answer = getUrl("http://www.lintukoto.net/viihde/oraakkeli/index.php?kysymys=%s&html=0"... |
import urllib
def command_oraakkeli(bot, user, channel, args):
"""Asks a question from the oracle (http://www.lintukoto.net/viihde/oraakkeli/)"""
if not args: return
args = urllib.quote_plus(args)
answer = getUrl("http://www.lintukoto.net/viihde/oraakkeli/index.php?kysymys=%s&html=0" % args).getCon... |
import urllib
def command_oraakkeli(bot, user, channel, args):
"""Asks a question from the oracle (http://www.lintukoto.net/viihde/oraakkeli/)"""
if not args: return
args = urllib.quote_plus(args)
answer = getUrl("http://www.lintukoto.net/viihde/oraakkeli/index.php?kysymys=%s&html=0" % args).getCon... | <commit_before>
import urllib
def command_oraakkeli(bot, user, channel, args):
"""Asks a question from the oracle (http://www.lintukoto.net/viihde/oraakkeli/)"""
if not args: return
args = urllib.quote_plus(args)
answer = getUrl("http://www.lintukoto.net/viihde/oraakkeli/index.php?kysymys=%s&html=0"... |
35cc1959ebfc209a7b2b15e7a323afc88474b3e5 | py/largest-palindrome-product.py | py/largest-palindrome-product.py | class Solution(object):
def largestPalindrome(self, n):
"""
:type n: int
:rtype: int
"""
if n == 1:
return 9
for x in xrange(3, 10 ** n):
# two numbers 10 ** n - i, 10 ** n - j
# x = i + j
# reverse(10 ** n - x) = i * j
... | Add py solution for 479. Largest Palindrome Product | Add py solution for 479. Largest Palindrome Product
479. Largest Palindrome Product: https://leetcode.com/problems/largest-palindrome-product/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 479. Largest Palindrome Product
479. Largest Palindrome Product: https://leetcode.com/problems/largest-palindrome-product/ | class Solution(object):
def largestPalindrome(self, n):
"""
:type n: int
:rtype: int
"""
if n == 1:
return 9
for x in xrange(3, 10 ** n):
# two numbers 10 ** n - i, 10 ** n - j
# x = i + j
# reverse(10 ** n - x) = i * j
... | <commit_before><commit_msg>Add py solution for 479. Largest Palindrome Product
479. Largest Palindrome Product: https://leetcode.com/problems/largest-palindrome-product/<commit_after> | class Solution(object):
def largestPalindrome(self, n):
"""
:type n: int
:rtype: int
"""
if n == 1:
return 9
for x in xrange(3, 10 ** n):
# two numbers 10 ** n - i, 10 ** n - j
# x = i + j
# reverse(10 ** n - x) = i * j
... | Add py solution for 479. Largest Palindrome Product
479. Largest Palindrome Product: https://leetcode.com/problems/largest-palindrome-product/class Solution(object):
def largestPalindrome(self, n):
"""
:type n: int
:rtype: int
"""
if n == 1:
return 9
for ... | <commit_before><commit_msg>Add py solution for 479. Largest Palindrome Product
479. Largest Palindrome Product: https://leetcode.com/problems/largest-palindrome-product/<commit_after>class Solution(object):
def largestPalindrome(self, n):
"""
:type n: int
:rtype: int
"""
if ... | |
18d10b310d83de6b6244fd09b9fc742db5ced6e2 | py/assign-cookies.py | py/assign-cookies.py | from collections import Counter
class Solution(object):
def findContentChildren(self, children, s):
"""
:type g: List[int]
:type s: List[int]
:rtype: int
"""
if not s:
return 0
cookies = Counter(s)
it = iter(sorted(cookies))
cur = i... | Add py solution for 455. Assign Cookies | Add py solution for 455. Assign Cookies
455. Assign Cookies: https://leetcode.com/problems/assign-cookies/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 455. Assign Cookies
455. Assign Cookies: https://leetcode.com/problems/assign-cookies/ | from collections import Counter
class Solution(object):
def findContentChildren(self, children, s):
"""
:type g: List[int]
:type s: List[int]
:rtype: int
"""
if not s:
return 0
cookies = Counter(s)
it = iter(sorted(cookies))
cur = i... | <commit_before><commit_msg>Add py solution for 455. Assign Cookies
455. Assign Cookies: https://leetcode.com/problems/assign-cookies/<commit_after> | from collections import Counter
class Solution(object):
def findContentChildren(self, children, s):
"""
:type g: List[int]
:type s: List[int]
:rtype: int
"""
if not s:
return 0
cookies = Counter(s)
it = iter(sorted(cookies))
cur = i... | Add py solution for 455. Assign Cookies
455. Assign Cookies: https://leetcode.com/problems/assign-cookies/from collections import Counter
class Solution(object):
def findContentChildren(self, children, s):
"""
:type g: List[int]
:type s: List[int]
:rtype: int
"""
if ... | <commit_before><commit_msg>Add py solution for 455. Assign Cookies
455. Assign Cookies: https://leetcode.com/problems/assign-cookies/<commit_after>from collections import Counter
class Solution(object):
def findContentChildren(self, children, s):
"""
:type g: List[int]
:type s: List[int]
... | |
192ec9e61839f9ea154a737cd219b3ca76bd7812 | Worker.py | Worker.py |
class Worker(object):
def __init__(self):
self.finished = False
class GridProcessor(Worker):
def __init__(self):
self.pid = os.getpid()
self.age = None
self.angle = None
self.data_dir = None
self.results_dir = None
def set_data_dir(self, data_dir):... | Check if data has nodata mask | Check if data has nodata mask
| Python | mit | stgl/scarplet,rmsare/scarplet | Check if data has nodata mask |
class Worker(object):
def __init__(self):
self.finished = False
class GridProcessor(Worker):
def __init__(self):
self.pid = os.getpid()
self.age = None
self.angle = None
self.data_dir = None
self.results_dir = None
def set_data_dir(self, data_dir):... | <commit_before><commit_msg>Check if data has nodata mask<commit_after> |
class Worker(object):
def __init__(self):
self.finished = False
class GridProcessor(Worker):
def __init__(self):
self.pid = os.getpid()
self.age = None
self.angle = None
self.data_dir = None
self.results_dir = None
def set_data_dir(self, data_dir):... | Check if data has nodata mask
class Worker(object):
def __init__(self):
self.finished = False
class GridProcessor(Worker):
def __init__(self):
self.pid = os.getpid()
self.age = None
self.angle = None
self.data_dir = None
self.results_dir = None
def ... | <commit_before><commit_msg>Check if data has nodata mask<commit_after>
class Worker(object):
def __init__(self):
self.finished = False
class GridProcessor(Worker):
def __init__(self):
self.pid = os.getpid()
self.age = None
self.angle = None
self.data_dir = None
... | |
2a214050a30048eab177f696d891a33c2860bb55 | pymatgen/symmetry/tests/test_spacegroup.py | pymatgen/symmetry/tests/test_spacegroup.py | #!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__date__ = "Mar 12, 2012"
import unittest
import os
from pymatg... | Add a unittest for spacegroup. Still very basic. | Add a unittest for spacegroup. Still very basic.
| Python | mit | rousseab/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,rousseab/pymatgen,sonium0/pymatgen,yanikou19/pymatgen,rousseab/pymatgen,Dioptas/pymatgen,Bismarrck/pymatgen,ctoher/pymatgen,sonium0/pymatgen,migueldiascosta/pymatgen,Dioptas/pymatgen,Bismarrck/pymatgen,yanikou19/pymatgen,yanikou19/pymatgen,migueldiascosta/pymatgen... | Add a unittest for spacegroup. Still very basic. | #!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__date__ = "Mar 12, 2012"
import unittest
import os
from pymatg... | <commit_before><commit_msg>Add a unittest for spacegroup. Still very basic.<commit_after> | #!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__date__ = "Mar 12, 2012"
import unittest
import os
from pymatg... | Add a unittest for spacegroup. Still very basic.#!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__date__ = "Mar 1... | <commit_before><commit_msg>Add a unittest for spacegroup. Still very basic.<commit_after>#!/usr/bin/env python
'''
Created on Mar 12, 2012
'''
from __future__ import division
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__em... | |
e3fdb634be82394703db6d2cc0bf1091646197d8 | skbeam/core/tests/test_smoothing.py | skbeam/core/tests/test_smoothing.py | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | Add test of smoothing module | Add test of smoothing module
| Python | bsd-3-clause | tacaswell/scikit-beam,Nikea/scikit-xray,tacaswell/scikit-xray,tacaswell/scikit-beam,scikit-xray/scikit-xray,scikit-xray/scikit-xray,tacaswell/scikit-xray,Nikea/scikit-xray,tacaswell/scikit-beam,scikit-xray/scikit-xray,Nikea/scikit-xray,tacaswell/scikit-xray | Add test of smoothing module | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | <commit_before><commit_msg>Add test of smoothing module<commit_after> | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | Add test of smoothing module# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
... | <commit_before><commit_msg>Add test of smoothing module<commit_after># ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# ... | |
497f5085143322d4b9d3ad23d35d30cdf852d1f6 | test/unit/sorting/test_heap_sort.py | test/unit/sorting/test_heap_sort.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.heap_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending orde... | Add unit test for heap sort implementation. | Add unit test for heap sort implementation.
| Python | mit | weichen2046/algorithm-study,weichen2046/algorithm-study | Add unit test for heap sort implementation. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.heap_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending orde... | <commit_before><commit_msg>Add unit test for heap sort implementation.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.heap_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending orde... | Add unit test for heap sort implementation.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.heap_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sor... | <commit_before><commit_msg>Add unit test for heap sort implementation.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.heap_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortT... | |
3d52040663eaef07aa3e9d13500819b4633f1187 | typhon/tests/spareice/test_array.py | typhon/tests/spareice/test_array.py | import numpy as np
from typhon.spareice import Array, GroupedArrays
import xarray as xr
class TestArray:
"""Testing the array methods."""
pass
class TestGroupedArrays:
"""Testing the GroupedArrays methods."""
def test_dict(self):
# TODO: Implement test for export to / import from python dic... | Implement test class for Array and GroupedArrays | Implement test class for Array and GroupedArrays
| Python | mit | atmtools/typhon,atmtools/typhon | Implement test class for Array and GroupedArrays | import numpy as np
from typhon.spareice import Array, GroupedArrays
import xarray as xr
class TestArray:
"""Testing the array methods."""
pass
class TestGroupedArrays:
"""Testing the GroupedArrays methods."""
def test_dict(self):
# TODO: Implement test for export to / import from python dic... | <commit_before><commit_msg>Implement test class for Array and GroupedArrays<commit_after> | import numpy as np
from typhon.spareice import Array, GroupedArrays
import xarray as xr
class TestArray:
"""Testing the array methods."""
pass
class TestGroupedArrays:
"""Testing the GroupedArrays methods."""
def test_dict(self):
# TODO: Implement test for export to / import from python dic... | Implement test class for Array and GroupedArraysimport numpy as np
from typhon.spareice import Array, GroupedArrays
import xarray as xr
class TestArray:
"""Testing the array methods."""
pass
class TestGroupedArrays:
"""Testing the GroupedArrays methods."""
def test_dict(self):
# TODO: Imple... | <commit_before><commit_msg>Implement test class for Array and GroupedArrays<commit_after>import numpy as np
from typhon.spareice import Array, GroupedArrays
import xarray as xr
class TestArray:
"""Testing the array methods."""
pass
class TestGroupedArrays:
"""Testing the GroupedArrays methods."""
d... | |
3c3259024310e3ed28bc71c8bb6fa60d608a049c | spacy/tests/doc/test_morphanalysis.py | spacy/tests/doc/test_morphanalysis.py | # coding: utf-8
from __future__ import unicode_literals
import pytest
import numpy
from spacy.attrs import IS_ALPHA, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_TITLE, IS_STOP
from spacy.symbols import VERB
from spacy.vocab import Vocab
from spacy.tokens import Doc
@pytest.fixture
def i_has(en_tokenizer):
doc = en_tokenizer... | Add test for morph analysis | Add test for morph analysis
| Python | mit | spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy | Add test for morph analysis | # coding: utf-8
from __future__ import unicode_literals
import pytest
import numpy
from spacy.attrs import IS_ALPHA, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_TITLE, IS_STOP
from spacy.symbols import VERB
from spacy.vocab import Vocab
from spacy.tokens import Doc
@pytest.fixture
def i_has(en_tokenizer):
doc = en_tokenizer... | <commit_before><commit_msg>Add test for morph analysis<commit_after> | # coding: utf-8
from __future__ import unicode_literals
import pytest
import numpy
from spacy.attrs import IS_ALPHA, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_TITLE, IS_STOP
from spacy.symbols import VERB
from spacy.vocab import Vocab
from spacy.tokens import Doc
@pytest.fixture
def i_has(en_tokenizer):
doc = en_tokenizer... | Add test for morph analysis# coding: utf-8
from __future__ import unicode_literals
import pytest
import numpy
from spacy.attrs import IS_ALPHA, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_TITLE, IS_STOP
from spacy.symbols import VERB
from spacy.vocab import Vocab
from spacy.tokens import Doc
@pytest.fixture
def i_has(en_tokeniz... | <commit_before><commit_msg>Add test for morph analysis<commit_after># coding: utf-8
from __future__ import unicode_literals
import pytest
import numpy
from spacy.attrs import IS_ALPHA, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_TITLE, IS_STOP
from spacy.symbols import VERB
from spacy.vocab import Vocab
from spacy.tokens import ... | |
39c28f76540da294d9dd4adf4f84ae266922498d | test/test_clientagent.py | test/test_clientagent.py | #!/usr/bin/env python2
import unittest
from socket import *
from common import *
from testdc import *
CONFIG = """\
messagedirector:
bind: 127.0.0.1:57123
general:
dc_files:
- %r
roles:
- type: clientagent
bind: 127.0.0.1:57128
version: "Sword Art Online v5.1"
""" % test_dc
VERSION =... | Create clientagent unittest file, with test for CLIENT_HELLO behavior. | tests: Create clientagent unittest file, with test for CLIENT_HELLO behavior.
| Python | bsd-3-clause | pizcogirl/Astron,blindsighttf2/Astron,ketoo/Astron,pizcogirl/Astron,ketoo/Astron,blindsighttf2/Astron,blindsighttf2/Astron,ketoo/Astron,blindsighttf2/Astron,pizcogirl/Astron,ketoo/Astron,pizcogirl/Astron | tests: Create clientagent unittest file, with test for CLIENT_HELLO behavior. | #!/usr/bin/env python2
import unittest
from socket import *
from common import *
from testdc import *
CONFIG = """\
messagedirector:
bind: 127.0.0.1:57123
general:
dc_files:
- %r
roles:
- type: clientagent
bind: 127.0.0.1:57128
version: "Sword Art Online v5.1"
""" % test_dc
VERSION =... | <commit_before><commit_msg>tests: Create clientagent unittest file, with test for CLIENT_HELLO behavior.<commit_after> | #!/usr/bin/env python2
import unittest
from socket import *
from common import *
from testdc import *
CONFIG = """\
messagedirector:
bind: 127.0.0.1:57123
general:
dc_files:
- %r
roles:
- type: clientagent
bind: 127.0.0.1:57128
version: "Sword Art Online v5.1"
""" % test_dc
VERSION =... | tests: Create clientagent unittest file, with test for CLIENT_HELLO behavior.#!/usr/bin/env python2
import unittest
from socket import *
from common import *
from testdc import *
CONFIG = """\
messagedirector:
bind: 127.0.0.1:57123
general:
dc_files:
- %r
roles:
- type: clientagent
bind: 1... | <commit_before><commit_msg>tests: Create clientagent unittest file, with test for CLIENT_HELLO behavior.<commit_after>#!/usr/bin/env python2
import unittest
from socket import *
from common import *
from testdc import *
CONFIG = """\
messagedirector:
bind: 127.0.0.1:57123
general:
dc_files:
- %r
rol... | |
b5d0d935f21c76166cd767b81a08a59cce04f9cb | livereload/__init__.py | livereload/__init__.py | """django-livereload"""
__version__ = '0.1.dev'
__license__ = 'BSD License'
__author__ = 'Fantomas42'
__email__ = '[email protected]'
__url__ = 'https://github.com/Fantomas42/django-livereload'
| Add metas information for the package | Add metas information for the package
| Python | bsd-3-clause | Fantomas42/django-livereload,kbussell/django-livereload | Add metas information for the package | """django-livereload"""
__version__ = '0.1.dev'
__license__ = 'BSD License'
__author__ = 'Fantomas42'
__email__ = '[email protected]'
__url__ = 'https://github.com/Fantomas42/django-livereload'
| <commit_before><commit_msg>Add metas information for the package<commit_after> | """django-livereload"""
__version__ = '0.1.dev'
__license__ = 'BSD License'
__author__ = 'Fantomas42'
__email__ = '[email protected]'
__url__ = 'https://github.com/Fantomas42/django-livereload'
| Add metas information for the package"""django-livereload"""
__version__ = '0.1.dev'
__license__ = 'BSD License'
__author__ = 'Fantomas42'
__email__ = '[email protected]'
__url__ = 'https://github.com/Fantomas42/django-livereload'
| <commit_before><commit_msg>Add metas information for the package<commit_after>"""django-livereload"""
__version__ = '0.1.dev'
__license__ = 'BSD License'
__author__ = 'Fantomas42'
__email__ = '[email protected]'
__url__ = 'https://github.com/Fantomas42/django-livereload'
| |
7fa9fb24262c5ced8d09a2de34fd412cc5aa3758 | private/realclearpolitics-scraper/realclearpolitics/spiders/spider.py | private/realclearpolitics-scraper/realclearpolitics/spiders/spider.py | import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
def __init__(self, url, state_code):
self.url = url
self.state_code = state_code
def start_requests(self):
return [scrapy.FormRequest(se... | import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
columns = ['Poll','Date', 'Sample', 'Spread']
def __init__(self, url, state_code):
self.url = url
self.state_code = state_code
def start_req... | Put candidate score in field object | Put candidate score in field object
| Python | mit | dpxxdp/berniemetrics,Rumel/berniemetrics,dpxxdp/berniemetrics,fpagnoux/berniemetrics,fpagnoux/berniemetrics,dpxxdp/berniemetrics,fpagnoux/berniemetrics,Rumel/berniemetrics,dpxxdp/berniemetrics,fpagnoux/berniemetrics,Rumel/berniemetrics,Rumel/berniemetrics | import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
def __init__(self, url, state_code):
self.url = url
self.state_code = state_code
def start_requests(self):
return [scrapy.FormRequest(se... | import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
columns = ['Poll','Date', 'Sample', 'Spread']
def __init__(self, url, state_code):
self.url = url
self.state_code = state_code
def start_req... | <commit_before>import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
def __init__(self, url, state_code):
self.url = url
self.state_code = state_code
def start_requests(self):
return [scrapy... | import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
columns = ['Poll','Date', 'Sample', 'Spread']
def __init__(self, url, state_code):
self.url = url
self.state_code = state_code
def start_req... | import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
def __init__(self, url, state_code):
self.url = url
self.state_code = state_code
def start_requests(self):
return [scrapy.FormRequest(se... | <commit_before>import scrapy
from realclearpolitics.items import TableItem
class RcpSpider(scrapy.Spider):
name = "realclearpoliticsSpider"
start_urls = []
def __init__(self, url, state_code):
self.url = url
self.state_code = state_code
def start_requests(self):
return [scrapy... |
e9105d4c0fcf7ff90b96e764cbf8acdb94856a7a | tests/executables/echo_server.py | tests/executables/echo_server.py | import sys
import socket
import select
from papa.utils import cast_string
__author__ = 'Scott Maxwell'
if len(sys.argv) != 2:
sys.stderr.write('Need one file descriptor\n')
sys.exit(1)
listen_socket = socket.fromfd(int(sys.argv[1]), socket.AF_INET, socket.SOCK_STREAM)
connection, address = listen_socket.acce... | Add simple echo server test app | Add simple echo server test app
| Python | mit | scottkmaxwell/papa | Add simple echo server test app | import sys
import socket
import select
from papa.utils import cast_string
__author__ = 'Scott Maxwell'
if len(sys.argv) != 2:
sys.stderr.write('Need one file descriptor\n')
sys.exit(1)
listen_socket = socket.fromfd(int(sys.argv[1]), socket.AF_INET, socket.SOCK_STREAM)
connection, address = listen_socket.acce... | <commit_before><commit_msg>Add simple echo server test app<commit_after> | import sys
import socket
import select
from papa.utils import cast_string
__author__ = 'Scott Maxwell'
if len(sys.argv) != 2:
sys.stderr.write('Need one file descriptor\n')
sys.exit(1)
listen_socket = socket.fromfd(int(sys.argv[1]), socket.AF_INET, socket.SOCK_STREAM)
connection, address = listen_socket.acce... | Add simple echo server test appimport sys
import socket
import select
from papa.utils import cast_string
__author__ = 'Scott Maxwell'
if len(sys.argv) != 2:
sys.stderr.write('Need one file descriptor\n')
sys.exit(1)
listen_socket = socket.fromfd(int(sys.argv[1]), socket.AF_INET, socket.SOCK_STREAM)
connectio... | <commit_before><commit_msg>Add simple echo server test app<commit_after>import sys
import socket
import select
from papa.utils import cast_string
__author__ = 'Scott Maxwell'
if len(sys.argv) != 2:
sys.stderr.write('Need one file descriptor\n')
sys.exit(1)
listen_socket = socket.fromfd(int(sys.argv[1]), sock... | |
41c6a71e2a9e013966df06e3b5f458aa9a902bc8 | tests/test_core.py | tests/test_core.py | import pytest
from mock import Mock
from saleor.core.utils import (
Country, get_country_by_ip, get_currency_for_country)
@pytest.mark.parametrize('ip_data, expected_country', [
({'country': {'iso_code': 'PL'}}, Country('PL')),
({'country': {'iso_code': 'UNKNOWN'}}, None),
(None, None),
({}, None... | import pytest
from mock import Mock
from saleor.core.utils import (
Country, get_country_by_ip, get_currency_for_country, create_superuser)
from saleor.userprofile.models import User
@pytest.mark.parametrize('ip_data, expected_country', [
({'country': {'iso_code': 'PL'}}, Country('PL')),
({'country': {'i... | Add populatedb admin creation test | Add populatedb admin creation test
| Python | bsd-3-clause | car3oon/saleor,mociepka/saleor,jreigel/saleor,mociepka/saleor,tfroehlich82/saleor,maferelo/saleor,itbabu/saleor,itbabu/saleor,HyperManTT/ECommerceSaleor,KenMutemi/saleor,UITools/saleor,tfroehlich82/saleor,KenMutemi/saleor,maferelo/saleor,maferelo/saleor,UITools/saleor,mociepka/saleor,jreigel/saleor,jreigel/saleor,UIToo... | import pytest
from mock import Mock
from saleor.core.utils import (
Country, get_country_by_ip, get_currency_for_country)
@pytest.mark.parametrize('ip_data, expected_country', [
({'country': {'iso_code': 'PL'}}, Country('PL')),
({'country': {'iso_code': 'UNKNOWN'}}, None),
(None, None),
({}, None... | import pytest
from mock import Mock
from saleor.core.utils import (
Country, get_country_by_ip, get_currency_for_country, create_superuser)
from saleor.userprofile.models import User
@pytest.mark.parametrize('ip_data, expected_country', [
({'country': {'iso_code': 'PL'}}, Country('PL')),
({'country': {'i... | <commit_before>import pytest
from mock import Mock
from saleor.core.utils import (
Country, get_country_by_ip, get_currency_for_country)
@pytest.mark.parametrize('ip_data, expected_country', [
({'country': {'iso_code': 'PL'}}, Country('PL')),
({'country': {'iso_code': 'UNKNOWN'}}, None),
(None, None)... | import pytest
from mock import Mock
from saleor.core.utils import (
Country, get_country_by_ip, get_currency_for_country, create_superuser)
from saleor.userprofile.models import User
@pytest.mark.parametrize('ip_data, expected_country', [
({'country': {'iso_code': 'PL'}}, Country('PL')),
({'country': {'i... | import pytest
from mock import Mock
from saleor.core.utils import (
Country, get_country_by_ip, get_currency_for_country)
@pytest.mark.parametrize('ip_data, expected_country', [
({'country': {'iso_code': 'PL'}}, Country('PL')),
({'country': {'iso_code': 'UNKNOWN'}}, None),
(None, None),
({}, None... | <commit_before>import pytest
from mock import Mock
from saleor.core.utils import (
Country, get_country_by_ip, get_currency_for_country)
@pytest.mark.parametrize('ip_data, expected_country', [
({'country': {'iso_code': 'PL'}}, Country('PL')),
({'country': {'iso_code': 'UNKNOWN'}}, None),
(None, None)... |
1da0e093bd2a1fd70964dd0b80c0a554d46fd3e9 | src/tests/client/test_stacking.py | src/tests/client/test_stacking.py | # Copyright (c) 2016, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... | Add tests for command stacking | Add tests for command stacking
| Python | bsd-3-clause | vlegoff/cocomud | Add tests for command stacking | # Copyright (c) 2016, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... | <commit_before><commit_msg>Add tests for command stacking<commit_after> | # Copyright (c) 2016, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... | Add tests for command stacking# Copyright (c) 2016, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this... | <commit_before><commit_msg>Add tests for command stacking<commit_after># Copyright (c) 2016, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code mus... | |
2dcfbc9dfecef4920a8dec9f3d2362f5ece13612 | sympy/printing/tests/test_numpy.py | sympy/printing/tests/test_numpy.py | from sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+.
See gh-97... | Add test for NumPyPrinter regression | Add test for NumPyPrinter regression
| Python | bsd-3-clause | kevalds51/sympy,aktech/sympy,maniteja123/sympy,madan96/sympy,atreyv/sympy,madan96/sympy,jbbskinny/sympy,Vishluck/sympy,iamutkarshtiwari/sympy,skidzo/sympy,chaffra/sympy,jbbskinny/sympy,saurabhjn76/sympy,kaichogami/sympy,sahmed95/sympy,abhiii5459/sympy,wyom/sympy,wyom/sympy,drufat/sympy,oliverlee/sympy,kumarkrishna/symp... | Add test for NumPyPrinter regression | from sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+.
See gh-97... | <commit_before><commit_msg>Add test for NumPyPrinter regression<commit_after> | from sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking compatibility with numpy 1.8. This is not necessary in numpy 1.9+.
See gh-97... | Add test for NumPyPrinter regressionfrom sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking compatibility with numpy 1.8. This is not ne... | <commit_before><commit_msg>Add test for NumPyPrinter regression<commit_after>from sympy import Piecewise
from sympy.abc import x
from sympy.printing.lambdarepr import NumPyPrinter
def test_numpy_piecewise_regression():
"""
NumPyPrinter needs to print Piecewise()'s choicelist as a list to avoid
breaking com... | |
a20255d2a2531eff982b78c15f5fc4d5cc1ec621 | tests/integration/suite/test_istio.py | tests/integration/suite/test_istio.py | import os
import pytest
import subprocess
from .common import random_str
from .conftest import cluster_and_client, ClusterContext
kube_fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"k8s_kube_config")
istio_crd_url = "https://raw.githubusercontent.com/istio/istio/1.1.5" \
... | Add integration tests for VirtualService and DestinationRule | Add integration tests for VirtualService and DestinationRule
| Python | apache-2.0 | rancherio/rancher,rancherio/rancher,cjellick/rancher,rancher/rancher,rancher/rancher,cjellick/rancher,rancher/rancher,cjellick/rancher,rancher/rancher | Add integration tests for VirtualService and DestinationRule | import os
import pytest
import subprocess
from .common import random_str
from .conftest import cluster_and_client, ClusterContext
kube_fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"k8s_kube_config")
istio_crd_url = "https://raw.githubusercontent.com/istio/istio/1.1.5" \
... | <commit_before><commit_msg>Add integration tests for VirtualService and DestinationRule<commit_after> | import os
import pytest
import subprocess
from .common import random_str
from .conftest import cluster_and_client, ClusterContext
kube_fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"k8s_kube_config")
istio_crd_url = "https://raw.githubusercontent.com/istio/istio/1.1.5" \
... | Add integration tests for VirtualService and DestinationRuleimport os
import pytest
import subprocess
from .common import random_str
from .conftest import cluster_and_client, ClusterContext
kube_fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"k8s_kube_config")
istio_crd_url... | <commit_before><commit_msg>Add integration tests for VirtualService and DestinationRule<commit_after>import os
import pytest
import subprocess
from .common import random_str
from .conftest import cluster_and_client, ClusterContext
kube_fname = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | |
79eff5aa96e54120f5f020ac45058088b3b77813 | tools/insert_dp_events_into_traceX.py | tools/insert_dp_events_into_traceX.py | #!/usr/bin/env python
import argparse
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import sts.replay_event as replay_events
from sts.dataplane_traces.trace import Trace
from sts.input_traces.input_logger import InputLogger
from sts.log_processing.superlog_parser import parse
pa... | Add tool for removing need for TrafficInjection backwards compatibility | Add tool for removing need for TrafficInjection backwards compatibility
| Python | apache-2.0 | ucb-sts/sts,jmiserez/sts,ucb-sts/sts,jmiserez/sts | Add tool for removing need for TrafficInjection backwards compatibility | #!/usr/bin/env python
import argparse
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import sts.replay_event as replay_events
from sts.dataplane_traces.trace import Trace
from sts.input_traces.input_logger import InputLogger
from sts.log_processing.superlog_parser import parse
pa... | <commit_before><commit_msg>Add tool for removing need for TrafficInjection backwards compatibility<commit_after> | #!/usr/bin/env python
import argparse
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import sts.replay_event as replay_events
from sts.dataplane_traces.trace import Trace
from sts.input_traces.input_logger import InputLogger
from sts.log_processing.superlog_parser import parse
pa... | Add tool for removing need for TrafficInjection backwards compatibility#!/usr/bin/env python
import argparse
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import sts.replay_event as replay_events
from sts.dataplane_traces.trace import Trace
from sts.input_traces.input_logger impo... | <commit_before><commit_msg>Add tool for removing need for TrafficInjection backwards compatibility<commit_after>#!/usr/bin/env python
import argparse
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import sts.replay_event as replay_events
from sts.dataplane_traces.trace import Trac... | |
86f35f14c91116c3f00e0227a2eeb10c58f20d4b | pymetabiosis/test/test_wrapper.py | pymetabiosis/test/test_wrapper.py | from pymetabiosis.module import import_module
from pymetabiosis.wrapper import MetabiosisWrapper
def test_getattr_on_module():
sqlite = import_module("sqlite")
assert isinstance(sqlite, MetabiosisWrapper)
connect = sqlite.connect
assert isinstance(connect, MetabiosisWrapper)
assert repr(connect).st... | Add a test for module.attribute | Add a test for module.attribute
| Python | mit | prabhuramachandran/pymetabiosis,rguillebert/pymetabiosis | Add a test for module.attribute | from pymetabiosis.module import import_module
from pymetabiosis.wrapper import MetabiosisWrapper
def test_getattr_on_module():
sqlite = import_module("sqlite")
assert isinstance(sqlite, MetabiosisWrapper)
connect = sqlite.connect
assert isinstance(connect, MetabiosisWrapper)
assert repr(connect).st... | <commit_before><commit_msg>Add a test for module.attribute<commit_after> | from pymetabiosis.module import import_module
from pymetabiosis.wrapper import MetabiosisWrapper
def test_getattr_on_module():
sqlite = import_module("sqlite")
assert isinstance(sqlite, MetabiosisWrapper)
connect = sqlite.connect
assert isinstance(connect, MetabiosisWrapper)
assert repr(connect).st... | Add a test for module.attributefrom pymetabiosis.module import import_module
from pymetabiosis.wrapper import MetabiosisWrapper
def test_getattr_on_module():
sqlite = import_module("sqlite")
assert isinstance(sqlite, MetabiosisWrapper)
connect = sqlite.connect
assert isinstance(connect, MetabiosisWrapp... | <commit_before><commit_msg>Add a test for module.attribute<commit_after>from pymetabiosis.module import import_module
from pymetabiosis.wrapper import MetabiosisWrapper
def test_getattr_on_module():
sqlite = import_module("sqlite")
assert isinstance(sqlite, MetabiosisWrapper)
connect = sqlite.connect
a... | |
c279862c8be98d697f9340a7a5ed96cc17744b08 | icekit/admin_forms.py | icekit/admin_forms.py | from django.contrib.auth.forms import PasswordResetForm
class PasswordResetForm(PasswordResetForm):
"""
An extended Password reset form designed for staff users.
It limits the users allowed to use this form the send them a
password reset email to staff users only.
"""
def get_users(self, emai... | Add admin form for password reset to limit to staff. | Add admin form for password reset to limit to staff.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | Add admin form for password reset to limit to staff. | from django.contrib.auth.forms import PasswordResetForm
class PasswordResetForm(PasswordResetForm):
"""
An extended Password reset form designed for staff users.
It limits the users allowed to use this form the send them a
password reset email to staff users only.
"""
def get_users(self, emai... | <commit_before><commit_msg>Add admin form for password reset to limit to staff.<commit_after> | from django.contrib.auth.forms import PasswordResetForm
class PasswordResetForm(PasswordResetForm):
"""
An extended Password reset form designed for staff users.
It limits the users allowed to use this form the send them a
password reset email to staff users only.
"""
def get_users(self, emai... | Add admin form for password reset to limit to staff.from django.contrib.auth.forms import PasswordResetForm
class PasswordResetForm(PasswordResetForm):
"""
An extended Password reset form designed for staff users.
It limits the users allowed to use this form the send them a
password reset email to st... | <commit_before><commit_msg>Add admin form for password reset to limit to staff.<commit_after>from django.contrib.auth.forms import PasswordResetForm
class PasswordResetForm(PasswordResetForm):
"""
An extended Password reset form designed for staff users.
It limits the users allowed to use this form the s... | |
19887c6d56761d1417b49f2e26787b9233bbdcae | Problems/newtonRaphson.py | Problems/newtonRaphson.py | #!/Applications/anaconda/envs/Python3/bin
def main():
# X^2 - 1
p_1 = (-1, 0, 1)
r_1 = newton_raphson(p_1)
print('Polynomial {} has root of {}'.format(print_poly(p_1), r_1))
# X^3 - 27
p_2 = (-27, 0, 0, 1)
r_2 = newton_raphson(p_2)
print('Polynomial {} has root of {}'.format(print_poly... | Add Newton-Raphson polynomial approximation problem | Add Newton-Raphson polynomial approximation problem
| Python | mit | HKuz/Test_Code | Add Newton-Raphson polynomial approximation problem | #!/Applications/anaconda/envs/Python3/bin
def main():
# X^2 - 1
p_1 = (-1, 0, 1)
r_1 = newton_raphson(p_1)
print('Polynomial {} has root of {}'.format(print_poly(p_1), r_1))
# X^3 - 27
p_2 = (-27, 0, 0, 1)
r_2 = newton_raphson(p_2)
print('Polynomial {} has root of {}'.format(print_poly... | <commit_before><commit_msg>Add Newton-Raphson polynomial approximation problem<commit_after> | #!/Applications/anaconda/envs/Python3/bin
def main():
# X^2 - 1
p_1 = (-1, 0, 1)
r_1 = newton_raphson(p_1)
print('Polynomial {} has root of {}'.format(print_poly(p_1), r_1))
# X^3 - 27
p_2 = (-27, 0, 0, 1)
r_2 = newton_raphson(p_2)
print('Polynomial {} has root of {}'.format(print_poly... | Add Newton-Raphson polynomial approximation problem#!/Applications/anaconda/envs/Python3/bin
def main():
# X^2 - 1
p_1 = (-1, 0, 1)
r_1 = newton_raphson(p_1)
print('Polynomial {} has root of {}'.format(print_poly(p_1), r_1))
# X^3 - 27
p_2 = (-27, 0, 0, 1)
r_2 = newton_raphson(p_2)
pri... | <commit_before><commit_msg>Add Newton-Raphson polynomial approximation problem<commit_after>#!/Applications/anaconda/envs/Python3/bin
def main():
# X^2 - 1
p_1 = (-1, 0, 1)
r_1 = newton_raphson(p_1)
print('Polynomial {} has root of {}'.format(print_poly(p_1), r_1))
# X^3 - 27
p_2 = (-27, 0, 0,... | |
7b9e7e3c2e0c6274dd4dc67621bdac6111e8d56f | improved_decorator.py | improved_decorator.py | from flask import abort, current_app, request
from functools import wraps
from twilio.util import RequestValidator
import os
def validate_twilio_request(f):
"""Validates that incoming requests genuinely originated from Twilio"""
@wraps(f)
def decorated_function(*args, **kwargs):
# Create an insta... | Add better decorator for testing | Add better decorator for testing
| Python | mit | TwilioDevEd/webhooks-example-flask | Add better decorator for testing | from flask import abort, current_app, request
from functools import wraps
from twilio.util import RequestValidator
import os
def validate_twilio_request(f):
"""Validates that incoming requests genuinely originated from Twilio"""
@wraps(f)
def decorated_function(*args, **kwargs):
# Create an insta... | <commit_before><commit_msg>Add better decorator for testing<commit_after> | from flask import abort, current_app, request
from functools import wraps
from twilio.util import RequestValidator
import os
def validate_twilio_request(f):
"""Validates that incoming requests genuinely originated from Twilio"""
@wraps(f)
def decorated_function(*args, **kwargs):
# Create an insta... | Add better decorator for testingfrom flask import abort, current_app, request
from functools import wraps
from twilio.util import RequestValidator
import os
def validate_twilio_request(f):
"""Validates that incoming requests genuinely originated from Twilio"""
@wraps(f)
def decorated_function(*args, **kw... | <commit_before><commit_msg>Add better decorator for testing<commit_after>from flask import abort, current_app, request
from functools import wraps
from twilio.util import RequestValidator
import os
def validate_twilio_request(f):
"""Validates that incoming requests genuinely originated from Twilio"""
@wraps(... | |
0c62015b0eca96f3118ee099fb1d4f375738a888 | CodeFights/stringsRearrangement.py | CodeFights/stringsRearrangement.py | #!/usr/local/bin/python
# Code Fights Cracking Password Problem
import itertools
def stringsRearrangement(inputArray):
def f(x, y):
c = 0
for i in range(len(x)):
if x[i] != y[i]:
c += 1
if c == 1:
return True
return False
for k in iter... | Solve Code Fights strings rearrangement problem | Solve Code Fights strings rearrangement problem
| Python | mit | HKuz/Test_Code | Solve Code Fights strings rearrangement problem | #!/usr/local/bin/python
# Code Fights Cracking Password Problem
import itertools
def stringsRearrangement(inputArray):
def f(x, y):
c = 0
for i in range(len(x)):
if x[i] != y[i]:
c += 1
if c == 1:
return True
return False
for k in iter... | <commit_before><commit_msg>Solve Code Fights strings rearrangement problem<commit_after> | #!/usr/local/bin/python
# Code Fights Cracking Password Problem
import itertools
def stringsRearrangement(inputArray):
def f(x, y):
c = 0
for i in range(len(x)):
if x[i] != y[i]:
c += 1
if c == 1:
return True
return False
for k in iter... | Solve Code Fights strings rearrangement problem#!/usr/local/bin/python
# Code Fights Cracking Password Problem
import itertools
def stringsRearrangement(inputArray):
def f(x, y):
c = 0
for i in range(len(x)):
if x[i] != y[i]:
c += 1
if c == 1:
retu... | <commit_before><commit_msg>Solve Code Fights strings rearrangement problem<commit_after>#!/usr/local/bin/python
# Code Fights Cracking Password Problem
import itertools
def stringsRearrangement(inputArray):
def f(x, y):
c = 0
for i in range(len(x)):
if x[i] != y[i]:
c... | |
fb2f4abee96a209c2c2066ed92e9b22533f501c1 | Arrays/longest_1s_by_replacing_0.py | Arrays/longest_1s_by_replacing_0.py | import unittest
"""
Given an array of 0s and 1s, find the position of 0 to be replaced with 1 to get longest contiguous
sequence of 1s.
Input: 1 1 0 0 1 0 1 1 1 0 1 1 1
Output: index 9
Input: 1 1 1 1 0
Output: index 4
Input: 01010
Output: index 2
"""
"""
Approach:
1. The idea is to keep track of 2 indexes - prev_zero ... | Index of zero to get longest 1s | Index of zero to get longest 1s
| Python | mit | prathamtandon/g4gproblems | Index of zero to get longest 1s | import unittest
"""
Given an array of 0s and 1s, find the position of 0 to be replaced with 1 to get longest contiguous
sequence of 1s.
Input: 1 1 0 0 1 0 1 1 1 0 1 1 1
Output: index 9
Input: 1 1 1 1 0
Output: index 4
Input: 01010
Output: index 2
"""
"""
Approach:
1. The idea is to keep track of 2 indexes - prev_zero ... | <commit_before><commit_msg>Index of zero to get longest 1s<commit_after> | import unittest
"""
Given an array of 0s and 1s, find the position of 0 to be replaced with 1 to get longest contiguous
sequence of 1s.
Input: 1 1 0 0 1 0 1 1 1 0 1 1 1
Output: index 9
Input: 1 1 1 1 0
Output: index 4
Input: 01010
Output: index 2
"""
"""
Approach:
1. The idea is to keep track of 2 indexes - prev_zero ... | Index of zero to get longest 1simport unittest
"""
Given an array of 0s and 1s, find the position of 0 to be replaced with 1 to get longest contiguous
sequence of 1s.
Input: 1 1 0 0 1 0 1 1 1 0 1 1 1
Output: index 9
Input: 1 1 1 1 0
Output: index 4
Input: 01010
Output: index 2
"""
"""
Approach:
1. The idea is to keep ... | <commit_before><commit_msg>Index of zero to get longest 1s<commit_after>import unittest
"""
Given an array of 0s and 1s, find the position of 0 to be replaced with 1 to get longest contiguous
sequence of 1s.
Input: 1 1 0 0 1 0 1 1 1 0 1 1 1
Output: index 9
Input: 1 1 1 1 0
Output: index 4
Input: 01010
Output: index 2
"... | |
c2592b39fde98ac8ba46c165deb4a1245954f3a1 | tests/test_crawler.py | tests/test_crawler.py | import warnings
import unittest
from scrapy.crawler import Crawler
from scrapy.settings import Settings
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
class CrawlerTestCase(unittest.TestCase):
def setUp(self):
self.crawler = Crawler(DefaultSpider, Settings())
... | import warnings
import unittest
from twisted.internet import defer
from scrapy.crawler import Crawler, CrawlerRunner
from scrapy.settings import Settings
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
class CrawlerTestCase(unittest.TestCase):
def setUp(self):
se... | Test verifying that CrawlerRunner populates spider class settings | Test verifying that CrawlerRunner populates spider class settings
| Python | bsd-3-clause | elijah513/scrapy,darkrho/scrapy-scrapy,hansenDise/scrapy,dracony/scrapy,eliasdorneles/scrapy,URXtech/scrapy,olorz/scrapy,dgillis/scrapy,nguyenhongson03/scrapy,crasker/scrapy,heamon7/scrapy,kimimj/scrapy,Djlavoy/scrapy,nikgr95/scrapy,Timeship/scrapy,eLRuLL/scrapy,jdemaeyer/scrapy,finfish/scrapy,github-account-because-th... | import warnings
import unittest
from scrapy.crawler import Crawler
from scrapy.settings import Settings
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
class CrawlerTestCase(unittest.TestCase):
def setUp(self):
self.crawler = Crawler(DefaultSpider, Settings())
... | import warnings
import unittest
from twisted.internet import defer
from scrapy.crawler import Crawler, CrawlerRunner
from scrapy.settings import Settings
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
class CrawlerTestCase(unittest.TestCase):
def setUp(self):
se... | <commit_before>import warnings
import unittest
from scrapy.crawler import Crawler
from scrapy.settings import Settings
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
class CrawlerTestCase(unittest.TestCase):
def setUp(self):
self.crawler = Crawler(DefaultSpider, ... | import warnings
import unittest
from twisted.internet import defer
from scrapy.crawler import Crawler, CrawlerRunner
from scrapy.settings import Settings
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
class CrawlerTestCase(unittest.TestCase):
def setUp(self):
se... | import warnings
import unittest
from scrapy.crawler import Crawler
from scrapy.settings import Settings
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
class CrawlerTestCase(unittest.TestCase):
def setUp(self):
self.crawler = Crawler(DefaultSpider, Settings())
... | <commit_before>import warnings
import unittest
from scrapy.crawler import Crawler
from scrapy.settings import Settings
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
class CrawlerTestCase(unittest.TestCase):
def setUp(self):
self.crawler = Crawler(DefaultSpider, ... |
f6fabf476e49d0d857217c428ed2ad1af7f034cd | candidates/management/commands/candidates_delete_everything_from_popit.py | candidates/management/commands/candidates_delete_everything_from_popit.py | import json
from candidates.models import PopItPerson
from candidates.popit import PopItApiMixin, get_base_url
from django.core.management.base import BaseCommand
class Command(PopItApiMixin, BaseCommand):
def handle(self, **options):
message = "WARNING: this will delete all people, posts, " \
... | Add a command to delete all objects from PopIt | Add a command to delete all objects from PopIt
| Python | agpl-3.0 | YoQuieroSaber/yournextrepresentative,datamade/yournextmp-popit,neavouli/yournextrepresentative,YoQuieroSaber/yournextrepresentative,datamade/yournextmp-popit,DemocracyClub/yournextrepresentative,YoQuieroSaber/yournextrepresentative,neavouli/yournextrepresentative,neavouli/yournextrepresentative,mysociety/yournextrepres... | Add a command to delete all objects from PopIt | import json
from candidates.models import PopItPerson
from candidates.popit import PopItApiMixin, get_base_url
from django.core.management.base import BaseCommand
class Command(PopItApiMixin, BaseCommand):
def handle(self, **options):
message = "WARNING: this will delete all people, posts, " \
... | <commit_before><commit_msg>Add a command to delete all objects from PopIt<commit_after> | import json
from candidates.models import PopItPerson
from candidates.popit import PopItApiMixin, get_base_url
from django.core.management.base import BaseCommand
class Command(PopItApiMixin, BaseCommand):
def handle(self, **options):
message = "WARNING: this will delete all people, posts, " \
... | Add a command to delete all objects from PopItimport json
from candidates.models import PopItPerson
from candidates.popit import PopItApiMixin, get_base_url
from django.core.management.base import BaseCommand
class Command(PopItApiMixin, BaseCommand):
def handle(self, **options):
message = "WARNING: thi... | <commit_before><commit_msg>Add a command to delete all objects from PopIt<commit_after>import json
from candidates.models import PopItPerson
from candidates.popit import PopItApiMixin, get_base_url
from django.core.management.base import BaseCommand
class Command(PopItApiMixin, BaseCommand):
def handle(self, **... | |
e9605dd5432806435dec26f7e23ebdf25074943b | blueLed.py | blueLed.py | '''
Dr Who Box: Blue Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
LED = 18
# Use numbering based on P1 header
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(LED, GPIO.OUT, GPIO.LOW)
def pulsate... | Add stand-alone demo of pulsating LED using multiprocess. | Add stand-alone demo of pulsating LED using multiprocess.
| Python | mit | davidb24v/drwho | Add stand-alone demo of pulsating LED using multiprocess. | '''
Dr Who Box: Blue Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
LED = 18
# Use numbering based on P1 header
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(LED, GPIO.OUT, GPIO.LOW)
def pulsate... | <commit_before><commit_msg>Add stand-alone demo of pulsating LED using multiprocess.<commit_after> | '''
Dr Who Box: Blue Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
LED = 18
# Use numbering based on P1 header
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(LED, GPIO.OUT, GPIO.LOW)
def pulsate... | Add stand-alone demo of pulsating LED using multiprocess.'''
Dr Who Box: Blue Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
LED = 18
# Use numbering based on P1 header
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings... | <commit_before><commit_msg>Add stand-alone demo of pulsating LED using multiprocess.<commit_after>'''
Dr Who Box: Blue Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
LED = 18
# Use numbering based on P1 header
... | |
93e5e1b8d36e6488044c619e9015aa2e7c5ab29b | dynamic_programming/edit_distance.py | dynamic_programming/edit_distance.py | """
Author : Turfa Auliarachman
Date : October 12, 2016
This is a pure Python implementation of Dynamic Programming solution to the edit distance problem.
The problem is :
Given two strings A and B. Find the minimum number of operations to string B such that A = B. The permitted operations are removal, insertion... | Add Edit Distance DP Algorithm | Add Edit Distance DP Algorithm
| Python | mit | TheAlgorithms/Python | Add Edit Distance DP Algorithm | """
Author : Turfa Auliarachman
Date : October 12, 2016
This is a pure Python implementation of Dynamic Programming solution to the edit distance problem.
The problem is :
Given two strings A and B. Find the minimum number of operations to string B such that A = B. The permitted operations are removal, insertion... | <commit_before><commit_msg>Add Edit Distance DP Algorithm<commit_after> | """
Author : Turfa Auliarachman
Date : October 12, 2016
This is a pure Python implementation of Dynamic Programming solution to the edit distance problem.
The problem is :
Given two strings A and B. Find the minimum number of operations to string B such that A = B. The permitted operations are removal, insertion... | Add Edit Distance DP Algorithm"""
Author : Turfa Auliarachman
Date : October 12, 2016
This is a pure Python implementation of Dynamic Programming solution to the edit distance problem.
The problem is :
Given two strings A and B. Find the minimum number of operations to string B such that A = B. The permitted oper... | <commit_before><commit_msg>Add Edit Distance DP Algorithm<commit_after>"""
Author : Turfa Auliarachman
Date : October 12, 2016
This is a pure Python implementation of Dynamic Programming solution to the edit distance problem.
The problem is :
Given two strings A and B. Find the minimum number of operations to str... | |
3a08fa5f2dba14c2527f1a381d6bb7dbaaf94553 | dhash.py | dhash.py | '''
- a way to separate entries by key to know which machine to store it at
- eviction strategy:
* FIFO
* LRU
* LFU
- access pattern:
* write-thru
* write-around
* write-back
- latency vs consistency vs availability
- how would multithreading work? locks?
- collision resolution method
- resizing
* consistent hashing
* ... | Add basic config functionality and stubs for MockNode, MockDB, as well as different resizing methods, access patterns and eviction strategies. | Add basic config functionality and stubs for MockNode, MockDB, as well as different resizing methods, access patterns and eviction strategies.
| Python | mit | gudnm/dhash | Add basic config functionality and stubs for MockNode, MockDB, as well as different resizing methods, access patterns and eviction strategies. | '''
- a way to separate entries by key to know which machine to store it at
- eviction strategy:
* FIFO
* LRU
* LFU
- access pattern:
* write-thru
* write-around
* write-back
- latency vs consistency vs availability
- how would multithreading work? locks?
- collision resolution method
- resizing
* consistent hashing
* ... | <commit_before><commit_msg>Add basic config functionality and stubs for MockNode, MockDB, as well as different resizing methods, access patterns and eviction strategies.<commit_after> | '''
- a way to separate entries by key to know which machine to store it at
- eviction strategy:
* FIFO
* LRU
* LFU
- access pattern:
* write-thru
* write-around
* write-back
- latency vs consistency vs availability
- how would multithreading work? locks?
- collision resolution method
- resizing
* consistent hashing
* ... | Add basic config functionality and stubs for MockNode, MockDB, as well as different resizing methods, access patterns and eviction strategies.'''
- a way to separate entries by key to know which machine to store it at
- eviction strategy:
* FIFO
* LRU
* LFU
- access pattern:
* write-thru
* write-around
* write-back
- l... | <commit_before><commit_msg>Add basic config functionality and stubs for MockNode, MockDB, as well as different resizing methods, access patterns and eviction strategies.<commit_after>'''
- a way to separate entries by key to know which machine to store it at
- eviction strategy:
* FIFO
* LRU
* LFU
- access pattern:
* w... | |
67320776e7c93004d023c71f6e855fea88f03d7c | statsmodels/tsa/tests/test_x13.py | statsmodels/tsa/tests/test_x13.py | from nose import SkipTest
from numpy.testing import assert_
from statsmodels.tsa.base.datetools import dates_from_range
from statsmodels.tsa.x12 import _find_x12, select_arima_order
x13path = _find_x12()
if x13path is False:
_have_x13 = False
else:
_have_x13 = True
class TestX13(object):
@classmethod
... | Add some smoke tests for x12/x13 | TST: Add some smoke tests for x12/x13
| Python | bsd-3-clause | gef756/statsmodels,adammenges/statsmodels,musically-ut/statsmodels,hlin117/statsmodels,josef-pkt/statsmodels,statsmodels/statsmodels,saketkc/statsmodels,DonBeo/statsmodels,saketkc/statsmodels,alekz112/statsmodels,ChadFulton/statsmodels,wzbozon/statsmodels,bashtage/statsmodels,DonBeo/statsmodels,wwf5067/statsmodels,asto... | TST: Add some smoke tests for x12/x13 | from nose import SkipTest
from numpy.testing import assert_
from statsmodels.tsa.base.datetools import dates_from_range
from statsmodels.tsa.x12 import _find_x12, select_arima_order
x13path = _find_x12()
if x13path is False:
_have_x13 = False
else:
_have_x13 = True
class TestX13(object):
@classmethod
... | <commit_before><commit_msg>TST: Add some smoke tests for x12/x13<commit_after> | from nose import SkipTest
from numpy.testing import assert_
from statsmodels.tsa.base.datetools import dates_from_range
from statsmodels.tsa.x12 import _find_x12, select_arima_order
x13path = _find_x12()
if x13path is False:
_have_x13 = False
else:
_have_x13 = True
class TestX13(object):
@classmethod
... | TST: Add some smoke tests for x12/x13from nose import SkipTest
from numpy.testing import assert_
from statsmodels.tsa.base.datetools import dates_from_range
from statsmodels.tsa.x12 import _find_x12, select_arima_order
x13path = _find_x12()
if x13path is False:
_have_x13 = False
else:
_have_x13 = True
class... | <commit_before><commit_msg>TST: Add some smoke tests for x12/x13<commit_after>from nose import SkipTest
from numpy.testing import assert_
from statsmodels.tsa.base.datetools import dates_from_range
from statsmodels.tsa.x12 import _find_x12, select_arima_order
x13path = _find_x12()
if x13path is False:
_have_x13 ... | |
bd79e93b12f2d0563492a2c89813927d18c06ac1 | tensorflow/python/tpu/__init__.py | tensorflow/python/tpu/__init__.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Initialize TPU_ML_PLATFORM env variable with `Tensorflow`. | Initialize TPU_ML_PLATFORM env variable with `Tensorflow`.
PiperOrigin-RevId: 474832980
| Python | apache-2.0 | paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/... | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
6aace4f414aa004551b03702c1dd2f5b5e9c8143 | tests/test_caster.py | tests/test_caster.py | """Additional tests for the caster to ensure full code coverage.
"""
import pytest
def test_corner():
from aflow.caster import cast
assert cast("numbers", "spinD", None) is None
assert cast("numbers", "spinD", "garbage") is None
| Increase test coverage for corner cases. | Increase test coverage for corner cases.
| Python | mit | rosenbrockc/aflow | Increase test coverage for corner cases. | """Additional tests for the caster to ensure full code coverage.
"""
import pytest
def test_corner():
from aflow.caster import cast
assert cast("numbers", "spinD", None) is None
assert cast("numbers", "spinD", "garbage") is None
| <commit_before><commit_msg>Increase test coverage for corner cases.<commit_after> | """Additional tests for the caster to ensure full code coverage.
"""
import pytest
def test_corner():
from aflow.caster import cast
assert cast("numbers", "spinD", None) is None
assert cast("numbers", "spinD", "garbage") is None
| Increase test coverage for corner cases."""Additional tests for the caster to ensure full code coverage.
"""
import pytest
def test_corner():
from aflow.caster import cast
assert cast("numbers", "spinD", None) is None
assert cast("numbers", "spinD", "garbage") is None
| <commit_before><commit_msg>Increase test coverage for corner cases.<commit_after>"""Additional tests for the caster to ensure full code coverage.
"""
import pytest
def test_corner():
from aflow.caster import cast
assert cast("numbers", "spinD", None) is None
assert cast("numbers", "spinD", "garbage") is Non... | |
7de33228e89139605f7eb20ebd7ba3192306c123 | dataedit/management/commands/mirror.py | dataedit/management/commands/mirror.py | from django.core.management.base import BaseCommand, CommandError
from sqlalchemy.orm.session import sessionmaker
from api.connection import _get_engine
from dataedit.models import Table
from dataedit.views import schema_whitelist
import sqlalchemy as sqla
class Command(BaseCommand):
def handle(self, *args, **opt... | Add transition method for legacy databases | Add transition method for legacy databases
| Python | agpl-3.0 | openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform | Add transition method for legacy databases | from django.core.management.base import BaseCommand, CommandError
from sqlalchemy.orm.session import sessionmaker
from api.connection import _get_engine
from dataedit.models import Table
from dataedit.views import schema_whitelist
import sqlalchemy as sqla
class Command(BaseCommand):
def handle(self, *args, **opt... | <commit_before><commit_msg>Add transition method for legacy databases<commit_after> | from django.core.management.base import BaseCommand, CommandError
from sqlalchemy.orm.session import sessionmaker
from api.connection import _get_engine
from dataedit.models import Table
from dataedit.views import schema_whitelist
import sqlalchemy as sqla
class Command(BaseCommand):
def handle(self, *args, **opt... | Add transition method for legacy databasesfrom django.core.management.base import BaseCommand, CommandError
from sqlalchemy.orm.session import sessionmaker
from api.connection import _get_engine
from dataedit.models import Table
from dataedit.views import schema_whitelist
import sqlalchemy as sqla
class Command(BaseC... | <commit_before><commit_msg>Add transition method for legacy databases<commit_after>from django.core.management.base import BaseCommand, CommandError
from sqlalchemy.orm.session import sessionmaker
from api.connection import _get_engine
from dataedit.models import Table
from dataedit.views import schema_whitelist
import... | |
e4e70331e95a515d669e576ebcdb854d141a5a84 | Tools/remove-trailing-whitespace.py | Tools/remove-trailing-whitespace.py | #!/usr/bin/python
# This file is a part of the OpenSurgSim project.
# Copyright 2012-2013, SimQuest Solutions Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | Add a script to remove trailing whitespace from a file. | Add a script to remove trailing whitespace from a file.
Typical usage:
Tools/remove-trailing-whitespace.py Foo.h
or:
find SurgSim \( -name '*.h' -o -name '*.cpp' \) -print \
| xargs python Tools/remove-trailing-whitespace.py
| Python | apache-2.0 | simquest/opensurgsim,simquest/opensurgsim,simquest/opensurgsim,simquest/opensurgsim | Add a script to remove trailing whitespace from a file.
Typical usage:
Tools/remove-trailing-whitespace.py Foo.h
or:
find SurgSim \( -name '*.h' -o -name '*.cpp' \) -print \
| xargs python Tools/remove-trailing-whitespace.py | #!/usr/bin/python
# This file is a part of the OpenSurgSim project.
# Copyright 2012-2013, SimQuest Solutions Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | <commit_before><commit_msg>Add a script to remove trailing whitespace from a file.
Typical usage:
Tools/remove-trailing-whitespace.py Foo.h
or:
find SurgSim \( -name '*.h' -o -name '*.cpp' \) -print \
| xargs python Tools/remove-trailing-whitespace.py<commit_after> | #!/usr/bin/python
# This file is a part of the OpenSurgSim project.
# Copyright 2012-2013, SimQuest Solutions Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | Add a script to remove trailing whitespace from a file.
Typical usage:
Tools/remove-trailing-whitespace.py Foo.h
or:
find SurgSim \( -name '*.h' -o -name '*.cpp' \) -print \
| xargs python Tools/remove-trailing-whitespace.py#!/usr/bin/python
# This file is a part of the OpenSurgSim project.
# Copyright 2012-2... | <commit_before><commit_msg>Add a script to remove trailing whitespace from a file.
Typical usage:
Tools/remove-trailing-whitespace.py Foo.h
or:
find SurgSim \( -name '*.h' -o -name '*.cpp' \) -print \
| xargs python Tools/remove-trailing-whitespace.py<commit_after>#!/usr/bin/python
# This file is a part of th... | |
960a12ee047a915e29258fcafcf642be11b838ed | overlay/DataRegion.py | overlay/DataRegion.py | class DataRegion:
def __init__(self):
self.data = []
def addTimeData(self, data_time, data_value):
self.data.append((data_time, data_value))
def isTimeInRegion(self, secs_since_epoch):
return self.data[0][0] <= secs_since_epoch <= self.data[-1][0]
def dataInTimeRegion(self, st... | Create class to hold regions of data | Create class to hold regions of data
| Python | mit | gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x,thelonious/g2x | Create class to hold regions of data | class DataRegion:
def __init__(self):
self.data = []
def addTimeData(self, data_time, data_value):
self.data.append((data_time, data_value))
def isTimeInRegion(self, secs_since_epoch):
return self.data[0][0] <= secs_since_epoch <= self.data[-1][0]
def dataInTimeRegion(self, st... | <commit_before><commit_msg>Create class to hold regions of data<commit_after> | class DataRegion:
def __init__(self):
self.data = []
def addTimeData(self, data_time, data_value):
self.data.append((data_time, data_value))
def isTimeInRegion(self, secs_since_epoch):
return self.data[0][0] <= secs_since_epoch <= self.data[-1][0]
def dataInTimeRegion(self, st... | Create class to hold regions of dataclass DataRegion:
def __init__(self):
self.data = []
def addTimeData(self, data_time, data_value):
self.data.append((data_time, data_value))
def isTimeInRegion(self, secs_since_epoch):
return self.data[0][0] <= secs_since_epoch <= self.data[-1][0... | <commit_before><commit_msg>Create class to hold regions of data<commit_after>class DataRegion:
def __init__(self):
self.data = []
def addTimeData(self, data_time, data_value):
self.data.append((data_time, data_value))
def isTimeInRegion(self, secs_since_epoch):
return self.data[0][... | |
6373384ddc2836fc23db27d1b230b9f4228a0e38 | bluebottle/cms/migrations/0062_auto_20200812_1514.py | bluebottle/cms/migrations/0062_auto_20200812_1514.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-07-17 08:37
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from django.db import migrations, models, connection
from django.utils.translation import activate, _trans
from tenant_extras.middleware import tenant_... | Add migration that deletes old statscontent objects from homepage | Add migration that deletes old statscontent objects from homepage
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Add migration that deletes old statscontent objects from homepage | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-07-17 08:37
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from django.db import migrations, models, connection
from django.utils.translation import activate, _trans
from tenant_extras.middleware import tenant_... | <commit_before><commit_msg>Add migration that deletes old statscontent objects from homepage<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-07-17 08:37
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from django.db import migrations, models, connection
from django.utils.translation import activate, _trans
from tenant_extras.middleware import tenant_... | Add migration that deletes old statscontent objects from homepage# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-07-17 08:37
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from django.db import migrations, models, connection
from django.utils.translation imp... | <commit_before><commit_msg>Add migration that deletes old statscontent objects from homepage<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-07-17 08:37
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from django.db import migrations, models, con... | |
aa43336c74376ac9ea70ee407d936c28cfc7ccab | MOS6502.py | MOS6502.py | class Register(object):
def __init__(self, name, bitwidth):
self.name = name
self.value = 0
self.past = [0] # maybe for rewind?
self.symbVal = [z3.BitVec(self.name, bitwidth)] # maybe for
# symbolic
... | Add register and CPU stuff | Add register and CPU stuff
| Python | bsd-2-clause | pusscat/refNes | Add register and CPU stuff | class Register(object):
def __init__(self, name, bitwidth):
self.name = name
self.value = 0
self.past = [0] # maybe for rewind?
self.symbVal = [z3.BitVec(self.name, bitwidth)] # maybe for
# symbolic
... | <commit_before><commit_msg>Add register and CPU stuff<commit_after> | class Register(object):
def __init__(self, name, bitwidth):
self.name = name
self.value = 0
self.past = [0] # maybe for rewind?
self.symbVal = [z3.BitVec(self.name, bitwidth)] # maybe for
# symbolic
... | Add register and CPU stuffclass Register(object):
def __init__(self, name, bitwidth):
self.name = name
self.value = 0
self.past = [0] # maybe for rewind?
self.symbVal = [z3.BitVec(self.name, bitwidth)] # maybe for
# symbolic
... | <commit_before><commit_msg>Add register and CPU stuff<commit_after>class Register(object):
def __init__(self, name, bitwidth):
self.name = name
self.value = 0
self.past = [0] # maybe for rewind?
self.symbVal = [z3.BitVec(self.name, bitwidth)] # maybe for
... | |
2f143f3eeaff68b2d871d4cc8e6c1e212bdf246b | tools/trigger-job.py | tools/trigger-job.py | #!/usr/bin/env python
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Add manual job triggering script. | Add manual job triggering script.
Change-Id: Ic396c845e5f61a98d3b0e8c3fc08c6f9dbfffc6a
Reviewed-on: https://review.openstack.org/34437
Reviewed-by: Jeremy Stanley <[email protected]>
Approved: Clark Boylan <[email protected]>
Reviewed-by: Clark Boylan... | Python | apache-2.0 | devdattakulkarni/zuul_messaging,devdattakulkarni/zuul_messaging,gooddata/zuul,gooddata/zuul,wikimedia/integration-zuul,wikimedia/integration-zuul,gooddata/zuul,gooddata/zuul,wikimedia/integration-zuul,devdattakulkarni/zuul_messaging,gooddata/zuul,wikimedia/integration-zuul | Add manual job triggering script.
Change-Id: Ic396c845e5f61a98d3b0e8c3fc08c6f9dbfffc6a
Reviewed-on: https://review.openstack.org/34437
Reviewed-by: Jeremy Stanley <[email protected]>
Approved: Clark Boylan <[email protected]>
Reviewed-by: Clark Boylan... | #!/usr/bin/env python
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | <commit_before><commit_msg>Add manual job triggering script.
Change-Id: Ic396c845e5f61a98d3b0e8c3fc08c6f9dbfffc6a
Reviewed-on: https://review.openstack.org/34437
Reviewed-by: Jeremy Stanley <[email protected]>
Approved: Clark Boylan <[email protected]... | #!/usr/bin/env python
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Add manual job triggering script.
Change-Id: Ic396c845e5f61a98d3b0e8c3fc08c6f9dbfffc6a
Reviewed-on: https://review.openstack.org/34437
Reviewed-by: Jeremy Stanley <[email protected]>
Approved: Clark Boylan <[email protected]>
Reviewed-by: Clark Boylan... | <commit_before><commit_msg>Add manual job triggering script.
Change-Id: Ic396c845e5f61a98d3b0e8c3fc08c6f9dbfffc6a
Reviewed-on: https://review.openstack.org/34437
Reviewed-by: Jeremy Stanley <[email protected]>
Approved: Clark Boylan <[email protected]... | |
e9619cdf7292de21a97562cdc068be7d26402cac | readthedocs/oauth/management/commands/sync_vcs_data.py | readthedocs/oauth/management/commands/sync_vcs_data.py | from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from readthedocs.oauth.tasks import sync_remote_repositories
class Command(BaseCommand):
help = "Sync OAuth RemoteRepository and RemoteOrganization"
def add_arguments(self, parser):
parser.add_argument(
... | Add manafement command to Sync RemoteRepositories and RemoteOrganizations | Add manafement command to Sync RemoteRepositories and RemoteOrganizations
| Python | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | Add manafement command to Sync RemoteRepositories and RemoteOrganizations | from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from readthedocs.oauth.tasks import sync_remote_repositories
class Command(BaseCommand):
help = "Sync OAuth RemoteRepository and RemoteOrganization"
def add_arguments(self, parser):
parser.add_argument(
... | <commit_before><commit_msg>Add manafement command to Sync RemoteRepositories and RemoteOrganizations<commit_after> | from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from readthedocs.oauth.tasks import sync_remote_repositories
class Command(BaseCommand):
help = "Sync OAuth RemoteRepository and RemoteOrganization"
def add_arguments(self, parser):
parser.add_argument(
... | Add manafement command to Sync RemoteRepositories and RemoteOrganizationsfrom django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from readthedocs.oauth.tasks import sync_remote_repositories
class Command(BaseCommand):
help = "Sync OAuth RemoteRepository and RemoteOrganizat... | <commit_before><commit_msg>Add manafement command to Sync RemoteRepositories and RemoteOrganizations<commit_after>from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from readthedocs.oauth.tasks import sync_remote_repositories
class Command(BaseCommand):
help = "Sync O... | |
f96919f5091126c96082acdcf430df9b93a97d06 | migrations/versions/0378_remove_doc_download_perm.py | migrations/versions/0378_remove_doc_download_perm.py | """
Revision ID: 0378_remove_doc_download_perm
Revises: 0377_populate_org_brand_pools
Create Date: 2022-10-12 11:55:28.906151
"""
from alembic import op
revision = "0378_remove_doc_download_perm"
down_revision = "0377_populate_org_brand_pools"
def upgrade():
op.execute("DELETE FROM service_permissions WHERE pe... | Remove temp doc download service perms | Remove temp doc download service perms
We added a service permission to gate the new document download security
features. Now that these have been released, let's remove the
permission.
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Remove temp doc download service perms
We added a service permission to gate the new document download security
features. Now that these have been released, let's remove the
permission. | """
Revision ID: 0378_remove_doc_download_perm
Revises: 0377_populate_org_brand_pools
Create Date: 2022-10-12 11:55:28.906151
"""
from alembic import op
revision = "0378_remove_doc_download_perm"
down_revision = "0377_populate_org_brand_pools"
def upgrade():
op.execute("DELETE FROM service_permissions WHERE pe... | <commit_before><commit_msg>Remove temp doc download service perms
We added a service permission to gate the new document download security
features. Now that these have been released, let's remove the
permission.<commit_after> | """
Revision ID: 0378_remove_doc_download_perm
Revises: 0377_populate_org_brand_pools
Create Date: 2022-10-12 11:55:28.906151
"""
from alembic import op
revision = "0378_remove_doc_download_perm"
down_revision = "0377_populate_org_brand_pools"
def upgrade():
op.execute("DELETE FROM service_permissions WHERE pe... | Remove temp doc download service perms
We added a service permission to gate the new document download security
features. Now that these have been released, let's remove the
permission."""
Revision ID: 0378_remove_doc_download_perm
Revises: 0377_populate_org_brand_pools
Create Date: 2022-10-12 11:55:28.906151
"""
fr... | <commit_before><commit_msg>Remove temp doc download service perms
We added a service permission to gate the new document download security
features. Now that these have been released, let's remove the
permission.<commit_after>"""
Revision ID: 0378_remove_doc_download_perm
Revises: 0377_populate_org_brand_pools
Create... | |
d82a6fa96391630a17520c7ff8dbb23918c2a8aa | test/conserve-p/lj-fluid.py | test/conserve-p/lj-fluid.py | #! /usr/bin/env hoomd
from hoomd_script import *
init.create_random(N=10000, phi_p=0.2)
lj = pair.lj(r_cut=2.5)
lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0, alpha=1.0)
all = group.all()
integrate.mode_standard(dt=0.005)
integrate.nvt(group=all, T=1.2, tau=0.5)
analyze.log(filename = 'thermo.log', quantities ... | Test script for evaluating momentum conservation | Test script for evaluating momentum conservation
git-svn-id: 0c14c15b0cdbdea73634a2d7d7d743954bb0522f@3197 fa922fa7-2fde-0310-acd8-f43f465a7996
| Python | bsd-3-clause | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | Test script for evaluating momentum conservation
git-svn-id: 0c14c15b0cdbdea73634a2d7d7d743954bb0522f@3197 fa922fa7-2fde-0310-acd8-f43f465a7996 | #! /usr/bin/env hoomd
from hoomd_script import *
init.create_random(N=10000, phi_p=0.2)
lj = pair.lj(r_cut=2.5)
lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0, alpha=1.0)
all = group.all()
integrate.mode_standard(dt=0.005)
integrate.nvt(group=all, T=1.2, tau=0.5)
analyze.log(filename = 'thermo.log', quantities ... | <commit_before><commit_msg>Test script for evaluating momentum conservation
git-svn-id: 0c14c15b0cdbdea73634a2d7d7d743954bb0522f@3197 fa922fa7-2fde-0310-acd8-f43f465a7996<commit_after> | #! /usr/bin/env hoomd
from hoomd_script import *
init.create_random(N=10000, phi_p=0.2)
lj = pair.lj(r_cut=2.5)
lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0, alpha=1.0)
all = group.all()
integrate.mode_standard(dt=0.005)
integrate.nvt(group=all, T=1.2, tau=0.5)
analyze.log(filename = 'thermo.log', quantities ... | Test script for evaluating momentum conservation
git-svn-id: 0c14c15b0cdbdea73634a2d7d7d743954bb0522f@3197 fa922fa7-2fde-0310-acd8-f43f465a7996#! /usr/bin/env hoomd
from hoomd_script import *
init.create_random(N=10000, phi_p=0.2)
lj = pair.lj(r_cut=2.5)
lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0, alpha=1.0)... | <commit_before><commit_msg>Test script for evaluating momentum conservation
git-svn-id: 0c14c15b0cdbdea73634a2d7d7d743954bb0522f@3197 fa922fa7-2fde-0310-acd8-f43f465a7996<commit_after>#! /usr/bin/env hoomd
from hoomd_script import *
init.create_random(N=10000, phi_p=0.2)
lj = pair.lj(r_cut=2.5)
lj.pair_coeff.set('A'... | |
7cb7fa17720864669ac1e0c3fe361e3925415169 | client/python/plot_request_times.py | client/python/plot_request_times.py | import requests
r = requests.get('http://localhost:8081/monitor_results/1')
print(r.json())
for monitoring_data in r.json():
print 'URL: ' + monitoring_data['urlToMonitor']['url']
| Add stub for python client | Add stub for python client
| Python | mit | gernd/simple-site-mon | Add stub for python client | import requests
r = requests.get('http://localhost:8081/monitor_results/1')
print(r.json())
for monitoring_data in r.json():
print 'URL: ' + monitoring_data['urlToMonitor']['url']
| <commit_before><commit_msg>Add stub for python client<commit_after> | import requests
r = requests.get('http://localhost:8081/monitor_results/1')
print(r.json())
for monitoring_data in r.json():
print 'URL: ' + monitoring_data['urlToMonitor']['url']
| Add stub for python clientimport requests
r = requests.get('http://localhost:8081/monitor_results/1')
print(r.json())
for monitoring_data in r.json():
print 'URL: ' + monitoring_data['urlToMonitor']['url']
| <commit_before><commit_msg>Add stub for python client<commit_after>import requests
r = requests.get('http://localhost:8081/monitor_results/1')
print(r.json())
for monitoring_data in r.json():
print 'URL: ' + monitoring_data['urlToMonitor']['url']
| |
7e5982299e8b5b07239f7fb1aa088e7eafd08f88 | tardis/montecarlo/enum.py | tardis/montecarlo/enum.py | from ctypes import c_int
class EnumerationType(type(c_int)):
def __new__(metacls, name, bases, dictionary):
if not "_members_" in dictionary:
_members_ = {}
for key, value in dictionary.items():
if not key.startswith("_"):
_members_[key] = value
... | Add metaclass and class for CEnumeration adoption. | Add metaclass and class for CEnumeration adoption.
| Python | bsd-3-clause | kaushik94/tardis,Tobychev/tardis,kaushik94/tardis,Tobychev/tardis,Tobychev/tardis,orbitfold/tardis,orbitfold/tardis,kaushik94/tardis,orbitfold/tardis,orbitfold/tardis,kaushik94/tardis | Add metaclass and class for CEnumeration adoption. | from ctypes import c_int
class EnumerationType(type(c_int)):
def __new__(metacls, name, bases, dictionary):
if not "_members_" in dictionary:
_members_ = {}
for key, value in dictionary.items():
if not key.startswith("_"):
_members_[key] = value
... | <commit_before><commit_msg>Add metaclass and class for CEnumeration adoption.<commit_after> | from ctypes import c_int
class EnumerationType(type(c_int)):
def __new__(metacls, name, bases, dictionary):
if not "_members_" in dictionary:
_members_ = {}
for key, value in dictionary.items():
if not key.startswith("_"):
_members_[key] = value
... | Add metaclass and class for CEnumeration adoption.from ctypes import c_int
class EnumerationType(type(c_int)):
def __new__(metacls, name, bases, dictionary):
if not "_members_" in dictionary:
_members_ = {}
for key, value in dictionary.items():
if not key.startswith... | <commit_before><commit_msg>Add metaclass and class for CEnumeration adoption.<commit_after>from ctypes import c_int
class EnumerationType(type(c_int)):
def __new__(metacls, name, bases, dictionary):
if not "_members_" in dictionary:
_members_ = {}
for key, value in dictionary.items... | |
a5d99114ac3c7d146f0874744d6a54b27e9a990f | search/generate_db.py | search/generate_db.py | from random_words import RandomWords
from faker import Factory
import random
import sqlite3
NUM_GENERATE = 100
CATEGORIES = ['miscellaneous', 'appliance', 'bedding', 'toys', 'books', 'clothing',
'seasonal', 'electronics', 'household', 'kitchen', 'sports']
def generate_postings(count):
postings = []
for i in range... | Implement auto generate db postings | Implement auto generate db postings
| Python | mit | njbbaer/give-get-green,njbbaer/give-get-green,njbbaer/give-get-green | Implement auto generate db postings | from random_words import RandomWords
from faker import Factory
import random
import sqlite3
NUM_GENERATE = 100
CATEGORIES = ['miscellaneous', 'appliance', 'bedding', 'toys', 'books', 'clothing',
'seasonal', 'electronics', 'household', 'kitchen', 'sports']
def generate_postings(count):
postings = []
for i in range... | <commit_before><commit_msg>Implement auto generate db postings<commit_after> | from random_words import RandomWords
from faker import Factory
import random
import sqlite3
NUM_GENERATE = 100
CATEGORIES = ['miscellaneous', 'appliance', 'bedding', 'toys', 'books', 'clothing',
'seasonal', 'electronics', 'household', 'kitchen', 'sports']
def generate_postings(count):
postings = []
for i in range... | Implement auto generate db postingsfrom random_words import RandomWords
from faker import Factory
import random
import sqlite3
NUM_GENERATE = 100
CATEGORIES = ['miscellaneous', 'appliance', 'bedding', 'toys', 'books', 'clothing',
'seasonal', 'electronics', 'household', 'kitchen', 'sports']
def generate_postings(cou... | <commit_before><commit_msg>Implement auto generate db postings<commit_after>from random_words import RandomWords
from faker import Factory
import random
import sqlite3
NUM_GENERATE = 100
CATEGORIES = ['miscellaneous', 'appliance', 'bedding', 'toys', 'books', 'clothing',
'seasonal', 'electronics', 'household', 'kitch... | |
881d7ed1e2ad8be504c02d29ccaaac4e12ea0605 | scripts/band_width.py | scripts/band_width.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
__author__ = "Yuji Ikeda"
from ph_plotter.common_arguments_adder import CommonArgumentsAdder
def run(variables):
from ph_plotter.band_error_plotter import Ba... | Add the script to plot band structures with bandwidths | Add the script to plot band structures with bandwidths
| Python | mit | yuzie007/ph_plotter | Add the script to plot band structures with bandwidths | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
__author__ = "Yuji Ikeda"
from ph_plotter.common_arguments_adder import CommonArgumentsAdder
def run(variables):
from ph_plotter.band_error_plotter import Ba... | <commit_before><commit_msg>Add the script to plot band structures with bandwidths<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
__author__ = "Yuji Ikeda"
from ph_plotter.common_arguments_adder import CommonArgumentsAdder
def run(variables):
from ph_plotter.band_error_plotter import Ba... | Add the script to plot band structures with bandwidths#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
__author__ = "Yuji Ikeda"
from ph_plotter.common_arguments_adder import CommonArgumentsAdder
def run(variab... | <commit_before><commit_msg>Add the script to plot band structures with bandwidths<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
__author__ = "Yuji Ikeda"
from ph_plotter.common_arguments_adder imp... | |
e567bdb0ed315f6e00be7d541e5d034fe926eeb6 | scripts/migration/migrate_citation_addons_list_id.py | scripts/migration/migrate_citation_addons_list_id.py | import logging
import sys
from modularodm import Q
from framework.mongo import database
from framework.transactions.context import TokuTransaction
from website.app import init_app
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
PROVIDERS = ['mendeley', 'zotero']
def migrate_list_id_... | Add migration script for [citations]nodesettings <provider>_list_id --> list_id | Add migration script for [citations]nodesettings
<provider>_list_id --> list_id
| Python | apache-2.0 | mfraezz/osf.io,leb2dg/osf.io,asanfilippo7/osf.io,chennan47/osf.io,kch8qx/osf.io,brianjgeiger/osf.io,hmoco/osf.io,monikagrabowska/osf.io,caseyrollins/osf.io,SSJohns/osf.io,alexschiller/osf.io,mattclark/osf.io,doublebits/osf.io,HalcyonChimera/osf.io,acshi/osf.io,zamattiac/osf.io,felliott/osf.io,chrisseto/osf.io,CenterFor... | Add migration script for [citations]nodesettings
<provider>_list_id --> list_id | import logging
import sys
from modularodm import Q
from framework.mongo import database
from framework.transactions.context import TokuTransaction
from website.app import init_app
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
PROVIDERS = ['mendeley', 'zotero']
def migrate_list_id_... | <commit_before><commit_msg>Add migration script for [citations]nodesettings
<provider>_list_id --> list_id<commit_after> | import logging
import sys
from modularodm import Q
from framework.mongo import database
from framework.transactions.context import TokuTransaction
from website.app import init_app
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
PROVIDERS = ['mendeley', 'zotero']
def migrate_list_id_... | Add migration script for [citations]nodesettings
<provider>_list_id --> list_idimport logging
import sys
from modularodm import Q
from framework.mongo import database
from framework.transactions.context import TokuTransaction
from website.app import init_app
from scripts import utils as script_utils
logger = lo... | <commit_before><commit_msg>Add migration script for [citations]nodesettings
<provider>_list_id --> list_id<commit_after>import logging
import sys
from modularodm import Q
from framework.mongo import database
from framework.transactions.context import TokuTransaction
from website.app import init_app
from scripts ... | |
361ca05d2ba9662551b688b1d7867edbec8d9705 | unittests/test_roles.py | unittests/test_roles.py | import pytest
@pytest.fixture
def mockctl(testdir):
testdir.makepyfile(mockctl="""
import mock
pytest_plugins = 'sangoma.lab.roles'
def pytest_lab_addroles(rolemanager):
rolemanager.register('mock', mock.Mock())
""")
def test_manage_location(testdir):
testdir.makecon... | Add unit tests for basic role stuff | Add unit tests for basic role stuff
| Python | mpl-2.0 | sangoma/pytestlab | Add unit tests for basic role stuff | import pytest
@pytest.fixture
def mockctl(testdir):
testdir.makepyfile(mockctl="""
import mock
pytest_plugins = 'sangoma.lab.roles'
def pytest_lab_addroles(rolemanager):
rolemanager.register('mock', mock.Mock())
""")
def test_manage_location(testdir):
testdir.makecon... | <commit_before><commit_msg>Add unit tests for basic role stuff<commit_after> | import pytest
@pytest.fixture
def mockctl(testdir):
testdir.makepyfile(mockctl="""
import mock
pytest_plugins = 'sangoma.lab.roles'
def pytest_lab_addroles(rolemanager):
rolemanager.register('mock', mock.Mock())
""")
def test_manage_location(testdir):
testdir.makecon... | Add unit tests for basic role stuffimport pytest
@pytest.fixture
def mockctl(testdir):
testdir.makepyfile(mockctl="""
import mock
pytest_plugins = 'sangoma.lab.roles'
def pytest_lab_addroles(rolemanager):
rolemanager.register('mock', mock.Mock())
""")
def test_manage_loc... | <commit_before><commit_msg>Add unit tests for basic role stuff<commit_after>import pytest
@pytest.fixture
def mockctl(testdir):
testdir.makepyfile(mockctl="""
import mock
pytest_plugins = 'sangoma.lab.roles'
def pytest_lab_addroles(rolemanager):
rolemanager.register('mock', mo... | |
e6866b5e186600d88a61684c8f35c59c4fcc228f | utils/indirect_calls.py | utils/indirect_calls.py | #!/usr/bin/env python
"""A tool for looking for indirect jumps and calls in x86 binaries.
Helpful to verify whether or not retpoline mitigations are catching
all of the indirect branches in a binary and telling you which
functions the remaining ones are in (assembly, etc).
Depends on llvm-objdump being i... | Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly. | Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.
Useful when looking for indirect calls/jmps the need mitigation
via retpoline or other mitigations for Spectre v2.
Feedback, extension, additional patches welcome.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@329050 91177308-0... | Python | apache-2.0 | llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm... | Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.
Useful when looking for indirect calls/jmps the need mitigation
via retpoline or other mitigations for Spectre v2.
Feedback, extension, additional patches welcome.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@329050 91177308-0... | #!/usr/bin/env python
"""A tool for looking for indirect jumps and calls in x86 binaries.
Helpful to verify whether or not retpoline mitigations are catching
all of the indirect branches in a binary and telling you which
functions the remaining ones are in (assembly, etc).
Depends on llvm-objdump being i... | <commit_before><commit_msg>Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.
Useful when looking for indirect calls/jmps the need mitigation
via retpoline or other mitigations for Spectre v2.
Feedback, extension, additional patches welcome.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab13... | #!/usr/bin/env python
"""A tool for looking for indirect jumps and calls in x86 binaries.
Helpful to verify whether or not retpoline mitigations are catching
all of the indirect branches in a binary and telling you which
functions the remaining ones are in (assembly, etc).
Depends on llvm-objdump being i... | Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.
Useful when looking for indirect calls/jmps the need mitigation
via retpoline or other mitigations for Spectre v2.
Feedback, extension, additional patches welcome.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@329050 91177308-0... | <commit_before><commit_msg>Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.
Useful when looking for indirect calls/jmps the need mitigation
via retpoline or other mitigations for Spectre v2.
Feedback, extension, additional patches welcome.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab13... | |
34e875d1d876f05b3d5bb50f38ae61a7c48ea42b | server/migrations/0080_auto_20190202_1020.py | server/migrations/0080_auto_20190202_1020.py | # Generated by Django 2.1.4 on 2019-02-02 15:20
from django.db import migrations, models
import django.db.models.deletion
import ulid2
class Migration(migrations.Migration):
dependencies = [
('server', '0079_auto_20181211_1028'),
]
operations = [
migrations.CreateModel(
name... | Add in migration for ManagedItem, MangementSource. | Add in migration for ManagedItem, MangementSource.
| Python | apache-2.0 | sheagcraig/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,salopensource/sal | Add in migration for ManagedItem, MangementSource. | # Generated by Django 2.1.4 on 2019-02-02 15:20
from django.db import migrations, models
import django.db.models.deletion
import ulid2
class Migration(migrations.Migration):
dependencies = [
('server', '0079_auto_20181211_1028'),
]
operations = [
migrations.CreateModel(
name... | <commit_before><commit_msg>Add in migration for ManagedItem, MangementSource.<commit_after> | # Generated by Django 2.1.4 on 2019-02-02 15:20
from django.db import migrations, models
import django.db.models.deletion
import ulid2
class Migration(migrations.Migration):
dependencies = [
('server', '0079_auto_20181211_1028'),
]
operations = [
migrations.CreateModel(
name... | Add in migration for ManagedItem, MangementSource.# Generated by Django 2.1.4 on 2019-02-02 15:20
from django.db import migrations, models
import django.db.models.deletion
import ulid2
class Migration(migrations.Migration):
dependencies = [
('server', '0079_auto_20181211_1028'),
]
operations = ... | <commit_before><commit_msg>Add in migration for ManagedItem, MangementSource.<commit_after># Generated by Django 2.1.4 on 2019-02-02 15:20
from django.db import migrations, models
import django.db.models.deletion
import ulid2
class Migration(migrations.Migration):
dependencies = [
('server', '0079_auto_... | |
f96c393611e07b31fe31bb44f7dc1729172483f0 | test_inclination.py | test_inclination.py | import numpy as np
from astropy import units as u
from poliastro.bodies import Earth
from poliastro.twobody import State
from poliastro.twobody.propagation import cowell
from poliastro.util import norm
def test_inclination():
a_0 = 7000.0
i_0 = (28.5 * u.deg).to(u.rad).value
f = 3.5e-7
k = Earth.k.... | Add test to study the change in inclination only | Add test to study the change in inclination only
| Python | mit | Juanlu001/pfc-uc3m | Add test to study the change in inclination only | import numpy as np
from astropy import units as u
from poliastro.bodies import Earth
from poliastro.twobody import State
from poliastro.twobody.propagation import cowell
from poliastro.util import norm
def test_inclination():
a_0 = 7000.0
i_0 = (28.5 * u.deg).to(u.rad).value
f = 3.5e-7
k = Earth.k.... | <commit_before><commit_msg>Add test to study the change in inclination only<commit_after> | import numpy as np
from astropy import units as u
from poliastro.bodies import Earth
from poliastro.twobody import State
from poliastro.twobody.propagation import cowell
from poliastro.util import norm
def test_inclination():
a_0 = 7000.0
i_0 = (28.5 * u.deg).to(u.rad).value
f = 3.5e-7
k = Earth.k.... | Add test to study the change in inclination onlyimport numpy as np
from astropy import units as u
from poliastro.bodies import Earth
from poliastro.twobody import State
from poliastro.twobody.propagation import cowell
from poliastro.util import norm
def test_inclination():
a_0 = 7000.0
i_0 = (28.5 * u.deg).... | <commit_before><commit_msg>Add test to study the change in inclination only<commit_after>import numpy as np
from astropy import units as u
from poliastro.bodies import Earth
from poliastro.twobody import State
from poliastro.twobody.propagation import cowell
from poliastro.util import norm
def test_inclination():
... | |
3287e9d1814cdc9fec61d5ad5888168f08d44e70 | pyp2c.py | pyp2c.py | #!/usr/bin/env python
import sys
import argparse
def _description():
return 'A C preprocessor that interprets python'
""" The usage
We do override the usage since the one given by `argparse` put the positional
arguments at the end of it.
"""
def _usage():
return 'usage: pyp2c.py [-h] FILES ... --the... | Add very basic handling of options | Add very basic handling of options
| Python | mit | ccharly/pyaspp,ccharly/pyaspp,lisqlql/pyaspp,lisqlql/pyaspp | Add very basic handling of options | #!/usr/bin/env python
import sys
import argparse
def _description():
return 'A C preprocessor that interprets python'
""" The usage
We do override the usage since the one given by `argparse` put the positional
arguments at the end of it.
"""
def _usage():
return 'usage: pyp2c.py [-h] FILES ... --the... | <commit_before><commit_msg>Add very basic handling of options<commit_after> | #!/usr/bin/env python
import sys
import argparse
def _description():
return 'A C preprocessor that interprets python'
""" The usage
We do override the usage since the one given by `argparse` put the positional
arguments at the end of it.
"""
def _usage():
return 'usage: pyp2c.py [-h] FILES ... --the... | Add very basic handling of options#!/usr/bin/env python
import sys
import argparse
def _description():
return 'A C preprocessor that interprets python'
""" The usage
We do override the usage since the one given by `argparse` put the positional
arguments at the end of it.
"""
def _usage():
return 'us... | <commit_before><commit_msg>Add very basic handling of options<commit_after>#!/usr/bin/env python
import sys
import argparse
def _description():
return 'A C preprocessor that interprets python'
""" The usage
We do override the usage since the one given by `argparse` put the positional
arguments at the en... | |
a8e3209663a5268b029214964e2db7faf2d8cf36 | scripts/calculate_cell_areas.py | scripts/calculate_cell_areas.py | """Script to calculate cell areas from a curated image of cell outlines.
Outputs csv file with cell areas as well as an image where the colour
of each cell represents its area.
"""
import os
import logging
import argparse
from jicbioimage.core.image import Image
from jicbioimage.core.io import AutoName, AutoWrite
f... | Add initial script for calculating cell areas | Add initial script for calculating cell areas
| Python | mit | JIC-Image-Analysis/semi-automated-leaf-segmentation,JIC-Image-Analysis/semi-automated-leaf-segmentation | Add initial script for calculating cell areas | """Script to calculate cell areas from a curated image of cell outlines.
Outputs csv file with cell areas as well as an image where the colour
of each cell represents its area.
"""
import os
import logging
import argparse
from jicbioimage.core.image import Image
from jicbioimage.core.io import AutoName, AutoWrite
f... | <commit_before><commit_msg>Add initial script for calculating cell areas<commit_after> | """Script to calculate cell areas from a curated image of cell outlines.
Outputs csv file with cell areas as well as an image where the colour
of each cell represents its area.
"""
import os
import logging
import argparse
from jicbioimage.core.image import Image
from jicbioimage.core.io import AutoName, AutoWrite
f... | Add initial script for calculating cell areas"""Script to calculate cell areas from a curated image of cell outlines.
Outputs csv file with cell areas as well as an image where the colour
of each cell represents its area.
"""
import os
import logging
import argparse
from jicbioimage.core.image import Image
from jicb... | <commit_before><commit_msg>Add initial script for calculating cell areas<commit_after>"""Script to calculate cell areas from a curated image of cell outlines.
Outputs csv file with cell areas as well as an image where the colour
of each cell represents its area.
"""
import os
import logging
import argparse
from jicb... | |
17da1f5053a66e35ed1955a1cf716fac667f5859 | py/postResultsTest.py | py/postResultsTest.py | import urllib
import urllib2
url = 'http://app.dev.inowas.com/api/results.json'
params = urllib.urlencode({
'id': '1',
'propertyType': 'gwHead',
'width': 4,
'height': 4,
'upperLeftX': 0.005,
'upperLeftY': 0.005,
'scaleX': 1,
'scaleY': 1,
'skewX': 0,
'skewY': 0,
'srid': 4326,... | Add python folder with a rest-test-file | Add python folder with a rest-test-file
| Python | mit | inowas/inowas,inowas/inowas_api,inowas/inowas,inowas/inowas_api,inowas/inowas_api,inowas/inowas,inowas/inowas,inowas/inowas_api | Add python folder with a rest-test-file | import urllib
import urllib2
url = 'http://app.dev.inowas.com/api/results.json'
params = urllib.urlencode({
'id': '1',
'propertyType': 'gwHead',
'width': 4,
'height': 4,
'upperLeftX': 0.005,
'upperLeftY': 0.005,
'scaleX': 1,
'scaleY': 1,
'skewX': 0,
'skewY': 0,
'srid': 4326,... | <commit_before><commit_msg>Add python folder with a rest-test-file<commit_after> | import urllib
import urllib2
url = 'http://app.dev.inowas.com/api/results.json'
params = urllib.urlencode({
'id': '1',
'propertyType': 'gwHead',
'width': 4,
'height': 4,
'upperLeftX': 0.005,
'upperLeftY': 0.005,
'scaleX': 1,
'scaleY': 1,
'skewX': 0,
'skewY': 0,
'srid': 4326,... | Add python folder with a rest-test-fileimport urllib
import urllib2
url = 'http://app.dev.inowas.com/api/results.json'
params = urllib.urlencode({
'id': '1',
'propertyType': 'gwHead',
'width': 4,
'height': 4,
'upperLeftX': 0.005,
'upperLeftY': 0.005,
'scaleX': 1,
'scaleY': 1,
'skewX... | <commit_before><commit_msg>Add python folder with a rest-test-file<commit_after>import urllib
import urllib2
url = 'http://app.dev.inowas.com/api/results.json'
params = urllib.urlencode({
'id': '1',
'propertyType': 'gwHead',
'width': 4,
'height': 4,
'upperLeftX': 0.005,
'upperLeftY': 0.005,
... | |
b16ed06e1b0c5fb1b189e1992e13726bda99fd68 | examples/plot_pmt_time_slewing.py | examples/plot_pmt_time_slewing.py | # -*- coding: utf-8 -*-
"""
==================
PMT Time Slewing
==================
Show different variants of PMT time slewing calculations.
Variant 3 is currently (as of 2020-10-16) what's also used in Jpp.
"""
# Author: Tamas Gal <[email protected]>
# License: BSD-3
import km3pipe as kp
import numpy as np
import m... | Add PMT time slewing example | Add PMT time slewing example
| Python | mit | tamasgal/km3pipe,tamasgal/km3pipe | Add PMT time slewing example | # -*- coding: utf-8 -*-
"""
==================
PMT Time Slewing
==================
Show different variants of PMT time slewing calculations.
Variant 3 is currently (as of 2020-10-16) what's also used in Jpp.
"""
# Author: Tamas Gal <[email protected]>
# License: BSD-3
import km3pipe as kp
import numpy as np
import m... | <commit_before><commit_msg>Add PMT time slewing example<commit_after> | # -*- coding: utf-8 -*-
"""
==================
PMT Time Slewing
==================
Show different variants of PMT time slewing calculations.
Variant 3 is currently (as of 2020-10-16) what's also used in Jpp.
"""
# Author: Tamas Gal <[email protected]>
# License: BSD-3
import km3pipe as kp
import numpy as np
import m... | Add PMT time slewing example# -*- coding: utf-8 -*-
"""
==================
PMT Time Slewing
==================
Show different variants of PMT time slewing calculations.
Variant 3 is currently (as of 2020-10-16) what's also used in Jpp.
"""
# Author: Tamas Gal <[email protected]>
# License: BSD-3
import km3pipe as kp... | <commit_before><commit_msg>Add PMT time slewing example<commit_after># -*- coding: utf-8 -*-
"""
==================
PMT Time Slewing
==================
Show different variants of PMT time slewing calculations.
Variant 3 is currently (as of 2020-10-16) what's also used in Jpp.
"""
# Author: Tamas Gal <[email protected]... | |
81c6d9664d08c72347ff8e1c7550ef53987dd8a0 | olympiad/sum.py | olympiad/sum.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Add solution for test problem | Add solution for test problem
| Python | apache-2.0 | fabianm/olympiad,fabianm/olympiad,fabianm/olympiad | Add solution for test problem | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | <commit_before><commit_msg>Add solution for test problem<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Add solution for test problem#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | <commit_before><commit_msg>Add solution for test problem<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License ... | |
fb2f00f0780ce447b985aedf5d13a36c4fcff4b1 | dipy/core/tests/test_propagation.py | dipy/core/tests/test_propagation.py | import numpy as np
import dipy as dp
import nibabel as ni
from nose.tools import assert_true, assert_false, \
assert_equal, assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
def test_fact():
pass
| TEST - new test file added for propagation | TEST - new test file added for propagation
| Python | bsd-3-clause | rfdougherty/dipy,samuelstjean/dipy,jyeatman/dipy,beni55/dipy,StongeEtienne/dipy,oesteban/dipy,beni55/dipy,demianw/dipy,maurozucchelli/dipy,maurozucchelli/dipy,matthieudumont/dipy,FrancoisRheaultUS/dipy,Messaoud-Boudjada/dipy,maurozucchelli/dipy,JohnGriffiths/dipy,oesteban/dipy,StongeEtienne/dipy,samuelstjean/dipy,mdesc... | TEST - new test file added for propagation | import numpy as np
import dipy as dp
import nibabel as ni
from nose.tools import assert_true, assert_false, \
assert_equal, assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
def test_fact():
pass
| <commit_before><commit_msg>TEST - new test file added for propagation<commit_after> | import numpy as np
import dipy as dp
import nibabel as ni
from nose.tools import assert_true, assert_false, \
assert_equal, assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
def test_fact():
pass
| TEST - new test file added for propagationimport numpy as np
import dipy as dp
import nibabel as ni
from nose.tools import assert_true, assert_false, \
assert_equal, assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
def test_fact():
pass
| <commit_before><commit_msg>TEST - new test file added for propagation<commit_after>import numpy as np
import dipy as dp
import nibabel as ni
from nose.tools import assert_true, assert_false, \
assert_equal, assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
def test_fact():
... | |
0e6fc9de3aaeec9d82bc6087b2ad1d8ef17d3c67 | contrib/inventory/lxc_inventory.py | contrib/inventory/lxc_inventory.py | #!/usr/bin/env python
#
# (c) 2015-16 Florian Haas, hastexo Professional Services GmbH
# <[email protected]>
# Based in part on:
# libvirt_lxc.py, (c) 2013, Michael Scherer <[email protected]>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the... | Add inventory script for LXC containers | Add inventory script for LXC containers
Enables an LXC server's configuration as an inventory source for LXC
containers.
In LXC, containers can be defined with an "lxc.group" configuration
option that is normally used with lxc-autostart -g. Here, we are using
the same option to build Ansible inventory groups.
In add... | Python | mit | thaim/ansible,thaim/ansible | Add inventory script for LXC containers
Enables an LXC server's configuration as an inventory source for LXC
containers.
In LXC, containers can be defined with an "lxc.group" configuration
option that is normally used with lxc-autostart -g. Here, we are using
the same option to build Ansible inventory groups.
In add... | #!/usr/bin/env python
#
# (c) 2015-16 Florian Haas, hastexo Professional Services GmbH
# <[email protected]>
# Based in part on:
# libvirt_lxc.py, (c) 2013, Michael Scherer <[email protected]>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the... | <commit_before><commit_msg>Add inventory script for LXC containers
Enables an LXC server's configuration as an inventory source for LXC
containers.
In LXC, containers can be defined with an "lxc.group" configuration
option that is normally used with lxc-autostart -g. Here, we are using
the same option to build Ansibl... | #!/usr/bin/env python
#
# (c) 2015-16 Florian Haas, hastexo Professional Services GmbH
# <[email protected]>
# Based in part on:
# libvirt_lxc.py, (c) 2013, Michael Scherer <[email protected]>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the... | Add inventory script for LXC containers
Enables an LXC server's configuration as an inventory source for LXC
containers.
In LXC, containers can be defined with an "lxc.group" configuration
option that is normally used with lxc-autostart -g. Here, we are using
the same option to build Ansible inventory groups.
In add... | <commit_before><commit_msg>Add inventory script for LXC containers
Enables an LXC server's configuration as an inventory source for LXC
containers.
In LXC, containers can be defined with an "lxc.group" configuration
option that is normally used with lxc-autostart -g. Here, we are using
the same option to build Ansibl... | |
b0648969f03dfa1cd55cf1f201883ec82afd97be | test/test_command_parser.py | test/test_command_parser.py | from string import ascii_letters
import pytest
from nex.codes import CatCode
from nex.instructions import Instructions
from nex.instructioner import (Instructioner,
make_unexpanded_control_sequence_instruction,
char_cat_instr_tok)
from nex.utils import asc... | Add test for command parsing, without executing | Add test for command parsing, without executing
| Python | mit | eddiejessup/nex | Add test for command parsing, without executing | from string import ascii_letters
import pytest
from nex.codes import CatCode
from nex.instructions import Instructions
from nex.instructioner import (Instructioner,
make_unexpanded_control_sequence_instruction,
char_cat_instr_tok)
from nex.utils import asc... | <commit_before><commit_msg>Add test for command parsing, without executing<commit_after> | from string import ascii_letters
import pytest
from nex.codes import CatCode
from nex.instructions import Instructions
from nex.instructioner import (Instructioner,
make_unexpanded_control_sequence_instruction,
char_cat_instr_tok)
from nex.utils import asc... | Add test for command parsing, without executingfrom string import ascii_letters
import pytest
from nex.codes import CatCode
from nex.instructions import Instructions
from nex.instructioner import (Instructioner,
make_unexpanded_control_sequence_instruction,
... | <commit_before><commit_msg>Add test for command parsing, without executing<commit_after>from string import ascii_letters
import pytest
from nex.codes import CatCode
from nex.instructions import Instructions
from nex.instructioner import (Instructioner,
make_unexpanded_control_sequence_i... | |
5c66a9d8c7b53338d37ef9e959e55e14511f7c84 | packages/Python/lldbsuite/test/commands/gui/invalid-args/TestInvalidArgsGui.py | packages/Python/lldbsuite/test/commands/gui/invalid-args/TestInvalidArgsGui.py | import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
class GuiTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
TestBase.setUp(self)
@no_debug_info_test
def test_reproducer_generate_invalid_invocation(self):
self.expect... | Add test for invalid gui command | [lldb][NFC] Add test for invalid gui command
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@370647 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb | [lldb][NFC] Add test for invalid gui command
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@370647 91177308-0d34-0410-b5e6-96231b3b80d8 | import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
class GuiTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
TestBase.setUp(self)
@no_debug_info_test
def test_reproducer_generate_invalid_invocation(self):
self.expect... | <commit_before><commit_msg>[lldb][NFC] Add test for invalid gui command
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@370647 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after> | import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
class GuiTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
TestBase.setUp(self)
@no_debug_info_test
def test_reproducer_generate_invalid_invocation(self):
self.expect... | [lldb][NFC] Add test for invalid gui command
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@370647 91177308-0d34-0410-b5e6-96231b3b80d8import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
class GuiTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def set... | <commit_before><commit_msg>[lldb][NFC] Add test for invalid gui command
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@370647 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
class GuiTestCase(TestBase):
mydir = Test... | |
5056586586becb94bba265bdd90e46f2e2366534 | factory/checkFactory.py | factory/checkFactory.py | #!/bin/env python
#
# Description:
# Check if a glideinFactory is running
#
# Arguments:
# $1 = glidein submit_dir (i.e. factory dir)
#
# Author:
# Igor Sfiligoi Jul 9th 2008
#
import sys
import glideFactoryPidLib
try:
startup_dir=sys.argv[1]
factory_pid=glideFactoryPidLib.get_gfactory_pid(startup_dir)... | Check if a glideinFactory is running | Check if a glideinFactory is running
| Python | bsd-3-clause | holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS | Check if a glideinFactory is running | #!/bin/env python
#
# Description:
# Check if a glideinFactory is running
#
# Arguments:
# $1 = glidein submit_dir (i.e. factory dir)
#
# Author:
# Igor Sfiligoi Jul 9th 2008
#
import sys
import glideFactoryPidLib
try:
startup_dir=sys.argv[1]
factory_pid=glideFactoryPidLib.get_gfactory_pid(startup_dir)... | <commit_before><commit_msg>Check if a glideinFactory is running<commit_after> | #!/bin/env python
#
# Description:
# Check if a glideinFactory is running
#
# Arguments:
# $1 = glidein submit_dir (i.e. factory dir)
#
# Author:
# Igor Sfiligoi Jul 9th 2008
#
import sys
import glideFactoryPidLib
try:
startup_dir=sys.argv[1]
factory_pid=glideFactoryPidLib.get_gfactory_pid(startup_dir)... | Check if a glideinFactory is running#!/bin/env python
#
# Description:
# Check if a glideinFactory is running
#
# Arguments:
# $1 = glidein submit_dir (i.e. factory dir)
#
# Author:
# Igor Sfiligoi Jul 9th 2008
#
import sys
import glideFactoryPidLib
try:
startup_dir=sys.argv[1]
factory_pid=glideFactory... | <commit_before><commit_msg>Check if a glideinFactory is running<commit_after>#!/bin/env python
#
# Description:
# Check if a glideinFactory is running
#
# Arguments:
# $1 = glidein submit_dir (i.e. factory dir)
#
# Author:
# Igor Sfiligoi Jul 9th 2008
#
import sys
import glideFactoryPidLib
try:
startup_dir... | |
e7cf50d3f1b751e695f6d7bd1ca1bbe4a4e067cc | scripts/odom_trace.py | scripts/odom_trace.py | #!/usr/bin/env python
'''
Copyright 2016 William Baskin
/*****************************************
LICENSE SUMMARY
This package is licensed under the
MIT License. Please see the LICENSE.md
file in the root folder for the
complete license.
*****************************************/
Odom Trace
Reco... | Create a ros node for storing, replaying a robot's position | Create a ros node for storing, replaying a robot's position
| Python | mit | buckbaskin/drive_stack,buckbaskin/drive_stack,buckbaskin/drive_stack | Create a ros node for storing, replaying a robot's position | #!/usr/bin/env python
'''
Copyright 2016 William Baskin
/*****************************************
LICENSE SUMMARY
This package is licensed under the
MIT License. Please see the LICENSE.md
file in the root folder for the
complete license.
*****************************************/
Odom Trace
Reco... | <commit_before><commit_msg>Create a ros node for storing, replaying a robot's position<commit_after> | #!/usr/bin/env python
'''
Copyright 2016 William Baskin
/*****************************************
LICENSE SUMMARY
This package is licensed under the
MIT License. Please see the LICENSE.md
file in the root folder for the
complete license.
*****************************************/
Odom Trace
Reco... | Create a ros node for storing, replaying a robot's position#!/usr/bin/env python
'''
Copyright 2016 William Baskin
/*****************************************
LICENSE SUMMARY
This package is licensed under the
MIT License. Please see the LICENSE.md
file in the root folder for the
complete license.
***... | <commit_before><commit_msg>Create a ros node for storing, replaying a robot's position<commit_after>#!/usr/bin/env python
'''
Copyright 2016 William Baskin
/*****************************************
LICENSE SUMMARY
This package is licensed under the
MIT License. Please see the LICENSE.md
file in the root f... | |
7bdc7e6002d837f7362f58f13e53e504e9de77e0 | examples/python/download_package.py | examples/python/download_package.py | #!/usr/bin/env python
"""
librepo - download a package
"""
import os
import sys
import shutil
from pprint import pprint
import librepo
DESTDIR = "downloaded_metadata"
PROGRESSBAR_LEN = 40
finished = False
def callback(data, total_to_download, downloaded):
"""Progress callback"""
global finished
if tot... | Add example of downloading a package | example: Add example of downloading a package
| Python | lgpl-2.1 | cgwalters/librepo,Conan-Kudo/librepo,Tojaj/librepo,cgwalters/librepo,Conan-Kudo/librepo,rpm-software-management/librepo,rpm-software-management/librepo,rpm-software-management/librepo,bgamari/librepo,Conan-Kudo/librepo,rholy/librepo,Tojaj/librepo,bgamari/librepo,rholy/librepo,rholy/librepo,bgamari/librepo,Tojaj/librepo... | example: Add example of downloading a package | #!/usr/bin/env python
"""
librepo - download a package
"""
import os
import sys
import shutil
from pprint import pprint
import librepo
DESTDIR = "downloaded_metadata"
PROGRESSBAR_LEN = 40
finished = False
def callback(data, total_to_download, downloaded):
"""Progress callback"""
global finished
if tot... | <commit_before><commit_msg>example: Add example of downloading a package<commit_after> | #!/usr/bin/env python
"""
librepo - download a package
"""
import os
import sys
import shutil
from pprint import pprint
import librepo
DESTDIR = "downloaded_metadata"
PROGRESSBAR_LEN = 40
finished = False
def callback(data, total_to_download, downloaded):
"""Progress callback"""
global finished
if tot... | example: Add example of downloading a package#!/usr/bin/env python
"""
librepo - download a package
"""
import os
import sys
import shutil
from pprint import pprint
import librepo
DESTDIR = "downloaded_metadata"
PROGRESSBAR_LEN = 40
finished = False
def callback(data, total_to_download, downloaded):
"""Progres... | <commit_before><commit_msg>example: Add example of downloading a package<commit_after>#!/usr/bin/env python
"""
librepo - download a package
"""
import os
import sys
import shutil
from pprint import pprint
import librepo
DESTDIR = "downloaded_metadata"
PROGRESSBAR_LEN = 40
finished = False
def callback(data, total... | |
1d50c5f10faeb17f8c7a1b7290c7d80f52220ad9 | src/ggrc/migrations/versions/20161020125620_1db61b597d2d_remove_bad_ca_names.py | src/ggrc/migrations/versions/20161020125620_1db61b597d2d_remove_bad_ca_names.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Remove bad CA names
Create Date: 2016-10-20 12:56:20.500665
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic import op
imp... | Add migration for fixing bad CA names | Add migration for fixing bad CA names
This migration removes all assessment template custom attribute
definition names that match any of the assessment global custom
attributes.
Resolves: GGRC-26, GGRC-111
| Python | apache-2.0 | AleksNeStu/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,josthkko/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,... | Add migration for fixing bad CA names
This migration removes all assessment template custom attribute
definition names that match any of the assessment global custom
attributes.
Resolves: GGRC-26, GGRC-111 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Remove bad CA names
Create Date: 2016-10-20 12:56:20.500665
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic import op
imp... | <commit_before><commit_msg>Add migration for fixing bad CA names
This migration removes all assessment template custom attribute
definition names that match any of the assessment global custom
attributes.
Resolves: GGRC-26, GGRC-111<commit_after> | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Remove bad CA names
Create Date: 2016-10-20 12:56:20.500665
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic import op
imp... | Add migration for fixing bad CA names
This migration removes all assessment template custom attribute
definition names that match any of the assessment global custom
attributes.
Resolves: GGRC-26, GGRC-111# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
... | <commit_before><commit_msg>Add migration for fixing bad CA names
This migration removes all assessment template custom attribute
definition names that match any of the assessment global custom
attributes.
Resolves: GGRC-26, GGRC-111<commit_after># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/... | |
c618a65f95b3c0486dd62bba4b1255ad95bbe9d2 | quran_tafseer/tests/test_views.py | quran_tafseer/tests/test_views.py | from django.test import TestCase
from django.urls import reverse
from model_mommy import mommy
class TestTafsserViews(TestCase):
def setUp(self):
self.sura = mommy.make('quran_text.sura', name='Al-Fateha', index=1)
self.ayah = mommy.make('quran_text.ayah', number=1, sura=self.sura,
... | Add tests for Tafseer Views | Add tests for Tafseer Views
| Python | mit | EmadMokhtar/tafseer_api | Add tests for Tafseer Views | from django.test import TestCase
from django.urls import reverse
from model_mommy import mommy
class TestTafsserViews(TestCase):
def setUp(self):
self.sura = mommy.make('quran_text.sura', name='Al-Fateha', index=1)
self.ayah = mommy.make('quran_text.ayah', number=1, sura=self.sura,
... | <commit_before><commit_msg>Add tests for Tafseer Views<commit_after> | from django.test import TestCase
from django.urls import reverse
from model_mommy import mommy
class TestTafsserViews(TestCase):
def setUp(self):
self.sura = mommy.make('quran_text.sura', name='Al-Fateha', index=1)
self.ayah = mommy.make('quran_text.ayah', number=1, sura=self.sura,
... | Add tests for Tafseer Viewsfrom django.test import TestCase
from django.urls import reverse
from model_mommy import mommy
class TestTafsserViews(TestCase):
def setUp(self):
self.sura = mommy.make('quran_text.sura', name='Al-Fateha', index=1)
self.ayah = mommy.make('quran_text.ayah', number=1, sura... | <commit_before><commit_msg>Add tests for Tafseer Views<commit_after>from django.test import TestCase
from django.urls import reverse
from model_mommy import mommy
class TestTafsserViews(TestCase):
def setUp(self):
self.sura = mommy.make('quran_text.sura', name='Al-Fateha', index=1)
self.ayah = mom... | |
03b0e88c909a5e8f0eeb8116222f166891e45b28 | scale_perf/vertica_queries.py | scale_perf/vertica_queries.py | import sys
import argparse
from subprocess import Popen, PIPE
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--vertica_password",
help="Vertica password for disk.sh and alarm_transitions.sh", default='password',
required=False)
ret... | Add script to query vertica stats | Add script to query vertica stats
| Python | apache-2.0 | hpcloud-mon/monasca-perf,hpcloud-mon/monasca-perf | Add script to query vertica stats | import sys
import argparse
from subprocess import Popen, PIPE
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--vertica_password",
help="Vertica password for disk.sh and alarm_transitions.sh", default='password',
required=False)
ret... | <commit_before><commit_msg>Add script to query vertica stats<commit_after> | import sys
import argparse
from subprocess import Popen, PIPE
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--vertica_password",
help="Vertica password for disk.sh and alarm_transitions.sh", default='password',
required=False)
ret... | Add script to query vertica statsimport sys
import argparse
from subprocess import Popen, PIPE
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--vertica_password",
help="Vertica password for disk.sh and alarm_transitions.sh", default='password',
... | <commit_before><commit_msg>Add script to query vertica stats<commit_after>import sys
import argparse
from subprocess import Popen, PIPE
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--vertica_password",
help="Vertica password for disk.sh and alarm_transition... | |
38e570e50976ee863fddd00129ce2d1782b06ca5 | examples/manual_stats_reporting.py | examples/manual_stats_reporting.py | """
Example of a manual_report() function that can be used either as a context manager
(with statement), or a decorator, to manually add entries to Locust's statistics.
Usage as a context manager:
with manual_report("stats entry name"):
# Run time of this block will be reported under a stats entry called... | Add example with a manual_report decorator/context manager that can be used to easily measure the time of functions/code blocks and manually report them as stats entries to the Locust statistics | Add example with a manual_report decorator/context manager that can be used to easily measure the time of functions/code blocks and manually report them as stats entries to the Locust statistics | Python | mit | mbeacom/locust,mbeacom/locust,mbeacom/locust,locustio/locust,locustio/locust,mbeacom/locust,locustio/locust,locustio/locust | Add example with a manual_report decorator/context manager that can be used to easily measure the time of functions/code blocks and manually report them as stats entries to the Locust statistics | """
Example of a manual_report() function that can be used either as a context manager
(with statement), or a decorator, to manually add entries to Locust's statistics.
Usage as a context manager:
with manual_report("stats entry name"):
# Run time of this block will be reported under a stats entry called... | <commit_before><commit_msg>Add example with a manual_report decorator/context manager that can be used to easily measure the time of functions/code blocks and manually report them as stats entries to the Locust statistics<commit_after> | """
Example of a manual_report() function that can be used either as a context manager
(with statement), or a decorator, to manually add entries to Locust's statistics.
Usage as a context manager:
with manual_report("stats entry name"):
# Run time of this block will be reported under a stats entry called... | Add example with a manual_report decorator/context manager that can be used to easily measure the time of functions/code blocks and manually report them as stats entries to the Locust statistics"""
Example of a manual_report() function that can be used either as a context manager
(with statement), or a decorator, to m... | <commit_before><commit_msg>Add example with a manual_report decorator/context manager that can be used to easily measure the time of functions/code blocks and manually report them as stats entries to the Locust statistics<commit_after>"""
Example of a manual_report() function that can be used either as a context manage... | |
811eab1329a02a36244b7a8f79c23bf5bfce4dc6 | spotpy/unittests/test_objectivefunctions.py | spotpy/unittests/test_objectivefunctions.py | import unittest
from spotpy import objectivefunctions as of
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestObjectiveFunctions(unittest.TestCase):
# How many digits to match in case of floating point answers
tolerance = 10
def setUp(self):
np.random.seed(42)
... | Add tests for bias and length mismatch | Add tests for bias and length mismatch
| Python | mit | thouska/spotpy,thouska/spotpy,bees4ever/spotpy,thouska/spotpy,bees4ever/spotpy,bees4ever/spotpy | Add tests for bias and length mismatch | import unittest
from spotpy import objectivefunctions as of
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestObjectiveFunctions(unittest.TestCase):
# How many digits to match in case of floating point answers
tolerance = 10
def setUp(self):
np.random.seed(42)
... | <commit_before><commit_msg>Add tests for bias and length mismatch<commit_after> | import unittest
from spotpy import objectivefunctions as of
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestObjectiveFunctions(unittest.TestCase):
# How many digits to match in case of floating point answers
tolerance = 10
def setUp(self):
np.random.seed(42)
... | Add tests for bias and length mismatchimport unittest
from spotpy import objectivefunctions as of
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestObjectiveFunctions(unittest.TestCase):
# How many digits to match in case of floating point answers
tolerance = 10
def setUp(sel... | <commit_before><commit_msg>Add tests for bias and length mismatch<commit_after>import unittest
from spotpy import objectivefunctions as of
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestObjectiveFunctions(unittest.TestCase):
# How many digits to match in case of floating point answ... | |
ee35ffbaef1990dfbedbb50d3d94eb9e4ae4a298 | migrations/versions/1f8e3cf51fbc_.py | migrations/versions/1f8e3cf51fbc_.py | """Add a creator_id to streams
Revision ID: 1f8e3cf51fbc
Revises: 70c7d046881
Create Date: 2013-12-08 16:55:14.142000
"""
# revision identifiers, used by Alembic.
revision = '1f8e3cf51fbc'
down_revision = '70c7d046881'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... | Add creator_id migration for streams | Add creator_id migration for streams
| Python | mit | streamr/marvin,streamr/marvin,streamr/marvin | Add creator_id migration for streams | """Add a creator_id to streams
Revision ID: 1f8e3cf51fbc
Revises: 70c7d046881
Create Date: 2013-12-08 16:55:14.142000
"""
# revision identifiers, used by Alembic.
revision = '1f8e3cf51fbc'
down_revision = '70c7d046881'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... | <commit_before><commit_msg>Add creator_id migration for streams<commit_after> | """Add a creator_id to streams
Revision ID: 1f8e3cf51fbc
Revises: 70c7d046881
Create Date: 2013-12-08 16:55:14.142000
"""
# revision identifiers, used by Alembic.
revision = '1f8e3cf51fbc'
down_revision = '70c7d046881'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... | Add creator_id migration for streams"""Add a creator_id to streams
Revision ID: 1f8e3cf51fbc
Revises: 70c7d046881
Create Date: 2013-12-08 16:55:14.142000
"""
# revision identifiers, used by Alembic.
revision = '1f8e3cf51fbc'
down_revision = '70c7d046881'
from alembic import op
import sqlalchemy as sa
def upgrade(... | <commit_before><commit_msg>Add creator_id migration for streams<commit_after>"""Add a creator_id to streams
Revision ID: 1f8e3cf51fbc
Revises: 70c7d046881
Create Date: 2013-12-08 16:55:14.142000
"""
# revision identifiers, used by Alembic.
revision = '1f8e3cf51fbc'
down_revision = '70c7d046881'
from alembic import ... | |
019a520ae3672e2bac791d1606e5d905700e21c0 | comics/crawlers/yafgc.py | comics/crawlers/yafgc.py | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Yet Another Fantasy Gamer Comic'
language = 'en'
url = 'http://yafgc.shipsinker.com/'
start_date = '2006-05-29'
history_capable_date = '2006-05-29'
schedule = '... | Add crawler for 'Yet Another Fantasy Gamer Comic' | Add crawler for 'Yet Another Fantasy Gamer Comic'
| Python | agpl-3.0 | jodal/comics,klette/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,klette/comics,datagutten/comics,klette/comics,jodal/comics | Add crawler for 'Yet Another Fantasy Gamer Comic' | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Yet Another Fantasy Gamer Comic'
language = 'en'
url = 'http://yafgc.shipsinker.com/'
start_date = '2006-05-29'
history_capable_date = '2006-05-29'
schedule = '... | <commit_before><commit_msg>Add crawler for 'Yet Another Fantasy Gamer Comic'<commit_after> | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Yet Another Fantasy Gamer Comic'
language = 'en'
url = 'http://yafgc.shipsinker.com/'
start_date = '2006-05-29'
history_capable_date = '2006-05-29'
schedule = '... | Add crawler for 'Yet Another Fantasy Gamer Comic'from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Yet Another Fantasy Gamer Comic'
language = 'en'
url = 'http://yafgc.shipsinker.com/'
start_date = '2006-05-29'
his... | <commit_before><commit_msg>Add crawler for 'Yet Another Fantasy Gamer Comic'<commit_after>from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Yet Another Fantasy Gamer Comic'
language = 'en'
url = 'http://yafgc.shipsinker.co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.