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
e9046cd97c1deba9ba70bf60cfdba81eba6e0210
setup.py
setup.py
#!/usr/bin/env python from os.path import exists from setuptools import setup import dask extras_require = { 'array': ['numpy', 'toolz >= 0.7.2'], 'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'], 'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'], } extras_require['complet...
#!/usr/bin/env python from os.path import exists from setuptools import setup import dask extras_require = { 'array': ['numpy', 'toolz >= 0.7.2'], 'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'], 'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'], 'imperative': ['toolz >...
Add dep on toolz 0.7.2 for imperative extra
Add dep on toolz 0.7.2 for imperative extra
Python
bsd-3-clause
dask/dask,jcrist/dask,cowlicks/dask,dask/dask,ContinuumIO/dask,blaze/dask,mraspaud/dask,gameduell/dask,cpcloud/dask,mikegraham/dask,chrisbarber/dask,jakirkham/dask,blaze/dask,mraspaud/dask,jcrist/dask,ContinuumIO/dask,mrocklin/dask,jakirkham/dask,mrocklin/dask
#!/usr/bin/env python from os.path import exists from setuptools import setup import dask extras_require = { 'array': ['numpy', 'toolz >= 0.7.2'], 'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'], 'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2', 'partd >= 0.3.2'], 'imperative': ['toolz >...
Add dep on toolz 0.7.2 for imperative extra #!/usr/bin/env python from os.path import exists from setuptools import setup import dask extras_require = { 'array': ['numpy', 'toolz >= 0.7.2'], 'bag': ['cloudpickle', 'toolz >= 0.7.2', 'partd >= 0.3.2'], 'dataframe': ['numpy', 'pandas >= 0.16.0', 'toolz >= 0.7.2',...
6bfd2d0cb6a92322391d7f5d5348594268e305b4
tilequeue/queue/file.py
tilequeue/queue/file.py
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self._lock = threading.RLock() def enqueue(self, coord): with self._lock: payload = serialize_coord(coord) ...
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self.lock = threading.RLock() def enqueue(self, coord): with self.lock: payload = serialize_coord(coord) ...
Revert "Rename lock to _lock to imply that it's private."
Revert "Rename lock to _lock to imply that it's private." tilequeue/queue/file.py -On second thought, the convention of prefixing private instance variables with an underscore isn't consistently adhered to elsewhere in the codebase, so don't bother using it, or we'll end up with a mix of classes that do and don't ...
Python
mit
mapzen/tilequeue,tilezen/tilequeue
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self.lock = threading.RLock() def enqueue(self, coord): with self.lock: payload = serialize_coord(coord) ...
Revert "Rename lock to _lock to imply that it's private." tilequeue/queue/file.py -On second thought, the convention of prefixing private instance variables with an underscore isn't consistently adhered to elsewhere in the codebase, so don't bother using it, or we'll end up with a mix of classes that do and don't ...
08f633cdf0f5dcd1940da46e91c175e81b39ad3f
setup.py
setup.py
#!/usr/bin/env python """ Setup script. Created on Oct 10, 2011 @author: tmetsch """ from distutils.core import setup from distutils.extension import Extension try: from Cython.Build import build_ext, cythonize BUILD_EXTENSION = {'build_ext': build_ext} EXT_MODULES = cythonize([Extension("dtrace", ["dt...
#!/usr/bin/env python """ Setup script. Created on Oct 10, 2011 @author: tmetsch """ from distutils.core import setup from distutils.extension import Extension import sys try: from Cython.Build import build_ext, cythonize BUILD_EXTENSION = {'build_ext': build_ext} EXT_MODULES = cythonize([Extension("dt...
Set Cython language_level to 3 when compiling for python3
Set Cython language_level to 3 when compiling for python3
Python
mit
tmetsch/python-dtrace,tmetsch/python-dtrace
#!/usr/bin/env python """ Setup script. Created on Oct 10, 2011 @author: tmetsch """ from distutils.core import setup from distutils.extension import Extension import sys try: from Cython.Build import build_ext, cythonize BUILD_EXTENSION = {'build_ext': build_ext} EXT_MODULES = cythonize([Extension("dt...
Set Cython language_level to 3 when compiling for python3 #!/usr/bin/env python """ Setup script. Created on Oct 10, 2011 @author: tmetsch """ from distutils.core import setup from distutils.extension import Extension try: from Cython.Build import build_ext, cythonize BUILD_EXTENSION = {'build_ext': build...
78cfcc7520bc2b2006f22ac4ef4fb432770c835c
bootstrap.py
bootstrap.py
#!/usr/bin/env python """ Bootstrap and serve your application. This file also serves to not make your application completely reliant upon DotCloud's hosting service. If you're in a development environment, envoke the script with: $ python bootstrap.py In a production environment, your application can be run wit...
#!/usr/bin/env python """ Bootstrap and serve your application. This file also serves to not make your application completely reliant upon DotCloud's hosting service. If you're in a development environment, envoke the script with: $ python bootstrap.py In a production environment, your application can be run wit...
Allow Flask to get port from heroku environment
Allow Flask to get port from heroku environment
Python
mit
Leonnash21/flask_heroku,Leonnash21/flask_heroku,QueryControl/querycontrol,Leonnash21/flask_heroku,bryanyang0528/ubike_api,pmrowla/goonbcs,QueryControl/querycontrol,Leonnash21/flask_heroku,bryanyang0528/ubike_api,Leonnash21/flask_heroku,pmrowla/goonbcs,QueryControl/querycontrol,bryanyang0528/ubike_api
#!/usr/bin/env python """ Bootstrap and serve your application. This file also serves to not make your application completely reliant upon DotCloud's hosting service. If you're in a development environment, envoke the script with: $ python bootstrap.py In a production environment, your application can be run wit...
Allow Flask to get port from heroku environment #!/usr/bin/env python """ Bootstrap and serve your application. This file also serves to not make your application completely reliant upon DotCloud's hosting service. If you're in a development environment, envoke the script with: $ python bootstrap.py In a produc...
bf621217d9ccb605ec16afb20852485b1708ce79
tests/test_utils.py
tests/test_utils.py
from bugsnag.utils import sanitize_object def test_sanitize_object(): filters = ["password", "credit_card"] crazy_dict = { "password": "123456", "metadata": { "another_password": "123456", "regular": "text" }, "bad_utf8": "a test of \xe9 char" } ...
Add a couple of basic tests for sanitize_object
Add a couple of basic tests for sanitize_object
Python
mit
overplumbum/bugsnag-python,overplumbum/bugsnag-python,bugsnag/bugsnag-python,bugsnag/bugsnag-python
from bugsnag.utils import sanitize_object def test_sanitize_object(): filters = ["password", "credit_card"] crazy_dict = { "password": "123456", "metadata": { "another_password": "123456", "regular": "text" }, "bad_utf8": "a test of \xe9 char" } ...
Add a couple of basic tests for sanitize_object
27ab3ad3d1ce869baec85264b840da49ff43f82f
scripts/sync_exceeded_traffic_limits.py
scripts/sync_exceeded_traffic_limits.py
#!/usr/bin/env python3 # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. import os from flask import _request_ctx_stack, g, request from sqlalchemy import creat...
#!/usr/bin/env python3 # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. import os from flask import _request_ctx_stack, g, request from sqlalchemy import creat...
Add schema version check to sync script
Add schema version check to sync script
Python
apache-2.0
agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft
#!/usr/bin/env python3 # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. import os from flask import _request_ctx_stack, g, request from sqlalchemy import creat...
Add schema version check to sync script #!/usr/bin/env python3 # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. import os from flask import _request_ctx_stac...
0b8bbb5def7d5f621b26093897b01ac9a14239bf
src/tor/x25519-gen.py
src/tor/x25519-gen.py
#!/usr/bin/env python3 import base64 try: import nacl.public except ImportError: print('PyNaCl is required: "pip install pynacl" or similar') exit(1) def key_str(key): # bytes to base 32 key_bytes = bytes(key) key_b32 = base64.b32encode(key_bytes) # strip trailing ==== assert key_b32[-...
Add script for generating x25519 keys
Add script for generating x25519 keys
Python
unlicense
pastly/python-snippits
#!/usr/bin/env python3 import base64 try: import nacl.public except ImportError: print('PyNaCl is required: "pip install pynacl" or similar') exit(1) def key_str(key): # bytes to base 32 key_bytes = bytes(key) key_b32 = base64.b32encode(key_bytes) # strip trailing ==== assert key_b32[-...
Add script for generating x25519 keys
509d4f1e6d22a373cfa20944ef388f7155443d4a
monroe/api.py
monroe/api.py
from flask import Flask import monroe api = Flask(__name__) @api.route('/') def aping(): return 'v0.1' @api.route('/start') def start_monroe(): monroe.main()
ADD Flask based RESTful API
ADD Flask based RESTful API
Python
apache-2.0
ecelis/monroe
from flask import Flask import monroe api = Flask(__name__) @api.route('/') def aping(): return 'v0.1' @api.route('/start') def start_monroe(): monroe.main()
ADD Flask based RESTful API
16b663441c0d994b02e68b8c785ec6c7a2805f03
onepercentclub/settings/payments.py
onepercentclub/settings/payments.py
from bluebottle.payments_docdata.settings import DOCDATA_SETTINGS, DOCDATA_PAYMENT_METHODS PAYMENT_METHODS = DOCDATA_PAYMENT_METHODS VAT_RATE = 0.21
from bluebottle.payments_docdata.settings import DOCDATA_SETTINGS PAYMENT_METHODS = ( { 'provider': 'docdata', 'id': 'docdata-ideal', 'profile': 'ideal', 'name': 'iDEAL', 'restricted_countries': ('NL', 'Netherlands'), 'supports_recurring': False, }, { ...
Disable Paypal, up Direct debit
Disable Paypal, up Direct debit
Python
bsd-3-clause
onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site
from bluebottle.payments_docdata.settings import DOCDATA_SETTINGS PAYMENT_METHODS = ( { 'provider': 'docdata', 'id': 'docdata-ideal', 'profile': 'ideal', 'name': 'iDEAL', 'restricted_countries': ('NL', 'Netherlands'), 'supports_recurring': False, }, { ...
Disable Paypal, up Direct debit from bluebottle.payments_docdata.settings import DOCDATA_SETTINGS, DOCDATA_PAYMENT_METHODS PAYMENT_METHODS = DOCDATA_PAYMENT_METHODS VAT_RATE = 0.21
eb8218de72d1789b9e054e2ee76c51558cc1a653
django_fake_model/case_extension.py
django_fake_model/case_extension.py
from __future__ import unicode_literals from django.test import SimpleTestCase class CaseExtension(SimpleTestCase): _models = tuple() @classmethod def append_model(cls, model): cls._models += (model, ) def _pre_setup(self): super(CaseExtension, self)._pre_setup() self._map_m...
from __future__ import unicode_literals from django.test import SimpleTestCase class CaseExtension(SimpleTestCase): _models = tuple() @classmethod def append_model(cls, model): cls._models += (model, ) def _pre_setup(self): super(CaseExtension, self)._pre_setup() self._map_m...
Fix ordering of deletions on MySQL
Fix ordering of deletions on MySQL
Python
bsd-3-clause
erm0l0v/django-fake-model
from __future__ import unicode_literals from django.test import SimpleTestCase class CaseExtension(SimpleTestCase): _models = tuple() @classmethod def append_model(cls, model): cls._models += (model, ) def _pre_setup(self): super(CaseExtension, self)._pre_setup() self._map_m...
Fix ordering of deletions on MySQL from __future__ import unicode_literals from django.test import SimpleTestCase class CaseExtension(SimpleTestCase): _models = tuple() @classmethod def append_model(cls, model): cls._models += (model, ) def _pre_setup(self): super(CaseExtension, se...
8005d43146669e98d921bb36c4afd5dffb08e2e3
Tests/varLib/featureVars_test.py
Tests/varLib/featureVars_test.py
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.varLib.featureVars import ( overlayFeatureVariations) def test_explosion(n = 10): conds = [] for i in range(n): end = i / n start = end - 1. region = [{'axis': (start, ...
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.varLib.featureVars import ( overlayFeatureVariations) def test_explosion(n = 10): conds = [] for i in range(n): end = i / n start = end - 1. region = [{'axis': (start, ...
Enable test now that it passes
[varLib.featureVars] Enable test now that it passes
Python
mit
googlefonts/fonttools,fonttools/fonttools
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.varLib.featureVars import ( overlayFeatureVariations) def test_explosion(n = 10): conds = [] for i in range(n): end = i / n start = end - 1. region = [{'axis': (start, ...
[varLib.featureVars] Enable test now that it passes from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.varLib.featureVars import ( overlayFeatureVariations) def test_explosion(n = 10): conds = [] for i in range(n): end = i / n ...
2fe04ba1d96b25f26a2651fe74a6271fe5991bb2
migrations/versions/cf62ec87d973_agency_description_to_agency_request_.py
migrations/versions/cf62ec87d973_agency_description_to_agency_request_.py
"""agency_description to agency_request_summary Revision ID: cf62ec87d973 Revises: 971f341c0204 Create Date: 2017-05-31 16:29:17.341283 """ # revision identifiers, used by Alembic. revision = 'cf62ec87d973' down_revision = '971f341c0204' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import...
Add Database Migration for Column Rename
Add Database Migration for Column Rename Migrate the column `requests.agency_description` to `requests.agency_request_summary` and `requests.agency_description_release_date` to `requests.agency_request_summary_release_date` Signed-off-by: Joel Castillo <877468732c93e7fff2a7305e99430be238218100@records.nyc.gov>
Python
apache-2.0
CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords
"""agency_description to agency_request_summary Revision ID: cf62ec87d973 Revises: 971f341c0204 Create Date: 2017-05-31 16:29:17.341283 """ # revision identifiers, used by Alembic. revision = 'cf62ec87d973' down_revision = '971f341c0204' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import...
Add Database Migration for Column Rename Migrate the column `requests.agency_description` to `requests.agency_request_summary` and `requests.agency_description_release_date` to `requests.agency_request_summary_release_date` Signed-off-by: Joel Castillo <877468732c93e7fff2a7305e99430be238218100@records.nyc.gov>
2b74c8714b659ccf5faa615e9b5c4c4559f8d9c8
artbot_website/views.py
artbot_website/views.py
from django.shortcuts import render from datetime import date, datetime, timedelta from .models import Event def index(request): if date.today().isoweekday() in [5,6,7]: weekend_start = date.today() else: weekend_start = date.today() + timedelta((5 - date.today().isoweekday()) ...
from django.shortcuts import render from datetime import date, datetime, timedelta from .models import Event def index(request): if date.today().isoweekday() in [5,6,7]: weekend_start = date.today() else: weekend_start = date.today() + timedelta((5 - date.today().isoweekday()) ...
Index now only displays published articles.
Index now only displays published articles.
Python
mit
coreymcdermott/artbot,coreymcdermott/artbot
from django.shortcuts import render from datetime import date, datetime, timedelta from .models import Event def index(request): if date.today().isoweekday() in [5,6,7]: weekend_start = date.today() else: weekend_start = date.today() + timedelta((5 - date.today().isoweekday()) ...
Index now only displays published articles. from django.shortcuts import render from datetime import date, datetime, timedelta from .models import Event def index(request): if date.today().isoweekday() in [5,6,7]: weekend_start = date.today() else: weekend_start = date.today()...
0e36a49d6a53f87cbe71fd5ec9dce524dd638122
fireplace/deck.py
fireplace/deck.py
import logging import random from .card import Card from .enums import GameTag, Zone from .utils import CardList class Deck(CardList): MAX_CARDS = 30 MAX_UNIQUE_CARDS = 2 MAX_UNIQUE_LEGENDARIES = 1 @classmethod def fromList(cls, cards, hero): return cls([Card(card) for card in cards], Card(hero)) def __init...
import logging import random from .card import Card from .enums import GameTag, Zone from .utils import CardList class Deck(CardList): MAX_CARDS = 30 MAX_UNIQUE_CARDS = 2 MAX_UNIQUE_LEGENDARIES = 1 @classmethod def fromList(cls, cards, hero): return cls([Card(card) for card in cards], Card(hero)) def __init...
Drop support for naming Deck objects
Drop support for naming Deck objects
Python
agpl-3.0
smallnamespace/fireplace,Meerkov/fireplace,amw2104/fireplace,Ragowit/fireplace,beheh/fireplace,butozerca/fireplace,Ragowit/fireplace,amw2104/fireplace,liujimj/fireplace,smallnamespace/fireplace,jleclanche/fireplace,oftc-ftw/fireplace,oftc-ftw/fireplace,butozerca/fireplace,NightKev/fireplace,Meerkov/fireplace,liujimj/fi...
import logging import random from .card import Card from .enums import GameTag, Zone from .utils import CardList class Deck(CardList): MAX_CARDS = 30 MAX_UNIQUE_CARDS = 2 MAX_UNIQUE_LEGENDARIES = 1 @classmethod def fromList(cls, cards, hero): return cls([Card(card) for card in cards], Card(hero)) def __init...
Drop support for naming Deck objects import logging import random from .card import Card from .enums import GameTag, Zone from .utils import CardList class Deck(CardList): MAX_CARDS = 30 MAX_UNIQUE_CARDS = 2 MAX_UNIQUE_LEGENDARIES = 1 @classmethod def fromList(cls, cards, hero): return cls([Card(card) for ca...
c5e5b3d6c3d8cad75b1d2eac16179872dd415eb9
scripts/asgard-deploy.py
scripts/asgard-deploy.py
#!/usr/bin/env python import sys import logging import click import tubular.asgard as asgard logging.basicConfig(stream=sys.stdout, level=logging.ERROR) @click.command() @click.option('--ami_id', help='The ami-id to deploy', required=True) def deploy(ami_id): try: asgard.deploy(ami_id) except Exceptio...
#!/usr/bin/env python import sys import logging import click import tubular.asgard as asgard logging.basicConfig(stream=sys.stdout, level=logging.ERROR) @click.command() @click.option('--ami_id', envvar='AMI_ID', help='The ami-id to deploy', required=True) def deploy(ami_id): try: asgard.deploy(ami_id) ...
Use environment var for AMI_ID.
Use environment var for AMI_ID.
Python
agpl-3.0
eltoncarr/tubular,eltoncarr/tubular
#!/usr/bin/env python import sys import logging import click import tubular.asgard as asgard logging.basicConfig(stream=sys.stdout, level=logging.ERROR) @click.command() @click.option('--ami_id', envvar='AMI_ID', help='The ami-id to deploy', required=True) def deploy(ami_id): try: asgard.deploy(ami_id) ...
Use environment var for AMI_ID. #!/usr/bin/env python import sys import logging import click import tubular.asgard as asgard logging.basicConfig(stream=sys.stdout, level=logging.ERROR) @click.command() @click.option('--ami_id', help='The ami-id to deploy', required=True) def deploy(ami_id): try: asgard.d...
b13ddcc7d001606faa27637b2cb09e789dff4271
thinc/tests/layers/test_layers_api.py
thinc/tests/layers/test_layers_api.py
from thinc.api import registry import pytest @pytest.mark.parametrize( "name,kwargs", [ ("CauchySimilarity.v0", {}), ("Dropout.v0", {}), ("Embed.v0", {}), ("ExtractWindow.v0", {}), ("FeatureExtractor.v0", {"columns": [1, 2]}), ("HashEmbed.v0", {"nO": 1, "nV": 2}...
Add layer creation sanity checks
Add layer creation sanity checks
Python
mit
explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc
from thinc.api import registry import pytest @pytest.mark.parametrize( "name,kwargs", [ ("CauchySimilarity.v0", {}), ("Dropout.v0", {}), ("Embed.v0", {}), ("ExtractWindow.v0", {}), ("FeatureExtractor.v0", {"columns": [1, 2]}), ("HashEmbed.v0", {"nO": 1, "nV": 2}...
Add layer creation sanity checks
593c2ec0d62049cee9bedc282903491b670d811f
ci/set_secrets_file.py
ci/set_secrets_file.py
""" Move the right secrets file into place for Travis CI. """
""" Move the right secrets file into place for Travis CI. """ import os import shutil from pathlib import Path def move_secrets_file() -> None: """ Move the right secrets file to the current directory. """ branch = os.environ['TRAVIS_BRANCH'] is_pr = os.environ['TRAVIS_PULL_REQUEST'] != 'false' ...
Add script to move secrets file
Add script to move secrets file
Python
mit
adamtheturtle/vws-python,adamtheturtle/vws-python
""" Move the right secrets file into place for Travis CI. """ import os import shutil from pathlib import Path def move_secrets_file() -> None: """ Move the right secrets file to the current directory. """ branch = os.environ['TRAVIS_BRANCH'] is_pr = os.environ['TRAVIS_PULL_REQUEST'] != 'false' ...
Add script to move secrets file """ Move the right secrets file into place for Travis CI. """
a09274fbc9277de2cbd3336fca4922094b0db8d1
crmapp/urls.py
crmapp/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'crmapp.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), )
from django.conf.urls import patterns, include, url from marketing.views import HomePage urlpatterns = patterns('', # Marketing pages url(r'^$', HomePage.as_view(), name="home"), # Subscriber related URLs # Admin URL # Login/Logout URLs # Account related URLs # Contact related UR...
Create the Home Page > Create the URL Conf
Create the Home Page > Create the URL Conf
Python
mit
tabdon/crmeasyapp,tabdon/crmeasyapp,deenaariff/Django
from django.conf.urls import patterns, include, url from marketing.views import HomePage urlpatterns = patterns('', # Marketing pages url(r'^$', HomePage.as_view(), name="home"), # Subscriber related URLs # Admin URL # Login/Logout URLs # Account related URLs # Contact related UR...
Create the Home Page > Create the URL Conf from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'crmapp.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), )
ff02f0e8a7b62d5afdc88730129a5e0811fb5a82
monitor/monitor_test.py
monitor/monitor_test.py
#!/usr/bin/python import unittest import monitor class TestMonitor(unittest.TestCase): def test_attr(self): mon = monitor.Monitor() assert mon.pvprefix == "MON-CONTROL:" assert mon.monitorname == "PI1" def test_testimage(self): mon = monitor.Monitor() image = mon.testimage() assert len(image) != 0 # ...
#!/usr/bin/python import unittest from mock import patch, MagicMock, PropertyMock from monitor import Monitor class MonitorUpdateTest(unittest.TestCase): def setUp(self): with patch('monitor.pv.PV'): mock_plotter = MagicMock() self.monitor = Monitor("MYNAME", mock_plotter) ...
Rewrite monitortests. Add tests for update_image
Rewrite monitortests. Add tests for update_image
Python
apache-2.0
nickbattam/picamon,nickbattam/picamon,nickbattam/picamon,nickbattam/picamon
#!/usr/bin/python import unittest from mock import patch, MagicMock, PropertyMock from monitor import Monitor class MonitorUpdateTest(unittest.TestCase): def setUp(self): with patch('monitor.pv.PV'): mock_plotter = MagicMock() self.monitor = Monitor("MYNAME", mock_plotter) ...
Rewrite monitortests. Add tests for update_image #!/usr/bin/python import unittest import monitor class TestMonitor(unittest.TestCase): def test_attr(self): mon = monitor.Monitor() assert mon.pvprefix == "MON-CONTROL:" assert mon.monitorname == "PI1" def test_testimage(self): mon = monitor.Monitor() im...
801c8c7463811af88f232e23d8496180d7b413ad
python/extract_duplicate_sets.py
python/extract_duplicate_sets.py
""" Copyright 2016 Ronald J. Nowling 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, softw...
Add script for extracting duplicate sets from SOLR dump
Add script for extracting duplicate sets from SOLR dump
Python
apache-2.0
rnowling/article-deduplication,rnowling/article-deduplication
""" Copyright 2016 Ronald J. Nowling 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, softw...
Add script for extracting duplicate sets from SOLR dump
14398ec42c0d31d577278d8748b0617650f91775
porick/controllers/create.py
porick/controllers/create.py
import logging from pylons import request, response, session, tmpl_context as c, url from pylons.controllers.util import abort, redirect import porick.lib.helpers as h from porick.lib.auth import authorize from porick.lib.base import BaseController, render from porick.lib.create import create_quote, create_user log...
import logging from pylons import request, response, session, tmpl_context as c, url from pylons.controllers.util import abort, redirect import porick.lib.helpers as h from porick.lib.auth import authorize from porick.lib.base import BaseController, render from porick.lib.create import create_quote, create_user log...
Deal with comma-separated tags lists HNGH
Deal with comma-separated tags lists HNGH
Python
apache-2.0
kopf/porick,kopf/porick,kopf/porick
import logging from pylons import request, response, session, tmpl_context as c, url from pylons.controllers.util import abort, redirect import porick.lib.helpers as h from porick.lib.auth import authorize from porick.lib.base import BaseController, render from porick.lib.create import create_quote, create_user log...
Deal with comma-separated tags lists HNGH import logging from pylons import request, response, session, tmpl_context as c, url from pylons.controllers.util import abort, redirect import porick.lib.helpers as h from porick.lib.auth import authorize from porick.lib.base import BaseController, render from porick.lib.cr...
f0e8999ad139a8da8d3762ee1d318f23928edd9c
tests/modelstest.py
tests/modelstest.py
# Copyright (C) 2010 rPath, Inc. import testsuite testsuite.setup() from testrunner import testcase from rpath_repeater import models class TestBase(testcase.TestCaseWithWorkDir): pass class ModelsTest(TestBase): def testModelToXml(self): files = models.ImageFiles([ models.ImageFile(tit...
# Copyright (C) 2010 rPath, Inc. import testsuite testsuite.setup() from testrunner import testcase from rpath_repeater import models class TestBase(testcase.TestCaseWithWorkDir): pass class ModelsTest(TestBase): def testModelToXml(self): files = models.ImageFiles([ models.ImageFile(tit...
Fix test after metadata changes
Fix test after metadata changes
Python
apache-2.0
sassoftware/rpath-repeater
# Copyright (C) 2010 rPath, Inc. import testsuite testsuite.setup() from testrunner import testcase from rpath_repeater import models class TestBase(testcase.TestCaseWithWorkDir): pass class ModelsTest(TestBase): def testModelToXml(self): files = models.ImageFiles([ models.ImageFile(tit...
Fix test after metadata changes # Copyright (C) 2010 rPath, Inc. import testsuite testsuite.setup() from testrunner import testcase from rpath_repeater import models class TestBase(testcase.TestCaseWithWorkDir): pass class ModelsTest(TestBase): def testModelToXml(self): files = models.ImageFiles([...
720833e96e24ffe73822a3a1280e3dc901e52829
anchorhub/lib/filetolist.py
anchorhub/lib/filetolist.py
""" Class for FileToList """ class FileToList(object): """ FileToList is a helper class used to import text files and turn them into lists, with each index in the list representing a single line from the text file. """ @staticmethod def to_list(file_path): """ Static method...
""" Class for FileToList """ class FileToList(object): """ FileToList is a helper class used to import text files and turn them into lists, with each index in the list representing a single line from the text file. """ @staticmethod def to_list(file_path): """ Static method...
Remove 'b' classifer on FileToList's read() usage
Remove 'b' classifer on FileToList's read() usage
Python
apache-2.0
samjabrahams/anchorhub
""" Class for FileToList """ class FileToList(object): """ FileToList is a helper class used to import text files and turn them into lists, with each index in the list representing a single line from the text file. """ @staticmethod def to_list(file_path): """ Static method...
Remove 'b' classifer on FileToList's read() usage """ Class for FileToList """ class FileToList(object): """ FileToList is a helper class used to import text files and turn them into lists, with each index in the list representing a single line from the text file. """ @staticmethod def to...
3f4415bd551b52418a5999a1ea64e31d15097802
framework/transactions/commands.py
framework/transactions/commands.py
# -*- coding: utf-8 -*- from framework.mongo import database as proxy_database def begin(database=None): database = database or proxy_database database.command('beginTransaction') def rollback(database=None): database = database or proxy_database database.command('rollbackTransaction') def commit...
# -*- coding: utf-8 -*- from framework.mongo import database as proxy_database from pymongo.errors import OperationFailure def begin(database=None): database = database or proxy_database database.command('beginTransaction') def rollback(database=None): database = database or proxy_database try: ...
Fix rollback transaction issue bby adding except for Operation Failure to rollback
Fix rollback transaction issue bby adding except for Operation Failure to rollback
Python
apache-2.0
erinspace/osf.io,doublebits/osf.io,brandonPurvis/osf.io,brandonPurvis/osf.io,kwierman/osf.io,GageGaskins/osf.io,hmoco/osf.io,amyshi188/osf.io,brandonPurvis/osf.io,felliott/osf.io,cosenal/osf.io,abought/osf.io,kch8qx/osf.io,haoyuchen1992/osf.io,himanshuo/osf.io,sbt9uc/osf.io,bdyetton/prettychart,samchrisinger/osf.io,mon...
# -*- coding: utf-8 -*- from framework.mongo import database as proxy_database from pymongo.errors import OperationFailure def begin(database=None): database = database or proxy_database database.command('beginTransaction') def rollback(database=None): database = database or proxy_database try: ...
Fix rollback transaction issue bby adding except for Operation Failure to rollback # -*- coding: utf-8 -*- from framework.mongo import database as proxy_database def begin(database=None): database = database or proxy_database database.command('beginTransaction') def rollback(database=None): database =...
ec72bfd00fdb81415efac782d224b17e534849c4
mfh.py
mfh.py
import os import sys import time from multiprocessing import Process, Event import mfhclient import server import update from arguments import parse from settings import HONEYPORT def main(): update_event = Event() mfhclient_process = Process( args=(args, update_event,), name="mfhclient_pro...
import os import sys import time from multiprocessing import Process, Event import mfhclient import server import update from arguments import parse from settings import HONEYPORT, HIVEPORT def main(): update_event = Event() mfhclient_process = Process( args=(args, update_event,), name="mfh...
Add condition to only launch server if -s or --server is specified
Add condition to only launch server if -s or --server is specified Now you can launch client, server or updater on its own, launch nothing, or launch the whole thing altogether!
Python
mit
Zloool/manyfaced-honeypot
import os import sys import time from multiprocessing import Process, Event import mfhclient import server import update from arguments import parse from settings import HONEYPORT, HIVEPORT def main(): update_event = Event() mfhclient_process = Process( args=(args, update_event,), name="mfh...
Add condition to only launch server if -s or --server is specified Now you can launch client, server or updater on its own, launch nothing, or launch the whole thing altogether! import os import sys import time from multiprocessing import Process, Event import mfhclient import server import update from arguments i...
9502755baf7efba7851c07edbf2579f7cff95e44
py/rackattack/tcp/debug.py
py/rackattack/tcp/debug.py
import contextlib import logging import time import os logger = logging.getLogger('network') @contextlib.contextmanager def logNetwork(message): transaction = Transaction(message) yield transaction.finished() class Transaction: def __init__(self, message): self._message = message s...
import contextlib import logging import time import os logger = logging.getLogger('network') @contextlib.contextmanager def logNetwork(message): transaction = Transaction(message) yield transaction.finished() class Transaction: TRANSACTION_PERIOD_MAX = 0.3 def __init__(self, message): ...
Increase max transaction period due to more networking tasks
Increase max transaction period due to more networking tasks
Python
apache-2.0
eliran-stratoscale/rackattack-api,Stratoscale/rackattack-api
import contextlib import logging import time import os logger = logging.getLogger('network') @contextlib.contextmanager def logNetwork(message): transaction = Transaction(message) yield transaction.finished() class Transaction: TRANSACTION_PERIOD_MAX = 0.3 def __init__(self, message): ...
Increase max transaction period due to more networking tasks import contextlib import logging import time import os logger = logging.getLogger('network') @contextlib.contextmanager def logNetwork(message): transaction = Transaction(message) yield transaction.finished() class Transaction: def __in...
760a663ab1c079ea03f022c169f7d2d05346dc02
scipy/ndimage/io.py
scipy/ndimage/io.py
from __future__ import division, print_function, absolute_import _have_pil = True try: from scipy.misc.pilutil import imread as _imread except ImportError: _have_pil = False __all__ = ['imread'] # Use the implementation of `imread` in `scipy.misc.pilutil.imread`. # If it weren't for the different names of...
from __future__ import division, print_function, absolute_import _have_pil = True try: from scipy.misc.pilutil import imread as _imread except ImportError: _have_pil = False __all__ = ['imread'] # Use the implementation of `imread` in `scipy.misc.pilutil.imread`. # If it weren't for the different names of...
Update PIL error install URL
DOC: Update PIL error install URL Update URL for PIL import error to point to Pillow installation instead of PIL, for the latter is somewhat out of date and does not even Python 3 at the moment unlike Pillow. Closes gh-5779.
Python
bsd-3-clause
anielsen001/scipy,dominicelse/scipy,aarchiba/scipy,gdooper/scipy,gfyoung/scipy,gertingold/scipy,woodscn/scipy,aeklant/scipy,Gillu13/scipy,rgommers/scipy,pyramania/scipy,scipy/scipy,mikebenfield/scipy,jakevdp/scipy,perimosocordiae/scipy,sriki18/scipy,anielsen001/scipy,person142/scipy,lhilt/scipy,aeklant/scipy,behzadnour...
from __future__ import division, print_function, absolute_import _have_pil = True try: from scipy.misc.pilutil import imread as _imread except ImportError: _have_pil = False __all__ = ['imread'] # Use the implementation of `imread` in `scipy.misc.pilutil.imread`. # If it weren't for the different names of...
DOC: Update PIL error install URL Update URL for PIL import error to point to Pillow installation instead of PIL, for the latter is somewhat out of date and does not even Python 3 at the moment unlike Pillow. Closes gh-5779. from __future__ import division, print_function, absolute_import _have_pil = True try: ...
819b968a3bb73c1e8fed1a9c5440c8122a6dec9e
plugin/core/logging.py
plugin/core/logging.py
import traceback from .settings import settings, PLUGIN_NAME def debug(*args): """Print args to the console if the "debug" setting is True.""" if settings.log_debug: printf(*args) def exception_log(message, ex): print(message) ex_traceback = ex.__traceback__ print(''.join(traceback.forma...
import traceback from .settings import settings, PLUGIN_NAME def debug(*args): """Print args to the console if the "debug" setting is True.""" if settings.log_debug: printf(*args) def exception_log(message, ex): print(message) ex_traceback = ex.__traceback__ print(''.join(traceback.forma...
Replace binary argument with hardcoded text "server"
Replace binary argument with hardcoded text "server"
Python
mit
tomv564/LSP
import traceback from .settings import settings, PLUGIN_NAME def debug(*args): """Print args to the console if the "debug" setting is True.""" if settings.log_debug: printf(*args) def exception_log(message, ex): print(message) ex_traceback = ex.__traceback__ print(''.join(traceback.forma...
Replace binary argument with hardcoded text "server" import traceback from .settings import settings, PLUGIN_NAME def debug(*args): """Print args to the console if the "debug" setting is True.""" if settings.log_debug: printf(*args) def exception_log(message, ex): print(message) ex_tracebac...
d5a2a11d23b9f5393b0b39ca2f90978276311f52
app/slot/routes.py
app/slot/routes.py
from app import app from app.slot import controller as con import config from auth import requires_auth from flask import render_template from flask.ext.login import login_required @app.route('/dashboard') # @requires_auth @login_required def index(): return con.index() @app.route('/new', methods=['GET', 'POST...
from app import app from app.slot import controller as con import config from auth import requires_auth from flask import render_template from flask.ext.login import login_required @app.route('/') @app.route('/dashboard') @login_required def index(): return con.index() @app.route('/new', methods=['GET', 'POST']...
Add / route to index. Remove old requires_auth decorator.
Add / route to index. Remove old requires_auth decorator.
Python
mit
nhshd-slot/SLOT,nhshd-slot/SLOT,nhshd-slot/SLOT
from app import app from app.slot import controller as con import config from auth import requires_auth from flask import render_template from flask.ext.login import login_required @app.route('/') @app.route('/dashboard') @login_required def index(): return con.index() @app.route('/new', methods=['GET', 'POST']...
Add / route to index. Remove old requires_auth decorator. from app import app from app.slot import controller as con import config from auth import requires_auth from flask import render_template from flask.ext.login import login_required @app.route('/dashboard') # @requires_auth @login_required def index(): re...
3aa10577f292a2962f66926fb021ed4a1b6fc493
lib/header/colors.py
lib/header/colors.py
"""ANSI escape sequence objects. This is designed to place ANSI escape sequences in format strings. Colors and attributes are selected by using object attributes in format strings. For example, '{0.red}Hello, {0.green}World!{0.reset}'.format(colors()) This prints "Hello, " in red, and "World" in green, and rese...
Add ANSI escape sequence library
Add ANSI escape sequence library
Python
bsd-2-clause
depp/headerfix,depp/headerfix,depp/headerfix,depp/headerfix
"""ANSI escape sequence objects. This is designed to place ANSI escape sequences in format strings. Colors and attributes are selected by using object attributes in format strings. For example, '{0.red}Hello, {0.green}World!{0.reset}'.format(colors()) This prints "Hello, " in red, and "World" in green, and rese...
Add ANSI escape sequence library
352ab7fa385835bd68b42eb60a5b149bcfb28865
pyblogit/posts.py
pyblogit/posts.py
""" pyblogit.posts ~~~~~~~~~~~~~~ This module contains the data model to represent blog posts and methods to manipulate it. """ class post(object): def __init__(self, post_id, title, url, author, content, images, labels, status): self._post_id = post_id self._title = title sel...
""" pyblogit.posts ~~~~~~~~~~~~~~ This module contains the data model to represent blog posts and methods to manipulate it. """ class post(object): """The post data model""" def __init__(self, post_id, title, url, author, content, images, labels, status): self._post_id = post_id s...
Add docstring to Post class
Add docstring to Post class
Python
mit
jamalmoir/pyblogit
""" pyblogit.posts ~~~~~~~~~~~~~~ This module contains the data model to represent blog posts and methods to manipulate it. """ class post(object): """The post data model""" def __init__(self, post_id, title, url, author, content, images, labels, status): self._post_id = post_id s...
Add docstring to Post class """ pyblogit.posts ~~~~~~~~~~~~~~ This module contains the data model to represent blog posts and methods to manipulate it. """ class post(object): def __init__(self, post_id, title, url, author, content, images, labels, status): self._post_id = post_id se...
071f42389aef9c57cb4f0a0434d8297ccba05ab2
openquake/hazardlib/general.py
openquake/hazardlib/general.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, ...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, ...
Replace subprocess.Popen with check_output to avoid git zombies
Replace subprocess.Popen with check_output to avoid git zombies
Python
agpl-3.0
larsbutler/oq-hazardlib,larsbutler/oq-hazardlib,gem/oq-engine,gem/oq-hazardlib,mmpagani/oq-hazardlib,gem/oq-engine,gem/oq-engine,mmpagani/oq-hazardlib,silviacanessa/oq-hazardlib,gem/oq-engine,larsbutler/oq-hazardlib,silviacanessa/oq-hazardlib,silviacanessa/oq-hazardlib,gem/oq-hazardlib,gem/oq-engine,vup1120/oq-hazardli...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, ...
Replace subprocess.Popen with check_output to avoid git zombies # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # b...
54dbc3638ba376f29aa619e897c9b87238559ac3
billjobs/tests/tests_export_account_email.py
billjobs/tests/tests_export_account_email.py
from django.test import TestCase from django.http import HttpResponse from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from billjobs.admin import UserAdmin class EmailExportTestCase(TestCase): """ Tests for email account export """ def test_method_is_avaible(self): ...
from django.test import TestCase from django.http import HttpResponse from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from billjobs.admin import UserAdmin class MockRequest(object): pass class EmailExportTestCase(TestCase): """ Tests for email account expor...
Refactor test, test export email return text/csv content type
Refactor test, test export email return text/csv content type
Python
mit
ioO/billjobs
from django.test import TestCase from django.http import HttpResponse from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from billjobs.admin import UserAdmin class MockRequest(object): pass class EmailExportTestCase(TestCase): """ Tests for email account expor...
Refactor test, test export email return text/csv content type from django.test import TestCase from django.http import HttpResponse from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from billjobs.admin import UserAdmin class EmailExportTestCase(TestCase): """ Tests for e...
01db1d6f591858b52b6a75ac72b5bdcb49aca708
python/extract_logs_from_nextflow.py
python/extract_logs_from_nextflow.py
#!/usr/bin/env python import os import sys import pandas as pd from glob import glob import subprocess def main(): if len(sys.argv) != 3: print("Usage: extract_logs_from_nextflow.py <nextflow_trace_file> <task_tag>:<stderr|stdout|both>",file=sys.stderr) # Load Nextflow trace nextflow_trac...
Add script to extract stderr and stout from nextflow
Add script to extract stderr and stout from nextflow
Python
apache-2.0
maubarsom/biotico-tools,maubarsom/biotico-tools,maubarsom/biotico-tools,maubarsom/biotico-tools,maubarsom/biotico-tools
#!/usr/bin/env python import os import sys import pandas as pd from glob import glob import subprocess def main(): if len(sys.argv) != 3: print("Usage: extract_logs_from_nextflow.py <nextflow_trace_file> <task_tag>:<stderr|stdout|both>",file=sys.stderr) # Load Nextflow trace nextflow_trac...
Add script to extract stderr and stout from nextflow
6b97c1bdcb7d7152c7c0a14833caadbf3aa5ad04
lms/djangoapps/coursewarehistoryextended/fields.py
lms/djangoapps/coursewarehistoryextended/fields.py
""" Custom fields for use in the coursewarehistoryextended django app. """ from django.db.models.fields import AutoField class UnsignedBigIntAutoField(AutoField): """ An unsigned 8-byte integer for auto-incrementing primary keys. """ def db_type(self, connection): if connection.settings_dict[...
""" Custom fields for use in the coursewarehistoryextended django app. """ from django.db.models.fields import AutoField class UnsignedBigIntAutoField(AutoField): """ An unsigned 8-byte integer for auto-incrementing primary keys. """ def db_type(self, connection): if connection.settings_dict[...
Add a rel_db_type to UnsignedBigIntAutoField
Add a rel_db_type to UnsignedBigIntAutoField
Python
agpl-3.0
proversity-org/edx-platform,angelapper/edx-platform,gymnasium/edx-platform,kmoocdev2/edx-platform,jolyonb/edx-platform,TeachAtTUM/edx-platform,cpennington/edx-platform,kmoocdev2/edx-platform,edx/edx-platform,eduNEXT/edunext-platform,angelapper/edx-platform,ahmedaljazzar/edx-platform,kmoocdev2/edx-platform,hastexo/edx-p...
""" Custom fields for use in the coursewarehistoryextended django app. """ from django.db.models.fields import AutoField class UnsignedBigIntAutoField(AutoField): """ An unsigned 8-byte integer for auto-incrementing primary keys. """ def db_type(self, connection): if connection.settings_dict[...
Add a rel_db_type to UnsignedBigIntAutoField """ Custom fields for use in the coursewarehistoryextended django app. """ from django.db.models.fields import AutoField class UnsignedBigIntAutoField(AutoField): """ An unsigned 8-byte integer for auto-incrementing primary keys. """ def db_type(self, con...
9bce03d89dad6b69a88632d95988fc42af19557a
st2common/st2common/util/versioning.py
st2common/st2common/util/versioning.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Add custom uility function which knows how to compare and match complex semver version specifiers.
Add custom uility function which knows how to compare and match complex semver version specifiers.
Python
apache-2.0
nzlosh/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,tonybaloney/st2,StackStorm/st2,Plexxi/st2,peak6/st2,Plexxi/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,tonybaloney/st2,Plexxi/st2,peak6/st2,tonybaloney/st2,peak6/st2,StackStorm/st2,lakshmi-kannan/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Add custom uility function which knows how to compare and match complex semver version specifiers.
9e77d9a40ae13cff09051c9975361dca9259b426
gala/__init__.py
gala/__init__.py
""" Gala === Gala is a Python package for nD image segmentation. """ from __future__ import absolute_import import sys, logging if sys.version_info[:2] < (2,6): logging.warning('Gala has not been tested on Python versions prior to 2.6'+ ' (%d.%d detected).'%sys.version_info[:2]) __author__ = 'Juan N...
""" Gala === Gala is a Python package for nD image segmentation. """ from __future__ import absolute_import import sys, logging if sys.version_info[:2] < (2,6): logging.warning('Gala has not been tested on Python versions prior to 2.6'+ ' (%d.%d detected).'%sys.version_info[:2]) __author__ = 'Juan N...
Update email in module init
Update email in module init
Python
bsd-3-clause
jni/gala,janelia-flyem/gala
""" Gala === Gala is a Python package for nD image segmentation. """ from __future__ import absolute_import import sys, logging if sys.version_info[:2] < (2,6): logging.warning('Gala has not been tested on Python versions prior to 2.6'+ ' (%d.%d detected).'%sys.version_info[:2]) __author__ = 'Juan N...
Update email in module init """ Gala === Gala is a Python package for nD image segmentation. """ from __future__ import absolute_import import sys, logging if sys.version_info[:2] < (2,6): logging.warning('Gala has not been tested on Python versions prior to 2.6'+ ' (%d.%d detected).'%sys.version_in...
e9c6b22ffaf498dc64f590689cc637a152444665
forms.py
forms.py
from flask_wtf import Form from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, BooleanField from wtforms.validators import DataRequired, Email, Length class AddUserForm(Form): name = StringField('Name of User', validators=[DataRequired("Please enter the name of the newco...
from flask_wtf import Form from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, BooleanField from wtforms.validators import DataRequired, Email, Length class AddUserForm(Form): name = StringField('Name of User', validators=[DataRequired("Please enter the name of the newco...
Change LoginForm parameter for BooleanField
Change LoginForm parameter for BooleanField
Python
mit
jinjiaho/project57,jinjiaho/project57,jinjiaho/project57,jinjiaho/project57
from flask_wtf import Form from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, BooleanField from wtforms.validators import DataRequired, Email, Length class AddUserForm(Form): name = StringField('Name of User', validators=[DataRequired("Please enter the name of the newco...
Change LoginForm parameter for BooleanField from flask_wtf import Form from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, BooleanField from wtforms.validators import DataRequired, Email, Length class AddUserForm(Form): name = StringField('Name of User', validators=[Dat...
f8a160b91cf91a02f36bfd88316c199b914298b2
src/nodeconductor_assembly_waldur/experts/filters.py
src/nodeconductor_assembly_waldur/experts/filters.py
import django_filters from nodeconductor.core import filters as core_filters from . import models class ExpertProviderFilter(django_filters.FilterSet): customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid') customer_uuid = django_filters.UUIDFilter(name='customer__uuid') ...
import django_filters from nodeconductor.core import filters as core_filters from . import models class ExpertProviderFilter(django_filters.FilterSet): customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid') customer_uuid = django_filters.UUIDFilter(name='customer__uuid') ...
Allow to filter expert requests by state
Allow to filter expert requests by state [WAL-1041]
Python
mit
opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind
import django_filters from nodeconductor.core import filters as core_filters from . import models class ExpertProviderFilter(django_filters.FilterSet): customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid') customer_uuid = django_filters.UUIDFilter(name='customer__uuid') ...
Allow to filter expert requests by state [WAL-1041] import django_filters from nodeconductor.core import filters as core_filters from . import models class ExpertProviderFilter(django_filters.FilterSet): customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid') customer_uuid = d...
55a6d1204543b9fea3b955f39722779d153c3752
update_checker_app/__init__.py
update_checker_app/__init__.py
#!/usr/bin/env python from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy __version__ = '0.1' DB_URI = 'postgresql://@/updatechecker' APP = Flask(__name__) APP.config['SQLALCHEMY_DATABASE_URI'] = DB_URI APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(APP) # Delay these imports u...
#!/usr/bin/env python from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from os import getenv __version__ = '0.1' DB_URI = 'postgresql://@/updatechecker' APP = Flask(__name__) APP.config['SQLALCHEMY_DATABASE_URI'] = DB_URI APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False APP.debug = getenv('DEB...
Enable debugging based on environment variable.
Enable debugging based on environment variable.
Python
bsd-2-clause
bboe/update_checker_app
#!/usr/bin/env python from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from os import getenv __version__ = '0.1' DB_URI = 'postgresql://@/updatechecker' APP = Flask(__name__) APP.config['SQLALCHEMY_DATABASE_URI'] = DB_URI APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False APP.debug = getenv('DEB...
Enable debugging based on environment variable. #!/usr/bin/env python from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy __version__ = '0.1' DB_URI = 'postgresql://@/updatechecker' APP = Flask(__name__) APP.config['SQLALCHEMY_DATABASE_URI'] = DB_URI APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = Fa...
e598426d190fbe9ccd6a2f11e4fd75de6e749071
test_settings.py
test_settings.py
from gem.settings import * # noqa: F401, F403 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'gem_test.db', } } DEBUG = True CELERY_ALWAYS_EAGER = True STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
from gem.settings import * # noqa: F401, F403 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'gem_test.db', } } LOGGING = { 'version': 1, 'handlers': { 'console': { 'level': 'WARNING', 'class': 'logging.StreamHandler', ...
Set log level for test
Set log level for test When moving to Python 3 the logger starts putting out loads of DEBUG and INFO lines, but we only really care about WARNING.
Python
bsd-2-clause
praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem
from gem.settings import * # noqa: F401, F403 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'gem_test.db', } } LOGGING = { 'version': 1, 'handlers': { 'console': { 'level': 'WARNING', 'class': 'logging.StreamHandler', ...
Set log level for test When moving to Python 3 the logger starts putting out loads of DEBUG and INFO lines, but we only really care about WARNING. from gem.settings import * # noqa: F401, F403 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'gem_test.db', } } DEBU...
32b35f49c525d6b527de325ecc4837ab7c18b5ad
apiserver/alembic/versions/201711101357_451d4bb125cb_add_ranking_data_to_participants_table.py
apiserver/alembic/versions/201711101357_451d4bb125cb_add_ranking_data_to_participants_table.py
"""Add ranking data to participants table Revision ID: 451d4bb125cb Revises: 49be2190c22d Create Date: 2017-11-10 13:57:37.807238+00:00 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '451d4bb125cb' down_revision = '49be219...
"""Add ranking data to participants table Revision ID: 451d4bb125cb Revises: 49be2190c22d Create Date: 2017-11-10 13:57:37.807238+00:00 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '451d4bb125cb' down_revision = '49be219...
Rename rank field to avoid column name clash
Rename rank field to avoid column name clash
Python
mit
HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteCh...
"""Add ranking data to participants table Revision ID: 451d4bb125cb Revises: 49be2190c22d Create Date: 2017-11-10 13:57:37.807238+00:00 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '451d4bb125cb' down_revision = '49be219...
Rename rank field to avoid column name clash """Add ranking data to participants table Revision ID: 451d4bb125cb Revises: 49be2190c22d Create Date: 2017-11-10 13:57:37.807238+00:00 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revi...
3080c44c23adcb3a09fb94343da872b8b26ce9fc
tests/conftest.py
tests/conftest.py
"""Configuration for test environment""" import sys from .fixtures import * collect_ignore = [] if sys.version_info < (3, 5): collect_ignore.append("test_async.py") if sys.version_info < (3, 4): collect_ignore.append("test_coroutines.py")
"""Configuration for test environment""" import sys from .fixtures import *
Remove no longer necessary test ignore logic
Remove no longer necessary test ignore logic
Python
mit
timothycrosley/hug,timothycrosley/hug,timothycrosley/hug
"""Configuration for test environment""" import sys from .fixtures import *
Remove no longer necessary test ignore logic """Configuration for test environment""" import sys from .fixtures import * collect_ignore = [] if sys.version_info < (3, 5): collect_ignore.append("test_async.py") if sys.version_info < (3, 4): collect_ignore.append("test_coroutines.py")
80524970b9e802787918af9ce6d25110be825df4
moderngl/__init__.py
moderngl/__init__.py
''' ModernGL: PyOpenGL alternative ''' from .error import * from .buffer import * from .compute_shader import * from .conditional_render import * from .context import * from .framebuffer import * from .program import * from .program_members import * from .query import * from .renderbuffer import * from .scope impo...
''' ModernGL: High performance rendering for Python 3 ''' from .error import * from .buffer import * from .compute_shader import * from .conditional_render import * from .context import * from .framebuffer import * from .program import * from .program_members import * from .query import * from .renderbuffer import...
Update module level description of moderngl
Update module level description of moderngl
Python
mit
cprogrammer1994/ModernGL,cprogrammer1994/ModernGL,cprogrammer1994/ModernGL
''' ModernGL: High performance rendering for Python 3 ''' from .error import * from .buffer import * from .compute_shader import * from .conditional_render import * from .context import * from .framebuffer import * from .program import * from .program_members import * from .query import * from .renderbuffer import...
Update module level description of moderngl ''' ModernGL: PyOpenGL alternative ''' from .error import * from .buffer import * from .compute_shader import * from .conditional_render import * from .context import * from .framebuffer import * from .program import * from .program_members import * from .query import *...
78df776f31e5a23213b7f9d162a71954a667950a
opps/views/tests/__init__.py
opps/views/tests/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from opps.views.tests.test_generic_detail import *
#!/usr/bin/env python # -*- coding: utf-8 -*- from opps.views.tests.test_generic_detail import * from opps.views.tests.test_generic_list import *
Add test_generic_list on tests views
Add test_generic_list on tests views
Python
mit
williamroot/opps,opps/opps,jeanmask/opps,opps/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,YACOWS/opps
#!/usr/bin/env python # -*- coding: utf-8 -*- from opps.views.tests.test_generic_detail import * from opps.views.tests.test_generic_list import *
Add test_generic_list on tests views #!/usr/bin/env python # -*- coding: utf-8 -*- from opps.views.tests.test_generic_detail import *
fccf3f1b2eb1a861d8c63aef1bef9ba4ac03a777
setup.py
setup.py
#-*- encoding: utf-8 -*- from setuptools import setup from setuptools.command.test import test as TestCommand import sys class Tox(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #impor...
#-*- encoding: utf-8 -*- from setuptools import setup from setuptools.command.test import test as TestCommand import sys class Tox(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #impor...
Add Python 3 trove classifier
Add Python 3 trove classifier
Python
bsd-3-clause
rescale/django-money,recklessromeo/django-money,tsouvarev/django-money,AlexRiina/django-money,recklessromeo/django-money,tsouvarev/django-money
#-*- encoding: utf-8 -*- from setuptools import setup from setuptools.command.test import test as TestCommand import sys class Tox(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #impor...
Add Python 3 trove classifier #-*- encoding: utf-8 -*- from setuptools import setup from setuptools.command.test import test as TestCommand import sys class Tox(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def ...
71a6d0a032896f4ef2e9a4cda541d142f2c48171
typhon/tests/test_environment.py
typhon/tests/test_environment.py
# -*- coding: utf-8 -*- """Testing the environment/configuration handler. """ import os from copy import copy import pytest from typhon import environment class TestEnvironment: """Testing the environment handler.""" def setup_method(self): """Run all test methods with an empty environment.""" ...
Add unittests for environment handler.
Add unittests for environment handler.
Python
mit
atmtools/typhon,atmtools/typhon
# -*- coding: utf-8 -*- """Testing the environment/configuration handler. """ import os from copy import copy import pytest from typhon import environment class TestEnvironment: """Testing the environment handler.""" def setup_method(self): """Run all test methods with an empty environment.""" ...
Add unittests for environment handler.
29c6d5b78e06e8487d9eccb47070b0fb36cbb821
scenarios/dindind_execute.py
scenarios/dindind_execute.py
#!/usr/bin/env python # Copyright 2018 The Kubernetes Authors. # # 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 appli...
Add a scenario to initiliaze nested dind
Add a scenario to initiliaze nested dind
Python
apache-2.0
jlowdermilk/test-infra,dims/test-infra,michelle192837/test-infra,monopole/test-infra,jlowdermilk/test-infra,monopole/test-infra,kargakis/test-infra,abgworrall/test-infra,michelle192837/test-infra,fejta/test-infra,kargakis/test-infra,ixdy/kubernetes-test-infra,jessfraz/test-infra,BenTheElder/test-infra,michelle192837/te...
#!/usr/bin/env python # Copyright 2018 The Kubernetes Authors. # # 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 appli...
Add a scenario to initiliaze nested dind
f857771d98627722bc9c81ee3d039ab11c3e8afb
jsonfield/utils.py
jsonfield/utils.py
import datetime from decimal import Decimal from django.core.serializers.json import DjangoJSONEncoder class TZAwareJSONEncoder(DjangoJSONEncoder): def default(self, obj): if isinstance(obj, datetime.datetime): return obj.strftime("%Y-%m-%d %H:%M:%S%z") return super(TZAwareJSONEncoder,...
import datetime from decimal import Decimal from django.core.serializers.json import DjangoJSONEncoder DATETIME = (datetime.datetime,) DATE = (datetime.date,) TIME = (datetime.time,) try: import freezegun.api except ImportError: pass else: DATETIME += (freezegun.api.FakeDatetime,) DATE += (freezegun....
Make compatible with freezegun when testing.
Make compatible with freezegun when testing.
Python
bsd-3-clause
SideStudios/django-jsonfield
import datetime from decimal import Decimal from django.core.serializers.json import DjangoJSONEncoder DATETIME = (datetime.datetime,) DATE = (datetime.date,) TIME = (datetime.time,) try: import freezegun.api except ImportError: pass else: DATETIME += (freezegun.api.FakeDatetime,) DATE += (freezegun....
Make compatible with freezegun when testing. import datetime from decimal import Decimal from django.core.serializers.json import DjangoJSONEncoder class TZAwareJSONEncoder(DjangoJSONEncoder): def default(self, obj): if isinstance(obj, datetime.datetime): return obj.strftime("%Y-%m-%d %H:%M:%...
fd4ddd1a4978191fdb0d19960960c703569c6348
examples/rmg/minimal/input.py
examples/rmg/minimal/input.py
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'], kineticsEstimator = 'rate rules', ) # List of species species( label='et...
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = 'default', kineticsEstimator = 'rate rules', ) # List of species species( label='ethane', reactive=True, structur...
Set minimal example to 'default' kineticsFamilies.
Set minimal example to 'default' kineticsFamilies.
Python
mit
pierrelb/RMG-Py,faribas/RMG-Py,nickvandewiele/RMG-Py,enochd/RMG-Py,nickvandewiele/RMG-Py,KEHANG/RMG-Py,nyee/RMG-Py,comocheng/RMG-Py,enochd/RMG-Py,pierrelb/RMG-Py,KEHANG/RMG-Py,faribas/RMG-Py,comocheng/RMG-Py,chatelak/RMG-Py,chatelak/RMG-Py,nyee/RMG-Py
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = 'default', kineticsEstimator = 'rate rules', ) # List of species species( label='ethane', reactive=True, structur...
Set minimal example to 'default' kineticsFamilies. # Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'], kineticsEstimator = 'rate...
8c097f07eca52dc37e8d3d4591bb9ee1c05fa310
calexicon/calendars/tests/test_other.py
calexicon/calendars/tests/test_other.py
from datetime import date as vanilla_date from calendar_testing import CalendarTest from calexicon.calendars.other import JulianDayNumber class TestJulianDayNumber(CalendarTest): def setUp(self): self.calendar = JulianDayNumber() def test_make_date(self): vd = vanilla_date(2010, 8, 1) ...
from datetime import date as vanilla_date from calendar_testing import CalendarTest from calexicon.calendars.other import JulianDayNumber class TestJulianDayNumber(CalendarTest): def setUp(self): self.calendar = JulianDayNumber() def test_make_date(self): vd = vanilla_date(2010, 8, 1) ...
Add a new test - on date to day number conversion.
Add a new test - on date to day number conversion.
Python
apache-2.0
jwg4/qual,jwg4/calexicon
from datetime import date as vanilla_date from calendar_testing import CalendarTest from calexicon.calendars.other import JulianDayNumber class TestJulianDayNumber(CalendarTest): def setUp(self): self.calendar = JulianDayNumber() def test_make_date(self): vd = vanilla_date(2010, 8, 1) ...
Add a new test - on date to day number conversion. from datetime import date as vanilla_date from calendar_testing import CalendarTest from calexicon.calendars.other import JulianDayNumber class TestJulianDayNumber(CalendarTest): def setUp(self): self.calendar = JulianDayNumber() def test_make_date...
22821de77f2c9ca16ed95b7042f8e2e266c6afcb
astrobin/management/commands/message_all.py
astrobin/management/commands/message_all.py
from django.core.management.base import BaseCommand from django.contrib.auth.models import User import persistent_messages class Command(BaseCommand): help = "Sends a message to all users." def handle(self, *args, **options): if len(args) < 2: print "Need two arbuments: subject and body."...
Add command to message everybody.
Add command to message everybody.
Python
agpl-3.0
astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin
from django.core.management.base import BaseCommand from django.contrib.auth.models import User import persistent_messages class Command(BaseCommand): help = "Sends a message to all users." def handle(self, *args, **options): if len(args) < 2: print "Need two arbuments: subject and body."...
Add command to message everybody.
74adefcad1fe411b596981da7d124cda2f8e936d
mopidy/backends/local/__init__.py
mopidy/backends/local/__init__.py
from __future__ import unicode_literals import mopidy from mopidy import ext __doc__ = """A backend for playing music from a local music archive. This backend handles URIs starting with ``file:``. See :ref:`music-from-local-storage` for further instructions on using this backend. **Issues:** https://github.com/m...
from __future__ import unicode_literals import mopidy from mopidy import ext from mopidy.utils import config, formatting default_config = """ [ext.local] # If the local extension should be enabled or not enabled = true # Path to folder with local music music_path = $XDG_MUSIC_DIR # Path to playlist folder with m3...
Add default config and config schema
local: Add default config and config schema
Python
apache-2.0
jmarsik/mopidy,jmarsik/mopidy,jodal/mopidy,rawdlite/mopidy,ali/mopidy,SuperStarPL/mopidy,jcass77/mopidy,adamcik/mopidy,pacificIT/mopidy,diandiankan/mopidy,tkem/mopidy,swak/mopidy,diandiankan/mopidy,bacontext/mopidy,mokieyue/mopidy,pacificIT/mopidy,swak/mopidy,ZenithDK/mopidy,vrs01/mopidy,bencevans/mopidy,bacontext/mopi...
from __future__ import unicode_literals import mopidy from mopidy import ext from mopidy.utils import config, formatting default_config = """ [ext.local] # If the local extension should be enabled or not enabled = true # Path to folder with local music music_path = $XDG_MUSIC_DIR # Path to playlist folder with m3...
local: Add default config and config schema from __future__ import unicode_literals import mopidy from mopidy import ext __doc__ = """A backend for playing music from a local music archive. This backend handles URIs starting with ``file:``. See :ref:`music-from-local-storage` for further instructions on using thi...
53aecfed27a01ea3ae44f87e9223260c735c82c6
apps/reviews/models.py
apps/reviews/models.py
import itertools from django.db import models import amo from translations.fields import TranslatedField from translations.models import Translation class Review(amo.ModelBase): version = models.ForeignKey('versions.Version') user = models.ForeignKey('users.UserProfile') reply_to = models.ForeignKey('s...
import itertools from django.db import models import amo from translations.fields import TranslatedField from translations.models import Translation class Review(amo.ModelBase): version = models.ForeignKey('versions.Version') user = models.ForeignKey('users.UserProfile') reply_to = models.ForeignKey('s...
Update reviews model for new added field in 5.5
Update reviews model for new added field in 5.5
Python
bsd-3-clause
Prashant-Surya/addons-server,andymckay/zamboni,elysium001/zamboni,eviljeff/zamboni,eviljeff/zamboni,lavish205/olympia,psiinon/addons-server,mozilla/olympia,andymckay/olympia,wagnerand/addons-server,tsl143/zamboni,kumar303/olympia,andymckay/addons-server,jbalogh/zamboni,wagnerand/zamboni,crdoconnor/olympia,Revanth47/add...
import itertools from django.db import models import amo from translations.fields import TranslatedField from translations.models import Translation class Review(amo.ModelBase): version = models.ForeignKey('versions.Version') user = models.ForeignKey('users.UserProfile') reply_to = models.ForeignKey('s...
Update reviews model for new added field in 5.5 import itertools from django.db import models import amo from translations.fields import TranslatedField from translations.models import Translation class Review(amo.ModelBase): version = models.ForeignKey('versions.Version') user = models.ForeignKey('users....
cad1e9bac1694bcb297a962481a18fac5a90bb0e
froide/publicbody/widgets.py
froide/publicbody/widgets.py
import json from django import forms from .models import PublicBody class PublicBodySelect(forms.Widget): input_type = "text" template_name = 'publicbody/_chooser.html' initial_search = None class Media: extend = False js = ('js/publicbody.js',) def set_initial_search(self, sea...
import json from django import forms from .models import PublicBody class PublicBodySelect(forms.Widget): input_type = "text" template_name = 'publicbody/_chooser.html' initial_search = None class Media: extend = False js = ('js/publicbody.js',) def set_initial_search(self, sea...
Return a list for objects on pb widget
Return a list for objects on pb widget
Python
mit
stefanw/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide
import json from django import forms from .models import PublicBody class PublicBodySelect(forms.Widget): input_type = "text" template_name = 'publicbody/_chooser.html' initial_search = None class Media: extend = False js = ('js/publicbody.js',) def set_initial_search(self, sea...
Return a list for objects on pb widget import json from django import forms from .models import PublicBody class PublicBodySelect(forms.Widget): input_type = "text" template_name = 'publicbody/_chooser.html' initial_search = None class Media: extend = False js = ('js/publicbody.js',...
1c7928a5aeff55518bfda2b9a9ef1ec2a2ef76e4
corehq/celery_monitoring/tests.py
corehq/celery_monitoring/tests.py
from __future__ import absolute_import from __future__ import print_function import datetime from freezegun import freeze_time from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \ HEARTBEAT_FREQUENCY from testil import assert_raises, eq def test_heartbeat(): hb = Heartbeat('c...
from __future__ import absolute_import from __future__ import print_function import datetime from freezegun import freeze_time from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \ HEARTBEAT_FREQUENCY from testil import assert_raises, eq from corehq.celery_monitoring.signals import...
Add simple test for celery time to start timer
Add simple test for celery time to start timer
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
from __future__ import absolute_import from __future__ import print_function import datetime from freezegun import freeze_time from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \ HEARTBEAT_FREQUENCY from testil import assert_raises, eq from corehq.celery_monitoring.signals import...
Add simple test for celery time to start timer from __future__ import absolute_import from __future__ import print_function import datetime from freezegun import freeze_time from corehq.celery_monitoring.heartbeat import Heartbeat, HeartbeatNeverRecorded, \ HEARTBEAT_FREQUENCY from testil import assert_raises, ...
4d8ee930b772329b4c3ded17a5a04efb7dada977
tests/test__compat.py
tests/test__compat.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest import numpy as np import dask import dask.array as da import dask.array.utils as dau import dask_distance._compat @pytest.mark.parametrize("x", [ list(range(5)), np.random.randint(10, size=(15, 16)), da.random.randint(10, size=(15, 16), chu...
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest import numpy as np import dask.array as da import dask.array.utils as dau import dask_distance._compat @pytest.mark.parametrize("x", [ list(range(5)), np.random.randint(10, size=(15, 16)), da.random.randint(10, size=(15, 16), chunks=(5, 5)),...
Drop unused import from _compat tests
Drop unused import from _compat tests
Python
bsd-3-clause
jakirkham/dask-distance
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest import numpy as np import dask.array as da import dask.array.utils as dau import dask_distance._compat @pytest.mark.parametrize("x", [ list(range(5)), np.random.randint(10, size=(15, 16)), da.random.randint(10, size=(15, 16), chunks=(5, 5)),...
Drop unused import from _compat tests #!/usr/bin/env python # -*- coding: utf-8 -*- import pytest import numpy as np import dask import dask.array as da import dask.array.utils as dau import dask_distance._compat @pytest.mark.parametrize("x", [ list(range(5)), np.random.randint(10, size=(15, 16)), d...
dfb11ba136359e9624b05af2e065eac8d8cd5111
plankton/lcg/lcg.py
plankton/lcg/lcg.py
from collections import namedtuple from ..prng import PRNG class LCG(PRNG): LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier 'c', # Increment 'm']) # Modulus def __init__(self): self._state ...
from collections import namedtuple from ..prng import PRNG class LCG(PRNG): LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier 'c', # Increment 'm']) # Modulus def __init__(self): self._state ...
Use seed function in constructor since some LCGs might overwrite it.
Use seed function in constructor since some LCGs might overwrite it.
Python
mit
SpacePlant/Plankton
from collections import namedtuple from ..prng import PRNG class LCG(PRNG): LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier 'c', # Increment 'm']) # Modulus def __init__(self): self._state ...
Use seed function in constructor since some LCGs might overwrite it. from collections import namedtuple from ..prng import PRNG class LCG(PRNG): LCGConstants = namedtuple('LCGConstants', ['a', # Multiplier 'c', # Increment ...
600fe835ddce18a6aec5702766350003f2f90745
gen-android-icons.py
gen-android-icons.py
__author__ = 'Maksim Dmitriev' import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--foo', help='foo help', required=True) args = parser.parse_args()
__author__ = 'Maksim Dmitriev' import argparse import os if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('-s', '--source', help='the icon to be resized', required=True) parser.add_argument('-d', '--dest', help='the directory where resized icons are saved') parser.add_...
Create an output directory unless it exists
Create an output directory unless it exists
Python
bsd-3-clause
MaksimDmitriev/Python-Scripts
__author__ = 'Maksim Dmitriev' import argparse import os if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('-s', '--source', help='the icon to be resized', required=True) parser.add_argument('-d', '--dest', help='the directory where resized icons are saved') parser.add_...
Create an output directory unless it exists __author__ = 'Maksim Dmitriev' import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--foo', help='foo help', required=True) args = parser.parse_args()
8c3b78d8c9f4beda07959f61c09de3f67023461e
corehq/apps/reminders/management/commands/check_for_old_reminders.py
corehq/apps/reminders/management/commands/check_for_old_reminders.py
from django.core.management.base import BaseCommand from corehq.apps.reminders.models import (CaseReminderHandler, UI_COMPLEX, ON_DATETIME, REMINDER_TYPE_DEFAULT, RECIPIENT_SURVEY_SAMPLE) from dimagi.utils.couch.database import iter_docs class Command(BaseCommand): """ The new reminders UI removes su...
Add script to check for unsupported edge cases
Add script to check for unsupported edge cases
Python
bsd-3-clause
qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq
from django.core.management.base import BaseCommand from corehq.apps.reminders.models import (CaseReminderHandler, UI_COMPLEX, ON_DATETIME, REMINDER_TYPE_DEFAULT, RECIPIENT_SURVEY_SAMPLE) from dimagi.utils.couch.database import iter_docs class Command(BaseCommand): """ The new reminders UI removes su...
Add script to check for unsupported edge cases
2994466719ce4f096d68a24c2e20fdd9ffc4232d
project/api/backends.py
project/api/backends.py
# Third-Party from django_filters.rest_framework.backends import DjangoFilterBackend from dry_rest_permissions.generics import DRYPermissionFiltersBase class CoalesceFilterBackend(DjangoFilterBackend): """Support Ember Data coalesceFindRequests.""" def filter_queryset(self, request, queryset, view): ...
# Third-Party from django_filters.rest_framework.backends import DjangoFilterBackend class CoalesceFilterBackend(DjangoFilterBackend): """Support Ember Data coalesceFindRequests.""" def filter_queryset(self, request, queryset, view): raw = request.query_params.get('filter[id]') if raw: ...
Remove unused score filter backend
Remove unused score filter backend
Python
bsd-2-clause
dbinetti/barberscore-django,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api
# Third-Party from django_filters.rest_framework.backends import DjangoFilterBackend class CoalesceFilterBackend(DjangoFilterBackend): """Support Ember Data coalesceFindRequests.""" def filter_queryset(self, request, queryset, view): raw = request.query_params.get('filter[id]') if raw: ...
Remove unused score filter backend # Third-Party from django_filters.rest_framework.backends import DjangoFilterBackend from dry_rest_permissions.generics import DRYPermissionFiltersBase class CoalesceFilterBackend(DjangoFilterBackend): """Support Ember Data coalesceFindRequests.""" def filter_queryset(sel...
df4e3d8a1db1b9195b70d95eb4fdcd45a7ca4b23
util/device_profile_data.py
util/device_profile_data.py
#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 """Parse device output to extract LLVM profile data. The profile data obtained from the device is raw. Thus, it must be indexed before it can be used...
Implement a script for extracting profile data from device output
[util] Implement a script for extracting profile data from device output This change introduces a python script that extracts profile data from device output. Signed-off-by: Alphan Ulusoy <23b245cc5a07aacf75a9db847b24c67dee1707bf@google.com>
Python
apache-2.0
lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan
#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 """Parse device output to extract LLVM profile data. The profile data obtained from the device is raw. Thus, it must be indexed before it can be used...
[util] Implement a script for extracting profile data from device output This change introduces a python script that extracts profile data from device output. Signed-off-by: Alphan Ulusoy <23b245cc5a07aacf75a9db847b24c67dee1707bf@google.com>
01c74cfea946eac098a0e144380314cd4676cf2f
analysis/04-lowpass.py
analysis/04-lowpass.py
#!/usr/bin/env python from __future__ import division import climate import lmj.cubes import pandas as pd import scipy.signal logging = climate.get_logger('lowpass') def lowpass(df, freq=10., order=4): '''Filter marker data using a butterworth low-pass filter. This method alters the data in `df` in-place. ...
Split lowpass filtering into another script.
Split lowpass filtering into another script.
Python
mit
lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment
#!/usr/bin/env python from __future__ import division import climate import lmj.cubes import pandas as pd import scipy.signal logging = climate.get_logger('lowpass') def lowpass(df, freq=10., order=4): '''Filter marker data using a butterworth low-pass filter. This method alters the data in `df` in-place. ...
Split lowpass filtering into another script.
656780b827202fc08992321ec2a98e91cb02da3b
utilities/__init__.py
utilities/__init__.py
#! /usr/bin/env python from subprocess import Popen, PIPE def _popen(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
#! /usr/bin/env python from subprocess import Popen, PIPE def launch(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() def get_stdout(cmd): """ Fork the specified command, returning stdout ...
Add a wrapper to get just stdout back
Add a wrapper to get just stdout back
Python
mit
IanLee1521/utilities
#! /usr/bin/env python from subprocess import Popen, PIPE def launch(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() def get_stdout(cmd): """ Fork the specified command, returning stdout ...
Add a wrapper to get just stdout back #! /usr/bin/env python from subprocess import Popen, PIPE def _popen(cmd): """ Fork the specified command, returning a tuple of (stdout, stderr) """ return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
3f5a6dcd622d7b1c890ced67468ecebd02b1806f
mastertickets/db_default.py
mastertickets/db_default.py
# Created by Noah Kantrowitz on 2007-07-04. # Copyright (c) 2007 Noah Kantrowitz. All rights reserved. from trac.db import Table, Column name = 'mastertickets' version = 2 tables = [ Table('mastertickets', key=('source','dest'))[ Column('source', type='integer'), Column('dest', type='integer'), ...
# Created by Noah Kantrowitz on 2007-07-04. # Copyright (c) 2007 Noah Kantrowitz. All rights reserved. from trac.db import Table, Column name = 'mastertickets' version = 2 tables = [ Table('mastertickets', key=('source','dest'))[ Column('source', type='integer'), Column('dest', type='integer'), ...
Fix the migration to actual work.
Fix the migration to actual work.
Python
bsd-3-clause
SpamExperts/trac-masterticketsplugin,SpamExperts/trac-masterticketsplugin,SpamExperts/trac-masterticketsplugin
# Created by Noah Kantrowitz on 2007-07-04. # Copyright (c) 2007 Noah Kantrowitz. All rights reserved. from trac.db import Table, Column name = 'mastertickets' version = 2 tables = [ Table('mastertickets', key=('source','dest'))[ Column('source', type='integer'), Column('dest', type='integer'), ...
Fix the migration to actual work. # Created by Noah Kantrowitz on 2007-07-04. # Copyright (c) 2007 Noah Kantrowitz. All rights reserved. from trac.db import Table, Column name = 'mastertickets' version = 2 tables = [ Table('mastertickets', key=('source','dest'))[ Column('source', type='integer'), ...
edf38ad11631ad5e793eb9ac95dbc865595d517b
glue_vispy_viewers/common/layer_state.py
glue_vispy_viewers/common/layer_state.py
from __future__ import absolute_import, division, print_function from glue.external.echo import CallbackProperty, keep_in_sync from glue.core.state_objects import State __all__ = ['VispyLayerState'] class VispyLayerState(State): """ A base state object for all Vispy layers """ layer = CallbackPrope...
from __future__ import absolute_import, division, print_function from glue.external.echo import CallbackProperty, keep_in_sync from glue.core.state_objects import State from glue.core.message import LayerArtistUpdatedMessage __all__ = ['VispyLayerState'] class VispyLayerState(State): """ A base state object...
Make sure layer artist icon updates when changing the color mode or colormaps
Make sure layer artist icon updates when changing the color mode or colormaps
Python
bsd-2-clause
glue-viz/glue-vispy-viewers,PennyQ/astro-vispy,astrofrog/glue-3d-viewer,glue-viz/glue-3d-viewer,astrofrog/glue-vispy-viewers
from __future__ import absolute_import, division, print_function from glue.external.echo import CallbackProperty, keep_in_sync from glue.core.state_objects import State from glue.core.message import LayerArtistUpdatedMessage __all__ = ['VispyLayerState'] class VispyLayerState(State): """ A base state object...
Make sure layer artist icon updates when changing the color mode or colormaps from __future__ import absolute_import, division, print_function from glue.external.echo import CallbackProperty, keep_in_sync from glue.core.state_objects import State __all__ = ['VispyLayerState'] class VispyLayerState(State): """ ...
412d84fd08f55e20a23314cb09a8e49751df38c2
setup.py
setup.py
from distutils.core import Extension, setup try: from Cython.Distutils import build_ext except ImportError: use_cython = False else: use_cython = True if use_cython: extensions = [ Extension('mathix.vector', ['mathix/vector.pyx']), ] cmdclass = { 'build_ext': build_ext } ...
from distutils.core import Extension, setup try: from Cython.Build import cythonize from Cython.Distutils import build_ext except ImportError: use_cython = False else: use_cython = True if use_cython: extensions = cythonize([ Extension('mathix.vector', ['mathix/vector.pyx']), ]) ...
Use "cythonize" if Cython is installed.
Use "cythonize" if Cython is installed.
Python
mit
PeithVergil/cython-example
from distutils.core import Extension, setup try: from Cython.Build import cythonize from Cython.Distutils import build_ext except ImportError: use_cython = False else: use_cython = True if use_cython: extensions = cythonize([ Extension('mathix.vector', ['mathix/vector.pyx']), ]) ...
Use "cythonize" if Cython is installed. from distutils.core import Extension, setup try: from Cython.Distutils import build_ext except ImportError: use_cython = False else: use_cython = True if use_cython: extensions = [ Extension('mathix.vector', ['mathix/vector.pyx']), ] cmdclass ...
2a198df61a420e97b746d1a27a0f622be56e386c
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}.py
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}.py
# -*- coding: utf-8 -*- """ {{cookiecutter.repo_name}} ============================ The root of :class:`{{cookiecutter.app_class_name}}` is created from the kv file. """ import kivy kivy.require('{{cookiecutter.kivy_version}}') from kivy.app import App class {{cookiecutter.app_class_name}}(App): """Basic Kivy...
Implement a basic kivy application
Implement a basic kivy application
Python
mit
hackebrot/cookiedozer,hackebrot/cookiedozer
# -*- coding: utf-8 -*- """ {{cookiecutter.repo_name}} ============================ The root of :class:`{{cookiecutter.app_class_name}}` is created from the kv file. """ import kivy kivy.require('{{cookiecutter.kivy_version}}') from kivy.app import App class {{cookiecutter.app_class_name}}(App): """Basic Kivy...
Implement a basic kivy application
0e1dd74c70a2fa682b3cd3b0027162ad50ee9998
social/app/views/friend.py
social/app/views/friend.py
from django.http import HttpResponseRedirect from django.urls import reverse from django.views import generic from social.app.models.author import Author class FriendRequestsListView(generic.ListView): context_object_name = "all_friend_requests" template_name = "app/friend_requests_list.html" def get_qu...
from django.http import HttpResponseRedirect from django.urls import reverse from django.views import generic from social.app.models.author import Author class FriendRequestsListView(generic.ListView): context_object_name = "all_friend_requests" template_name = "app/friend_requests_list.html" def get_qu...
Put in a raise for status for now
Put in a raise for status for now
Python
apache-2.0
TeamAADGT/CMPUT404-project-socialdistribution,TeamAADGT/CMPUT404-project-socialdistribution,TeamAADGT/CMPUT404-project-socialdistribution
from django.http import HttpResponseRedirect from django.urls import reverse from django.views import generic from social.app.models.author import Author class FriendRequestsListView(generic.ListView): context_object_name = "all_friend_requests" template_name = "app/friend_requests_list.html" def get_qu...
Put in a raise for status for now from django.http import HttpResponseRedirect from django.urls import reverse from django.views import generic from social.app.models.author import Author class FriendRequestsListView(generic.ListView): context_object_name = "all_friend_requests" template_name = "app/friend_...
4c69a59f99fd5f425c31e3fdcbf6e3f78d82d9e4
vex_via_wrapper.py
vex_via_wrapper.py
import requests MATCH_LIST_URL = "http://data.vexvia.dwabtech.net/mobile/events/csv" DIVISION_URL = "http://data.vexvia.dwabtech.net/mobile/{}/divisions/csv" MATCH_URL = "http://data.vexvia.dwabtech.net/mobile/{}/{}/matches/csv" def get_events(iq=False): data = requests.get(MATCH_LIST_URL).text.split("\r\n")[1:-1...
import requests MATCH_LIST_URL = "http://data.vexvia.dwabtech.net/mobile/events/csv" DIVISION_URL = "http://data.vexvia.dwabtech.net/mobile/{}/divisions/csv" MATCH_URL = "http://data.vexvia.dwabtech.net/mobile/{}/{}/matches/csv" def get_events(is_iq: bool=False) -> list: """Get a list of iq events or edr events. ...
Add comments to vex via wrapper
Add comments to vex via wrapper
Python
mit
DLProgram/Project_Snake_Sort,DLProgram/Project_Snake_Sort
import requests MATCH_LIST_URL = "http://data.vexvia.dwabtech.net/mobile/events/csv" DIVISION_URL = "http://data.vexvia.dwabtech.net/mobile/{}/divisions/csv" MATCH_URL = "http://data.vexvia.dwabtech.net/mobile/{}/{}/matches/csv" def get_events(is_iq: bool=False) -> list: """Get a list of iq events or edr events. ...
Add comments to vex via wrapper import requests MATCH_LIST_URL = "http://data.vexvia.dwabtech.net/mobile/events/csv" DIVISION_URL = "http://data.vexvia.dwabtech.net/mobile/{}/divisions/csv" MATCH_URL = "http://data.vexvia.dwabtech.net/mobile/{}/{}/matches/csv" def get_events(iq=False): data = requests.get(MATCH_...
822e6123cc598b4f6a0eafedfb2f0d0cbfba5f37
currencies/migrations/0003_auto_20151216_1906.py
currencies/migrations/0003_auto_20151216_1906.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from extra_countries.models import ExtraCountry def add_currencies_with_countries(apps, schema_editor): # We can't import the model directly as it may be a newer # version than this migration expects. We use the...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from extra_countries.models import ExtraCountry def add_currencies_with_countries(apps, schema_editor): # We can't import the model directly as it may be a newer # version than this migration expects. We use the...
Fix currencies seeding, so it won't have empty currencies
Fix currencies seeding, so it won't have empty currencies
Python
mit
openspending/cosmopolitan,kiote/cosmopolitan
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from extra_countries.models import ExtraCountry def add_currencies_with_countries(apps, schema_editor): # We can't import the model directly as it may be a newer # version than this migration expects. We use the...
Fix currencies seeding, so it won't have empty currencies # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from extra_countries.models import ExtraCountry def add_currencies_with_countries(apps, schema_editor): # We can't import the model directly as it may be a ...
4fb54ac1b06f368d788526a7400c377c715f594c
epf.py
epf.py
from __future__ import division # for Python 2.x compatibility import numpy class EuclidField(object): p = 5.0 r = 30.0 @staticmethod def dist(x, y): return numpy.hypot(x[0]-y[0], x[1]-y[1]) def __init__(self, size, dst, obstacles): w, h = size self.shape = (h, w) se...
from __future__ import division # for Python 2.x compatibility import numpy class EuclidField(object): p = 5.0 r = 30.0 @staticmethod def dist(x, y): return numpy.hypot(x[0]-y[0], x[1]-y[1]) def __init__(self, size, dst, obstacles): w, h = size self.shape = (h, w) se...
Remove a line of debugging code
Remove a line of debugging code
Python
bsd-2-clause
z-rui/pf
from __future__ import division # for Python 2.x compatibility import numpy class EuclidField(object): p = 5.0 r = 30.0 @staticmethod def dist(x, y): return numpy.hypot(x[0]-y[0], x[1]-y[1]) def __init__(self, size, dst, obstacles): w, h = size self.shape = (h, w) se...
Remove a line of debugging code from __future__ import division # for Python 2.x compatibility import numpy class EuclidField(object): p = 5.0 r = 30.0 @staticmethod def dist(x, y): return numpy.hypot(x[0]-y[0], x[1]-y[1]) def __init__(self, size, dst, obstacles): w, h = size ...
6c04c2dc0647f7103000aee2996ce243f7fe3535
thinc/tests/layers/test_hash_embed.py
thinc/tests/layers/test_hash_embed.py
import numpy from thinc.api import HashEmbed def test_init(): model = HashEmbed(64, 1000).initialize() assert model.get_dim("nV") == 1000 assert model.get_dim("nO") == 64 assert model.get_param("E").shape == (1001, 64) def test_seed_changes_bucket(): model1 = HashEmbed(64, 1000, seed=2).initiali...
import numpy from thinc.api import HashEmbed def test_init(): model = HashEmbed(64, 1000).initialize() assert model.get_dim("nV") == 1000 assert model.get_dim("nO") == 64 assert model.get_param("E").shape == (1000, 64) def test_seed_changes_bucket(): model1 = HashEmbed(64, 1000, seed=2).initiali...
Fix off-by-one in HashEmbed test
Fix off-by-one in HashEmbed test
Python
mit
explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc
import numpy from thinc.api import HashEmbed def test_init(): model = HashEmbed(64, 1000).initialize() assert model.get_dim("nV") == 1000 assert model.get_dim("nO") == 64 assert model.get_param("E").shape == (1000, 64) def test_seed_changes_bucket(): model1 = HashEmbed(64, 1000, seed=2).initiali...
Fix off-by-one in HashEmbed test import numpy from thinc.api import HashEmbed def test_init(): model = HashEmbed(64, 1000).initialize() assert model.get_dim("nV") == 1000 assert model.get_dim("nO") == 64 assert model.get_param("E").shape == (1001, 64) def test_seed_changes_bucket(): model1 = Ha...
2f87d814a973f1e0ae456fde6d42947a5a72f017
setup.py
setup.py
#! /usr/bin/env python from setuptools import find_packages, setup setup(name='oemof.db', version='0.0.4', description='The oemof database extension', namespace_package = ['oemof'], packages=find_packages(), package_dir={'oemof': 'oemof'}, install_requires=['sqlalchemy >= 1.0', ...
#! /usr/bin/env python from setuptools import find_packages, setup setup(name='oemof.db', version='0.0.4', description='The oemof database extension', namespace_package = ['oemof'], packages=find_packages(), package_dir={'oemof': 'oemof'}, install_requires=['sqlalchemy >= 1.0', ...
Add pandas as required package
Add pandas as required package
Python
mit
oemof/oemof.db
#! /usr/bin/env python from setuptools import find_packages, setup setup(name='oemof.db', version='0.0.4', description='The oemof database extension', namespace_package = ['oemof'], packages=find_packages(), package_dir={'oemof': 'oemof'}, install_requires=['sqlalchemy >= 1.0', ...
Add pandas as required package #! /usr/bin/env python from setuptools import find_packages, setup setup(name='oemof.db', version='0.0.4', description='The oemof database extension', namespace_package = ['oemof'], packages=find_packages(), package_dir={'oemof': 'oemof'}, install_re...
7c3ac5adc33d2048f28a96d8145e71a4c12518cc
udata/__init__.py
udata/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' uData ''' from __future__ import unicode_literals __version__ = '1.5.1.dev' __description__ = 'Open data portal'
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' uData ''' from __future__ import unicode_literals __version__ = '1.6.0.dev' __description__ = 'Open data portal'
Set base version to 1.6
Set base version to 1.6
Python
agpl-3.0
etalab/udata,opendatateam/udata,opendatateam/udata,opendatateam/udata,etalab/udata,etalab/udata
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' uData ''' from __future__ import unicode_literals __version__ = '1.6.0.dev' __description__ = 'Open data portal'
Set base version to 1.6 #!/usr/bin/env python # -*- coding: utf-8 -*- ''' uData ''' from __future__ import unicode_literals __version__ = '1.5.1.dev' __description__ = 'Open data portal'
70a642c0597fb2f929fc83d821c8b1f095ed1328
proxy/plugins/plugins.py
proxy/plugins/plugins.py
packetFunctions = {} commands = {} onStart = [] onConnection = [] onConnectionLoss = [] class packetHook(object): def __init__(self, pktType, pktSubtype): self.pktType = pktType self.pktSubtype = pktSubtype def __call__(self, f): global packetFunctions packetFunctions[(self.pktType, self.pktSubtype)] = f c...
packetFunctions = {} commands = {} onStart = [] onConnection = [] onConnectionLoss = [] class packetHook(object): def __init__(self, pktType, pktSubtype): self.pktType = pktType self.pktSubtype = pktSubtype def __call__(self, f): global packetFunctions if (self.pktType, self.pktSubtype) not in packetFunctio...
Allow mutiple hooks for packets
Allow mutiple hooks for packets
Python
agpl-3.0
alama/PSO2Proxy,alama/PSO2Proxy,flyergo/PSO2Proxy,alama/PSO2Proxy,cyberkitsune/PSO2Proxy,cyberkitsune/PSO2Proxy,flyergo/PSO2Proxy,cyberkitsune/PSO2Proxy
packetFunctions = {} commands = {} onStart = [] onConnection = [] onConnectionLoss = [] class packetHook(object): def __init__(self, pktType, pktSubtype): self.pktType = pktType self.pktSubtype = pktSubtype def __call__(self, f): global packetFunctions if (self.pktType, self.pktSubtype) not in packetFunctio...
Allow mutiple hooks for packets packetFunctions = {} commands = {} onStart = [] onConnection = [] onConnectionLoss = [] class packetHook(object): def __init__(self, pktType, pktSubtype): self.pktType = pktType self.pktSubtype = pktSubtype def __call__(self, f): global packetFunctions packetFunctions[(self....
0e0d41e875236c421cd1016449f56c4fa6717c2e
examples/shp_lines_to_polygons.py
examples/shp_lines_to_polygons.py
#!/usr/bin/env python from __future__ import print_function from stompy.spatial import join_features from optparse import OptionParser try: from osgeo import ogr except ImportError: import ogr # # How to use this: # ### Load shapefile # ods = ogr.Open("/home/rusty/classes/research/spatialdata/us/ca/suntans/s...
Add CLI for joining lines to polygons
Add CLI for joining lines to polygons
Python
mit
rustychris/stompy,rustychris/stompy
#!/usr/bin/env python from __future__ import print_function from stompy.spatial import join_features from optparse import OptionParser try: from osgeo import ogr except ImportError: import ogr # # How to use this: # ### Load shapefile # ods = ogr.Open("/home/rusty/classes/research/spatialdata/us/ca/suntans/s...
Add CLI for joining lines to polygons
882fc867ab115f2b84f2f185bcebf3eb4a1d2fc8
core/forms.py
core/forms.py
from django.forms import ModelForm from django.forms.fields import CharField from models import UserProfile class UserProfileForm(ModelForm): first_name = CharField(label='First name', required=False) last_name = CharField(label='Last name', required=False) class Meta: model = UserProfile ...
from django.forms import ModelForm from django.forms.fields import CharField from models import UserProfile class UserProfileForm(ModelForm): first_name = CharField(label='First name', required=False) last_name = CharField(label='Last name', required=False) class Meta: model = UserProfile ...
Fix profile creation. (Need tests badly).
Fix profile creation. (Need tests badly).
Python
mit
kenwang76/readthedocs.org,soulshake/readthedocs.org,nyergler/pythonslides,gjtorikian/readthedocs.org,tddv/readthedocs.org,kenshinthebattosai/readthedocs.org,ojii/readthedocs.org,LukasBoersma/readthedocs.org,mhils/readthedocs.org,sid-kap/readthedocs.org,michaelmcandrew/readthedocs.org,michaelmcandrew/readthedocs.org,oji...
from django.forms import ModelForm from django.forms.fields import CharField from models import UserProfile class UserProfileForm(ModelForm): first_name = CharField(label='First name', required=False) last_name = CharField(label='Last name', required=False) class Meta: model = UserProfile ...
Fix profile creation. (Need tests badly). from django.forms import ModelForm from django.forms.fields import CharField from models import UserProfile class UserProfileForm(ModelForm): first_name = CharField(label='First name', required=False) last_name = CharField(label='Last name', required=False) cl...
9745638bbb58b0ccef543a76d1f0677d4dda6c03
setup.py
setup.py
from setuptools import find_packages, setup import versioneer setup( name="bmipy", version=versioneer.get_version(), description="Basic Model Interface for Python", author="Eric Hutton", author_email="huttone@colorado.edu", url="http://csdms.colorado.edu", classifiers=[ "Intended ...
from setuptools import find_packages, setup import versioneer setup( name="bmipy", version=versioneer.get_version(), description="Basic Model Interface for Python", author="Eric Hutton", author_email="huttone@colorado.edu", url="http://csdms.colorado.edu", classifiers=[ "Intended ...
Add numpy as an install requirement.
Add numpy as an install requirement.
Python
mit
csdms/bmi-python
from setuptools import find_packages, setup import versioneer setup( name="bmipy", version=versioneer.get_version(), description="Basic Model Interface for Python", author="Eric Hutton", author_email="huttone@colorado.edu", url="http://csdms.colorado.edu", classifiers=[ "Intended ...
Add numpy as an install requirement. from setuptools import find_packages, setup import versioneer setup( name="bmipy", version=versioneer.get_version(), description="Basic Model Interface for Python", author="Eric Hutton", author_email="huttone@colorado.edu", url="http://csdms.colorado.edu"...
28e9cd3e9d047883668263e595978392cd208ac5
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import os def readfile(fname): with open(os.path.join(os.path.dirname(__file__), fname)) as f: return f.read() setup( name="imagesort", version="0.2.0", packages=find_packages(), install_requires=[ 'ExifRead>=1.4...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import os def readfile(fname): with open(os.path.join(os.path.dirname(__file__), fname)) as f: return f.read() setup( name="imagesort", version="0.2.0", packages=find_packages(), install_requires=[ 'ExifRead>=1.4...
Mark package as OS independent
Mark package as OS independent
Python
mit
leinz/imagesort
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import os def readfile(fname): with open(os.path.join(os.path.dirname(__file__), fname)) as f: return f.read() setup( name="imagesort", version="0.2.0", packages=find_packages(), install_requires=[ 'ExifRead>=1.4...
Mark package as OS independent # -*- coding: utf-8 -*- from setuptools import setup, find_packages import os def readfile(fname): with open(os.path.join(os.path.dirname(__file__), fname)) as f: return f.read() setup( name="imagesort", version="0.2.0", packages=find_packages(), install_r...
7d6d73dab90be9d3c77cfd81d73e0b5e21c340fa
playlist-to-yaml.py
playlist-to-yaml.py
"""Convert Exportify csv Spotify playlists to yaml.""" import os import glob import pandas import yaml csv_files = glob.glob("*.csv") for playlist_file in csv_files: playlist_name, _ = os.path.splitext(playlist_file) yaml_file = 'yaml/{}.yaml'.format(playlist_name) print("- {}".format(yaml_file)) pl...
Convert a Spotify playylist from Exportify to yaml
Convert a Spotify playylist from Exportify to yaml
Python
mit
mdpiper/wunderkammer,mdpiper/wunderkammer,mdpiper/wunderkammer,mdpiper/wunderkammer
"""Convert Exportify csv Spotify playlists to yaml.""" import os import glob import pandas import yaml csv_files = glob.glob("*.csv") for playlist_file in csv_files: playlist_name, _ = os.path.splitext(playlist_file) yaml_file = 'yaml/{}.yaml'.format(playlist_name) print("- {}".format(yaml_file)) pl...
Convert a Spotify playylist from Exportify to yaml
66c1b353a7fce078fc9c4209e453906b098a22e8
tests/common.py
tests/common.py
from pprint import pprint, pformat import datetime import os import itertools from sgmock import Fixture from sgmock import TestCase if 'USE_SHOTGUN' in os.environ: from shotgun_api3 import ShotgunError, Fault import shotgun_api3_registry def Shotgun(): return shotgun_api3_registry.connect('sgsess...
from pprint import pprint, pformat import datetime import itertools import os from sgmock import Fixture from sgmock import TestCase _shotgun_server = os.environ.get('SHOTGUN', 'mock') if _shotgun_server == 'mock': from sgmock import Shotgun, ShotgunError, Fault else: from shotgun_api3 import ShotgunError, Fa...
Change the way we test the real Shotgun server
Change the way we test the real Shotgun server
Python
bsd-3-clause
westernx/sgfs,westernx/sgfs
from pprint import pprint, pformat import datetime import itertools import os from sgmock import Fixture from sgmock import TestCase _shotgun_server = os.environ.get('SHOTGUN', 'mock') if _shotgun_server == 'mock': from sgmock import Shotgun, ShotgunError, Fault else: from shotgun_api3 import ShotgunError, Fa...
Change the way we test the real Shotgun server from pprint import pprint, pformat import datetime import os import itertools from sgmock import Fixture from sgmock import TestCase if 'USE_SHOTGUN' in os.environ: from shotgun_api3 import ShotgunError, Fault import shotgun_api3_registry def Shotgun(): ...
3358d47cc9bdad5abaa1e8a9358d49539e6256b1
scuevals_api/resources/official_user_types.py
scuevals_api/resources/official_user_types.py
from flask_jwt_extended import current_user from flask_restful import Resource from marshmallow import fields, Schema from scuevals_api.auth import auth_required from scuevals_api.models import Permission, OfficialUserType, db from scuevals_api.utils import use_args class OfficialUserTypeSchema(Schema): email = ...
from flask_jwt_extended import current_user from flask_restful import Resource from marshmallow import fields, Schema from scuevals_api.auth import auth_required from scuevals_api.models import Permission, OfficialUserType, db from scuevals_api.utils import use_args class OfficialUserTypeSchema(Schema): email = ...
Make sure official user type emails are lower case
Make sure official user type emails are lower case
Python
agpl-3.0
SCUEvals/scuevals-api,SCUEvals/scuevals-api
from flask_jwt_extended import current_user from flask_restful import Resource from marshmallow import fields, Schema from scuevals_api.auth import auth_required from scuevals_api.models import Permission, OfficialUserType, db from scuevals_api.utils import use_args class OfficialUserTypeSchema(Schema): email = ...
Make sure official user type emails are lower case from flask_jwt_extended import current_user from flask_restful import Resource from marshmallow import fields, Schema from scuevals_api.auth import auth_required from scuevals_api.models import Permission, OfficialUserType, db from scuevals_api.utils import use_args ...
9a145fd5df247d1b018cc8cb66ce89659a39f874
pygame/color.py
pygame/color.py
class Color(object): def __init__(self, *args): if len(args) == 4: r, g, b, a = args else: raise NotImplementedError("implement me") self.r = r self.g = g self.b = b self.a = a
Make blitting work (the basics anyway)
Make blitting work (the basics anyway)
Python
lgpl-2.1
caseyc37/pygame_cffi,GertBurger/pygame_cffi,CTPUG/pygame_cffi,caseyc37/pygame_cffi,CTPUG/pygame_cffi,GertBurger/pygame_cffi,GertBurger/pygame_cffi,GertBurger/pygame_cffi,CTPUG/pygame_cffi,caseyc37/pygame_cffi
class Color(object): def __init__(self, *args): if len(args) == 4: r, g, b, a = args else: raise NotImplementedError("implement me") self.r = r self.g = g self.b = b self.a = a
Make blitting work (the basics anyway)
5c66a9d8c7b53338d37ef9e959e55e14511f7c84
packages/Python/lldbsuite/test/commands/gui/invalid-args/TestInvalidArgsGui.py
packages/Python/lldbsuite/test/commands/gui/invalid-args/TestInvalidArgsGui.py
import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * class GuiTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): TestBase.setUp(self) @no_debug_info_test def test_reproducer_generate_invalid_invocation(self): self.expect...
Add test for invalid gui command
[lldb][NFC] Add test for invalid gui command git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@370647 91177308-0d34-0410-b5e6-96231b3b80d8
Python
apache-2.0
llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb
import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * class GuiTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): TestBase.setUp(self) @no_debug_info_test def test_reproducer_generate_invalid_invocation(self): self.expect...
[lldb][NFC] Add test for invalid gui command git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@370647 91177308-0d34-0410-b5e6-96231b3b80d8
6b0673334d14dca0e64ab9a760d8652b29e26b07
fs/test/test_mkdir.py
fs/test/test_mkdir.py
from __future__ import with_statement from nose.tools import ( eq_ as eq, ) from fs.test.util import ( maketemp, assert_raises, ) import errno import os import fs def test_mkdir(): tmp = maketemp() fs.path(tmp).child('foo').mkdir() foo = os.path.join(tmp, 'foo') assert os.path.i...
Add more tests for mkdir.
Add more tests for mkdir.
Python
mit
tv42/fs,nailor/filesystem
from __future__ import with_statement from nose.tools import ( eq_ as eq, ) from fs.test.util import ( maketemp, assert_raises, ) import errno import os import fs def test_mkdir(): tmp = maketemp() fs.path(tmp).child('foo').mkdir() foo = os.path.join(tmp, 'foo') assert os.path.i...
Add more tests for mkdir.
05ed915cab57ec8014a4d4636687132694171218
setup.py
setup.py
from setuptools import setup, find_packages import populous requirements = [ "click", ] setup( name="populous", version=populous.__version__, url=populous.__url__, description=populous.__doc__, author=populous.__author__, license=populous.__license__, long_description="TODO", pack...
from setuptools import setup, find_packages import populous requirements = [ "click", "cached-property", ] setup( name="populous", version=populous.__version__, url=populous.__url__, description=populous.__doc__, author=populous.__author__, license=populous.__license__, long_descr...
Add cached-property to the dependencies
Add cached-property to the dependencies
Python
mit
novafloss/populous
from setuptools import setup, find_packages import populous requirements = [ "click", "cached-property", ] setup( name="populous", version=populous.__version__, url=populous.__url__, description=populous.__doc__, author=populous.__author__, license=populous.__license__, long_descr...
Add cached-property to the dependencies from setuptools import setup, find_packages import populous requirements = [ "click", ] setup( name="populous", version=populous.__version__, url=populous.__url__, description=populous.__doc__, author=populous.__author__, license=populous.__license...
e3c9adf810ac97f8780dbed03fb190d388e11926
setup.py
setup.py
import os from setuptools import find_packages from setuptools import setup import sys sys.path.insert(0, os.path.abspath('lib')) exec(open('lib/ansiblereview/version.py').read()) setup( name='ansible-review', version=__version__, description=('reviews ansible playbooks, roles and inventory and suggests...
import os from setuptools import find_packages from setuptools import setup import sys sys.path.insert(0, os.path.abspath('lib')) exec(open('lib/ansiblereview/version.py').read()) setup( name='ansible-review', version=__version__, description=('reviews ansible playbooks, roles and inventory and suggests...
Add flake8 to installation dependencies
Add flake8 to installation dependencies
Python
mit
willthames/ansible-review
import os from setuptools import find_packages from setuptools import setup import sys sys.path.insert(0, os.path.abspath('lib')) exec(open('lib/ansiblereview/version.py').read()) setup( name='ansible-review', version=__version__, description=('reviews ansible playbooks, roles and inventory and suggests...
Add flake8 to installation dependencies import os from setuptools import find_packages from setuptools import setup import sys sys.path.insert(0, os.path.abspath('lib')) exec(open('lib/ansiblereview/version.py').read()) setup( name='ansible-review', version=__version__, description=('reviews ansible pl...
f600ec497a6ff20c4cd8c983e27482fc77ab4deb
moksha/api/hub/consumer.py
moksha/api/hub/consumer.py
""" Consumers ========= A `Consumer` is a simple consumer of messages. Based on a given `routing_key`, your consumer's :meth:`consume` method will be called with the message. Example consumers: -tapping into a koji build, and sending a notification? - hook into a given RSS feed and save data in a DB? Addin...
# This file is part of Moksha. # # Moksha is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Moksha is distributed in the hope that it...
Update our message Consumer api to consume a `topic`, not a `queue`.
Update our message Consumer api to consume a `topic`, not a `queue`.
Python
apache-2.0
lmacken/moksha,mokshaproject/moksha,pombredanne/moksha,pombredanne/moksha,lmacken/moksha,pombredanne/moksha,mokshaproject/moksha,ralphbean/moksha,mokshaproject/moksha,mokshaproject/moksha,ralphbean/moksha,ralphbean/moksha,pombredanne/moksha,lmacken/moksha
# This file is part of Moksha. # # Moksha is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Moksha is distributed in the hope that it...
Update our message Consumer api to consume a `topic`, not a `queue`. """ Consumers ========= A `Consumer` is a simple consumer of messages. Based on a given `routing_key`, your consumer's :meth:`consume` method will be called with the message. Example consumers: -tapping into a koji build, and sending a notifi...
c35887025a2127a527862e664d1ef3bb5c4f528a
Constants.py
Constants.py
IRC_numeric_to_name = {"001": "RPL_WELCOME", "372": "RPL_MOTD", "375": "RPL_MOTDSTART", "376": "RPL_ENDOFMOTD", "433": "ERR_NICKNAMEINUSE"} CTCP_DELIMITER = chr(1)
IRC_numeric_to_name = {"001": "RPL_WELCOME", "315": "RPL_ENDOFWHO", "352": "RPL_WHOREPLY", "372": "RPL_MOTD", "375": "RPL_MOTDSTART", "376": "RPL_ENDOFMOTD", "433": "ERR_NICKNAMEINUSE"} CTCP_DELIMITER = chr(1)
Add some needed IRC numerics
Add some needed IRC numerics
Python
mit
Didero/DideRobot
IRC_numeric_to_name = {"001": "RPL_WELCOME", "315": "RPL_ENDOFWHO", "352": "RPL_WHOREPLY", "372": "RPL_MOTD", "375": "RPL_MOTDSTART", "376": "RPL_ENDOFMOTD", "433": "ERR_NICKNAMEINUSE"} CTCP_DELIMITER = chr(1)
Add some needed IRC numerics IRC_numeric_to_name = {"001": "RPL_WELCOME", "372": "RPL_MOTD", "375": "RPL_MOTDSTART", "376": "RPL_ENDOFMOTD", "433": "ERR_NICKNAMEINUSE"} CTCP_DELIMITER = chr(1)
a42ffdcd34876bcd1df81ce00dbfd6426580bd82
gaphor/UML/classes/copypaste.py
gaphor/UML/classes/copypaste.py
import itertools from gaphor.diagram.copypaste import copy, copy_named_element from gaphor.UML import Association, Class, Interface, Operation @copy.register(Class) @copy.register(Interface) def copy_class(element): yield element.id, copy_named_element(element) for feature in itertools.chain( element...
import itertools from gaphor.diagram.copypaste import copy, copy_named_element from gaphor.UML import Association, Class, Enumeration, Interface, Operation @copy.register(Class) @copy.register(Interface) def copy_class(element): yield element.id, copy_named_element(element) for feature in itertools.chain( ...
Copy enumeration literals when pasting an Enumeration
Copy enumeration literals when pasting an Enumeration Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
Python
lgpl-2.1
amolenaar/gaphor,amolenaar/gaphor
import itertools from gaphor.diagram.copypaste import copy, copy_named_element from gaphor.UML import Association, Class, Enumeration, Interface, Operation @copy.register(Class) @copy.register(Interface) def copy_class(element): yield element.id, copy_named_element(element) for feature in itertools.chain( ...
Copy enumeration literals when pasting an Enumeration Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me> import itertools from gaphor.diagram.copypaste import copy, copy_named_element from gaphor.UML import Association, Class, Interface, Operation @copy.register(Class) @copy.register(Interf...
b05ba019143cc39ba0d02d822824172313e78591
aubergine/celery.py
aubergine/celery.py
from __future__ import absolute_import from celery import Celery app = Celery('aubergine') app.config_from_object('aubergine.settings.celeryconfig') app.autodiscover_tasks(['aubergine'], related_name='tasks') app.setup_security() @app.task(bind=True) def debug_task(self): print('Request: {0!r}'.format(self.req...
from __future__ import absolute_import from celery import Celery app = Celery('aubergine') app.config_from_object('aubergine.settings.celeryconfig') app.autodiscover_tasks(['aubergine'], related_name='tasks') # For message signing # app.setup_security() @app.task(bind=True) def debug_task(self): print('Reques...
Disable message signing for now
Disable message signing for now
Python
bsd-3-clause
michaelwisely/aubergine
from __future__ import absolute_import from celery import Celery app = Celery('aubergine') app.config_from_object('aubergine.settings.celeryconfig') app.autodiscover_tasks(['aubergine'], related_name='tasks') # For message signing # app.setup_security() @app.task(bind=True) def debug_task(self): print('Reques...
Disable message signing for now from __future__ import absolute_import from celery import Celery app = Celery('aubergine') app.config_from_object('aubergine.settings.celeryconfig') app.autodiscover_tasks(['aubergine'], related_name='tasks') app.setup_security() @app.task(bind=True) def debug_task(self): print...
a93635977bbdbe8d0ebfbc054b068c7e5fae7e9c
runners/serializers.py
runners/serializers.py
from rest_framework import serializers from .models import Runner, RunnerVersion class RunnerVersionSerializer(serializers.ModelSerializer): class Meta(object): model = RunnerVersion fields = ('version', 'path') class RunnerSerializer(serializers.ModelSerializer): versions = RunnerVersionSer...
from rest_framework import serializers from .models import Runner, RunnerVersion class RunnerVersionSerializer(serializers.ModelSerializer): class Meta(object): model = RunnerVersion fields = ('version', 'url') class RunnerSerializer(serializers.ModelSerializer): versions = RunnerVersionSeri...
Fix url field for runner version serializer
Fix url field for runner version serializer
Python
agpl-3.0
lutris/website,lutris/website,Turupawn/website,lutris/website,lutris/website,Turupawn/website,Turupawn/website,Turupawn/website
from rest_framework import serializers from .models import Runner, RunnerVersion class RunnerVersionSerializer(serializers.ModelSerializer): class Meta(object): model = RunnerVersion fields = ('version', 'url') class RunnerSerializer(serializers.ModelSerializer): versions = RunnerVersionSeri...
Fix url field for runner version serializer from rest_framework import serializers from .models import Runner, RunnerVersion class RunnerVersionSerializer(serializers.ModelSerializer): class Meta(object): model = RunnerVersion fields = ('version', 'path') class RunnerSerializer(serializers.Mode...
259dab25fb2aceb3b5fa229eb41d3eacf8f1c71c
nanomon/scheduler/__init__.py
nanomon/scheduler/__init__.py
import base64 import json import Queue import time import logging from boto import sns from boto import sqs from boto.sqs.message import Message, RawMessage from nanomon.utils import yaml_includes from nanomon.message import NanoMessage from nanomon.queue import QueueWorker from nanomon.queue.backends.sns_sqs import ...
import base64 import json import Queue import time import logging from boto import sns from boto import sqs from boto.sqs.message import Message, RawMessage from nanomon.utils import yaml_includes from nanomon.message import NanoMessage from nanomon.queue import QueueWorker from nanomon.queue.backends.sns_sqs import ...
Update for new node definition syntax
Update for new node definition syntax
Python
bsd-2-clause
cloudtools/nymms
import base64 import json import Queue import time import logging from boto import sns from boto import sqs from boto.sqs.message import Message, RawMessage from nanomon.utils import yaml_includes from nanomon.message import NanoMessage from nanomon.queue import QueueWorker from nanomon.queue.backends.sns_sqs import ...
Update for new node definition syntax import base64 import json import Queue import time import logging from boto import sns from boto import sqs from boto.sqs.message import Message, RawMessage from nanomon.utils import yaml_includes from nanomon.message import NanoMessage from nanomon.queue import QueueWorker from...
15c8215415d36da4fac9c7333e62239f7b81c12d
test/support/mock_definitions.py
test/support/mock_definitions.py
# Generates validation/input definitions as if they were created by splunk for tests class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): host = os.getenv('SPLUNK_API_HOS...
import os # Generates validation/input definitions as if they were created by splunk for tests class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): host = os.getenv('SPLU...
Change mock to be env dependant
Change mock to be env dependant
Python
bsd-2-clause
Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input
import os # Generates validation/input definitions as if they were created by splunk for tests class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): host = os.getenv('SPLU...
Change mock to be env dependant # Generates validation/input definitions as if they were created by splunk for tests class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): ...
9d2ff18544950e129f5b363af4fa042b067e6830
dashboards/help/guides/urls.py
dashboards/help/guides/urls.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
Fix patterns for Django > 1.10
Fix patterns for Django > 1.10 Pike requires Django 1.11 so fix the template pattern import which was not compatible with that version. This fixes: File "/srv/www/openstack-dashboard/openstack_dashboard/dashboards/help/guides/\ urls.py", line 15, in <module> from django.conf.urls import patterns, url ImportError:...
Python
apache-2.0
SUSE-Cloud/horizon-suse-theme,SUSE-Cloud/horizon-suse-theme
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
Fix patterns for Django > 1.10 Pike requires Django 1.11 so fix the template pattern import which was not compatible with that version. This fixes: File "/srv/www/openstack-dashboard/openstack_dashboard/dashboards/help/guides/\ urls.py", line 15, in <module> from django.conf.urls import patterns, url ImportError:...
d8a4cfcf50462050d186d086733ee9cbb2a2ec3b
imhotep_jsl/plugin.py
imhotep_jsl/plugin.py
from imhotep.tools import Tool from collections import defaultdict import re class JSL(Tool): regex = re.compile( r'^(?P<type>[WE]) ' r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$') def invoke(self, dirname, filenames=set()): retval = defaultdict(lambda: defaultdict(list...
from imhotep.tools import Tool from collections import defaultdict import re class JSL(Tool): regex = re.compile( r'^(?P<type>[WE]) ' r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$') def invoke(self, dirname, filenames=set(), linter_configs=set()): retval = defaultdict(la...
Update for api change with linter_configs.
Update for api change with linter_configs.
Python
mit
hayes/imhotep_jsl
from imhotep.tools import Tool from collections import defaultdict import re class JSL(Tool): regex = re.compile( r'^(?P<type>[WE]) ' r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$') def invoke(self, dirname, filenames=set(), linter_configs=set()): retval = defaultdict(la...
Update for api change with linter_configs. from imhotep.tools import Tool from collections import defaultdict import re class JSL(Tool): regex = re.compile( r'^(?P<type>[WE]) ' r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$') def invoke(self, dirname, filenames=set()): r...
46982bbb4c8c74aece4b80fdbdcf3d5ee1d75ac9
Lib/email/Iterators.py
Lib/email/Iterators.py
# Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) """Various types of useful iterators and generators. """ import sys try: from email._compat22 import body_line_iterator, typed_subpart_iterator except SyntaxError: # Python 2.1 doesn't have generators from email....
# Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) """Various types of useful iterators and generators. """ import sys try: from email._compat22 import body_line_iterator, typed_subpart_iterator except SyntaxError: # Python 2.1 doesn't have generators from email....
Swap fp and level arguments.
_structure(): Swap fp and level arguments.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
# Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) """Various types of useful iterators and generators. """ import sys try: from email._compat22 import body_line_iterator, typed_subpart_iterator except SyntaxError: # Python 2.1 doesn't have generators from email....
_structure(): Swap fp and level arguments. # Copyright (C) 2001,2002 Python Software Foundation # Author: barry@zope.com (Barry Warsaw) """Various types of useful iterators and generators. """ import sys try: from email._compat22 import body_line_iterator, typed_subpart_iterator except SyntaxError: # Python...
7fd7ce41e388a2014cd30a641f1fb3b35661af40
setup.py
setup.py
from setuptools import setup,find_packages setup ( name = 'pymatgen', version = '1.0.2', packages = find_packages(), # Declare your packages' dependencies here, for eg: install_requires = ['numpy','scipy','matplotlib','PyCIFRW'], author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan Gunter', aut...
from setuptools import setup,find_packages setup ( name = 'pymatgen', version = '1.0.3', packages = find_packages(), # Declare your packages' dependencies here, for eg: install_requires = ['numpy','scipy','matplotlib','PyCIFRW'], author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan Gunter', aut...
Update to v1.0.3 given all the bug fixes.
Update to v1.0.3 given all the bug fixes. Former-commit-id: 0aebb52391a2dea2aabf08879335df01775d02ab [formerly 65ccbe5c10f2c1b54e1736caf7d8d88c7345610f] Former-commit-id: 1e823ba824b20ed7641ff7360c6b50184562b3bd
Python
mit
mbkumar/pymatgen,davidwaroquiers/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,richardtran415/pymatgen,gpetretto/pymatgen,gVallverdu/pymatgen,johnson1228/pymatgen,czhengsci/pymatgen,xhqu1981/pymatgen,johnson1228/pymatgen,vorwerkc/pymatgen,montoyjh/pymatgen,setten/pymatgen,setten/pymatgen,blondegeek/pymatgen,richardtra...
from setuptools import setup,find_packages setup ( name = 'pymatgen', version = '1.0.3', packages = find_packages(), # Declare your packages' dependencies here, for eg: install_requires = ['numpy','scipy','matplotlib','PyCIFRW'], author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan Gunter', aut...
Update to v1.0.3 given all the bug fixes. Former-commit-id: 0aebb52391a2dea2aabf08879335df01775d02ab [formerly 65ccbe5c10f2c1b54e1736caf7d8d88c7345610f] Former-commit-id: 1e823ba824b20ed7641ff7360c6b50184562b3bd from setuptools import setup,find_packages setup ( name = 'pymatgen', version = '1.0.2', packages =...
8e603328ff08888a1236e6b8ca0adbeb8bae819b
ckanext/ckanext-apply_permissions_for_service/ckanext/apply_permissions_for_service/logic.py
ckanext/ckanext-apply_permissions_for_service/ckanext/apply_permissions_for_service/logic.py
from ckan.plugins import toolkit as tk import model import ckan.model as ckan_model def service_permission_application_create(context, data_dict): tk.check_access('service_permission_application_create', context, data_dict) organization = data_dict.get('organization') vat_id = data_dict.get('vat_id') ...
from ckan.plugins import toolkit as tk import model _ = tk._ def service_permission_application_create(context, data_dict): tk.check_access('service_permission_application_create', context, data_dict) errors = {} error_summary = {} organization = data_dict.get('organization') if organization is...
Add validation to api for missing required values
LIKA-106: Add validation to api for missing required values
Python
mit
vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog
from ckan.plugins import toolkit as tk import model _ = tk._ def service_permission_application_create(context, data_dict): tk.check_access('service_permission_application_create', context, data_dict) errors = {} error_summary = {} organization = data_dict.get('organization') if organization is...
LIKA-106: Add validation to api for missing required values from ckan.plugins import toolkit as tk import model import ckan.model as ckan_model def service_permission_application_create(context, data_dict): tk.check_access('service_permission_application_create', context, data_dict) organization = data_dict....