commit
stringlengths
40
40
old_file
stringlengths
5
117
new_file
stringlengths
5
117
old_contents
stringlengths
0
1.93k
new_contents
stringlengths
19
3.3k
subject
stringlengths
17
320
message
stringlengths
18
3.28k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
42.4k
completion
stringlengths
19
3.3k
prompt
stringlengths
21
3.65k
6c54fc230e8c889a2351f20b524382a5c6e29d1c
examples/apps.py
examples/apps.py
# coding: utf-8 import os import sys from pysuru import TsuruClient TSURU_TARGET = os.environ.get('TSURU_TARGET', None) TSURU_TOKEN = os.environ.get('TSURU_TOKEN', None) if not TSURU_TARGET or not TSURU_TOKEN: print('You must set TSURU_TARGET and TSURU_TOKEN.') sys.exit(1) api = TsuruClient(TSURU_TARGET, T...
# coding: utf-8 import os import sys from pysuru import TsuruClient TSURU_TARGET = os.environ.get('TSURU_TARGET', None) TSURU_TOKEN = os.environ.get('TSURU_TOKEN', None) if not TSURU_TARGET or not TSURU_TOKEN: print('You must set TSURU_TARGET and TSURU_TOKEN env variables.') sys.exit(1) # Creating TsuruCli...
Update examples to match docs
Update examples to match docs Use the interface defined in the docs in the examples scripts.
Python
mit
rcmachado/pysuru
# coding: utf-8 import os import sys from pysuru import TsuruClient TSURU_TARGET = os.environ.get('TSURU_TARGET', None) TSURU_TOKEN = os.environ.get('TSURU_TOKEN', None) if not TSURU_TARGET or not TSURU_TOKEN: print('You must set TSURU_TARGET and TSURU_TOKEN env variables.') sys.exit(1) # Creating TsuruCli...
Update examples to match docs Use the interface defined in the docs in the examples scripts. # coding: utf-8 import os import sys from pysuru import TsuruClient TSURU_TARGET = os.environ.get('TSURU_TARGET', None) TSURU_TOKEN = os.environ.get('TSURU_TOKEN', None) if not TSURU_TARGET or not TSURU_TOKEN: print('...
98a4cd76ce9ecb81675ebaa29b249a8d80347e0d
zc-list.py
zc-list.py
#!/usr/bin/env python import client_wrap KEY_LONG = "key1" DATA_LONG = 1024 KEY_DOUBLE = "key2" DATA_DOUBLE = 100.53 KEY_STRING = "key3" DATA_STRING = "test data" def init_data(client): client.WriteLong(KEY_LONG, DATA_LONG) client.WriteDouble(KEY_DOUBLE, DATA_DOUBLE) client.WriteString(KEY_STRING, DATA...
#!/usr/bin/env python import client_wrap def main(): client = client_wrap.ClientWrap("get_test.log", "ipc:///var/run/zero-cache/0", 0) key_str = client.GetKeys() keys = key_str.split (';') del keys[-1] if len(keys) == 0: return print keys if __name__ == "__main__": main()
Implement displaying of the current key list
Implement displaying of the current key list
Python
agpl-3.0
ellysh/zero-cache-utils,ellysh/zero-cache-utils
#!/usr/bin/env python import client_wrap def main(): client = client_wrap.ClientWrap("get_test.log", "ipc:///var/run/zero-cache/0", 0) key_str = client.GetKeys() keys = key_str.split (';') del keys[-1] if len(keys) == 0: return print keys if __name__ == "__main__": main()
Implement displaying of the current key list #!/usr/bin/env python import client_wrap KEY_LONG = "key1" DATA_LONG = 1024 KEY_DOUBLE = "key2" DATA_DOUBLE = 100.53 KEY_STRING = "key3" DATA_STRING = "test data" def init_data(client): client.WriteLong(KEY_LONG, DATA_LONG) client.WriteDouble(KEY_DOUBLE, DATA_D...
3fc94b4cffcfd08b439386fb2b01aa1e12fec6d5
iati/core/tests/test_data.py
iati/core/tests/test_data.py
"""A module containing tests for the library representation of IATI data.""" import iati.core.data class TestDatasets(object): """A container for tests relating to Datasets""" pass
"""A module containing tests for the library representation of IATI data.""" import iati.core.data class TestDatasets(object): """A container for tests relating to Datasets""" def test_dataset_no_params(self): """Test Dataset creation with no parameters.""" pass def test_dataset_valid_xm...
Test stubs for dataset creation
Test stubs for dataset creation
Python
mit
IATI/iati.core,IATI/iati.core
"""A module containing tests for the library representation of IATI data.""" import iati.core.data class TestDatasets(object): """A container for tests relating to Datasets""" def test_dataset_no_params(self): """Test Dataset creation with no parameters.""" pass def test_dataset_valid_xm...
Test stubs for dataset creation """A module containing tests for the library representation of IATI data.""" import iati.core.data class TestDatasets(object): """A container for tests relating to Datasets""" pass
cf49e996f07a2fd7107b953369fdccdc850d51d8
test_tws/test_EReader.py
test_tws/test_EReader.py
'''Unit test package for module "tws._EReader".''' __copyright__ = "Copyright (c) 2008 Kevin J Bluck" __version__ = "$Id$" import unittest from StringIO import StringIO from tws import EClientSocket, EReader from test_tws import mock_wrapper class test_EReader(unittest.TestCase): '''Test class "tws.EReader"''...
'''Unit test package for module "tws._EReader".''' __copyright__ = "Copyright (c) 2008 Kevin J Bluck" __version__ = "$Id$" import unittest from StringIO import StringIO from tws import EClientSocket, EReader from test_tws import mock_wrapper class test_EReader(unittest.TestCase): '''Test class "tws.EReader"''...
Create EReader object using EClientSocket.createReader()
Create EReader object using EClientSocket.createReader()
Python
bsd-3-clause
kbluck/pytws,kbluck/pytws
'''Unit test package for module "tws._EReader".''' __copyright__ = "Copyright (c) 2008 Kevin J Bluck" __version__ = "$Id$" import unittest from StringIO import StringIO from tws import EClientSocket, EReader from test_tws import mock_wrapper class test_EReader(unittest.TestCase): '''Test class "tws.EReader"''...
Create EReader object using EClientSocket.createReader() '''Unit test package for module "tws._EReader".''' __copyright__ = "Copyright (c) 2008 Kevin J Bluck" __version__ = "$Id$" import unittest from StringIO import StringIO from tws import EClientSocket, EReader from test_tws import mock_wrapper class test_ERea...
ab5ebb50019add34333edb04cc96f7f55fce8d1c
src/toil/utils/__init__.py
src/toil/utils/__init__.py
from __future__ import absolute_import from toil import version import logging logger = logging.getLogger(__name__) def addBasicProvisionerOptions(parser): parser.add_argument("--version", action='version', version=version) parser.add_argument('-p', "--provisioner", dest='provisioner', choices=['aws', 'azur...
from __future__ import absolute_import from toil import version import logging import os logger = logging.getLogger(__name__) def addBasicProvisionerOptions(parser): parser.add_argument("--version", action='version', version=version) parser.add_argument('-p', "--provisioner", dest='provisioner', choices=['aw...
Remove default for zone, add method for searching for specified zone in environ vars.
Remove default for zone, add method for searching for specified zone in environ vars.
Python
apache-2.0
BD2KGenomics/slugflow,BD2KGenomics/slugflow
from __future__ import absolute_import from toil import version import logging import os logger = logging.getLogger(__name__) def addBasicProvisionerOptions(parser): parser.add_argument("--version", action='version', version=version) parser.add_argument('-p', "--provisioner", dest='provisioner', choices=['aw...
Remove default for zone, add method for searching for specified zone in environ vars. from __future__ import absolute_import from toil import version import logging logger = logging.getLogger(__name__) def addBasicProvisionerOptions(parser): parser.add_argument("--version", action='version', version=version) ...
01d35d13aaedea0ef87ae1d78ee1368e5e0f407c
corehq/apps/locations/management/commands/set_location_id.py
corehq/apps/locations/management/commands/set_location_id.py
from django.core.management.base import BaseCommand from dimagi.utils.couch.database import iter_docs from corehq.apps.users.models import CouchUser, CommCareUser class Command(BaseCommand): help = '' def handle(self, *args, **options): self.stdout.write("Population location_id field...\n") ...
Move migration into main branch
Move migration into main branch
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq
from django.core.management.base import BaseCommand from dimagi.utils.couch.database import iter_docs from corehq.apps.users.models import CouchUser, CommCareUser class Command(BaseCommand): help = '' def handle(self, *args, **options): self.stdout.write("Population location_id field...\n") ...
Move migration into main branch
eed413229978523b41a637c68c34100a31270643
scripts/TestHarness/testers/RavenUtils.py
scripts/TestHarness/testers/RavenUtils.py
import os import subprocess def inPython3(): return os.environ.get("CHECK_PYTHON3","0") == "1" def checkForMissingModules(): missing = [] too_old = [] to_try = [("numpy",'numpy.version.version',"1.7"), ("h5py",'',''), ("scipy",'scipy.__version__',"0.12"), ("sklearn",'sklear...
import os import subprocess def inPython3(): return os.environ.get("CHECK_PYTHON3","0") == "1" def checkForMissingModules(): missing = [] too_old = [] to_try = [("numpy",'numpy.version.version',"1.7"), ("h5py",'',''), ("scipy",'scipy.__version__',"0.12"), ("sklearn",'sklear...
Decrease the needed matplotlib to 1.3, to make it easier to get installed.
Decrease the needed matplotlib to 1.3, to make it easier to get installed.
Python
apache-2.0
joshua-cogliati-inl/raven,idaholab/raven,idaholab/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,idaholab/raven,idaholab/raven,idaholab/raven,idaholab/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,idaholab/raven
import os import subprocess def inPython3(): return os.environ.get("CHECK_PYTHON3","0") == "1" def checkForMissingModules(): missing = [] too_old = [] to_try = [("numpy",'numpy.version.version',"1.7"), ("h5py",'',''), ("scipy",'scipy.__version__',"0.12"), ("sklearn",'sklear...
Decrease the needed matplotlib to 1.3, to make it easier to get installed. import os import subprocess def inPython3(): return os.environ.get("CHECK_PYTHON3","0") == "1" def checkForMissingModules(): missing = [] too_old = [] to_try = [("numpy",'numpy.version.version',"1.7"), ("h5py",'',''), ...
a501b99fa60ca5118d2a0e0be4e8c2dff5bd385d
ci/check-benchmark.py
ci/check-benchmark.py
#!/usr/bin/env python3 import json import sys def run_compare(report): with open(report) as f: doc = json.load(f) for testcase in doc: measurements = testcase['measurements'] time = float(measurements[0]["time"]) if time < 0: continue if time > 0.05: ...
Add a script to process benchmark comparisons
CI: Add a script to process benchmark comparisons
Python
lgpl-2.1
chouquette/medialibrary,chouquette/medialibrary,chouquette/medialibrary,chouquette/medialibrary
#!/usr/bin/env python3 import json import sys def run_compare(report): with open(report) as f: doc = json.load(f) for testcase in doc: measurements = testcase['measurements'] time = float(measurements[0]["time"]) if time < 0: continue if time > 0.05: ...
CI: Add a script to process benchmark comparisons
277ec688d7f92c415446e700db42386620d9b418
satnogsclient/settings.py
satnogsclient/settings.py
from os import environ DEMODULATION_COMMAND = environ.get('DEMODULATION_COMMAND', None) ENCODING_COMMAND = environ.get('ENCODING_COMMAND', None) DECODING_COMMAND = environ.get('DECODING_COMMAND', None)
Add configuration file for client
Add configuration file for client
Python
agpl-3.0
adamkalis/satnogs-client,cshields/satnogs-client,adamkalis/satnogs-client,cshields/satnogs-client
from os import environ DEMODULATION_COMMAND = environ.get('DEMODULATION_COMMAND', None) ENCODING_COMMAND = environ.get('ENCODING_COMMAND', None) DECODING_COMMAND = environ.get('DECODING_COMMAND', None)
Add configuration file for client
fc6202425e0c855dc29980904949b60c0ac48bbf
preparation/tools/build_assets.py
preparation/tools/build_assets.py
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() with get_storage(resource_name.replace('Resource', '')) as out_storage: ...
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() trunk = resource_name.replace('Resource', '') with get_storage(trunk) as o...
Add start/finish debug info while generating
Add start/finish debug info while generating
Python
mit
hatbot-team/hatbot_resources
from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() trunk = resource_name.replace('Resource', '') with get_storage(trunk) as o...
Add start/finish debug info while generating from copy import copy from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage def rebuild_from_resource(resource_name: str): resource = resource_by_name(resource_name)() with get_storage(resource_name.r...
a870433fab72fe184f12353397ad916aabe5cb61
pegasus/gtfar/__init__.py
pegasus/gtfar/__init__.py
# Copyright 2007-2014 University Of Southern California # # 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 applicable law or...
# Copyright 2007-2014 University Of Southern California # # 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 applicable law or...
Add boilerplate code to configure the Flask app.
Add boilerplate code to configure the Flask app.
Python
apache-2.0
pegasus-isi/pegasus-gtfar,pegasus-isi/pegasus-gtfar,pegasus-isi/pegasus-gtfar,pegasus-isi/pegasus-gtfar
# Copyright 2007-2014 University Of Southern California # # 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 applicable law or...
Add boilerplate code to configure the Flask app. # Copyright 2007-2014 University Of Southern California # # 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...
0a33b7d8df544226df711db33a27f45421c19290
setup.py
setup.py
from setuptools import setup version = '2.0.0' setup(name='pyactiveresource', version=version, description='ActiveResource for Python', author='Shopify', author_email='developers@shopify.com', url='https://github.com/Shopify/pyactiveresource/', packages=['pyactiveresource', 'pyacti...
from setuptools import setup import sys version = '2.0.0' if sys.version_info >= (3,): python_dateutils_version = 'python-dateutil>=2.0' else: python_dateutils_version = 'python-dateutil<2.0' setup(name='pyactiveresource', version=version, description='ActiveResource for Python', author='S...
Use the right version of python-dateutils when using python 3.
Use the right version of python-dateutils when using python 3.
Python
mit
metric-collective/pyactiveresource,piran/pyactiveresource,varesa/pyactiveresource,hockeybuggy/pyactiveresource
from setuptools import setup import sys version = '2.0.0' if sys.version_info >= (3,): python_dateutils_version = 'python-dateutil>=2.0' else: python_dateutils_version = 'python-dateutil<2.0' setup(name='pyactiveresource', version=version, description='ActiveResource for Python', author='S...
Use the right version of python-dateutils when using python 3. from setuptools import setup version = '2.0.0' setup(name='pyactiveresource', version=version, description='ActiveResource for Python', author='Shopify', author_email='developers@shopify.com', url='https://github.com/Shopify...
0e2bfd59ca9db6568bac40504977d80b8ad84aba
helga_prod_fixer.py
helga_prod_fixer.py
import random from helga.plugins import command RESPONSES = [ 'There is no hope for {thing}, {nick}', 'It looks ok to me...', 'Did you power cycle {thing}? Are any of the lights blinking?', 'I\'ll take {thing} to the Genius Bar after work', 'Can we look at this tomorrow? I have Com Truise tickets...
import random from helga.plugins import command RESPONSES = [ 'There is no hope for {thing}, {nick}', 'It looks ok to me...', 'Did you power cycle {thing}? Are any of the lights blinking?', 'I\'ll take {thing} to the Genius Bar after work', 'Can we look at this tomorrow? I have Com Truise tickets...
Reboot and IE6 compatibility fixer messages
Reboot and IE6 compatibility fixer messages
Python
mit
shaunduncan/helga-prod-fixer
import random from helga.plugins import command RESPONSES = [ 'There is no hope for {thing}, {nick}', 'It looks ok to me...', 'Did you power cycle {thing}? Are any of the lights blinking?', 'I\'ll take {thing} to the Genius Bar after work', 'Can we look at this tomorrow? I have Com Truise tickets...
Reboot and IE6 compatibility fixer messages import random from helga.plugins import command RESPONSES = [ 'There is no hope for {thing}, {nick}', 'It looks ok to me...', 'Did you power cycle {thing}? Are any of the lights blinking?', 'I\'ll take {thing} to the Genius Bar after work', 'Can we loo...
7a09d36448d646e29c8d0aeeb7c39df2d20885ab
test/unit/ggrc/models/test_states.py
test/unit/ggrc/models/test_states.py
"""Test Object State Module""" import unittest import ggrc.app # noqa pylint: disable=unused-import from ggrc.models import all_models class TestStates(unittest.TestCase): """Test Object State main Test Case class""" def _assert_states(self, models, expected_states, default): # pylint: disable=no-self-use ...
Add unit test for object state
Add unit test for object state
Python
apache-2.0
selahssea/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core
"""Test Object State Module""" import unittest import ggrc.app # noqa pylint: disable=unused-import from ggrc.models import all_models class TestStates(unittest.TestCase): """Test Object State main Test Case class""" def _assert_states(self, models, expected_states, default): # pylint: disable=no-self-use ...
Add unit test for object state
e3248ba4bca04b434414570dc438547d8770adc9
tools/ocd_restore.py
tools/ocd_restore.py
#!/usr/bin/env python from pupa.utils import JSONEncoderPlus from contextlib import contextmanager from pymongo import Connection import argparse import json import os parser = argparse.ArgumentParser(description='Re-convert a jurisdiction.') parser.add_argument('--server', type=str, help='Mongo Server', ...
Add basics for a restore script
Add basics for a restore script (Yes, sadly, still debugging, need the prod db)
Python
bsd-3-clause
rshorey/pupa,mileswwatkins/pupa,datamade/pupa,rshorey/pupa,opencivicdata/pupa,influence-usa/pupa,mileswwatkins/pupa,influence-usa/pupa,opencivicdata/pupa,datamade/pupa
#!/usr/bin/env python from pupa.utils import JSONEncoderPlus from contextlib import contextmanager from pymongo import Connection import argparse import json import os parser = argparse.ArgumentParser(description='Re-convert a jurisdiction.') parser.add_argument('--server', type=str, help='Mongo Server', ...
Add basics for a restore script (Yes, sadly, still debugging, need the prod db)
78aabbc9c66bc92fdedec740e32ad9fbd9ee8937
pygraphc/clustering/ConnectedComponents.py
pygraphc/clustering/ConnectedComponents.py
import networkx as nx class ConnectedComponents: """This is a class for connected component detection method to cluster event logs [1]_. References ---------- .. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authentication log clustering, in Proceedings...
import networkx as nx from ClusterUtility import ClusterUtility class ConnectedComponents: """This is a class for connected component detection method to cluster event logs [1]_. References ---------- .. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authentication...
Change cluster data structure from list to dict
Change cluster data structure from list to dict
Python
mit
studiawan/pygraphc
import networkx as nx from ClusterUtility import ClusterUtility class ConnectedComponents: """This is a class for connected component detection method to cluster event logs [1]_. References ---------- .. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authentication...
Change cluster data structure from list to dict import networkx as nx class ConnectedComponents: """This is a class for connected component detection method to cluster event logs [1]_. References ---------- .. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authent...
ecfadf8478b8775d8579812a7bd835f6ebb1ffd4
util/rclone-list-files.py
util/rclone-list-files.py
#!/usr/bin/env python3 import glob # For use with --files-from argument for Rclone # This suits Edgar's structure with is # SPECIESNAME/{occurrences|projected-distributions}/[2nd-to-latest-file-is-the-latest].zip for folder in glob.glob('*'): occurrences = glob.glob(folder + '/occurrences/*') projected_distrib...
Add file lister for rclone export
Add file lister for rclone export
Python
bsd-3-clause
jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar
#!/usr/bin/env python3 import glob # For use with --files-from argument for Rclone # This suits Edgar's structure with is # SPECIESNAME/{occurrences|projected-distributions}/[2nd-to-latest-file-is-the-latest].zip for folder in glob.glob('*'): occurrences = glob.glob(folder + '/occurrences/*') projected_distrib...
Add file lister for rclone export
b7ede20d4e82b5aba701dd02c49ca8a5fe00e0ed
dimagi/utils/prime_views.py
dimagi/utils/prime_views.py
def prime_views(pool_size): """ Prime the views so that a very large import doesn't cause the index to get too far behind """ # These have to be included here or ./manage.py runserver explodes on # all pages of the app with single thread related errors from gevent.pool import Pool from ...
Move prime views method in
Move prime views method in
Python
bsd-3-clause
qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq
def prime_views(pool_size): """ Prime the views so that a very large import doesn't cause the index to get too far behind """ # These have to be included here or ./manage.py runserver explodes on # all pages of the app with single thread related errors from gevent.pool import Pool from ...
Move prime views method in
f6ce7485f18d3c5299b64a9b10af08f5da1c2335
infrastructure/control/osimctrl/src/start-opensim.py
infrastructure/control/osimctrl/src/start-opensim.py
#!/usr/bin/python import os.path import re import subprocess import sys ### CONFIGURE THESE PATHS ### binaryPath = "/home/opensim/opensim/opensim-current/bin" pidPath = "/tmp/OpenSim.pid" ### END OF CONFIG ### if os.path.exists(pidPath): print >> sys.stderr, "ERROR: OpenSim PID file %s still present. Assuming Ope...
#!/usr/bin/python import os.path import re import subprocess import sys ### CONFIGURE THESE PATHS ### binaryPath = "/home/opensim/opensim/opensim-current/bin" pidPath = "/tmp/OpenSim.pid" ### END OF CONFIG ### ### FUNCTIONS ### def execCmd(cmd): print "Executing command: %s" % cmd return subprocess.check_out...
Create execCmd function and use
Create execCmd function and use
Python
bsd-3-clause
justinccdev/opensimulator-tools,justinccdev/opensimulator-tools,justinccdev/opensimulator-tools,justinccdev/opensimulator-tools
#!/usr/bin/python import os.path import re import subprocess import sys ### CONFIGURE THESE PATHS ### binaryPath = "/home/opensim/opensim/opensim-current/bin" pidPath = "/tmp/OpenSim.pid" ### END OF CONFIG ### ### FUNCTIONS ### def execCmd(cmd): print "Executing command: %s" % cmd return subprocess.check_out...
Create execCmd function and use #!/usr/bin/python import os.path import re import subprocess import sys ### CONFIGURE THESE PATHS ### binaryPath = "/home/opensim/opensim/opensim-current/bin" pidPath = "/tmp/OpenSim.pid" ### END OF CONFIG ### if os.path.exists(pidPath): print >> sys.stderr, "ERROR: OpenSim PID fil...
db9afab144c12391c9c54174b8973ec187455b9c
webpack/conf.py
webpack/conf.py
import os from optional_django import conf class Conf(conf.Conf): # Environment configuration STATIC_ROOT = None STATIC_URL = None BUILD_SERVER_URL = 'http://127.0.0.1:9009' OUTPUT_DIR = 'webpack_assets' CONFIG_DIRS = None CONTEXT = None # Watching WATCH = True # TODO: should def...
import os from optional_django import conf class Conf(conf.Conf): # Environment configuration STATIC_ROOT = None STATIC_URL = None BUILD_SERVER_URL = 'http://127.0.0.1:9009' OUTPUT_DIR = 'webpack_assets' CONFIG_DIRS = None CONTEXT = None # Watching WATCH = False AGGREGATE_TIME...
WATCH now defaults to False
WATCH now defaults to False
Python
mit
markfinger/python-webpack,markfinger/python-webpack
import os from optional_django import conf class Conf(conf.Conf): # Environment configuration STATIC_ROOT = None STATIC_URL = None BUILD_SERVER_URL = 'http://127.0.0.1:9009' OUTPUT_DIR = 'webpack_assets' CONFIG_DIRS = None CONTEXT = None # Watching WATCH = False AGGREGATE_TIME...
WATCH now defaults to False import os from optional_django import conf class Conf(conf.Conf): # Environment configuration STATIC_ROOT = None STATIC_URL = None BUILD_SERVER_URL = 'http://127.0.0.1:9009' OUTPUT_DIR = 'webpack_assets' CONFIG_DIRS = None CONTEXT = None # Watching WAT...
a5cd2110283ba699f36548c42b83aa86e6b50aab
configuration.py
configuration.py
# -*- coding: utf-8 -*- """ configuration.py """ from trytond.model import fields, ModelSingleton, ModelSQL, ModelView __all__ = ['EndiciaConfiguration'] class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView): """ Configuration settings for Endicia. """ __name__ = 'endicia.configuration...
# -*- coding: utf-8 -*- """ configuration.py """ from trytond import backend from trytond.model import fields, ModelSingleton, ModelSQL, ModelView from trytond.transaction import Transaction __all__ = ['EndiciaConfiguration'] class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView): """ Configura...
Migrate account_id from integer field to char field
Migrate account_id from integer field to char field
Python
bsd-3-clause
priyankarani/trytond-shipping-endicia,fulfilio/trytond-shipping-endicia,prakashpp/trytond-shipping-endicia
# -*- coding: utf-8 -*- """ configuration.py """ from trytond import backend from trytond.model import fields, ModelSingleton, ModelSQL, ModelView from trytond.transaction import Transaction __all__ = ['EndiciaConfiguration'] class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView): """ Configura...
Migrate account_id from integer field to char field # -*- coding: utf-8 -*- """ configuration.py """ from trytond.model import fields, ModelSingleton, ModelSQL, ModelView __all__ = ['EndiciaConfiguration'] class EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView): """ Configuration settings for E...
de89049649fe720d45b271f519674845104f1941
flow_workflow/petri_net/future_nets/base.py
flow_workflow/petri_net/future_nets/base.py
from flow.petri_net.future_net import FutureNet from flow.petri_net.success_failure_net import SuccessFailureNet class SimplifiedSuccessFailureNet(FutureNet): def __init__(self, name=''): FutureNet.__init__(self, name=name) # Internal -- subclasses should connect to these self.internal_st...
from flow.petri_net.future_net import FutureNet from flow.petri_net.success_failure_net import SuccessFailureNet class GenomeNetBase(SuccessFailureNet): def __init__(self, name, operation_id, parent_operation_id=None): SuccessFailureNet.__init__(self, name=name) self.operation_id = operation_id ...
Make GenomeNetBase a SuccessFailureNet again
Make GenomeNetBase a SuccessFailureNet again
Python
agpl-3.0
genome/flow-workflow,genome/flow-workflow,genome/flow-workflow
from flow.petri_net.future_net import FutureNet from flow.petri_net.success_failure_net import SuccessFailureNet class GenomeNetBase(SuccessFailureNet): def __init__(self, name, operation_id, parent_operation_id=None): SuccessFailureNet.__init__(self, name=name) self.operation_id = operation_id ...
Make GenomeNetBase a SuccessFailureNet again from flow.petri_net.future_net import FutureNet from flow.petri_net.success_failure_net import SuccessFailureNet class SimplifiedSuccessFailureNet(FutureNet): def __init__(self, name=''): FutureNet.__init__(self, name=name) # Internal -- subclasses sh...
730aaf64635268df8d3c5cd3e1d5e2448644c907
problem-static/Intro-Eval_50/admin/eval.py
problem-static/Intro-Eval_50/admin/eval.py
#!/usr/bin/python2.7 import sys del __builtins__.__dict__['__import__'] del __builtins__.__dict__['reload'] flag = "eval_is_fun" class UnbufferedStream(object): def __init__(self, stream): self.stream = stream def write(self, data): self.stream.write(data) self.stream.flush() def...
#!/usr/bin/python2.7 import sys del __builtins__.__dict__['__import__'] del __builtins__.__dict__['reload'] flag = "eval_is_fun" class UnbufferedStream(object): def __init__(self, stream): self.stream = stream def write(self, data): self.stream.write(data) self.stream.flush() def...
Make Intro Eval use input instead of raw_input
Make Intro Eval use input instead of raw_input
Python
mit
james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF
#!/usr/bin/python2.7 import sys del __builtins__.__dict__['__import__'] del __builtins__.__dict__['reload'] flag = "eval_is_fun" class UnbufferedStream(object): def __init__(self, stream): self.stream = stream def write(self, data): self.stream.write(data) self.stream.flush() def...
Make Intro Eval use input instead of raw_input #!/usr/bin/python2.7 import sys del __builtins__.__dict__['__import__'] del __builtins__.__dict__['reload'] flag = "eval_is_fun" class UnbufferedStream(object): def __init__(self, stream): self.stream = stream def write(self, data): self.stream...
018583a7b8ce3b74b3942402b37b642d37b54c6d
scripts/prepared_json_to_fasta.py
scripts/prepared_json_to_fasta.py
""" Convert a prepared JSON file from augur into a FASTA file. """ import argparse import Bio import json import logging import sys sys.path.append('..') from base.sequences_process import sequence_set if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("json", help="prepared J...
""" Convert a prepared JSON file from augur into a FASTA file. """ import argparse import Bio import json import logging import sys sys.path.append('..') from base.sequences_process import sequence_set if __name__ == "__main__": parser = argparse.ArgumentParser(description="Convert a prepared JSON file from aug...
Write FASTA output to standard out.
Write FASTA output to standard out.
Python
agpl-3.0
blab/nextstrain-augur,nextstrain/augur,nextstrain/augur,nextstrain/augur
""" Convert a prepared JSON file from augur into a FASTA file. """ import argparse import Bio import json import logging import sys sys.path.append('..') from base.sequences_process import sequence_set if __name__ == "__main__": parser = argparse.ArgumentParser(description="Convert a prepared JSON file from aug...
Write FASTA output to standard out. """ Convert a prepared JSON file from augur into a FASTA file. """ import argparse import Bio import json import logging import sys sys.path.append('..') from base.sequences_process import sequence_set if __name__ == "__main__": parser = argparse.ArgumentParser() parser....
d6b3c47169082eeee6f1f01458b8791de2573849
kolibri/plugins/management/kolibri_plugin.py
kolibri/plugins/management/kolibri_plugin.py
from __future__ import absolute_import, print_function, unicode_literals from kolibri.plugins.base import KolibriFrontEndPluginBase class ManagementModule(KolibriFrontEndPluginBase): """ The Management module. """ entry_file = "assets/src/management.js" base_url = "management" template = "...
from __future__ import absolute_import, print_function, unicode_literals from kolibri.core.webpack import hooks as webpack_hooks from kolibri.plugins.base import KolibriPluginBase class ManagementPlugin(KolibriPluginBase): """ Required boilerplate so that the module is recognized as a plugin """ pass class...
Use new plugin classes for management
Use new plugin classes for management
Python
mit
66eli77/kolibri,learningequality/kolibri,indirectlylit/kolibri,lyw07/kolibri,jtamiace/kolibri,learningequality/kolibri,aronasorman/kolibri,jamalex/kolibri,christianmemije/kolibri,rtibbles/kolibri,benjaoming/kolibri,jtamiace/kolibri,jayoshih/kolibri,MingDai/kolibri,DXCanas/kolibri,jamalex/kolibri,rtibbles/kolibri,mrpau/...
from __future__ import absolute_import, print_function, unicode_literals from kolibri.core.webpack import hooks as webpack_hooks from kolibri.plugins.base import KolibriPluginBase class ManagementPlugin(KolibriPluginBase): """ Required boilerplate so that the module is recognized as a plugin """ pass class...
Use new plugin classes for management from __future__ import absolute_import, print_function, unicode_literals from kolibri.plugins.base import KolibriFrontEndPluginBase class ManagementModule(KolibriFrontEndPluginBase): """ The Management module. """ entry_file = "assets/src/management.js" ba...
63c81a18bd95876cad1bd4c1269d38e18ee3e817
wikichatter/TalkPageParser.py
wikichatter/TalkPageParser.py
import mwparserfromhell as mwp from . import IndentTree from . import WikiComments as wc class Page: def __init__(self): self.indent = -2 def __str__(self): return "Talk_Page" class Section: def __init__(self, heading): self.heading = heading self.indent = -1 def __st...
import mwparserfromhell as mwp from . import IndentTree from . import WikiComments as wc class Page: def __init__(self): self.indent = -2 def __str__(self): return "Talk_Page" class Section: def __init__(self, heading): self.heading = heading self.indent = -1 def __st...
Make mwparserfromhell skip style tags
Make mwparserfromhell skip style tags Since we do not really care if '' and ''' tags are processed as plaintext or not, and not processing them as plaintext causes #10
Python
mit
kjschiroo/WikiChatter
import mwparserfromhell as mwp from . import IndentTree from . import WikiComments as wc class Page: def __init__(self): self.indent = -2 def __str__(self): return "Talk_Page" class Section: def __init__(self, heading): self.heading = heading self.indent = -1 def __st...
Make mwparserfromhell skip style tags Since we do not really care if '' and ''' tags are processed as plaintext or not, and not processing them as plaintext causes #10 import mwparserfromhell as mwp from . import IndentTree from . import WikiComments as wc class Page: def __init__(self): self.indent = -2...
d71b2f3b8943465ebe04aa9926cba0159402da96
tests/test_sorting.py
tests/test_sorting.py
import os from textwrap import dedent from autosort.sorting import sort_imports def test_regular(): path = os.path.abspath('test.py') rv = sort_imports(dedent(''' from tokenize import COMMENT, INDENT, ENDMARKER from tokenize import (DEDENT, # noqa NEWLINE, STRING, ...
import os from textwrap import dedent from autosort.sorting import sort_imports def test_regular(): path = os.path.abspath('test.py') rv = sort_imports(dedent('''\ from tokenize import COMMENT, INDENT, ENDMARKER from tokenize import (DEDENT, # noqa NEWLINE, STRING, ...
Remove leading empty line in multiline test
Remove leading empty line in multiline test
Python
mit
fbergroth/autosort
import os from textwrap import dedent from autosort.sorting import sort_imports def test_regular(): path = os.path.abspath('test.py') rv = sort_imports(dedent('''\ from tokenize import COMMENT, INDENT, ENDMARKER from tokenize import (DEDENT, # noqa NEWLINE, STRING, ...
Remove leading empty line in multiline test import os from textwrap import dedent from autosort.sorting import sort_imports def test_regular(): path = os.path.abspath('test.py') rv = sort_imports(dedent(''' from tokenize import COMMENT, INDENT, ENDMARKER from tokenize import (DEDENT, # noqa ...
d788375843d42d1de3c0143064e905a932394e30
library/tests/test_factories.py
library/tests/test_factories.py
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
Test that BookSpecimenFactory also creates the related book
Test that BookSpecimenFactory also creates the related book
Python
agpl-3.0
ideascube/ideascube,ideascube/ideascube,Lcaracol/ideasbox.lan,ideascube/ideascube,Lcaracol/ideasbox.lan,Lcaracol/ideasbox.lan,ideascube/ideascube
import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_it_should_override_book_fields_passed_to_factory(): book =...
Test that BookSpecimenFactory also creates the related book import pytest from .factories import BookFactory, BookSpecimenFactory pytestmark = pytest.mark.django_db def test_it_should_create_a_default_book_from_factory(): book = BookFactory() assert book.pk is not None assert unicode(book) def test_i...
d8a5d6d6478ae8267ccd9d1e4db710f8decb7991
wiki/achievements.py
wiki/achievements.py
import wikipedia import sys import random import re import nltk.data def process_file(f): names = {} with open(f) as file: for line in file: l = line.strip().split('\t') if len(l) != 2: continue (k, v) = l names[k] = v return names ...
import wikipedia import sys import random import re import nltk.data def process_file(f): names = {} with open(f) as file: for line in file: l = line.strip().split('\t') if len(l) != 2: continue (k, v) = l names[k] = v return names ...
Use print as a statement
janitoring: Use print as a statement - Let's be Python 3 compatible. Signed-off-by: mr.Shu <8e7be411ad89ade93d144531f3925d0bb4011004@shu.io>
Python
apache-2.0
Motivatix/wikipedia-achievements-processing
import wikipedia import sys import random import re import nltk.data def process_file(f): names = {} with open(f) as file: for line in file: l = line.strip().split('\t') if len(l) != 2: continue (k, v) = l names[k] = v return names ...
janitoring: Use print as a statement - Let's be Python 3 compatible. Signed-off-by: mr.Shu <8e7be411ad89ade93d144531f3925d0bb4011004@shu.io> import wikipedia import sys import random import re import nltk.data def process_file(f): names = {} with open(f) as file: for line in file: l = l...
30be74075e761f932a10ea0806a08991b8fd9cb4
code/python/find-nodes-without-external-id.py
code/python/find-nodes-without-external-id.py
#!/usr/bin/env python import httplib import urllib import json import ssl import argparse import re parser = argparse.ArgumentParser(description='Find any node that does not have an external ID set.') parser.add_argument('--target-url', required=True, help='URL for the UpGuard instance. This should be the hostname on...
Add script to list nodes without an external ID
Add script to list nodes without an external ID
Python
mit
ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content
#!/usr/bin/env python import httplib import urllib import json import ssl import argparse import re parser = argparse.ArgumentParser(description='Find any node that does not have an external ID set.') parser.add_argument('--target-url', required=True, help='URL for the UpGuard instance. This should be the hostname on...
Add script to list nodes without an external ID
2f9c912c9071a498feb8d9cca69e447ffec397be
polygamy/pygit2_git.py
polygamy/pygit2_git.py
from __future__ import absolute_import import pygit2 from .base_git import NoSuchRemote from .plain_git import PlainGit class Pygit2Git(PlainGit): @staticmethod def is_on_branch(path): repo = pygit2.Repository(path) return not (repo.head_is_detached or repo.head_is_unborn) @staticmetho...
from __future__ import absolute_import import pygit2 from .base_git import NoSuchRemote from .plain_git import PlainGit class Pygit2Git(PlainGit): @staticmethod def _find_remote(repo, remote_name): for remote in repo.remotes: if remote.name == remote_name: return remote ...
Implement set_remote_url in pygit2 implementation
Implement set_remote_url in pygit2 implementation
Python
bsd-3-clause
solarnz/polygamy,solarnz/polygamy
from __future__ import absolute_import import pygit2 from .base_git import NoSuchRemote from .plain_git import PlainGit class Pygit2Git(PlainGit): @staticmethod def _find_remote(repo, remote_name): for remote in repo.remotes: if remote.name == remote_name: return remote ...
Implement set_remote_url in pygit2 implementation from __future__ import absolute_import import pygit2 from .base_git import NoSuchRemote from .plain_git import PlainGit class Pygit2Git(PlainGit): @staticmethod def is_on_branch(path): repo = pygit2.Repository(path) return not (repo.head_is...
f29477416729df9cc198f679a2478f6a077ce365
app/util.py
app/util.py
# Various utility functions import os from typing import Any, Callable SHOULD_CACHE = os.environ.get('ENV', 'development') == 'production' def cached_function(func: Callable[..., Any]) -> Callable[..., Any]: data = {} def wrapper(*args: Any) -> Any: if not SHOULD_CACHE: return func(*arg...
# Various utility functions import inspect import os from typing import Any, Callable SHOULD_CACHE = os.environ.get('ENV', 'development') == 'production' def cached_function(func: Callable[..., Any]) -> Callable[..., Any]: data = {} def wrapper(*args: Any) -> Any: if not SHOULD_CACHE: r...
Make cached_function not overwrite signature of wrapped function
Make cached_function not overwrite signature of wrapped function
Python
mit
albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com
# Various utility functions import inspect import os from typing import Any, Callable SHOULD_CACHE = os.environ.get('ENV', 'development') == 'production' def cached_function(func: Callable[..., Any]) -> Callable[..., Any]: data = {} def wrapper(*args: Any) -> Any: if not SHOULD_CACHE: r...
Make cached_function not overwrite signature of wrapped function # Various utility functions import os from typing import Any, Callable SHOULD_CACHE = os.environ.get('ENV', 'development') == 'production' def cached_function(func: Callable[..., Any]) -> Callable[..., Any]: data = {} def wrapper(*args: Any)...
9d0ea4eaf8269350fabc3415545bebf4da4137a7
source/segue/backend/processor/background.py
source/segue/backend/processor/background.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import multiprocessing from .base import Processor class BackgroundProcessor(Processor): '''Local background processor.''' def process(self, command, args=None, kw=None): '''Process *command*...
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import multiprocessing from .base import Processor class BackgroundProcessor(Processor): '''Local background processor.''' def process(self, command, args=None, kw=None): '''Process *command*...
Fix passing invalid None to multiprocessing Process class.
Fix passing invalid None to multiprocessing Process class.
Python
apache-2.0
4degrees/segue
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import multiprocessing from .base import Processor class BackgroundProcessor(Processor): '''Local background processor.''' def process(self, command, args=None, kw=None): '''Process *command*...
Fix passing invalid None to multiprocessing Process class. # :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import multiprocessing from .base import Processor class BackgroundProcessor(Processor): '''Local background processor.''' def process(self...
1713cf8553d7f21d1192ed58138ecf7875c4b181
icebergsdk/front_modules.py
icebergsdk/front_modules.py
# -*- coding: utf-8 -*- import logging from icebergsdk.mixins.request_mixin import IcebergRequestBase logger = logging.getLogger('icebergsdk.frontmodules') class FrontModules(IcebergRequestBase): cache_key = "icebergsdk:frontmodule:data" cache_expire = 60*60 # one hour def __init__(self, *args, **kwargs...
# -*- coding: utf-8 -*- import logging from icebergsdk.mixins.request_mixin import IcebergRequestBase logger = logging.getLogger('icebergsdk.frontmodules') class FrontModules(IcebergRequestBase): cache_key = "icebergsdk:frontmodule:data" cache_expire = 60*60 # one hour def __init__(self, *args, **kwargs...
Add lang, enviro in request
Add lang, enviro in request
Python
mit
izberg-marketplace/izberg-api-python,Iceberg-Marketplace/Iceberg-API-PYTHON
# -*- coding: utf-8 -*- import logging from icebergsdk.mixins.request_mixin import IcebergRequestBase logger = logging.getLogger('icebergsdk.frontmodules') class FrontModules(IcebergRequestBase): cache_key = "icebergsdk:frontmodule:data" cache_expire = 60*60 # one hour def __init__(self, *args, **kwargs...
Add lang, enviro in request # -*- coding: utf-8 -*- import logging from icebergsdk.mixins.request_mixin import IcebergRequestBase logger = logging.getLogger('icebergsdk.frontmodules') class FrontModules(IcebergRequestBase): cache_key = "icebergsdk:frontmodule:data" cache_expire = 60*60 # one hour def _...
0e54e8ac75acbd289c2fde2d7fae486cc31ab3ab
tests/test_block_aio.py
tests/test_block_aio.py
# -*- coding: utf-8 -*- import aiounittest from graphenecommon.utils import parse_time from .fixtures_aio import fixture_data, Block, BlockHeader class Testcases(aiounittest.AsyncTestCase): def setUp(self): fixture_data() async def test_block(self): block = await Block(1) self.assertE...
Add test for async Block
Add test for async Block
Python
mit
xeroc/python-graphenelib
# -*- coding: utf-8 -*- import aiounittest from graphenecommon.utils import parse_time from .fixtures_aio import fixture_data, Block, BlockHeader class Testcases(aiounittest.AsyncTestCase): def setUp(self): fixture_data() async def test_block(self): block = await Block(1) self.assertE...
Add test for async Block
ab36778ec3c8ed69ce798816161ee35a368e2dc2
tests/test_base.py
tests/test_base.py
# Copyright 2013 OpenStack Foundation # Copyright (C) 2013 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 # # http://www.apache.org/licens...
Improve unit tests for python-glanceclient.glanceclient.common.base
Improve unit tests for python-glanceclient.glanceclient.common.base Add several tests for glanceclient.common.base module Fixes: bug #1144158 Change-Id: Ifc288075c79849ee1384f09f513874ee08cd0248
Python
apache-2.0
ntt-sic/python-glanceclient,citrix-openstack-build/python-glanceclient,metacloud/python-glanceclient,alexpilotti/python-glanceclient,metacloud/python-glanceclient,klmitch/python-glanceclient,klmitch/python-glanceclient,citrix-openstack-build/python-glanceclient,varunarya10/python-glanceclient,JioCloud/python-glanceclie...
# Copyright 2013 OpenStack Foundation # Copyright (C) 2013 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 # # http://www.apache.org/licens...
Improve unit tests for python-glanceclient.glanceclient.common.base Add several tests for glanceclient.common.base module Fixes: bug #1144158 Change-Id: Ifc288075c79849ee1384f09f513874ee08cd0248
4f0415f5cb7f8322a0738cb1d55c7102464d3aef
openedx/core/djangoapps/discussions/tests/test_views.py
openedx/core/djangoapps/discussions/tests/test_views.py
""" Test app view logic """ # pylint: disable=test-inherits-tests import unittest from django.conf import settings from django.urls import reverse from opaque_keys.edx.keys import CourseKey from rest_framework import status from rest_framework.test import APITestCase from common.djangoapps.student.tests.factories imp...
Add tests for discussions API access
test: Add tests for discussions API access This checks for expected API access [1]; data integrity will be checked later [2]. This work exposes that the code currently does _not_ grant access to _course_ staff, only _global_ staff. This is being addressed next [3]. Fix: TNL-8229 [1] - [1] https://openedx.atlassian....
Python
agpl-3.0
edx/edx-platform,angelapper/edx-platform,eduNEXT/edx-platform,arbrandes/edx-platform,eduNEXT/edx-platform,angelapper/edx-platform,arbrandes/edx-platform,angelapper/edx-platform,arbrandes/edx-platform,edx/edx-platform,arbrandes/edx-platform,eduNEXT/edx-platform,eduNEXT/edx-platform,edx/edx-platform,edx/edx-platform,ange...
""" Test app view logic """ # pylint: disable=test-inherits-tests import unittest from django.conf import settings from django.urls import reverse from opaque_keys.edx.keys import CourseKey from rest_framework import status from rest_framework.test import APITestCase from common.djangoapps.student.tests.factories imp...
test: Add tests for discussions API access This checks for expected API access [1]; data integrity will be checked later [2]. This work exposes that the code currently does _not_ grant access to _course_ staff, only _global_ staff. This is being addressed next [3]. Fix: TNL-8229 [1] - [1] https://openedx.atlassian....
4efdee1f93e85b96607a21c0d8f79343ef989697
setup.py
setup.py
from setuptools import setup, find_packages setup( name = 'compdb', version = '0.1', package_dir = {'': 'src'}, packages = find_packages('src'), author = 'Carl Simon Adorf', author_email = 'csadorf@umich.edu', description = "Computational Database.", keywords = 'simulation tools mc md ...
from setuptools import setup, find_packages setup( name = 'compdb', version = '0.1', package_dir = {'': 'src'}, packages = find_packages('src'), author = 'Carl Simon Adorf', author_email = 'csadorf@umich.edu', description = "Computational Database.", keywords = 'simulation tools mc md ...
Make mpi4py required for this package.
Make mpi4py required for this package.
Python
bsd-3-clause
csadorf/signac,csadorf/signac
from setuptools import setup, find_packages setup( name = 'compdb', version = '0.1', package_dir = {'': 'src'}, packages = find_packages('src'), author = 'Carl Simon Adorf', author_email = 'csadorf@umich.edu', description = "Computational Database.", keywords = 'simulation tools mc md ...
Make mpi4py required for this package. from setuptools import setup, find_packages setup( name = 'compdb', version = '0.1', package_dir = {'': 'src'}, packages = find_packages('src'), author = 'Carl Simon Adorf', author_email = 'csadorf@umich.edu', description = "Computational Database.",...
f94bc30004aa9977bac652d337f69069efc132bd
marmoset/pxe/__init__.py
marmoset/pxe/__init__.py
from .label import Label from .client_config import ClientConfig def create(args): pxe_client = ClientConfig(args.ip_address, args.password, args.script) pxe_client.create(Label.find(args.label)) msg = 'Created %s with password %s' print(msg % (pxe_client.file_path(), pxe_client.password)) def list(...
from .label import Label from .client_config import ClientConfig def create(args): pxe_client = ClientConfig(args.ip_address, args.password, args.script) used_options = pxe_client.create(Label.find(args.label)) msg = 'Created %s with following Options:' print(msg % pxe_client.file_path()) for op...
Implement better result output for pxe config file crete
Implement better result output for pxe config file crete
Python
agpl-3.0
aibor/marmoset
from .label import Label from .client_config import ClientConfig def create(args): pxe_client = ClientConfig(args.ip_address, args.password, args.script) used_options = pxe_client.create(Label.find(args.label)) msg = 'Created %s with following Options:' print(msg % pxe_client.file_path()) for op...
Implement better result output for pxe config file crete from .label import Label from .client_config import ClientConfig def create(args): pxe_client = ClientConfig(args.ip_address, args.password, args.script) pxe_client.create(Label.find(args.label)) msg = 'Created %s with password %s' print(msg % ...
390851ce7c606e803094487e6278ea5620d26f3c
src/python/vff.py
src/python/vff.py
"""Show a command to edit fred files""" import os import sys from dotsite.paths import makepath, pwd def get_freds(paths): if not paths: paths = ['.'] result = set() for path in paths: path = makepath(path) if path.isdir(): result |= {p for p in path.files('fred*') i...
"""Show a command to edit fred files""" import os import sys from dotsite.paths import makepath, pwd def get_freds(paths): if not paths: paths = ['~/tmp'] result = set() for path in paths: path = makepath(path) if path.isdir(): result |= {p for p in path.files('fred*...
Put temp files in ~/tmp by default
Put temp files in ~/tmp by default
Python
mit
jalanb/jab,jalanb/dotjab,jalanb/jab,jalanb/dotjab
"""Show a command to edit fred files""" import os import sys from dotsite.paths import makepath, pwd def get_freds(paths): if not paths: paths = ['~/tmp'] result = set() for path in paths: path = makepath(path) if path.isdir(): result |= {p for p in path.files('fred*...
Put temp files in ~/tmp by default """Show a command to edit fred files""" import os import sys from dotsite.paths import makepath, pwd def get_freds(paths): if not paths: paths = ['.'] result = set() for path in paths: path = makepath(path) if path.isdir(): result ...
212b5a126e464ff46e60e00846bbb87a2de3fbb2
seleniumbase/config/proxy_list.py
seleniumbase/config/proxy_list.py
""" Proxy Server "Phone Book". Simplify running browser tests through a proxy server by adding your frequently-used proxies here. Now you can do something like this on the command line: "pytest SOME_TEST.py --proxy=proxy1" Format of PROXY_LIST server entries: * "ip_address:port" OR "username:password@ip_address:po...
""" Proxy Server "Phone Book". Simplify running browser tests through a proxy server by adding your frequently-used proxies here. Now you can do something like this on the command line: "pytest SOME_TEST.py --proxy=proxy1" Format of PROXY_LIST server entries: * "ip_address:port" OR "username:password@ip_address:po...
Update the sample proxy list
Update the sample proxy list
Python
mit
mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase
""" Proxy Server "Phone Book". Simplify running browser tests through a proxy server by adding your frequently-used proxies here. Now you can do something like this on the command line: "pytest SOME_TEST.py --proxy=proxy1" Format of PROXY_LIST server entries: * "ip_address:port" OR "username:password@ip_address:po...
Update the sample proxy list """ Proxy Server "Phone Book". Simplify running browser tests through a proxy server by adding your frequently-used proxies here. Now you can do something like this on the command line: "pytest SOME_TEST.py --proxy=proxy1" Format of PROXY_LIST server entries: * "ip_address:port" OR "u...
4f2743ed845185de718763df6d26db390ee2eb48
test_putget.py
test_putget.py
from multiprocessing import Process, Queue q = Queue() iterations = 10000000 def produce(q): for i in range(iterations): q.put(i) if __name__ == "__main__": t = Process(target=produce, args=(q,)) t.start() previous = -1 for i in range(iterations): m = q.get() if m !...
Add equivalent put/get test in python.
Add equivalent put/get test in python.
Python
mit
abwilson/L3,abwilson/L3,tempbottle/L3,tempbottle/L3
from multiprocessing import Process, Queue q = Queue() iterations = 10000000 def produce(q): for i in range(iterations): q.put(i) if __name__ == "__main__": t = Process(target=produce, args=(q,)) t.start() previous = -1 for i in range(iterations): m = q.get() if m !...
Add equivalent put/get test in python.
f7b1d233ed39eed24e3c1489738df01f700112e3
tensorflow/contrib/tensorrt/__init__.py
tensorflow/contrib/tensorrt/__init__.py
# Copyright 2018 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 2018 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...
Move the pylint message and fix comment length
Move the pylint message and fix comment length
Python
apache-2.0
paolodedios/tensorflow,lukeiwanski/tensorflow,alshedivat/tensorflow,kobejean/tensorflow,frreiss/tensorflow-fred,Xeralux/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,alsrgv/tensorflow,nburn42/tensorflow,meteorcloudy/tensorflow,Xeralux/tensorflow,paolodedios/tensorflow,ppwwyyxx/tensorflow,gaut...
# Copyright 2018 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...
Move the pylint message and fix comment length # Copyright 2018 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/lic...
d633d3c13a958b279b93d09142a772e59c798f6f
peas-demo/plugins/pythonhello/pythonhello.py
peas-demo/plugins/pythonhello/pythonhello.py
# -*- coding: utf-8 -*- # ex:set ts=4 et sw=4 ai: import gobject import libpeas import gtk LABEL_STRING="Python Says Hello!" class PythonHelloPlugin(libpeas.Plugin): def do_activate(self, window): print "PythonHelloPlugin.do_activate", repr(window) window._pythonhello_label = gtk.Label(LABEL_STRI...
# -*- coding: utf-8 -*- # ex:set ts=4 et sw=4 ai: import gobject import libpeas import gtk LABEL_STRING="Python Says Hello!" class PythonHelloPlugin(libpeas.Plugin): def do_activate(self, window): print "PythonHelloPlugin.do_activate", repr(window) window._pythonhello_label = gtk.Label(LABEL_STRI...
Fix a typo in the python plugin.
[PeasDemo] Fix a typo in the python plugin. It was indicating "do_activate" in the console when actually deactivating the plugin.
Python
lgpl-2.1
GNOME/libpeas,gregier/libpeas,Distrotech/libpeas,chergert/libpeas,GNOME/libpeas,chergert/libpeas,gregier/libpeas,chergert/libpeas,gregier/libpeas,gregier/libpeas,Distrotech/libpeas,Distrotech/libpeas
# -*- coding: utf-8 -*- # ex:set ts=4 et sw=4 ai: import gobject import libpeas import gtk LABEL_STRING="Python Says Hello!" class PythonHelloPlugin(libpeas.Plugin): def do_activate(self, window): print "PythonHelloPlugin.do_activate", repr(window) window._pythonhello_label = gtk.Label(LABEL_STRI...
[PeasDemo] Fix a typo in the python plugin. It was indicating "do_activate" in the console when actually deactivating the plugin. # -*- coding: utf-8 -*- # ex:set ts=4 et sw=4 ai: import gobject import libpeas import gtk LABEL_STRING="Python Says Hello!" class PythonHelloPlugin(libpeas.Plugin): def do_activate...
2a32fc912a5839f627a216918e4671e6547ee53b
tests/utils/driver.py
tests/utils/driver.py
import os from importlib import import_module from .testdriver import TestDriver class Driver(TestDriver): drivers = {} def __new__(cls, type, *args, **kwargs): if type not in cls.drivers: try: mod = import_module('onitu.drivers.{}.tests.driver'. ...
import os import pkg_resources from .testdriver import TestDriver class Driver(TestDriver): drivers = {} def __new__(cls, name, *args, **kwargs): entry_points = pkg_resources.iter_entry_points('onitu.tests') tests_modules = {e.name: e for e in entry_points} if name not in tests_modu...
Load tests helpers using entry_points
Load tests helpers using entry_points
Python
mit
onitu/onitu,onitu/onitu,onitu/onitu
import os import pkg_resources from .testdriver import TestDriver class Driver(TestDriver): drivers = {} def __new__(cls, name, *args, **kwargs): entry_points = pkg_resources.iter_entry_points('onitu.tests') tests_modules = {e.name: e for e in entry_points} if name not in tests_modu...
Load tests helpers using entry_points import os from importlib import import_module from .testdriver import TestDriver class Driver(TestDriver): drivers = {} def __new__(cls, type, *args, **kwargs): if type not in cls.drivers: try: mod = import_module('onitu.drivers.{}.t...
19df6de71721db1a4d7b43e360731704ba462d9d
tests/services/user/test_find_user.py
tests/services/user/test_find_user.py
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.user import service as user_service from tests.conftest import database_recreated from tests.helpers import create_user @pytest.fixture(scope='module') def app(party_app, db): ...
Test finding user by email address, screen name
Test finding user by email address, screen name
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.user import service as user_service from tests.conftest import database_recreated from tests.helpers import create_user @pytest.fixture(scope='module') def app(party_app, db): ...
Test finding user by email address, screen name
c2b11e603de32d65f5f5ddf500c4e04d3bcce4fd
setup.py
setup.py
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='dependency_injection' , author='Gittip, LLC' , description="dependency_injection helpers" , url='https://dependency-injection-py.readthedocs.org' , version='0.0.0-dev' ...
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='dependency_injection' , author='Gittip, LLC' , author_email='support@gittip.com' , description="dependency_injection helpers" , url='https://dependency-injection-py.readthe...
Add missing metadata to suppress warning
Add missing metadata to suppress warning Doesn't fix the "503 Backend is unhealthy" error I'm getting from `python setup.py register`, however.
Python
mit
gratipay/dependency_injection.py,gratipay/dependency_injection.py
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='dependency_injection' , author='Gittip, LLC' , author_email='support@gittip.com' , description="dependency_injection helpers" , url='https://dependency-injection-py.readthe...
Add missing metadata to suppress warning Doesn't fix the "503 Backend is unhealthy" error I'm getting from `python setup.py register`, however. from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='dependency_injection' , author='Gittip, L...
c6d81ce7eede6db801d4e9a92b27ec5d409d0eab
setup.py
setup.py
from setuptools import setup setup( name='autograd', version='1.4', description='Efficiently computes derivatives of numpy code.', author='Dougal Maclaurin and David Duvenaud and Matthew Johnson', author_email="maclaurin@physics.harvard.edu, duvenaud@cs.toronto.edu, mattjj@csail.mit.edu", packa...
from setuptools import setup setup( name='autograd', version='1.5', description='Efficiently computes derivatives of numpy code.', author='Dougal Maclaurin and David Duvenaud and Matthew Johnson', author_email="maclaurin@physics.harvard.edu, duvenaud@cs.toronto.edu, mattjj@csail.mit.edu", packa...
Increase version number for pypi
Increase version number for pypi
Python
mit
HIPS/autograd,HIPS/autograd
from setuptools import setup setup( name='autograd', version='1.5', description='Efficiently computes derivatives of numpy code.', author='Dougal Maclaurin and David Duvenaud and Matthew Johnson', author_email="maclaurin@physics.harvard.edu, duvenaud@cs.toronto.edu, mattjj@csail.mit.edu", packa...
Increase version number for pypi from setuptools import setup setup( name='autograd', version='1.4', description='Efficiently computes derivatives of numpy code.', author='Dougal Maclaurin and David Duvenaud and Matthew Johnson', author_email="maclaurin@physics.harvard.edu, duvenaud@cs.toronto.edu...
8ba03f6be64ee12634183e0b5c5f3aa3b6014b94
linguine/ops/StanfordCoreNLP.py
linguine/ops/StanfordCoreNLP.py
#!/usr/bin/env python import os """ Performs some core NLP operations as a proof of concept for the library. """ from stanford_corenlp_pywrapper import CoreNLP class StanfordCoreNLP: def __init__(self): # I don't see anywhere to put properties like this path... # For now it's hardcoded and would ...
#!/usr/bin/env python import os """ Performs some core NLP operations as a proof of concept for the library. """ from stanford_corenlp_pywrapper import CoreNLP class StanfordCoreNLP: def __init__(self): # I don't see anywhere to put properties like this path... # For now it's hardcoded and would ...
Add coreNLP models jar relative path as well
Add coreNLP models jar relative path as well
Python
mit
rigatoni/linguine-python,Pastafarians/linguine-python
#!/usr/bin/env python import os """ Performs some core NLP operations as a proof of concept for the library. """ from stanford_corenlp_pywrapper import CoreNLP class StanfordCoreNLP: def __init__(self): # I don't see anywhere to put properties like this path... # For now it's hardcoded and would ...
Add coreNLP models jar relative path as well #!/usr/bin/env python import os """ Performs some core NLP operations as a proof of concept for the library. """ from stanford_corenlp_pywrapper import CoreNLP class StanfordCoreNLP: def __init__(self): # I don't see anywhere to put properties like this path...
972cb7c234729d2ce8bbab0937f8efbfe18a2eeb
lab_members/models.py
lab_members/models.py
from django.db import models class Position(models.Model): class Meta: verbose_name = "Position" verbose_name_plural = "Positions" title = models.CharField(u'title', blank=False, default='', help_text=u'Please enter a title for this position', max_length=64, ...
from django.db import models class Position(models.Model): class Meta: verbose_name = "Position" verbose_name_plural = "Positions" title = models.CharField(u'title', blank=False, default='', help_text=u'Please enter a title for this position', max_length=64, ...
Fix error: __str__ returned non-string (type NoneType)
Fix error: __str__ returned non-string (type NoneType)
Python
bsd-3-clause
mfcovington/django-lab-members,mfcovington/django-lab-members,mfcovington/django-lab-members
from django.db import models class Position(models.Model): class Meta: verbose_name = "Position" verbose_name_plural = "Positions" title = models.CharField(u'title', blank=False, default='', help_text=u'Please enter a title for this position', max_length=64, ...
Fix error: __str__ returned non-string (type NoneType) from django.db import models class Position(models.Model): class Meta: verbose_name = "Position" verbose_name_plural = "Positions" title = models.CharField(u'title', blank=False, default='', help_text=u'Please ent...
fd302e3f9cbc5bcf06d47600adc3e0f0df33c114
f8a_jobs/auth.py
f8a_jobs/auth.py
from flask import session from flask_oauthlib.client import OAuth import f8a_jobs.defaults as configuration oauth = OAuth() github = oauth.remote_app( 'github', consumer_key=configuration.GITHUB_CONSUMER_KEY, consumer_secret=configuration.GITHUB_CONSUMER_SECRET, request_token_params={'scope': 'user:ema...
from flask import session from flask_oauthlib.client import OAuth import f8a_jobs.defaults as configuration oauth = OAuth() github = oauth.remote_app( 'github', consumer_key=configuration.GITHUB_CONSUMER_KEY, consumer_secret=configuration.GITHUB_CONSUMER_SECRET, request_token_params={'scope': 'user:ema...
Add read organization scope for OAuth
Add read organization scope for OAuth This will enable to access jobs service even for not public organization members.
Python
apache-2.0
fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs
from flask import session from flask_oauthlib.client import OAuth import f8a_jobs.defaults as configuration oauth = OAuth() github = oauth.remote_app( 'github', consumer_key=configuration.GITHUB_CONSUMER_KEY, consumer_secret=configuration.GITHUB_CONSUMER_SECRET, request_token_params={'scope': 'user:ema...
Add read organization scope for OAuth This will enable to access jobs service even for not public organization members. from flask import session from flask_oauthlib.client import OAuth import f8a_jobs.defaults as configuration oauth = OAuth() github = oauth.remote_app( 'github', consumer_key=configuration.G...
29041cdaf3beca926f1dff1d3f147b7dc07ad8dd
pylp/cli/run.py
pylp/cli/run.py
""" Run a pylpfile. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import runpy, os, sys import traceback import asyncio import pylp, pylp.cli.logger as logger # Run a pylpfile def run(path, tasks): # Test if the pylpfile exists if not os.path.isfile(path): logger.log(logger.red(...
""" Run a pylpfile. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import runpy, os, sys import traceback import asyncio import pylp import pylp.cli.logger as logger from pylp.utils.paths import make_readable_path # Run a pylpfile def run(path, tasks): # Test if the pylpfile exists ...
Make pylpfile path more readable
Make pylpfile path more readable
Python
mit
pylp/pylp
""" Run a pylpfile. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import runpy, os, sys import traceback import asyncio import pylp import pylp.cli.logger as logger from pylp.utils.paths import make_readable_path # Run a pylpfile def run(path, tasks): # Test if the pylpfile exists ...
Make pylpfile path more readable """ Run a pylpfile. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import runpy, os, sys import traceback import asyncio import pylp, pylp.cli.logger as logger # Run a pylpfile def run(path, tasks): # Test if the pylpfile exists if not os.path.isfi...
6696451b7c7a9b2de5b624b47159efae8fcf06b7
opwen_email_server/api/lokole.py
opwen_email_server/api/lokole.py
def upload(upload_info): """ :type upload_info: dict """ client_id = upload_info['client_id'] resource_id = upload_info['resource_id'] resource_type = upload_info['resource_type'] raise NotImplementedError def download(client_id): """ :type client_id: str :rtype dict """...
def upload(upload_info): """ :type upload_info: dict """ client_id = upload_info['client_id'] # noqa: F841 resource_id = upload_info['resource_id'] # noqa: F841 resource_type = upload_info['resource_type'] # noqa: F841 raise NotImplementedError def download(client_id): # noqa: F841 ...
Disable linter in in-progress code
Disable linter in in-progress code
Python
apache-2.0
ascoderu/opwen-cloudserver,ascoderu/opwen-cloudserver
def upload(upload_info): """ :type upload_info: dict """ client_id = upload_info['client_id'] # noqa: F841 resource_id = upload_info['resource_id'] # noqa: F841 resource_type = upload_info['resource_type'] # noqa: F841 raise NotImplementedError def download(client_id): # noqa: F841 ...
Disable linter in in-progress code def upload(upload_info): """ :type upload_info: dict """ client_id = upload_info['client_id'] resource_id = upload_info['resource_id'] resource_type = upload_info['resource_type'] raise NotImplementedError def download(client_id): """ :type cli...
e7b6aef4db85c777463d2335107145b60b678ae2
examples/tour_examples/maps_introjs_tour.py
examples/tour_examples/maps_introjs_tour.py
from seleniumbase import BaseCase class MyTourClass(BaseCase): def test_google_maps_tour(self): self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z") self.wait_for_element("#searchboxinput") self.wait_for_element("#minimap") self.wait_for_element("#zoom") s...
Create a new tour example
Create a new tour example
Python
mit
seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase
from seleniumbase import BaseCase class MyTourClass(BaseCase): def test_google_maps_tour(self): self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z") self.wait_for_element("#searchboxinput") self.wait_for_element("#minimap") self.wait_for_element("#zoom") s...
Create a new tour example
d5f02b13db9b6d23e15bc07a985b8c67644ffb44
pyclibrary/__init__.py
pyclibrary/__init__.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by PyCLibrary Authors, see AUTHORS for more details. # # Distributed under the terms of the MIT/X11 license. # # The full license is in the file LICENCE, distributed with this software. # -----------...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by PyCLibrary Authors, see AUTHORS for more details. # # Distributed under the terms of the MIT/X11 license. # # The full license is in the file LICENCE, distributed with this software. # -----------...
Add NullHandler to avoid logging complaining for nothing.
Add NullHandler to avoid logging complaining for nothing.
Python
mit
MatthieuDartiailh/pyclibrary,mrh1997/pyclibrary,mrh1997/pyclibrary,MatthieuDartiailh/pyclibrary,mrh1997/pyclibrary,duguxy/pyclibrary,duguxy/pyclibrary,duguxy/pyclibrary
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by PyCLibrary Authors, see AUTHORS for more details. # # Distributed under the terms of the MIT/X11 license. # # The full license is in the file LICENCE, distributed with this software. # -----------...
Add NullHandler to avoid logging complaining for nothing. # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by PyCLibrary Authors, see AUTHORS for more details. # # Distributed under the terms of the MIT/X11 license. # # The full license is in the ...
45fc612fdc5a354dbf0bacccd345b1aebcc73e59
tests/test_openweather.py
tests/test_openweather.py
# -*- coding: utf-8 -*- import bot_mock from pyfibot.modules import module_openweather from utils import check_re bot = bot_mock.BotMock() def test_weather(): regex = u'Lappeenranta, FI: Temperature: \d+.\d\xb0C, feels like: \d+.\d\xb0C, wind: \d+.\d m/s, humidity: \d+%, pressure: \d+ hPa, cloudiness: \d+%' ...
# -*- coding: utf-8 -*- import bot_mock from pyfibot.modules import module_openweather from utils import check_re bot = bot_mock.BotMock() def test_weather(): regex = u'Lappeenranta, FI: Temperature: \d+.\d\xb0C, feels like: \d+.\d\xb0C, wind: \d+.\d m/s, humidity: \d+%, pressure: \d+ hPa, cloudiness: \d+%' ...
Revert "Fix openweather unit tests"
Revert "Fix openweather unit tests" This reverts commit 36e100e649f0a337228a6d7375358d23afd544ff. Open Weather Map has reverted back to their old api or something like that...
Python
bsd-3-clause
rnyberg/pyfibot,EArmour/pyfibot,aapa/pyfibot,aapa/pyfibot,lepinkainen/pyfibot,rnyberg/pyfibot,lepinkainen/pyfibot,huqa/pyfibot,huqa/pyfibot,EArmour/pyfibot
# -*- coding: utf-8 -*- import bot_mock from pyfibot.modules import module_openweather from utils import check_re bot = bot_mock.BotMock() def test_weather(): regex = u'Lappeenranta, FI: Temperature: \d+.\d\xb0C, feels like: \d+.\d\xb0C, wind: \d+.\d m/s, humidity: \d+%, pressure: \d+ hPa, cloudiness: \d+%' ...
Revert "Fix openweather unit tests" This reverts commit 36e100e649f0a337228a6d7375358d23afd544ff. Open Weather Map has reverted back to their old api or something like that... # -*- coding: utf-8 -*- import bot_mock from pyfibot.modules import module_openweather from utils import check_re bot = bot_mock.BotMock() ...
c600d1e1ad3cef69f6028afd64e14a04c747e1c6
tests/test_install.py
tests/test_install.py
import sys import os from subprocess import check_call from pew._utils import invoke_pew as invoke from utils import skip_windows, connection_required import pytest def skip_marker(f): return skip_windows(reason='Pythonz unavailable in Windows')( pytest.mark.skipif( sys.platform == 'cygwin', ...
import sys import os from subprocess import check_call from pew._utils import invoke_pew as invoke from utils import skip_windows, connection_required import pytest def skip_marker(f): return skip_windows(reason='Pythonz unavailable in Windows')( pytest.mark.skipif( sys.platform == 'cygwin', ...
Replace version of Python to install in test_{un,}install test
Replace version of Python to install in test_{un,}install test PyPy 2.6.1's download link is not working anymore.
Python
mit
berdario/pew,berdario/pew
import sys import os from subprocess import check_call from pew._utils import invoke_pew as invoke from utils import skip_windows, connection_required import pytest def skip_marker(f): return skip_windows(reason='Pythonz unavailable in Windows')( pytest.mark.skipif( sys.platform == 'cygwin', ...
Replace version of Python to install in test_{un,}install test PyPy 2.6.1's download link is not working anymore. import sys import os from subprocess import check_call from pew._utils import invoke_pew as invoke from utils import skip_windows, connection_required import pytest def skip_marker(f): return skip_wi...
1065f63e29c9b31f55ed1986c409fc85f1aa26e3
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Aparajita Fishman # Copyright (c) 2013 Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter-contrib-json # License: MIT # """This module exports the JSON plugin linter class.""" import json ...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Aparajita Fishman # Copyright (c) 2013 Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter-contrib-json # License: MIT # """This module exports the JSON plugin linter class.""" import json ...
Change 'language' to 'syntax', that is more precise terminology.
Change 'language' to 'syntax', that is more precise terminology.
Python
mit
SublimeLinter/SublimeLinter-json
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Aparajita Fishman # Copyright (c) 2013 Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter-contrib-json # License: MIT # """This module exports the JSON plugin linter class.""" import json ...
Change 'language' to 'syntax', that is more precise terminology. # # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Aparajita Fishman # Copyright (c) 2013 Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter-contrib-json # License: MIT # """...
945baec1540ff72b85b3d0563511d93cb33d660e
nbgrader/tests/formgrader/fakeuser.py
nbgrader/tests/formgrader/fakeuser.py
import os from jupyterhub.auth import LocalAuthenticator from jupyterhub.spawner import LocalProcessSpawner from tornado import gen class FakeUserAuth(LocalAuthenticator): """Authenticate fake users""" @gen.coroutine def authenticate(self, handler, data): """If the user is on the whitelist, authe...
import os from jupyterhub.auth import LocalAuthenticator from jupyterhub.spawner import LocalProcessSpawner from tornado import gen class FakeUserAuth(LocalAuthenticator): """Authenticate fake users""" @gen.coroutine def authenticate(self, handler, data): """If the user is on the whitelist, authe...
Remove os.setpgrp() from fake spawner
Remove os.setpgrp() from fake spawner
Python
bsd-3-clause
jhamrick/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jupyter/nbgrader
import os from jupyterhub.auth import LocalAuthenticator from jupyterhub.spawner import LocalProcessSpawner from tornado import gen class FakeUserAuth(LocalAuthenticator): """Authenticate fake users""" @gen.coroutine def authenticate(self, handler, data): """If the user is on the whitelist, authe...
Remove os.setpgrp() from fake spawner import os from jupyterhub.auth import LocalAuthenticator from jupyterhub.spawner import LocalProcessSpawner from tornado import gen class FakeUserAuth(LocalAuthenticator): """Authenticate fake users""" @gen.coroutine def authenticate(self, handler, data): ""...
f9b079b7956419ec324234dbad11d073bed70dd8
users/views.py
users/views.py
from django.shortcuts import redirect from rest_framework import viewsets from .models import User from .permissions import IsUserOrReadOnly from .serializers import AuthenticatedUserSerializer, UserSerializer class UserViewSet(viewsets.ModelViewSet): """API endpoint for viewing and editing users.""" query...
from django.shortcuts import redirect from rest_framework import viewsets from .models import User from .permissions import IsUserOrReadOnly from .serializers import AuthenticatedUserSerializer, UserSerializer class UserViewSet(viewsets.ModelViewSet): """API endpoint for viewing and editing users.""" query...
Use Python 3 style for super
Use Python 3 style for super
Python
bsd-3-clause
FreeMusicNinja/api.freemusic.ninja
from django.shortcuts import redirect from rest_framework import viewsets from .models import User from .permissions import IsUserOrReadOnly from .serializers import AuthenticatedUserSerializer, UserSerializer class UserViewSet(viewsets.ModelViewSet): """API endpoint for viewing and editing users.""" query...
Use Python 3 style for super from django.shortcuts import redirect from rest_framework import viewsets from .models import User from .permissions import IsUserOrReadOnly from .serializers import AuthenticatedUserSerializer, UserSerializer class UserViewSet(viewsets.ModelViewSet): """API endpoint for viewing an...
97229a7e51279906254a7befa0456a4c89a9b0ea
planner/models.py
planner/models.py
from django.db import models # Route model # Start and end locations with additional stop-overs class Route(models.Model): origin = models.CharField(max_length=63) destination = models.CharField(max_length=63) class Waypoint(models.Model): waypoint = models.CharField(max_length=63) route = models.Fo...
from django.db import models # Route model # Start and end locations with additional stop-overs class Route(models.Model): origin = models.CharField(max_length=63) destination = models.CharField(max_length=63) def __unicode__(self): return "{} to {}".format( self.origin, s...
Add unicode methods to model classes
Add unicode methods to model classes
Python
apache-2.0
jwarren116/RoadTrip,jwarren116/RoadTrip,jwarren116/RoadTrip
from django.db import models # Route model # Start and end locations with additional stop-overs class Route(models.Model): origin = models.CharField(max_length=63) destination = models.CharField(max_length=63) def __unicode__(self): return "{} to {}".format( self.origin, s...
Add unicode methods to model classes from django.db import models # Route model # Start and end locations with additional stop-overs class Route(models.Model): origin = models.CharField(max_length=63) destination = models.CharField(max_length=63) class Waypoint(models.Model): waypoint = models.CharFiel...
56cdcde184b613dabdcc3f999b90915f75e03726
tests/backends/__init__.py
tests/backends/__init__.py
from mopidy.models import Track class BaseCurrentPlaylistControllerTest(object): uris = [] backend_class = None def setUp(self): self.backend = self.backend_class() def test_add(self): playlist = self.backend.current_playlist for uri in self.uris: playlist.add(uri...
from mopidy.models import Track class BaseCurrentPlaylistControllerTest(object): uris = [] backend_class = None def setUp(self): self.backend = self.backend_class() def test_add(self): playlist = self.backend.current_playlist for uri in self.uris: playlist.add(uri...
Update test to check basic case for playback without current track
Update test to check basic case for playback without current track
Python
apache-2.0
hkariti/mopidy,mopidy/mopidy,abarisain/mopidy,quartz55/mopidy,ZenithDK/mopidy,quartz55/mopidy,priestd09/mopidy,diandiankan/mopidy,dbrgn/mopidy,diandiankan/mopidy,SuperStarPL/mopidy,adamcik/mopidy,rawdlite/mopidy,liamw9534/mopidy,pacificIT/mopidy,jcass77/mopidy,bencevans/mopidy,mokieyue/mopidy,swak/mopidy,bacontext/mopi...
from mopidy.models import Track class BaseCurrentPlaylistControllerTest(object): uris = [] backend_class = None def setUp(self): self.backend = self.backend_class() def test_add(self): playlist = self.backend.current_playlist for uri in self.uris: playlist.add(uri...
Update test to check basic case for playback without current track from mopidy.models import Track class BaseCurrentPlaylistControllerTest(object): uris = [] backend_class = None def setUp(self): self.backend = self.backend_class() def test_add(self): playlist = self.backend.current_...
12e9814d0225960450bb7cf0fc80502cef13195b
rewind/test/test_code.py
rewind/test/test_code.py
"""Test code format and coding standards.""" import importlib import inspect import pkgutil import unittest def setUpModule(): global modules modules = [name for _, name, ispkg in pkgutil.walk_packages(['rewind'], 'rewind.') if not...
Test that asserts all public classes have pydoc
Test that asserts all public classes have pydoc
Python
agpl-3.0
JensRantil/rewind,JensRantil/rewind-client
"""Test code format and coding standards.""" import importlib import inspect import pkgutil import unittest def setUpModule(): global modules modules = [name for _, name, ispkg in pkgutil.walk_packages(['rewind'], 'rewind.') if not...
Test that asserts all public classes have pydoc
f84ba2d213636482951553cc453b33a4bac8541f
pytest_doctest_custom.py
pytest_doctest_custom.py
"""Py.test doctest custom plugin""" # By Danilo J. S. Bellini import sys, functools def printer(value): """Prints the object representation using the given custom formatter.""" if value is not None: print(printer.repr(value)) # This attribute has to be set elsewhere def temp_replace(obj, attr_name, va...
Create the plugin based on PyScanPrev conftest.py
Create the plugin based on PyScanPrev conftest.py
Python
mit
danilobellini/pytest-doctest-custom
"""Py.test doctest custom plugin""" # By Danilo J. S. Bellini import sys, functools def printer(value): """Prints the object representation using the given custom formatter.""" if value is not None: print(printer.repr(value)) # This attribute has to be set elsewhere def temp_replace(obj, attr_name, va...
Create the plugin based on PyScanPrev conftest.py
d82b1f9d7334c1cd976624788da785a87cd5db8a
functional/tests/volume/v1/test_qos.py
functional/tests/volume/v1/test_qos.py
# 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 applicable law or agreed to in writing, software # d...
Add functional tests for volume qos
Add functional tests for volume qos Change-Id: I80010b56b399bc027ac864304be60a3ee53bda00
Python
apache-2.0
openstack/python-openstackclient,redhat-openstack/python-openstackclient,BjoernT/python-openstackclient,BjoernT/python-openstackclient,openstack/python-openstackclient,dtroyer/python-openstackclient,redhat-openstack/python-openstackclient,dtroyer/python-openstackclient
# 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 applicable law or agreed to in writing, software # d...
Add functional tests for volume qos Change-Id: I80010b56b399bc027ac864304be60a3ee53bda00
9cfe03ab06f126406a51c0945e990fc849d8dfb9
scripts/crontab/gen-crons.py
scripts/crontab/gen-crons.py
#!/usr/bin/env python import os from optparse import OptionParser from jinja2 import Template TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read() def main(): parser = OptionParser() parser.add_option("-k", "--kitsune", help="Location of kitsune (required)") ...
#!/usr/bin/env python import os from optparse import OptionParser from jinja2 import Template TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read() def main(): parser = OptionParser() parser.add_option("-k", "--kitsune", help="Location of kitsune (required)") ...
Add local site-packages to PYTHONPATH.
Add local site-packages to PYTHONPATH. To pick up the local version of PyOpenSSL.
Python
bsd-3-clause
philipp-sumo/kitsune,iDTLabssl/kitsune,orvi2014/kitsune,silentbob73/kitsune,NewPresident1/kitsune,MziRintu/kitsune,YOTOV-LIMITED/kitsune,iDTLabssl/kitsune,YOTOV-LIMITED/kitsune,safwanrahman/kitsune,silentbob73/kitsune,safwanrahman/linuxdesh,mythmon/kitsune,YOTOV-LIMITED/kitsune,iDTLabssl/kitsune,turtleloveshoes/kitsune...
#!/usr/bin/env python import os from optparse import OptionParser from jinja2 import Template TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read() def main(): parser = OptionParser() parser.add_option("-k", "--kitsune", help="Location of kitsune (required)") ...
Add local site-packages to PYTHONPATH. To pick up the local version of PyOpenSSL. #!/usr/bin/env python import os from optparse import OptionParser from jinja2 import Template TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read() def main(): parser = OptionParser() parser.add_opt...
bdeb28f2f7840c04dbf65b6c0771c121f229e59a
tests.py
tests.py
#!/usr/bin/env python import sys import os import unittest from straight.plugin.loader import StraightPluginLoader class PluginTestCase(unittest.TestCase): def setUp(self): self.loader = StraightPluginLoader() self.added_path = os.path.join(os.path.dirname(__file__), 'more-test-plugins') ...
#!/usr/bin/env python import sys import os import unittest from straight.plugin.loader import StraightPluginLoader class PluginTestCase(unittest.TestCase): def setUp(self): self.loader = StraightPluginLoader() sys.path.append(os.path.join(os.path.dirname(__file__), 'more-test-plugins')) ...
Fix test case for multiple locations of a namespace
Fix test case for multiple locations of a namespace
Python
mit
ironfroggy/straight.plugin,pombredanne/straight.plugin
#!/usr/bin/env python import sys import os import unittest from straight.plugin.loader import StraightPluginLoader class PluginTestCase(unittest.TestCase): def setUp(self): self.loader = StraightPluginLoader() sys.path.append(os.path.join(os.path.dirname(__file__), 'more-test-plugins')) ...
Fix test case for multiple locations of a namespace #!/usr/bin/env python import sys import os import unittest from straight.plugin.loader import StraightPluginLoader class PluginTestCase(unittest.TestCase): def setUp(self): self.loader = StraightPluginLoader() self.added_path = os.path.join(o...
5da30efc6cbbc58db60ba29643c56448b5a79e77
test/test_pipeline/components/test_base.py
test/test_pipeline/components/test_base.py
import unittest from autosklearn.pipeline.components.base import find_components, \ AutoSklearnClassificationAlgorithm class TestBase(unittest.TestCase): def test_find_components(self): c = find_components('dummy_components', 'dummy_components', AutoSklearnClassificationA...
import os import sys import unittest from autosklearn.pipeline.components.base import find_components, \ AutoSklearnClassificationAlgorithm this_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(this_dir) class TestBase(unittest.TestCase): def test_find_components(self): c = find_com...
FIX fix unit test by fixing import paths
FIX fix unit test by fixing import paths
Python
bsd-3-clause
automl/auto-sklearn,automl/auto-sklearn
import os import sys import unittest from autosklearn.pipeline.components.base import find_components, \ AutoSklearnClassificationAlgorithm this_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(this_dir) class TestBase(unittest.TestCase): def test_find_components(self): c = find_com...
FIX fix unit test by fixing import paths import unittest from autosklearn.pipeline.components.base import find_components, \ AutoSklearnClassificationAlgorithm class TestBase(unittest.TestCase): def test_find_components(self): c = find_components('dummy_components', 'dummy_components', ...
29e9d3a5fbac2730acd4c2115399556b09fb83e5
tools/psycopg2_experiment.py
tools/psycopg2_experiment.py
#!/usr/bin/env python ''' A CLI tool for formulating an Abba url using data from PostgreSQL ''' from __future__ import print_function import argparse import psycopg2 import sys TOOL_DESCRIPTION = ''' Formulates an Abba url using data from PostgreSQL The query passed to this tool should return three columns, which ...
Add tool for pulling data from PostgreSQL to Abba
Add tool for pulling data from PostgreSQL to Abba
Python
bsd-3-clause
thumbtack/abba,thii/abbajs,thumbtack/abba,thumbtack/abba
#!/usr/bin/env python ''' A CLI tool for formulating an Abba url using data from PostgreSQL ''' from __future__ import print_function import argparse import psycopg2 import sys TOOL_DESCRIPTION = ''' Formulates an Abba url using data from PostgreSQL The query passed to this tool should return three columns, which ...
Add tool for pulling data from PostgreSQL to Abba
384e2fd9ae794e182dfdf4072d2689cff5f5d91d
log4django/routers.py
log4django/routers.py
from .settings import CONNECTION_NAME class Log4DjangoRouter(object): def db_for_read(self, model, **hints): if model._meta.app_label == 'log4django': return CONNECTION_NAME return None def db_for_write(self, model, **hints): if model._meta.app_label == 'log4django': ...
from .settings import CONNECTION_NAME class Log4DjangoRouter(object): def db_for_read(self, model, **hints): if model._meta.app_label == 'log4django': return CONNECTION_NAME return None def db_for_write(self, model, **hints): if model._meta.app_label == 'log4django': ...
Fix syncdb in database router
Fix syncdb in database router
Python
bsd-3-clause
CodeScaleInc/log4django,CodeScaleInc/log4django,CodeScaleInc/log4django
from .settings import CONNECTION_NAME class Log4DjangoRouter(object): def db_for_read(self, model, **hints): if model._meta.app_label == 'log4django': return CONNECTION_NAME return None def db_for_write(self, model, **hints): if model._meta.app_label == 'log4django': ...
Fix syncdb in database router from .settings import CONNECTION_NAME class Log4DjangoRouter(object): def db_for_read(self, model, **hints): if model._meta.app_label == 'log4django': return CONNECTION_NAME return None def db_for_write(self, model, **hints): if model._meta.a...
28e9129a71cac0ab60071d6e2a6bd258312703a8
example_script3.py
example_script3.py
""" Usage: python -m recipy example_script3.py OUTPUT.npy """ from __future__ import print_function import sys import numpy if len(sys.argv) < 2: print(__doc__, file=sys.stderr) sys.exit(1) arr = numpy.arange(10) arr = arr + 500 # We've made a fairly big change here! numpy.save(sys.argv[1], arr)
Add example script for python -m recipy usage
Add example script for python -m recipy usage
Python
apache-2.0
github4ry/recipy,musically-ut/recipy,github4ry/recipy,MBARIMike/recipy,MichielCottaar/recipy,MBARIMike/recipy,recipy/recipy,recipy/recipy,MichielCottaar/recipy,musically-ut/recipy
""" Usage: python -m recipy example_script3.py OUTPUT.npy """ from __future__ import print_function import sys import numpy if len(sys.argv) < 2: print(__doc__, file=sys.stderr) sys.exit(1) arr = numpy.arange(10) arr = arr + 500 # We've made a fairly big change here! numpy.save(sys.argv[1], arr)
Add example script for python -m recipy usage
40af69656b71cda7f775cface3478106f070ed35
numba/__init__.py
numba/__init__.py
import sys import logging # NOTE: Be sure to keep the logging level commented out before commiting. See: # https://github.com/numba/numba/issues/31 # A good work around is to make your tests handle a debug flag, per # numba.tests.test_support.main(). logging.basicConfig(#level=logging.DEBUG, for...
import sys import logging # NOTE: Be sure to keep the logging level commented out before commiting. See: # https://github.com/numba/numba/issues/31 # A good work around is to make your tests handle a debug flag, per # numba.tests.test_support.main(). class _RedirectingHandler(logging.Handler): ''' A log ha...
Update logging facility. Don't overide root logger with basicConfig.
Update logging facility. Don't overide root logger with basicConfig.
Python
bsd-2-clause
numba/numba,stefanseefeld/numba,pitrou/numba,stonebig/numba,ssarangi/numba,ssarangi/numba,seibert/numba,gmarkall/numba,seibert/numba,pombredanne/numba,sklam/numba,shiquanwang/numba,stefanseefeld/numba,cpcloud/numba,gmarkall/numba,numba/numba,jriehl/numba,cpcloud/numba,seibert/numba,jriehl/numba,jriehl/numba,pitrou/numb...
import sys import logging # NOTE: Be sure to keep the logging level commented out before commiting. See: # https://github.com/numba/numba/issues/31 # A good work around is to make your tests handle a debug flag, per # numba.tests.test_support.main(). class _RedirectingHandler(logging.Handler): ''' A log ha...
Update logging facility. Don't overide root logger with basicConfig. import sys import logging # NOTE: Be sure to keep the logging level commented out before commiting. See: # https://github.com/numba/numba/issues/31 # A good work around is to make your tests handle a debug flag, per # numba.tests.test_support.ma...
6a17674897bbb3a44fb2153967e3985dfdb3d5df
zounds/learn/graph.py
zounds/learn/graph.py
import featureflow as ff from random_samples import ShuffledSamples from random_samples import InfiniteSampler from preprocess import PreprocessingPipeline def learning_pipeline(): class LearningPipeline(ff.BaseModel): samples = ff.PickleFeature(ff.IteratorNode) shuffled = ff.PickleFeature( ...
import featureflow as ff from random_samples import ShuffledSamples from random_samples import InfiniteSampler from preprocess import PreprocessingPipeline def learning_pipeline(): class LearningPipeline(ff.BaseModel): samples = ff.PickleFeature(ff.IteratorNode) shuffled = ff.PickleFeature( ...
Add a new option allowing client code to turn off parallelism
Add a new option allowing client code to turn off parallelism
Python
mit
JohnVinyard/zounds,JohnVinyard/zounds,JohnVinyard/zounds,JohnVinyard/zounds
import featureflow as ff from random_samples import ShuffledSamples from random_samples import InfiniteSampler from preprocess import PreprocessingPipeline def learning_pipeline(): class LearningPipeline(ff.BaseModel): samples = ff.PickleFeature(ff.IteratorNode) shuffled = ff.PickleFeature( ...
Add a new option allowing client code to turn off parallelism import featureflow as ff from random_samples import ShuffledSamples from random_samples import InfiniteSampler from preprocess import PreprocessingPipeline def learning_pipeline(): class LearningPipeline(ff.BaseModel): samples = ff.PickleFeatu...
47c1dfd602281c56973de0d8afe64b923eb29592
test/test_env.py
test/test_env.py
from _ebcf_alexa import env from unittest.mock import patch, call import pytest @pytest.yield_fixture def mock_now(): with patch.object(env, 'now') as now: yield now @patch('datetime.datetime') def test_now_is_utc(fake_datetime): assert env.now() assert fake_datetime.now.call_args == call(tz=env...
Add unit tests for env module.
Add unit tests for env module. These are pretty simple - just tests wiring to datetime and pytz
Python
mit
dmotles/ebcf-alexa
from _ebcf_alexa import env from unittest.mock import patch, call import pytest @pytest.yield_fixture def mock_now(): with patch.object(env, 'now') as now: yield now @patch('datetime.datetime') def test_now_is_utc(fake_datetime): assert env.now() assert fake_datetime.now.call_args == call(tz=env...
Add unit tests for env module. These are pretty simple - just tests wiring to datetime and pytz
2eb8dfdfdc31c5315546ff7c89cd59f8d6cb4727
tacker/__init__.py
tacker/__init__.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # 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.apach...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # 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.apach...
Fix gettext wrong argument error in py34
Fix gettext wrong argument error in py34 Closes-Bug: #1550202 Change-Id: I468bef7a8c0a9fa93576744e7869dfa5f2569fa0
Python
apache-2.0
priya-pp/Tacker,openstack/tacker,zeinsteinz/tacker,trozet/tacker,priya-pp/Tacker,stackforge/tacker,openstack/tacker,trozet/tacker,openstack/tacker,stackforge/tacker,zeinsteinz/tacker
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # 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.apach...
Fix gettext wrong argument error in py34 Closes-Bug: #1550202 Change-Id: I468bef7a8c0a9fa93576744e7869dfa5f2569fa0 # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this ...
4e6458bddec9758da609c681a0ea05b43c399f50
bot/multithreading/worker/pool/workers/main.py
bot/multithreading/worker/pool/workers/main.py
import queue from bot.multithreading.work import Work from bot.multithreading.worker import QueueWorker from bot.multithreading.worker.pool.name_generator import WorkerPoolNameGenerator from bot.multithreading.worker.pool.spawner import WorkerSpawner class QueueWorkerPool(QueueWorker): def __init__(self, base_na...
Create a worker pool to handle pool of workers that can grow or shrink as necessary
Create a worker pool to handle pool of workers that can grow or shrink as necessary
Python
agpl-3.0
alvarogzp/telegram-bot,alvarogzp/telegram-bot
import queue from bot.multithreading.work import Work from bot.multithreading.worker import QueueWorker from bot.multithreading.worker.pool.name_generator import WorkerPoolNameGenerator from bot.multithreading.worker.pool.spawner import WorkerSpawner class QueueWorkerPool(QueueWorker): def __init__(self, base_na...
Create a worker pool to handle pool of workers that can grow or shrink as necessary
0097f33900b6d75df38b28012a1e09fb03e22326
driller/tasks.py
driller/tasks.py
import redis from celery import Celery from .driller import Driller app = Celery('tasks', broker='amqp://guest@localhost//', backend='redis://localhost') redis_pool = redis.ConnectionPool(host='localhost', port=6379, db=1) @app.task def drill(binary, input, out_dir, fuzz_bitmap, qemu_dir): redis_inst = redis.Red...
import redis from celery import Celery from .driller import Driller app = Celery('tasks', broker='amqp://guest@localhost//', backend='redis://localhost') redis_pool = redis.ConnectionPool(host='localhost', port=6379, db=1) @app.task def drill(binary, input, fuzz_bitmap, qemu_dir): redis_inst = redis.Redis(connec...
Remove out_dir from the drill task's list of arguments
Remove out_dir from the drill task's list of arguments
Python
bsd-2-clause
shellphish/driller
import redis from celery import Celery from .driller import Driller app = Celery('tasks', broker='amqp://guest@localhost//', backend='redis://localhost') redis_pool = redis.ConnectionPool(host='localhost', port=6379, db=1) @app.task def drill(binary, input, fuzz_bitmap, qemu_dir): redis_inst = redis.Redis(connec...
Remove out_dir from the drill task's list of arguments import redis from celery import Celery from .driller import Driller app = Celery('tasks', broker='amqp://guest@localhost//', backend='redis://localhost') redis_pool = redis.ConnectionPool(host='localhost', port=6379, db=1) @app.task def drill(binary, input, out...
cd2ff46284a8144755b880c035d0a89938474955
salt/grains/extra.py
salt/grains/extra.py
# -*- coding: utf-8 -*- from __future__ import absolute_import # Import python libs import os # Import third party libs import yaml import logging # Import salt libs import salt.utils.files log = logging.getLogger(__name__) def shell(): ''' Return the default shell to use on this system ''' # Pro...
# -*- coding: utf-8 -*- from __future__ import absolute_import # Import python libs import os # Import third party libs import yaml import logging # Import salt libs import salt.utils.files import salt.utils.platform log = logging.getLogger(__name__) def shell(): ''' Return the default shell to use on th...
Return COMSPEC as the shell for Windows
Return COMSPEC as the shell for Windows
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
# -*- coding: utf-8 -*- from __future__ import absolute_import # Import python libs import os # Import third party libs import yaml import logging # Import salt libs import salt.utils.files import salt.utils.platform log = logging.getLogger(__name__) def shell(): ''' Return the default shell to use on th...
Return COMSPEC as the shell for Windows # -*- coding: utf-8 -*- from __future__ import absolute_import # Import python libs import os # Import third party libs import yaml import logging # Import salt libs import salt.utils.files log = logging.getLogger(__name__) def shell(): ''' Return the default shel...
8e0cf99380b284ff4f7b962f622933c243828be7
setup.py
setup.py
from setuptools import setup, find_packages setup( name="django-posgtres-geometry", version="0.1.2", packages=find_packages(), install_requires=['django', 'psycopg2'], description="Django ORM field for Postgres geometry types", author="Daniele Esposti", author_email="expo@expobrain.net", ...
from setuptools import setup, find_packages setup( name="django-postgres-geometry", version="0.1.2", packages=find_packages(), install_requires=['django', 'psycopg2'], description="Django ORM field for Postgres geometry types", author="Daniele Esposti", author_email="expo@expobrain.net", ...
Fix typo in package name
Fix typo in package name
Python
mit
team23/django-postgres-geometry
from setuptools import setup, find_packages setup( name="django-postgres-geometry", version="0.1.2", packages=find_packages(), install_requires=['django', 'psycopg2'], description="Django ORM field for Postgres geometry types", author="Daniele Esposti", author_email="expo@expobrain.net", ...
Fix typo in package name from setuptools import setup, find_packages setup( name="django-posgtres-geometry", version="0.1.2", packages=find_packages(), install_requires=['django', 'psycopg2'], description="Django ORM field for Postgres geometry types", author="Daniele Esposti", author_ema...
5b7b301c3f9dd906b8450acc5b28dbcb35fe973a
candidates/management/commands/candidates_fix_not_standing.py
candidates/management/commands/candidates_fix_not_standing.py
from __future__ import print_function, unicode_literals from django.core.management.base import BaseCommand from popolo.models import Membership from candidates.models import PersonExtra class Command(BaseCommand): help = "Find elections in not_standing that should be removed" def add_arguments(self, pars...
Add a script to fix the not_standing relationships of people
Add a script to fix the not_standing relationships of people There was a bug in bulk adding people which meant that their "not_standing" status for an election wasn't removed when reinstating them as a candidate in that election. That bug has been fixed in the parent commit, but there are still people in the database...
Python
agpl-3.0
DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative
from __future__ import print_function, unicode_literals from django.core.management.base import BaseCommand from popolo.models import Membership from candidates.models import PersonExtra class Command(BaseCommand): help = "Find elections in not_standing that should be removed" def add_arguments(self, pars...
Add a script to fix the not_standing relationships of people There was a bug in bulk adding people which meant that their "not_standing" status for an election wasn't removed when reinstating them as a candidate in that election. That bug has been fixed in the parent commit, but there are still people in the database...
7f05b622ab6cb1202d2d00ec1bcac2c5bbb326b7
dthm4kaiako/config/__init__.py
dthm4kaiako/config/__init__.py
"""Configuration for Django system.""" __version__ = "0.9.2" __version_info__ = tuple( [ int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".") ] )
"""Configuration for Django system.""" __version__ = "0.9.3" __version_info__ = tuple( [ int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".") ] )
Increment version number to 0.9.3
Increment version number to 0.9.3
Python
mit
uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers
"""Configuration for Django system.""" __version__ = "0.9.3" __version_info__ = tuple( [ int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".") ] )
Increment version number to 0.9.3 """Configuration for Django system.""" __version__ = "0.9.2" __version_info__ = tuple( [ int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".") ] )
3364747195f0f3d2711169fb92c250fc10823d82
default_settings.py
default_settings.py
# Copyright 2014 0xc0170 # # 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 applicable law or agreed to in writing, soft...
# Copyright 2014 0xc0170 # # 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 applicable law or agreed to in writing, soft...
Add message if you're using default settings
Add message if you're using default settings
Python
apache-2.0
0xc0170/valinor,sarahmarshy/project_generator,autopulated/valinor,ARMmbed/valinor,sg-/project_generator,ohagendorf/project_generator,molejar/project_generator,aethaniel/project_generator,0xc0170/project_generator,sg-/project_generator,project-generator/project_generator,hwfwgrp/project_generator
# Copyright 2014 0xc0170 # # 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 applicable law or agreed to in writing, soft...
Add message if you're using default settings # Copyright 2014 0xc0170 # # 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 b...
759f6a2e4ced9ce9beeda01e638f109d946050b1
server/migrations/0006_auto_20150811_0811.py
server/migrations/0006_auto_20150811_0811.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('server', '0005_auto_20150717_1827'), ] operations = [ migrations.AddField( model_name='machine', nam...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import get_object_or_404 from django.db import models, migrations def add_initial_date(apps, schema_editor): Machine = apps.get_model("server", "Machine") for machine in Machine.objects.all(): if not machine.first_che...
Add in the first checkin date if it doesn't exist
Add in the first checkin date if it doesn't exist
Python
apache-2.0
sheagcraig/sal,salopensource/sal,salopensource/sal,macjustice/sal,chasetb/sal,salopensource/sal,sheagcraig/sal,erikng/sal,macjustice/sal,erikng/sal,chasetb/sal,chasetb/sal,erikng/sal,macjustice/sal,macjustice/sal,sheagcraig/sal,erikng/sal,sheagcraig/sal,chasetb/sal,salopensource/sal
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import get_object_or_404 from django.db import models, migrations def add_initial_date(apps, schema_editor): Machine = apps.get_model("server", "Machine") for machine in Machine.objects.all(): if not machine.first_che...
Add in the first checkin date if it doesn't exist # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('server', '0005_auto_20150717_1827'), ] operations = [ migrations.AddField...
264075d9b313f5c2677e32fcf5d340bba73f0b0e
corehq/apps/app_manager/migrations/0019_exchangeapplication_required_privileges.py
corehq/apps/app_manager/migrations/0019_exchangeapplication_required_privileges.py
# Generated by Django 2.2.24 on 2021-09-13 21:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app_manager', '0018_migrate_case_search_labels'), ] operations = [ migrations.AddField( model_name='exchangeapplication', ...
# Generated by Django 2.2.24 on 2021-09-14 17:54 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app_manager', '0018_migrate_case_search_labels'), ] operations = [ migrations.AddField( model_name='exchangeapplication', ...
Fix migration with help text
Fix migration with help text
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
# Generated by Django 2.2.24 on 2021-09-14 17:54 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app_manager', '0018_migrate_case_search_labels'), ] operations = [ migrations.AddField( model_name='exchangeapplication', ...
Fix migration with help text # Generated by Django 2.2.24 on 2021-09-13 21:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app_manager', '0018_migrate_case_search_labels'), ] operations = [ migrations.AddField( model_nam...
0c3529bd264d5512e31d828c65676baff6edefa6
pinax/waitinglist/templatetags/pinax_waitinglist_tags.py
pinax/waitinglist/templatetags/pinax_waitinglist_tags.py
from django import template from ..forms import WaitingListEntryForm register = template.Library() @register.assignment_tag def waitinglist_entry_form(): """ Get a (new) form object to post a new comment. Syntax:: {% waitinglist_entry_form as [varname] %} """ return WaitingListEntryF...
from django import template from ..forms import WaitingListEntryForm register = template.Library() @register.simple_tag(takes_context=True) def waitinglist_entry_form(context): """ Get a (new) form object to post a new comment. Syntax:: {% waitinglist_entry_form as [varname] %} """ i...
Update template tag to also take context
Update template tag to also take context
Python
mit
pinax/pinax-waitinglist,pinax/pinax-waitinglist
from django import template from ..forms import WaitingListEntryForm register = template.Library() @register.simple_tag(takes_context=True) def waitinglist_entry_form(context): """ Get a (new) form object to post a new comment. Syntax:: {% waitinglist_entry_form as [varname] %} """ i...
Update template tag to also take context from django import template from ..forms import WaitingListEntryForm register = template.Library() @register.assignment_tag def waitinglist_entry_form(): """ Get a (new) form object to post a new comment. Syntax:: {% waitinglist_entry_form as [varname...
be3ee0a06ec350431e66efbcbcead28075056f55
django_extensions/tests/models.py
django_extensions/tests/models.py
from django.db import models try: from django_extensions.db.fields.encrypted import EncryptedTextField, EncryptedCharField except ImportError: class EncryptedCharField(): def __init__(self, **kwargs): pass; class EncryptedTextField(): def __init__(self, **kwargs): ...
from django.db import models try: from django_extensions.db.fields.encrypted import EncryptedTextField, EncryptedCharField except ImportError: class EncryptedCharField(): def __init__(self, **kwargs): pass class EncryptedTextField(): def __init__(self, **kwargs): ...
Remove bogus semicolons, thanks justinlilly
Remove bogus semicolons, thanks justinlilly
Python
mit
django-extensions/django-extensions,levic/django-extensions,linuxmaniac/django-extensions,kevgathuku/django-extensions,ewjoachim/django-extensions,joeyespo/django-extensions,Christophe31/django-extensions,Moulde/django-extensions,nikolas/django-extensions,barseghyanartur/django-extensions,atchariya/django-extensions,fr...
from django.db import models try: from django_extensions.db.fields.encrypted import EncryptedTextField, EncryptedCharField except ImportError: class EncryptedCharField(): def __init__(self, **kwargs): pass class EncryptedTextField(): def __init__(self, **kwargs): ...
Remove bogus semicolons, thanks justinlilly from django.db import models try: from django_extensions.db.fields.encrypted import EncryptedTextField, EncryptedCharField except ImportError: class EncryptedCharField(): def __init__(self, **kwargs): pass; class EncryptedTextField(): ...
e233352d5016c2b57ec4edbc4366ca4347bc1d98
demo/start_servers.py
demo/start_servers.py
""" start_servers.py <Purpose> A simple script to start the three cloud-side Uptane servers: the Director (including its per-vehicle repositories) the Image Repository the Timeserver To run the demo services in non-interactive mode, run: python start_servers.py To run the demo services in inter...
Create a single script to run the three demo services
DEMO: Create a single script to run the three demo services (image repo, director, and timeserver)
Python
mit
uptane/uptane,awwad/uptane,awwad/uptane,uptane/uptane
""" start_servers.py <Purpose> A simple script to start the three cloud-side Uptane servers: the Director (including its per-vehicle repositories) the Image Repository the Timeserver To run the demo services in non-interactive mode, run: python start_servers.py To run the demo services in inter...
DEMO: Create a single script to run the three demo services (image repo, director, and timeserver)
a96046b4b7372cb942509b5e9778d54124319617
bin/rofi_menu.py
bin/rofi_menu.py
from typing import Dict, Callable from rofi import Rofi def menu(r: Rofi, prompt: str, options: Dict[str, Callable], *args, **kwargs): """ Create a menu using rofi to execute on of some options, all args not documented are passed directly into Rofi.select :param options: A dict of strings to show o...
Add a common helper for selection menus
[rofi] Add a common helper for selection menus
Python
mit
mpardalos/dotfiles,mpardalos/dotfiles
from typing import Dict, Callable from rofi import Rofi def menu(r: Rofi, prompt: str, options: Dict[str, Callable], *args, **kwargs): """ Create a menu using rofi to execute on of some options, all args not documented are passed directly into Rofi.select :param options: A dict of strings to show o...
[rofi] Add a common helper for selection menus
e435592d64dbd4f75a7cc9d1ac8bb17ab4177a2b
erpnext/patches/v4_2/default_website_style.py
erpnext/patches/v4_2/default_website_style.py
import frappe from frappe.templates.pages.style_settings import default_properties def execute(): style_settings = frappe.get_doc("Style Settings", "Style Settings") if not style_settings.apply_style: style_settings.update(default_properties) style_settings.apply_style = 1 style_settings.save()
import frappe from frappe.templates.pages.style_settings import default_properties def execute(): frappe.reload_doc('website', 'doctype', 'style_settings') style_settings = frappe.get_doc("Style Settings", "Style Settings") if not style_settings.apply_style: style_settings.update(default_properties) style_setti...
Fix default website style patch (reload doc)
[minor] Fix default website style patch (reload doc)
Python
agpl-3.0
gangadharkadam/saloon_erp,hatwar/buyback-erpnext,gangadharkadam/v6_erp,indictranstech/Das_Erpnext,gangadharkadam/vlinkerp,shft117/SteckerApp,sheafferusa/erpnext,mahabuber/erpnext,hernad/erpnext,suyashphadtare/gd-erp,gangadharkadam/letzerp,indictranstech/internal-erpnext,indictranstech/buyback-erp,4commerce-technologies...
import frappe from frappe.templates.pages.style_settings import default_properties def execute(): frappe.reload_doc('website', 'doctype', 'style_settings') style_settings = frappe.get_doc("Style Settings", "Style Settings") if not style_settings.apply_style: style_settings.update(default_properties) style_setti...
[minor] Fix default website style patch (reload doc) import frappe from frappe.templates.pages.style_settings import default_properties def execute(): style_settings = frappe.get_doc("Style Settings", "Style Settings") if not style_settings.apply_style: style_settings.update(default_properties) style_settings.ap...
182b94f777b1743671b706c939ce14f89c31efca
lint/queue.py
lint/queue.py
from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def hit(self, view): assert self._callback, "Queu...
from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def hit(self, view): assert self._callback, "Queu...
Remove MIN_DELAY bc a default setting is guaranteed
Remove MIN_DELAY bc a default setting is guaranteed
Python
mit
SublimeLinter/SublimeLinter3,SublimeLinter/SublimeLinter3
from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def hit(self, view): assert self._callback, "Queu...
Remove MIN_DELAY bc a default setting is guaranteed from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def ...
8337a3912533dfb7d686a453c53adcda783a50a4
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages from sys import version_info version = "1.3" deps = ["pbs", "requests>=0.12.1"] # require argparse on Python <2.7 and <3.2 if (version_info[0] == 2 and version_info[1] < 7) or \ (version_info[0] == 3 and version_info[1] < 2): deps.append("argpa...
#!/usr/bin/env python from setuptools import setup, find_packages from sys import version_info version = "1.3" deps = ["pbs", "requests>=0.12.1"] # require argparse on Python <2.7 and <3.2 if (version_info[0] == 2 and version_info[1] < 7) or \ (version_info[0] == 3 and version_info[1] < 2): deps.append("argpa...
Add .stream to packages list.
Add .stream to packages list.
Python
bsd-2-clause
gravyboat/streamlink,javiercantero/streamlink,melmorabity/streamlink,asermax/livestreamer,lyhiving/livestreamer,chhe/livestreamer,derrod/livestreamer,gravyboat/streamlink,okaywit/livestreamer,Dobatymo/livestreamer,fishscene/streamlink,sbstp/streamlink,programming086/livestreamer,melmorabity/streamlink,fishscene/streaml...
#!/usr/bin/env python from setuptools import setup, find_packages from sys import version_info version = "1.3" deps = ["pbs", "requests>=0.12.1"] # require argparse on Python <2.7 and <3.2 if (version_info[0] == 2 and version_info[1] < 7) or \ (version_info[0] == 3 and version_info[1] < 2): deps.append("argpa...
Add .stream to packages list. #!/usr/bin/env python from setuptools import setup, find_packages from sys import version_info version = "1.3" deps = ["pbs", "requests>=0.12.1"] # require argparse on Python <2.7 and <3.2 if (version_info[0] == 2 and version_info[1] < 7) or \ (version_info[0] == 3 and version_info[...
0f427ed334f8a58e888872d60419709cfd6f41c3
var/spack/repos/builtin/packages/nccmp/package.py
var/spack/repos/builtin/packages/nccmp/package.py
from spack import * import os class Nccmp(Package): """Compare NetCDF Files""" homepage = "http://nccmp.sourceforge.net/" url = "http://downloads.sourceforge.net/project/nccmp/nccmp-1.8.2.0.tar.gz" version('1.8.2.0', '81e6286d4413825aec4327e61a28a580') depends_on('netcdf') def install(s...
from spack import * class Nccmp(Package): """Compare NetCDF Files""" homepage = "http://nccmp.sourceforge.net/" url = "http://downloads.sourceforge.net/project/nccmp/nccmp-1.8.2.0.tar.gz" version('1.8.2.0', '81e6286d4413825aec4327e61a28a580') depends_on('netcdf') def install(self, spec,...
Tweak nccmp to be more spack-compatible.
Tweak nccmp to be more spack-compatible. - Spack doesn't set F90, but it confuses the nccmp build. Just remove it from the environment. - TODO: should build environment unset this variable?
Python
lgpl-2.1
skosukhin/spack,matthiasdiener/spack,EmreAtes/spack,iulian787/spack,mfherbst/spack,matthiasdiener/spack,iulian787/spack,tmerrick1/spack,TheTimmy/spack,iulian787/spack,EmreAtes/spack,TheTimmy/spack,krafczyk/spack,LLNL/spack,lgarren/spack,TheTimmy/spack,iulian787/spack,iulian787/spack,tmerrick1/spack,lgarren/spack,matthi...
from spack import * class Nccmp(Package): """Compare NetCDF Files""" homepage = "http://nccmp.sourceforge.net/" url = "http://downloads.sourceforge.net/project/nccmp/nccmp-1.8.2.0.tar.gz" version('1.8.2.0', '81e6286d4413825aec4327e61a28a580') depends_on('netcdf') def install(self, spec,...
Tweak nccmp to be more spack-compatible. - Spack doesn't set F90, but it confuses the nccmp build. Just remove it from the environment. - TODO: should build environment unset this variable? from spack import * import os class Nccmp(Package): """Compare NetCDF Files""" homepage = "http://nccmp.sourceforge...
2a30afaea9d4cb1d704fd5ec0d78a946770c1c18
scripts/download-jamendo.py
scripts/download-jamendo.py
#!/usr/bin/env python # Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz import xml.etree.cElementTree as ElementTree import sys, gzip, time, os.path, urllib class DownloadJamendo: def __init__(self, destination): if not os.path.exists(destination): os.m...
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)
Python
agpl-3.0
foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm
#!/usr/bin/env python # Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz import xml.etree.cElementTree as ElementTree import sys, gzip, time, os.path, urllib class DownloadJamendo: def __init__(self, destination): if not os.path.exists(destination): os.m...
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)
9d1dc2ef7db2f883e05286edd3865acfdadc19be
django-oracle-drcp/base.py
django-oracle-drcp/base.py
# pylint: disable=W0401 from django.core.exceptions import ImproperlyConfigured from django.db.backends.oracle.base import * from django.db.backends.oracle.base import DatabaseWrapper as DjDatabaseWrapper import cx_Oracle class DatabaseWrapper(DjDatabaseWrapper): def __init__(self, *args, **kwargs): sup...
# pylint: disable=W0401 from django.core.exceptions import ImproperlyConfigured from django.db.backends.oracle.base import * from django.db.backends.oracle.base import DatabaseWrapper as DjDatabaseWrapper import cx_Oracle class DatabaseWrapper(DjDatabaseWrapper): def __init__(self, *args, **kwargs): sup...
Change variable name consistently to pool_config
Change variable name consistently to pool_config
Python
bsd-2-clause
JohnPapps/django-oracle-drcp
# pylint: disable=W0401 from django.core.exceptions import ImproperlyConfigured from django.db.backends.oracle.base import * from django.db.backends.oracle.base import DatabaseWrapper as DjDatabaseWrapper import cx_Oracle class DatabaseWrapper(DjDatabaseWrapper): def __init__(self, *args, **kwargs): sup...
Change variable name consistently to pool_config # pylint: disable=W0401 from django.core.exceptions import ImproperlyConfigured from django.db.backends.oracle.base import * from django.db.backends.oracle.base import DatabaseWrapper as DjDatabaseWrapper import cx_Oracle class DatabaseWrapper(DjDatabaseWrapper): ...
8be84789d561c916b6d37e61537c4d957061a380
diceserver.py
diceserver.py
#!/usr/bin/env python import random from twisted.protocols import amp port = 1234 _rand = random.Random() class RollDice(amp.Command): arguments = [('sides', amp.Integer())] response = [('result', amp.Integer())] class Dice(amp.AMP): def roll(self, sides=6): """Return a random integer from 1...
#!/usr/bin/env python import random from twisted.protocols import amp from twisted.internet import reactor from twisted.internet.protocol import Factory from twisted.python import usage port = 1234 _rand = random.Random() class Options(usage.Options): optParameters = [ ["port", "p", port, "server port"...
Add command-line option to set port.
Add command-line option to set port.
Python
mit
dripton/ampchat
#!/usr/bin/env python import random from twisted.protocols import amp from twisted.internet import reactor from twisted.internet.protocol import Factory from twisted.python import usage port = 1234 _rand = random.Random() class Options(usage.Options): optParameters = [ ["port", "p", port, "server port"...
Add command-line option to set port. #!/usr/bin/env python import random from twisted.protocols import amp port = 1234 _rand = random.Random() class RollDice(amp.Command): arguments = [('sides', amp.Integer())] response = [('result', amp.Integer())] class Dice(amp.AMP): def roll(self, sides=6): ...
42a287d23a1153df636c193695615d99b7c75e4d
test/stop_all.py
test/stop_all.py
import urbackup_api server = urbackup_api.urbackup_server("http://127.0.0.1:55414/x", "admin", "foo") for action in server.get_actions(): a = action["action"] if a ==server.action_full_file or a==server.action_resumed_full_file: print("Running full file backup: "+action["name"]) ...
Test stopping all running file backups
Test stopping all running file backups
Python
apache-2.0
uroni/urbackup-server-python-web-api-wrapper
import urbackup_api server = urbackup_api.urbackup_server("http://127.0.0.1:55414/x", "admin", "foo") for action in server.get_actions(): a = action["action"] if a ==server.action_full_file or a==server.action_resumed_full_file: print("Running full file backup: "+action["name"]) ...
Test stopping all running file backups
3154ef23b48a42e274417a28953c55b98ac3fec3
filters/png2jpg.py
filters/png2jpg.py
""" Change image extensions from .png to .jpg EXAMPLE: >>>> echo An ![image](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png) | pandoc -F png2jpg.py """ import panflute as pf def action(elem, doc): if isinstance(elem, pf.Image): elem.url = elem.url.replace('.png', '.j...
Convert .png endings to .jpg
Convert .png endings to .jpg
Python
bsd-3-clause
sergiocorreia/panflute-filters
""" Change image extensions from .png to .jpg EXAMPLE: >>>> echo An ![image](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png) | pandoc -F png2jpg.py """ import panflute as pf def action(elem, doc): if isinstance(elem, pf.Image): elem.url = elem.url.replace('.png', '.j...
Convert .png endings to .jpg
74dfabb565dbd6581a300091c045067d0398e899
source/jormungandr/jormungandr/interfaces/v1/Coverage.py
source/jormungandr/jormungandr/interfaces/v1/Coverage.py
# coding=utf-8 from flask.ext.restful import Resource, fields, marshal_with from jormungandr import i_manager from make_links import add_coverage_link, add_collection_links, clean_links from converters_collection_type import collections_to_resource_type from collections import OrderedDict region_fields = { "id": ...
# coding=utf-8 from flask.ext.restful import Resource, fields, marshal_with from jormungandr import i_manager from make_links import add_coverage_link, add_coverage_link, add_collection_links, clean_links from converters_collection_type import collections_to_resource_type from collections import OrderedDict from fields...
Add error field to region
Jormungandr: Add error field to region
Python
agpl-3.0
VincentCATILLON/navitia,prhod/navitia,xlqian/navitia,prhod/navitia,prhod/navitia,xlqian/navitia,ballouche/navitia,is06/navitia,pbougue/navitia,ballouche/navitia,kadhikari/navitia,CanalTP/navitia,VincentCATILLON/navitia,frodrigo/navitia,CanalTP/navitia,pbougue/navitia,francois-vincent/navitia,TeXitoi/navitia,kinnou02/na...
# coding=utf-8 from flask.ext.restful import Resource, fields, marshal_with from jormungandr import i_manager from make_links import add_coverage_link, add_coverage_link, add_collection_links, clean_links from converters_collection_type import collections_to_resource_type from collections import OrderedDict from fields...
Jormungandr: Add error field to region # coding=utf-8 from flask.ext.restful import Resource, fields, marshal_with from jormungandr import i_manager from make_links import add_coverage_link, add_collection_links, clean_links from converters_collection_type import collections_to_resource_type from collections import Or...
4ce3502e1623ca24e43e01e4c580ee327e6192fa
django_extensions/management/commands/generate_secret_key.py
django_extensions/management/commands/generate_secret_key.py
# -*- coding: utf-8 -*- from random import choice from django.core.management.base import BaseCommand from django_extensions.management.utils import signalcommand class Command(BaseCommand): help = "Generates a new SECRET_KEY that can be used in a project settings file." requires_system_checks = False ...
# -*- coding: utf-8 -*- from random import choice from django.core.management.base import BaseCommand from django.core.management.utils import get_random_secret_key from django_extensions.management.utils import signalcommand class Command(BaseCommand): help = "Generates a new SECRET_KEY that can be used in a p...
Use same algo to generate SECRET_KEY as Django
Use same algo to generate SECRET_KEY as Django Using random from standard library is not cryptographically secure.
Python
mit
haakenlid/django-extensions,haakenlid/django-extensions,django-extensions/django-extensions,linuxmaniac/django-extensions,linuxmaniac/django-extensions,django-extensions/django-extensions,haakenlid/django-extensions,django-extensions/django-extensions,linuxmaniac/django-extensions
# -*- coding: utf-8 -*- from random import choice from django.core.management.base import BaseCommand from django.core.management.utils import get_random_secret_key from django_extensions.management.utils import signalcommand class Command(BaseCommand): help = "Generates a new SECRET_KEY that can be used in a p...
Use same algo to generate SECRET_KEY as Django Using random from standard library is not cryptographically secure. # -*- coding: utf-8 -*- from random import choice from django.core.management.base import BaseCommand from django_extensions.management.utils import signalcommand class Command(BaseCommand): help ...
c138adaf69f5029209f03cafe72f1082cdb78f30
ppp_nlp_ml_standalone/requesthandler.py
ppp_nlp_ml_standalone/requesthandler.py
"""Request handler of the module.""" import ppp_datamodel from ppp_datamodel import Sentence from ppp_datamodel.communication import TraceItem, Response from ppp_nlp_ml_standalone import ExtractTriplet class RequestHandler: def __init__(self, request): self.request = request def answer(self): ...
"""Request handler of the module.""" import ppp_datamodel from ppp_datamodel import Sentence, Missing, Resource from ppp_datamodel.communication import TraceItem, Response from ppp_nlp_ml_standalone import ExtractTriplet def missing_or_resource(x): return Missing() if x == '?' else Resource(value=x) class Reques...
Make RequestHandler's code less redundant.
Make RequestHandler's code less redundant.
Python
mit
ProjetPP/PPP-QuestionParsing-ML-Standalone,ProjetPP/PPP-QuestionParsing-ML-Standalone
"""Request handler of the module.""" import ppp_datamodel from ppp_datamodel import Sentence, Missing, Resource from ppp_datamodel.communication import TraceItem, Response from ppp_nlp_ml_standalone import ExtractTriplet def missing_or_resource(x): return Missing() if x == '?' else Resource(value=x) class Reques...
Make RequestHandler's code less redundant. """Request handler of the module.""" import ppp_datamodel from ppp_datamodel import Sentence from ppp_datamodel.communication import TraceItem, Response from ppp_nlp_ml_standalone import ExtractTriplet class RequestHandler: def __init__(self, request): self.req...