commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
6af31da53a43bcd2e45ea4242892a4831b2fb2f8
asyncio_irc/listeners.py
asyncio_irc/listeners.py
class Listener: """Always invokes the handler.""" def __init__(self, handler): self.handler = handler def handle(self, connection, message): self.handler(connection, message=message) class CommandListener(Listener): """Only invokes the handler on one particular command.""" def __i...
class Listener: """Always invokes the handler.""" def __init__(self, handler): self.handler = handler def handle(self, connection, message): self.handler(connection, message=message) class CommandListener(Listener): """Only invokes the handler on one particular command.""" def __i...
Remove commented code for the mo
Remove commented code for the mo
Python
bsd-2-clause
meshy/framewirc
--- +++ @@ -38,9 +38,3 @@ def handle(self, connection, message): if message.command not in self.blacklist: super().handle(connection, message) - - -# class RegexListener(Listener): -# def __init__(self, regex, *args, **kwargs): -# super().__init__(*args, **kwargs) -# sel...
b6927cadb72e0a73700416d0218a569c15ec8818
generative/tests/compare_test/concat_first/run.py
generative/tests/compare_test/concat_first/run.py
from __future__ import division from __future__ import print_function from __future__ import absolute_import import subprocess if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument('layer', type=str, help='fc6|conv42|pool1') parser.add_argument('--cuda-devic...
from __future__ import division from __future__ import print_function from __future__ import absolute_import import subprocess if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument('layer', type=str, help='fc6|conv42|pool1') parser.add_argument('--cuda-devic...
Update path to save to mnt dir
Update path to save to mnt dir
Python
mit
judithfan/pix2svg
--- +++ @@ -12,7 +12,7 @@ args = parser.parse_args() for i in xrange(5): - out_dir = './trained_models/%s/%d' % (args.layer, i + 1) + out_dir = '/mnt/visual_communication_dataset/trained_models_5_30_18/%s/%d' % (args.layer, i + 1) train_test_split_dir = './train_test_split/%d' % (i ...
fd9d1b604e94b27b502413fe84848a6998e37318
opentreemap/registration_backend/urls.py
opentreemap/registration_backend/urls.py
from django.conf.urls import include from django.conf.urls import url from django.contrib.auth.views import login from django.views.generic.base import TemplateView from views import (RegistrationView, ActivationView, LoginForm, PasswordResetView) urlpatterns = [ url(r'^login/?$', login, {'au...
from django.conf.urls import include from django.conf.urls import url from django.contrib.auth.views import login from django.views.generic.base import TemplateView from views import (RegistrationView, ActivationView, LoginForm, PasswordResetView) urlpatterns = [ url(r'^login/$', login, {'aut...
Make trailing slash on login view non-optional
Make trailing slash on login view non-optional This was causing the UI tests to fail
Python
agpl-3.0
maurizi/otm-core,maurizi/otm-core,maurizi/otm-core,maurizi/otm-core
--- +++ @@ -9,7 +9,7 @@ urlpatterns = [ - url(r'^login/?$', login, {'authentication_form': LoginForm}, name='login'), + url(r'^login/$', login, {'authentication_form': LoginForm}, name='login'), url(r'^activation-complete/$', TemplateView.as_view(template_name='registration/activation_complet...
fe2dbf3d0008c344f1ef1ba3895c2cbb6b07209a
instance/config.py
instance/config.py
import os class MainConfig(object): DEBUG = False WTF_CSRF_ENABLED = True SQLALCHEMY_TRACK_MODIFICATIONS = False # Will generate a random secret key with a sequence of random chaarcters SECRET_KEY = os.urandom(24) class DevelopmentEnviron(MainConfig): DEBUG = True TESTING = True # UR...
import os class MainConfig(object): DEBUG = False WTF_CSRF_ENABLED = True SQLALCHEMY_TRACK_MODIFICATIONS = False SECRET_KEY = os.getenv('SECRET_KEY') class DevelopmentEnviron(MainConfig): DEBUG = True TESTING = True # URI to our development database SQLALCHEMY_DATABASE_URI = 'postgre...
Add secret key to env viarables
Add secret key to env viarables
Python
mit
paulupendo/CP-2-Bucketlist-Application
--- +++ @@ -5,8 +5,7 @@ DEBUG = False WTF_CSRF_ENABLED = True SQLALCHEMY_TRACK_MODIFICATIONS = False - # Will generate a random secret key with a sequence of random chaarcters - SECRET_KEY = os.urandom(24) + SECRET_KEY = os.getenv('SECRET_KEY') class DevelopmentEnviron(MainConfig):
83b8f44a3d978a120b8a1b8346ecdd54fdd068fd
correctiv_justizgelder/urls.py
correctiv_justizgelder/urls.py
from functools import wraps from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ from django.views.decorators.cache import cache_page from .views import OrganisationSearchView, OrganisationDetail CACHE_TIME = 15 * 60 def c(view): @wraps(view) def cache_page_ano...
from functools import wraps from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ from django.views.decorators.cache import cache_page from .views import OrganisationSearchView, OrganisationDetail CACHE_TIME = 15 * 60 def c(view): @wraps(view) def cache_page_ano...
Add tilde to url lookup for recipient slugs
Add tilde to url lookup for recipient slugs
Python
mit
correctiv/correctiv-justizgelder,correctiv/correctiv-justizgelder
--- +++ @@ -20,7 +20,7 @@ urlpatterns = patterns('', url(r'^$', c(OrganisationSearchView.as_view()), name='search'), - url(_(r'^recipient/(?P<slug>[\w-]+)/$'), + url(_(r'^recipient/(?P<slug>[\w\~\-]+)/$'), c(OrganisationDetail.as_view()), name='organisation_detail'), )
d3489d51621fc001d0700f5a8562e53d82b52cac
tests/test_cyclus.py
tests/test_cyclus.py
#! /usr/bin/env python import os from testcases import sim_files from cyclus_tools import run_cyclus, db_comparator """Tests""" def test_cyclus(): """Test for all inputs in sim_files. Checks if reference and current cyclus output is the same. WARNING: the tests require cyclus executable to be included ...
#! /usr/bin/env python import os from testcases import sim_files from cyclus_tools import run_cyclus, db_comparator """Tests""" def test_cyclus(): """Test for all inputs in sim_files. Checks if reference and current cyclus output is the same. WARNING: the tests require cyclus executable to be included ...
Remove output_temp.h5 only if it exists
Remove output_temp.h5 only if it exists
Python
bsd-3-clause
Baaaaam/cyCLASS,gonuke/cycamore,Baaaaam/cyBaM,cyclus/cycaless,rwcarlsen/cycamore,jlittell/cycamore,jlittell/cycamore,rwcarlsen/cycamore,gonuke/cycamore,cyclus/cycaless,Baaaaam/cycamore,Baaaaam/cyCLASS,Baaaaam/cyBaM,rwcarlsen/cycamore,gonuke/cycamore,jlittell/cycamore,Baaaaam/cycamore,Baaaaam/cycamore,Baaaaam/cyBaM,Baaa...
--- +++ @@ -13,7 +13,7 @@ WARNING: the tests require cyclus executable to be included in PATH """ cwd = os.getcwd() - + for sim_input,bench_db in sim_files: temp_output = [(sim_input, "./output_temp.h5")] @@ -21,4 +21,5 @@ yield db_comparator, bench_db, "./output_temp.h5"...
21e2db0e2c3873e6390eee1865c67ee4c73ba498
tests/test_cyprep.py
tests/test_cyprep.py
import numpy as np import pytest import yatsm._cyprep as cyprep def test_get_valid_mask(): n_bands, n_images, n_mask = 8, 500, 50 data = np.random.randint(0, 10000, size=(n_bands, n_images)).astype(np.int32) # Add in bad data _idx = np.arange(0, n_images) for b in rang...
import numpy as np import pytest import yatsm._cyprep as cyprep def test_get_valid_mask(): n_bands, n_images, n_mask = 8, 500, 50 data = np.random.randint(0, 10000, size=(n_bands, n_images)).astype(np.int32) # Add in bad data _idx = np.arange(0, n_images) for b in rang...
Fix bool logic in mask test & add test criteria
Fix bool logic in mask test & add test criteria
Python
mit
c11/yatsm,ceholden/yatsm,valpasq/yatsm,valpasq/yatsm,c11/yatsm,ceholden/yatsm
--- +++ @@ -16,7 +16,15 @@ mins = np.repeat(0, n_bands).astype(np.int16) maxes = np.repeat(10000, n_bands).astype(np.int16) - truth = np.all([((b > _min) & (b < _max)) for b, _min, _max in - zip(np.rollaxis(data, 0), mins, maxes)], axis=0) + truth = np.all([((b >= _min) & (b <= _m...
40edd2d679bcaebcbdb55b08fdd38b4c1af68672
tests/test_models.py
tests/test_models.py
#! /usr/bin/env python import os import pytest from pymt import models @pytest.mark.parametrize("cls", models.__all__) def test_model_setup(cls): model = models.__dict__[cls]() args = model.setup() assert os.path.isfile(os.path.join(args[1], args[0])) @pytest.mark.parametrize("cls", models.__all__) de...
#! /usr/bin/env python import os import pytest from pymt import models @pytest.mark.parametrize("cls", models.__all__) def test_model_setup(cls): model = models.__dict__[cls]() args = model.setup() assert os.path.isfile(os.path.join(args[1], args[0])) @pytest.mark.parametrize("cls", models.__all__) de...
Add test for finalize method.
Add test for finalize method.
Python
mit
csdms/coupling,csdms/pymt,csdms/coupling
--- +++ @@ -24,9 +24,15 @@ @pytest.mark.parametrize("cls", models.__all__) -def test_model_irf(cls): +def test_model_update(cls): model = models.__dict__[cls]() model.initialize(*model.setup()) model.update() assert model.get_current_time() > model.get_start_time() + + +@pytest.mark.parametri...
d0d7c1f29ca17d3273033821a8ed1326b0ec7b4c
wmata.py
wmata.py
import datetime import urllib import json class WmataError(Exception): pass class Wmata(object): api_url = 'http://api.wmata.com/%(svc)s.svc/json/%(endpoint)s' # By default, we'll use the WMATA demonstration key def __init__(self, api_key='kfgpmgvfgacx98de9q3xazww'): if api_key is not None: ...
import datetime import urllib import json class WmataError(Exception): pass class Wmata(object): api_url = 'http://api.wmata.com/%(svc)s.svc/json/%(endpoint)s' # By default, we'll use the WMATA demonstration key def __init__(self, api_key='kfgpmgvfgacx98de9q3xazww'): self.api_key = api_key
Remove old default api_key logic in __init__.
Remove old default api_key logic in __init__.
Python
mit
ExperimentMonty/py3-wmata
--- +++ @@ -11,5 +11,4 @@ # By default, we'll use the WMATA demonstration key def __init__(self, api_key='kfgpmgvfgacx98de9q3xazww'): - if api_key is not None: - self.api_key = api_key + self.api_key = api_key
b9f302f38e07b32590fc4008f413a5baa756dbee
zou/app/resources/source/csv/assets.py
zou/app/resources/source/csv/assets.py
from zou.app.resources.source.csv.base import BaseCsvImportResource from zou.app.project import project_info, asset_info from zou.app.models.entity import Entity from sqlalchemy.exc import IntegrityError class AssetsCsvImportResource(BaseCsvImportResource): def prepare_import(self): self.projects = {} ...
from zou.app.resources.source.csv.base import BaseCsvImportResource from zou.app.project import project_info, asset_info from zou.app.models.entity import Entity from sqlalchemy.exc import IntegrityError class AssetsCsvImportResource(BaseCsvImportResource): def prepare_import(self): self.projects = {} ...
Fix duplicates in asset import
Fix duplicates in asset import It relied on the unique constraint from the database, but it doesn't apply if parent_id is null. So it checks the existence of the asset before inserting it.
Python
agpl-3.0
cgwire/zou
--- +++ @@ -36,17 +36,20 @@ ) try: - entity = Entity.create( - name=name, - description=description, - project_id=project_id, - entity_type_id=entity_type_id - ) - except IntegrityError: entity = ...
9ebc81565171866462dae5eb068bb7c1d98948a7
ovp_users/serializers/__init__.py
ovp_users/serializers/__init__.py
from ovp_users.serializers.user import UserCreateSerializer from ovp_users.serializers.user import UserUpdateSerializer from ovp_users.serializers.user import CurrentUserSerializer from ovp_users.serializers.user import UserPublicRetrieveSerializer from ovp_users.serializers.user import UserProjectRetrieveSerializer fr...
from ovp_users.serializers.user import UserCreateSerializer from ovp_users.serializers.user import UserUpdateSerializer from ovp_users.serializers.user import CurrentUserSerializer from ovp_users.serializers.user import ShortUserPublicRetrieveSerializer from ovp_users.serializers.user import LongUserPublicRetrieveSeria...
Add ShortUserRetrieve and LongUserRetrieve serializers
Add ShortUserRetrieve and LongUserRetrieve serializers
Python
agpl-3.0
OpenVolunteeringPlatform/django-ovp-users,OpenVolunteeringPlatform/django-ovp-users
--- +++ @@ -1,7 +1,8 @@ from ovp_users.serializers.user import UserCreateSerializer from ovp_users.serializers.user import UserUpdateSerializer from ovp_users.serializers.user import CurrentUserSerializer -from ovp_users.serializers.user import UserPublicRetrieveSerializer +from ovp_users.serializers.user import S...
b85a713f883caaf29f39daff1e0c3d3d0896969f
primestg/message.py
primestg/message.py
from lxml.objectify import fromstring class BaseMessage(object): """ Base XML message. """ def __init__(self, xml): """ Create an object of BaseMessage. :param xml: a file object or a string with the XML :return: an instance of BaseMessage """ self.obje...
from lxml.objectify import fromstring class BaseMessage(object): """ Base XML message. """ def __init__(self, xml): """ Create an object of BaseMessage. :param xml: a file object or a string with the XML :return: an instance of BaseMessage """ self.obje...
Fix typo in objectified name
Fix typo in objectified name
Python
agpl-3.0
gisce/primestg
--- +++ @@ -21,7 +21,7 @@ :return: the XML objectified """ - return self._objectifyed + return self._objectified @objectified.setter def objectified(self, value): @@ -34,7 +34,7 @@ if isinstance(value, file): value = value.read() self._xml =...
2a7eecbf55f5cc00bed76a70990946309baa2baa
boardinghouse/tests/test_sql.py
boardinghouse/tests/test_sql.py
""" Tests for the RAW sql functions. """ from django.conf import settings from django.test import TestCase from django.db.models import connection from boardinghouse.models import Schema class TestRejectSchemaColumnChange(TestCase): def test_exception_is_raised(self): Schema.objects.mass_create('a') ...
""" Tests for the RAW sql functions. """ from django.conf import settings from django.test import TestCase from django.db import connection from boardinghouse.models import Schema class TestRejectSchemaColumnChange(TestCase): def test_exception_is_raised(self): Schema.objects.mass_create('a') cur...
Make test work with 1.7
Make test work with 1.7
Python
bsd-3-clause
schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse
--- +++ @@ -4,7 +4,7 @@ from django.conf import settings from django.test import TestCase -from django.db.models import connection +from django.db import connection from boardinghouse.models import Schema @@ -13,4 +13,4 @@ Schema.objects.mass_create('a') cursor = connection.cursor() ...
32efe6c239a62c2f011179c4431adf6e028442f0
alg_selection_sort.py
alg_selection_sort.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(a_list): """Selection Sort algortihm. Procedure: - Find out the max item's original slot first, - then swap it and the item at the max slot. - Iterate the proced...
from __future__ import absolute_import from __future__ import print_function from __future__ import division def selection_sort(a_list): """Selection Sort algortihm. Time complexity: O(n^2). """ for max_slot in reversed(range(len(a_list))): select_slot = 0 for slot in range(1, max_slo...
Add to doc string: time complexity
Add to doc string: time complexity
Python
bsd-2-clause
bowen0701/algorithms_data_structures
--- +++ @@ -5,11 +5,6 @@ def selection_sort(a_list): """Selection Sort algortihm. - - Procedure: - - Find out the max item's original slot first, - - then swap it and the item at the max slot. - - Iterate the procedure for the next max, etc. Time complexity: O(n^2). """
f828523180e8996e17ecb36e4a39c67656a372a3
launch_instance.py
launch_instance.py
# License under the MIT License - see LICENSE import boto.ec2 import os import time def launch(key_name=None, region='us-west-2', image_id='ami-5189a661', instance_type='t2.micro', security_groups='launch-wizard-1', user_data=None, initial_check=True): ''' ''' if not isinstance(sec...
# License under the MIT License - see LICENSE import boto.ec2 import os import time def launch(key_name=None, region='us-west-2', image_id='ami-5189a661', instance_type='t2.micro', security_groups='launch-wizard-1', user_data=None, initial_check=True): ''' ''' if not isinstance(sec...
Move status into initial check; fails when instance is stopped already
Move status into initial check; fails when instance is stopped already
Python
mit
Astroua/aws_controller,Astroua/aws_controller
--- +++ @@ -27,10 +27,10 @@ time.sleep(10) inst.update() - # Wait for the status checks first - status = ec2.get_all_instance_status(instance_ids=[inst.id])[0] + if initial_check: + # Wait for the status checks first + status = ec2.get_all_instance_status(instance_ids=[inst....
5bf2f25cb309f38bc7a48d76c2018768117a456a
alg_tower_of_hanoi.py
alg_tower_of_hanoi.py
"""The tower of Hanoi.""" from __future__ import print_function def move_towers(height, from_pole, to_pole, with_pole): if height == 1: print('Moving disk from {0} to {1}'.format(from_pole, to_pole)) else: move_towers(height - 1, from_pole, with_pole, to_pole) move_towers(1, from_pole,...
"""The tower of Hanoi.""" from __future__ import absolute_import from __future__ import print_function from __future__ import division def tower_of_hanoi(height, from_pole, to_pole, with_pole, counter): if height == 1: counter[0] += 1 print('{0} -> {1}'.format(from_pole, to_pole)) else: ...
Revise tower of hanoi alg from Yuanlin
Revise tower of hanoi alg from Yuanlin
Python
bsd-2-clause
bowen0701/algorithms_data_structures
--- +++ @@ -1,32 +1,42 @@ """The tower of Hanoi.""" +from __future__ import absolute_import from __future__ import print_function +from __future__ import division -def move_towers(height, from_pole, to_pole, with_pole): +def tower_of_hanoi(height, from_pole, to_pole, with_pole, counter): if height == 1: - ...
5987cfc1485b6dc4cccef2b1e538078b90a9acd1
pythonx/completers/javascript/__init__.py
pythonx/completers/javascript/__init__.py
# -*- coding: utf-8 -*- import json import os.path from completor import Completor from completor.compat import to_unicode dirname = os.path.dirname(__file__) class Tern(Completor): filetype = 'javascript' daemon = True trigger = r'\w+$|[\w\)\]\}\'\"]+\.\w*$' def format_cmd(self): binary =...
# -*- coding: utf-8 -*- import json import os.path import re from completor import Completor from completor.compat import to_unicode dirname = os.path.dirname(__file__) class Tern(Completor): filetype = 'javascript' daemon = True ident = re.compile(r"""(\w+)|(('|").+)""", re.U) trigger = r"""\w+$|[...
Add support for tern complete_strings plugin
Add support for tern complete_strings plugin
Python
mit
maralla/completor.vim,maralla/completor.vim
--- +++ @@ -2,6 +2,7 @@ import json import os.path +import re from completor import Completor from completor.compat import to_unicode @@ -12,7 +13,8 @@ class Tern(Completor): filetype = 'javascript' daemon = True - trigger = r'\w+$|[\w\)\]\}\'\"]+\.\w*$' + ident = re.compile(r"""(\w+)|(('|")....
88752efa9ac2c0f251733e335763cb880da34741
thinglang/parser/definitions/member_definition.py
thinglang/parser/definitions/member_definition.py
from thinglang.lexer.definitions.tags import LexicalPrivateTag from thinglang.lexer.definitions.thing_definition import LexicalDeclarationMember from thinglang.lexer.values.identifier import Identifier from thinglang.parser.nodes import BaseNode from thinglang.parser.rule import ParserRule from thinglang.symbols.symbol...
from thinglang.lexer.definitions.tags import LexicalPrivateTag from thinglang.lexer.definitions.thing_definition import LexicalDeclarationMember from thinglang.lexer.values.identifier import Identifier from thinglang.parser.nodes import BaseNode from thinglang.parser.rule import ParserRule from thinglang.symbols.symbol...
Add visibility tagging to MethoDefinition
Add visibility tagging to MethoDefinition
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
--- +++ @@ -27,11 +27,5 @@ @staticmethod @ParserRule.mark - def parse_member_definition(_: LexicalDeclarationMember, type_name: MEMBER_NAME_TYPES, name: Identifier): + def parse_member_definition(_: (LexicalDeclarationMember, LexicalPrivateTag), type_name: MEMBER_NAME_TYPES, name: Identifier): ...
f4a067acd58aa083680a556bb7d79e9d05403eba
cc/deploy/vendor_wsgi.py
cc/deploy/vendor_wsgi.py
""" Alternative WSGI entry-point that uses requirements/vendor for dependencies. """ import os, sys base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, base_dir) from cc.deploy.paths import add_vendor_lib add_vendor_lib() # Set default settings and instantiate application os....
""" Alternative WSGI entry-point that uses requirements/vendor for dependencies. """ import os, sys base_dir = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, base_dir) from cc.deploy.paths import add_vendor_lib add_vendor_lib() # Set default settings and instan...
Fix path addition in vendor-wsgi.py.
Fix path addition in vendor-wsgi.py.
Python
bsd-2-clause
mozilla/moztrap,mozilla/moztrap,mozilla/moztrap,mccarrmb/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mccarrmb/moztrap,mozilla/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,mozilla/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,bobsilverberg/moztrap...
--- +++ @@ -5,7 +5,8 @@ """ import os, sys -base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +base_dir = os.path.dirname( + os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, base_dir) from cc.deploy.paths import add_vendor_lib
d115f039a474e93585096a22f5870c60a221bae9
dthm4kaiako/config/__init__.py
dthm4kaiako/config/__init__.py
"""Configuration for Django system.""" __version__ = "0.14.1" __version_info__ = tuple( [ int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".") ] )
"""Configuration for Django system.""" __version__ = "0.14.2" __version_info__ = tuple( [ int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".") ] )
Increment version number to 0.14.2
Increment version number to 0.14.2
Python
mit
uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers
--- +++ @@ -1,6 +1,6 @@ """Configuration for Django system.""" -__version__ = "0.14.1" +__version__ = "0.14.2" __version_info__ = tuple( [ int(num) if num.isdigit() else num
6d16a7d137b723fe93260eb2729aca1d8f98e37f
actions/cloudbolt_plugins/multi_user_approval/two_user_approval.py
actions/cloudbolt_plugins/multi_user_approval/two_user_approval.py
""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it becomes Active. Requires CloudBolt 8.8 """ def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approve...
""" Two User Approval ~~~~~~~~~~~~~~~~~ Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an Order before it becomes Active. Version Req. ~~~~~~~~~~~~ CloudBolt 8.8 """ def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewe...
Standardize approval Orch Actions docstrings
Standardize approval Orch Actions docstrings [DEV-12140]
Python
apache-2.0
CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge
--- +++ @@ -1,10 +1,13 @@ """ Two User Approval +~~~~~~~~~~~~~~~~~ +Overrides CloudBolt's standard Order Approval workflow. This Orchestration +Action requires two users to approve an Order before it becomes Active. -Overrides CloudBolt's standard Order Approval workflow. This Orchestration -Action requires two u...
318c98ab5a9710dfdeedc0ee893e87993ac49727
robosync/test/test_robosync.py
robosync/test/test_robosync.py
import unittest import os import shutil class testMirror(unittest.TestCase): def setUp(self): os.mkdir('test_source') os.mkdir('test_dest') source_dirs = ['dir1', 'dir2', 'dir3'] filenames = ['file1.txt', 'file2.txt', 'file3.txt'] contents = ['foobar1', 'foobar2', 'foobar3'...
import unittest import os import shutil class testMirror(unittest.TestCase): def setUp(self): os.mkdir('test_source') os.mkdir('test_dest') source_dirs = ['dir1', 'dir2', 'dir3'] dest_dirs = ['dir1_c', 'dir2_c', 'dir3_c'] filenames = ['file1.txt', 'file2.txt', 'file3.txt'] ...
Add source and destination list to setup and teardown
Add source and destination list to setup and teardown
Python
mit
rbn920/robosync
--- +++ @@ -8,8 +8,15 @@ os.mkdir('test_source') os.mkdir('test_dest') source_dirs = ['dir1', 'dir2', 'dir3'] + dest_dirs = ['dir1_c', 'dir2_c', 'dir3_c'] filenames = ['file1.txt', 'file2.txt', 'file3.txt'] contents = ['foobar1', 'foobar2', 'foobar3'] + with ...
7fc0c026508472726d2a47b5ab027b3bcc43f101
calibre_books/core/management/commands/synchronize.py
calibre_books/core/management/commands/synchronize.py
from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import NoArgsCommand from django.conf import settings from django_dropbox.storage import DropboxStorage from dropbox.rest import ErrorResponse from calibre_books.calibre.models import Book, Data class Command(NoArgsCommand): ...
from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import NoArgsCommand from django.conf import settings from django_dropbox.storage import DropboxStorage from dropbox.rest import ErrorResponse from calibre_books.calibre.models import Book, Data class Command(NoArgsCommand): ...
Add ability to get calibre db
Add ability to get calibre db
Python
bsd-2-clause
bogdal/calibre-books,bogdal/calibre-books
--- +++ @@ -18,6 +18,11 @@ def handle_noargs(self, **options): self.client = DropboxStorage().client + calibre_db = self.client.get_file('/%s/metadata.db' % settings.DROPBOX_CALIBRE_DIR) + + local_db = open(settings.DATABASES['calibre']['NAME'], 'wb') + local_db.write(calibre_db.r...
7183edee23f715d225b7dc506746e3b7a96d7d6b
gmql/dataset/loaders/__init__.py
gmql/dataset/loaders/__init__.py
""" Loader settings: we use the GMQL scala class CombineTextFileWithPathInputFormat in order to load the region and metadata files with the same id_sample based on the hash of the file name """ inputFormatClass = 'it.polimi.genomics.spark.implementation.loaders.Loaders$CombineTextFileWithPathInputFormat' keyFormatClas...
import os """ Loader settings: we use the GMQL scala class CombineTextFileWithPathInputFormat in order to load the region and metadata files with the same id_sample based on the hash of the file name """ inputFormatClass = 'it.polimi.genomics.spark.implementation.loaders.Loaders$CombineTextFileWithPathInputFormat' ke...
Use only the base file name for key
Use only the base file name for key Former-commit-id: 3acbf9e93d3d501013e2a1b6aa9631bdcc663c66 [formerly eea949727d3693aa032033d84dcca3790d9072dd] [formerly ca065bc9f78b1416903179418d64b3273d437987] Former-commit-id: 58c1d18e8960ad3236a34b8080b18ccff5684eaa Former-commit-id: 6501068cea164df37ec055c3fb8baf8c89fc7823
Python
apache-2.0
DEIB-GECO/PyGMQL,DEIB-GECO/PyGMQL
--- +++ @@ -1,3 +1,5 @@ +import os + """ Loader settings: we use the GMQL scala class CombineTextFileWithPathInputFormat in order to load the region and metadata files with the @@ -16,11 +18,19 @@ } +""" + Generation of the index of the pandas dataframe. + This can be done in different ways: + ...
a117b191c402ce051b6e8aec2fced315c119b9eb
test/test_large_source_tree.py
test/test_large_source_tree.py
import unittest from yeast_harness import * class TestLargeSourceTree(unittest.TestCase): def test_large_source_tree(self): make_filename = lambda ext='': ''.join( random.choice(string.ascii_lowercase) for _ in range(8)) + ext make_sources = lambda path: [ CSourc...
import unittest from yeast_harness import * class TestLargeSourceTree(unittest.TestCase): def test_large_source_tree(self): make_filename = lambda ext='': ''.join( random.choice(string.ascii_lowercase) for _ in range(8)) + ext make_sources = lambda path: [ CSourc...
Increase size of large source tree 10x
Increase size of large source tree 10x - up to 1000 source files - use parallel make - preserve source tree
Python
mit
sjanhunen/moss,sjanhunen/yeast,sjanhunen/moss,sjanhunen/gnumake-molds
--- +++ @@ -10,7 +10,7 @@ random.choice(string.ascii_lowercase) for _ in range(8)) + ext make_sources = lambda path: [ - CSourceFile(path + '/' + make_filename('.c')) for _ in range(10)] + CSourceFile(path + '/' + make_filename('.c')) for _ in range(100)] ...
3e06403b71e8ee826d38f58198342cc22af398bd
yacs/settings/development.py
yacs/settings/development.py
from yacs.settings.base import * DEBUG = True TEMPLATE_DEBUG = DEBUG CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', 'VERSION': CACHE_VERSION, } } DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'yacs...
from yacs.settings.base import * DEBUG = True TEMPLATE_DEBUG = DEBUG CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', 'VERSION': CACHE_VERSION, } } DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'yacs...
Add space before inline comment
Add space before inline comment
Python
mit
JGrippo/YACS,jeffh/YACS,jeffh/YACS,jeffh/YACS,JGrippo/YACS,JGrippo/YACS,jeffh/YACS,JGrippo/YACS
--- +++ @@ -15,7 +15,7 @@ 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'yacsdb', 'USER': 'yacs', - 'PASSWORD': 'NULL', # using trust auth via localhost + 'PASSWORD': 'NULL', # using trust auth via localhost 'HOST': '127.0.0.1', 'PORT': '5432...
a84ce4c8215cced7a64253453a3530911b8518f8
job_runner/apps/job_runner/management/commands/broadcast_queue.py
job_runner/apps/job_runner/management/commands/broadcast_queue.py
import json import logging import time from datetime import datetime import zmq from django.conf import settings from django.core.management.base import NoArgsCommand from job_runner.apps.job_runner.models import Run logger = logging.getLogger(__name__) class Command(NoArgsCommand): help = 'Broadcast runs in ...
import json import logging import time from datetime import datetime import zmq from django.conf import settings from django.core.management.base import NoArgsCommand from job_runner.apps.job_runner.models import Run logger = logging.getLogger(__name__) class Command(NoArgsCommand): help = 'Broadcast runs in ...
Add time.sleep after binding publisher to give subscribers time to (re-)connect.
Add time.sleep after binding publisher to give subscribers time to (re-)connect.
Python
bsd-3-clause
spilgames/job-runner,spilgames/job-runner
--- +++ @@ -22,6 +22,9 @@ publisher = context.socket(zmq.PUB) publisher.bind( 'tcp://*:{0}'.format(settings.JOB_RUNNER_BROADCASTER_PORT)) + + # give the subscribers some time to (re-)connect. + time.sleep(2) while True: self._broadcast(publisher)
68c7db19c0ac8c159bc12ff9714dea068a7835e4
importlib_resources/__init__.py
importlib_resources/__init__.py
"""Read resources contained within a package.""" import sys __all__ = [ 'Package', 'Resource', 'ResourceReader', 'contents', 'is_resource', 'open_binary', 'open_text', 'path', 'read_binary', 'read_text', ] if sys.version_info >= (3,): from importlib_resources._py3 im...
"""Read resources contained within a package.""" import sys __all__ = [ 'Package', 'Resource', 'ResourceReader', 'contents', 'files', 'is_resource', 'open_binary', 'open_text', 'path', 'read_binary', 'read_text', ] if sys.version_info >= (3,): from importlib_reso...
Add files to the exported names.
Add files to the exported names.
Python
apache-2.0
python/importlib_resources
--- +++ @@ -8,6 +8,7 @@ 'Resource', 'ResourceReader', 'contents', + 'files', 'is_resource', 'open_binary', 'open_text', @@ -22,6 +23,7 @@ Package, Resource, contents, + files, is_resource, open_binary, open_text, @@ -33,6 +3...
3ef02d93f9c7e60341ea2d8e407a62d2cadd95f6
mangopaysdk/types/payinexecutiondetailsdirect.py
mangopaysdk/types/payinexecutiondetailsdirect.py
from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails class PayInExecutionDetailsDirect(PayInExecutionDetails): def __init__(self): # direct card self.CardId = None self.SecureModeReturnURL = None self.SecureModeRedirectURL = None # Mode3DSType ...
from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails class PayInExecutionDetailsDirect(PayInExecutionDetails): def __init__(self): # direct card self.CardId = None self.SecureModeReturnURL = None self.SecureModeRedirectURL = None self.SecureMod...
Add SecureModeNeeded property to PayInExecutionDetailsDirect
Add SecureModeNeeded property to PayInExecutionDetailsDirect
Python
mit
chocopoche/mangopay2-python-sdk,Mangopay/mangopay2-python-sdk
--- +++ @@ -8,6 +8,7 @@ self.CardId = None self.SecureModeReturnURL = None self.SecureModeRedirectURL = None + self.SecureModeNeeded = None # Mode3DSType { DEFAULT, FORCE } self.SecureMode = None self.StatementDescriptor = None
491ce4e51d666fc068e4bed14ab410b90e5b1ea8
extraction/utils.py
extraction/utils.py
import subprocess32 as subprocess import threading import signal def external_process(process_args, input_data='', timeout=None): ''' Pipes input_data via stdin to the process specified by process_args and returns the results Arguments: process_args -- passed directly to subprocess.Popen(), see there f...
import subprocess32 as subprocess import threading import signal import tempfile import os def external_process(process_args, input_data='', timeout=None): ''' Pipes input_data via stdin to the process specified by process_args and returns the results Arguments: process_args -- passed directly to subpr...
Add method to create tempfile with content easily
Add method to create tempfile with content easily
Python
apache-2.0
SeerLabs/extractor-framework,Tiger66639/extractor-framework
--- +++ @@ -1,6 +1,8 @@ import subprocess32 as subprocess import threading import signal +import tempfile +import os def external_process(process_args, input_data='', timeout=None): ''' @@ -35,3 +37,13 @@ exit_status = process.returncode return (exit_status, stdout, stderr) + +def temp_file(data, ...
59db2a96034955fe678242e63d826610a009a103
indra/tests/test_dart_client.py
indra/tests/test_dart_client.py
import json from indra.literature.dart_client import _jsonify_query_data def test_timestamp(): # Should ignore "after" assert _jsonify_query_data(timestamp={'on': '2020-01-01', 'after': '2020-01-02'}) == \ json.dumps({"timestamp": {"on": "2020-01-01"}}) as...
import json import requests from indra.config import get_config from indra.literature.dart_client import _jsonify_query_data, dart_base_url def test_timestamp(): # Should ignore "after" assert _jsonify_query_data(timestamp={'on': '2020-01-01', 'after': '2020-01-02'}) ...
Add test for reaching API health endpoint
Add test for reaching API health endpoint
Python
bsd-2-clause
sorgerlab/indra,bgyori/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/indra,johnbachman/belpy,sorgerlab/belpy,bgyori/indra,johnbachman/belpy,bgyori/indra,sorgerlab/indra,sorgerlab/belpy
--- +++ @@ -1,5 +1,7 @@ import json -from indra.literature.dart_client import _jsonify_query_data +import requests +from indra.config import get_config +from indra.literature.dart_client import _jsonify_query_data, dart_base_url def test_timestamp(): @@ -18,3 +20,11 @@ assert _jsonify_query_data(readers=['...
0e6f62ec8230f85cfb891917be5d7ed144b44979
src/pretty_print.py
src/pretty_print.py
#!/usr/bin/python import argparse import re format = list(''' -- -- ----------- ----------- ---------- -------- ------- -- -- ----------- '''[1:-1]) def setFormatString(index, value): position = -1 for i in range(len(format)): if not format[i].isspace(): position += 1 if position == index: format[i...
#!/usr/bin/python import argparse import ast format = list(''' -- -- ----------- ----------- ---------- -------- ------- -- -- ----------- '''[1:-1]) # Print the given labels using the whitespace of format. def printFormatted(labels): i = 0 for c in format: if c.isspace(): print(c, end='') else: pr...
Clean up python script and make it run in linear time.
Clean up python script and make it run in linear time.
Python
mit
altayhunter/Pentomino-Puzzle-Solver,altayhunter/Pentomino-Puzzle-Solver
--- +++ @@ -1,6 +1,6 @@ #!/usr/bin/python import argparse -import re +import ast format = list(''' -- -- @@ -13,29 +13,41 @@ ----------- '''[1:-1]) -def setFormatString(index, value): - position = -1 - for i in range(len(format)): - if not format[i].isspace(): - position += 1 - if position == index...
941392d41317943f4c0603d7d28a31858a2648bc
neutron/plugins/ml2/drivers/datacom/db/models.py
neutron/plugins/ml2/drivers/datacom/db/models.py
from sqlalchemy import Column, String, ForeignKey from sqlalchemy.orm import relationship, backref from neutron.db.model_base import BASEV2 from neutron.db.models_v2 import HasId class DatacomTenant(BASEV2, HasId): """Datacom Tenant table""" tenant = Column(String(50)) class DatacomNetwork(BASEV2, HasId): ...
from sqlalchemy import Column, String, ForeignKey, Integer from sqlalchemy.orm import relationship, backref from neutron.db.model_base import BASEV2 from neutron.db.models_v2 import HasId class DatacomNetwork(BASEV2, HasId): """Each VLAN represent a Network a network may have multiple ports """ vid = ...
Fix DB to fit new requirements
Fix DB to fit new requirements
Python
apache-2.0
asgard-lab/neutron,asgard-lab/neutron
--- +++ @@ -1,27 +1,20 @@ -from sqlalchemy import Column, String, ForeignKey +from sqlalchemy import Column, String, ForeignKey, Integer from sqlalchemy.orm import relationship, backref from neutron.db.model_base import BASEV2 from neutron.db.models_v2 import HasId - -class DatacomTenant(BASEV2, HasId): - "...
e6611885dcb1200dec13603b68c5ad03fcae97e4
frasco/redis/ext.py
frasco/redis/ext.py
from frasco.ext import * from redis import StrictRedis from werkzeug.local import LocalProxy from .templating import CacheFragmentExtension class FrascoRedis(Extension): name = "frasco_redis" defaults = {"url": "redis://localhost:6379/0", "fragment_cache_timeout": 3600, "decode...
from frasco.ext import * from redis import Redis from werkzeug.local import LocalProxy from .templating import CacheFragmentExtension class FrascoRedis(Extension): name = "frasco_redis" defaults = {"url": "redis://localhost:6379/0", "fragment_cache_timeout": 3600, "decode_respo...
Set the encoding parameter in Redis constructor
[redis] Set the encoding parameter in Redis constructor
Python
mit
frascoweb/frasco,frascoweb/frasco
--- +++ @@ -1,5 +1,5 @@ from frasco.ext import * -from redis import StrictRedis +from redis import Redis from werkzeug.local import LocalProxy from .templating import CacheFragmentExtension @@ -8,10 +8,13 @@ name = "frasco_redis" defaults = {"url": "redis://localhost:6379/0", "fragment...
903274d3bf87e642430e5b603c924601baa3955a
emission/net/usercache/formatters/android/motion_activity.py
emission/net/usercache/formatters/android/motion_activity.py
import logging import emission.core.wrapper.motionactivity as ecwa import emission.net.usercache.formatters.common as fc import attrdict as ad def format(entry): formatted_entry = ad.AttrDict() formatted_entry["_id"] = entry["_id"] formatted_entry.user_id = entry.user_id metadata = entry.metadata ...
import logging import emission.core.wrapper.motionactivity as ecwa import emission.net.usercache.formatters.common as fc import attrdict as ad def format(entry): formatted_entry = ad.AttrDict() formatted_entry["_id"] = entry["_id"] formatted_entry.user_id = entry.user_id metadata = entry.metadata ...
Change the motionactivity formatter to match the new version of the google play library
Change the motionactivity formatter to match the new version of the google play library We bumped up the play version number in https://github.com/e-mission/e-mission-data-collection/commit/a93bc993ddcc1e78ab7fc15e6c9a588ce28a5e45 which will change the fields that show up in the android messages. We really need to re...
Python
bsd-3-clause
shankari/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server
--- +++ @@ -20,6 +20,8 @@ data.type = ecwa.MotionTypes(entry.data.agb).value elif 'zzaEg' in entry.data: data.type = ecwa.MotionTypes(entry.data.zzaEg).value + elif 'ajO' in entry.data: + data.type = ecwa.MotionTypes(entry.data.ajO).value else: data.type = ecwa.MotionTyp...
92420d319865f2f0dcf0e53a4b4a3fecc30b6aad
components/lie_md/lie_md/gromacs_gromit.py
components/lie_md/lie_md/gromacs_gromit.py
# -*- coding: utf-8 -*- """ file: gromacs_gromit.py Prepaire gromit command line input """ GROMIT_ARG_DICT = { 'forcefield': '-ff', 'charge': '-charge', 'gromacs_lie': '-lie', 'periodic_distance': '-d', 'temperature': '-t', 'prfc': '-prfc', 'ttau': '-ttau', 'salinity': '-conc', 's...
# -*- coding: utf-8 -*- """ file: gromacs_gromit.py Prepaire gromit command line input """ GROMIT_ARG_DICT = { 'forcefield': '-ff', 'charge': '-charge', 'gromacs_lie': '-lie', 'periodic_distance': '-d', 'temperature': '-t', 'prfc': '-prfc', 'ttau': '-ttau', 'salinity': '-conc', 's...
Fix command line argument construction
Fix command line argument construction Boolean values not parsed correctly
Python
apache-2.0
MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio
--- +++ @@ -19,7 +19,9 @@ 'ptau': '-ptau', 'sim_time': '-time', 'gromacs_vsite': '-vsite', - 'gmxrc': '-gmxrc'} + 'gmxrc': '-gmxrc', + 'gromacs_rtc': '-rtc', + 'gromacs_ndlp': '-ndlp'} def gromit_cmd(options): @@ -27,9 +29,11 @@ gmxRun = './gmx45md.sh ' for arg, val in option...
3245d884845748ef641ae1b39a14a040cf9a97a9
debexpo/tests/functional/test_register.py
debexpo/tests/functional/test_register.py
from debexpo.tests import TestController, url from debexpo.model import meta from debexpo.model.users import User class TestRegisterController(TestController): def test_maintainer_signup(self): count = meta.session.query(User).filter(User.email=='mr_me@example.com').count() self.assertEquals(count...
from debexpo.tests import TestController, url from debexpo.model import meta from debexpo.model.users import User class TestRegisterController(TestController): def test_maintainer_signup(self, actually_delete_it=True): count = meta.session.query(User).filter(User.email=='mr_me@example.com').count() ...
Add a test that reproduces the crash if you sign up a second time with the same name
Add a test that reproduces the crash if you sign up a second time with the same name
Python
mit
jonnylamb/debexpo,swvist/Debexpo,jonnylamb/debexpo,swvist/Debexpo,jonnylamb/debexpo,swvist/Debexpo,jadonk/debexpo,jadonk/debexpo,jadonk/debexpo
--- +++ @@ -4,7 +4,7 @@ class TestRegisterController(TestController): - def test_maintainer_signup(self): + def test_maintainer_signup(self, actually_delete_it=True): count = meta.session.query(User).filter(User.email=='mr_me@example.com').count() self.assertEquals(count, 0) @@ -20,5 +2...
772cff48318cd745fd2fcadd4c6bdc52629b176d
dp/dirichlet.py
dp/dirichlet.py
# -*- coding: utf-8 -*- from random import betavariate, uniform def weighted_choice(weights): choices = range(len(weights)) total = sum(weights) r = uniform(0, total) upto = 0 for c, w in zip(choices, weights): if upto + w > r: return c upto += w raise Exception("E...
# -*- coding: utf-8 -*- from random import betavariate, uniform def weighted_choice(weights): choices = range(len(weights)) total = sum(weights) r = uniform(0, total) upto = 0 for c, w in zip(choices, weights): if upto + w > r: return c upto += w raise Exception("E...
Raise error on bad alpha value
Raise error on bad alpha value
Python
mit
fivejjs/dirichletprocess,tdhopper/dirichletprocess,fivejjs/dirichletprocess,tdhopper/dirichletprocess
--- +++ @@ -17,6 +17,8 @@ class DirichletProcess(): def __init__(self, base_measure, alpha): + if alpha <= 0: + raise ValueError("alpha must be a positive number") self.base_measure = base_measure self.alpha = alpha
f80b080f62b450531007f58849019fd18c75c25f
stacker/blueprints/rds/postgres.py
stacker/blueprints/rds/postgres.py
from stacker.blueprints.rds import base class PostgresMixin(object): def engine(self): return "postgres" def get_engine_versions(self): return ['9.3.1', '9.3.2', '9.3.3', '9.3.5', '9.3.6', '9.4.1'] def get_db_families(self): return ["postgres9.3", "postgres9.4"] class MasterIns...
from stacker.blueprints.rds import base class PostgresMixin(object): def engine(self): return "postgres" def get_engine_versions(self): return ['9.3.1', '9.3.2', '9.3.3', '9.3.5', '9.3.6', '9.3.9', '9.3.10', '9.4.1', '9.4.4', '9.4.5'] def get_db_families(self): re...
Add new versions of Postgres
Add new versions of Postgres
Python
bsd-2-clause
mhahn/stacker,remind101/stacker,mhahn/stacker,remind101/stacker
--- +++ @@ -6,7 +6,8 @@ return "postgres" def get_engine_versions(self): - return ['9.3.1', '9.3.2', '9.3.3', '9.3.5', '9.3.6', '9.4.1'] + return ['9.3.1', '9.3.2', '9.3.3', '9.3.5', '9.3.6', '9.3.9', + '9.3.10', '9.4.1', '9.4.4', '9.4.5'] def get_db_families(self):...
6860d8a1fabdf7a8b18ad7cd6c687128443f85b5
HARK/tests/test_validators.py
HARK/tests/test_validators.py
import unittest from HARK.validators import non_empty class ValidatorsTests(unittest.TestCase): ''' Tests for validator decorators which validate function arguments ''' def test_non_empty(self): @non_empty('list_a') def foo(list_a, list_b): pass try: f...
import unittest from HARK.validators import non_empty class ValidatorsTests(unittest.TestCase): ''' Tests for validator decorators which validate function arguments ''' def test_non_empty(self): @non_empty('list_a') def foo(list_a, list_b): pass try: f...
Use different assert for Python 2 v 3
Use different assert for Python 2 v 3
Python
apache-2.0
econ-ark/HARK,econ-ark/HARK
--- +++ @@ -16,11 +16,19 @@ foo([1], []) except Exception: self.fail() - with self.assertRaisesRegex( - TypeError, - 'Expected non-empty argument for parameter list_a', - ): - foo([], [1]) + + if sys.version[0] == 2: ...
35fe55e41a6b1d22cb0ca93651771152cba831ad
wafer/users/migrations/0001_initial.py
wafer/users/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.core.validators from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations...
Add validator to initial user migration
Add validator to initial user migration
Python
isc
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer
--- +++ @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import django.core.validators from django.db import models, migrations from django.conf import settings @@ -24,7 +25,12 @@ ('homepage', models.CharField( max_length=256, null=True, bl...
e139cb8fc8887f98724eb8670de930230280976f
mclearn/tests/test_experiment.py
mclearn/tests/test_experiment.py
import os import shutil from .datasets import Dataset from mclearn.experiment import ActiveExperiment class TestExperiment: @classmethod def setup_class(cls): cls.data = Dataset('wine') cls.policies = ['passive', 'margin', 'weighted-margin', 'confidence', 'weighted-confi...
import os import shutil from .datasets import Dataset from mclearn.experiment import ActiveExperiment class TestExperiment: @classmethod def setup_class(cls): cls.data = Dataset('wine') cls.policies = ['passive', 'margin', 'w-margin', 'confidence', 'w-confidence', 'entro...
Update policy names in test
Update policy names in test
Python
bsd-3-clause
chengsoonong/mclass-sky,chengsoonong/mclass-sky,alasdairtran/mclearn,alasdairtran/mclearn,chengsoonong/mclass-sky,chengsoonong/mclass-sky,alasdairtran/mclearn,alasdairtran/mclearn
--- +++ @@ -7,8 +7,8 @@ @classmethod def setup_class(cls): cls.data = Dataset('wine') - cls.policies = ['passive', 'margin', 'weighted-margin', 'confidence', - 'weighted-confidence', 'entropy', 'weighted-entropy', + cls.policies = ['passive', 'margin', 'w-margin...
59057c28746220cd0c9d9c78d4fe18b6480e8dda
vertica_python/vertica/messages/backend_messages/empty_query_response.py
vertica_python/vertica/messages/backend_messages/empty_query_response.py
from vertica_python.vertica.messages.message import BackendMessage class EmptyQueryResponse(BackendMessage): pass EmptyQueryResponse._message_id(b'I')
from vertica_python.vertica.messages.message import BackendMessage class EmptyQueryResponse(BackendMessage): def __init__(self, data=None): self.data = data EmptyQueryResponse._message_id(b'I')
Add init for empty query response
Add init for empty query response
Python
apache-2.0
uber/vertica-python
--- +++ @@ -4,7 +4,8 @@ class EmptyQueryResponse(BackendMessage): - pass + def __init__(self, data=None): + self.data = data EmptyQueryResponse._message_id(b'I')
0ca662090e4b10b5fbc10b3d00fb87b861943272
calaccess_website/management/commands/updatedownloadswebsite.py
calaccess_website/management/commands/updatedownloadswebsite.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Update to the latest CAL-ACCESS snapshot and bake static website pages. """ import logging from django.core.management import call_command from calaccess_raw.management.commands.updatecalaccessrawdata import Command as updatecommand logger = logging.getLogger(__name__) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Update to the latest CAL-ACCESS snapshot and bake static website pages. """ import logging from django.core.management import call_command from calaccess_raw.management.commands.updatecalaccessrawdata import Command as updatecommand logger = logging.getLogger(__name__) ...
Add processcalaccessdata to update routine
Add processcalaccessdata to update routine
Python
mit
california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website
--- +++ @@ -34,6 +34,10 @@ """ super(Command, self).handle(*args, **options) + call_command( + 'processcalaccessdata', + verbosity=self.verbosity, + ) self.header('Creating latest file links') call_command('createlatestlinks') self.hea...
4ff7f008552cb2696c5e6b933a8e9df9e2cf9db9
setup.py
setup.py
from setuptools import setup, find_packages setup( name='validation', url='https://github.com/JOIVY/validation', version='0.1.0', author='Ben Mather', author_email='bwhmather@bwhmather.com', maintainer='', license='BSD', description=( "A library for runtime type checking and va...
from setuptools import setup, find_packages setup( name='validation', url='https://github.com/JOIVY/validation', version='0.1.0', author='Ben Mather', author_email='bwhmather@bwhmather.com', maintainer='', license='BSD', description=( "A library for runtime type checking and va...
Add python 3.6 to the list of supported versions
Add python 3.6 to the list of supported versions
Python
apache-2.0
JOIVY/validation
--- +++ @@ -21,6 +21,7 @@ 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', ], install_requires=[ 'six >= 1.10, < 2',
45b9d6329eb3ea4d602bd7785b9085d2769dfb70
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name='bankbarcode', version='0.1.1', packages=find_packages(), url='https://github.com/gisce/bankbarcode', license='GNU Affero General Public License v3', author='GISCE-TI, S.L.', author_email='devel@gisce.net', ...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name='bankbarcode', version='0.1.1', packages=find_packages(), url='https://github.com/gisce/bankbarcode', license='GNU Affero General Public License v3', author='GISCE-TI, S.L.', author_email='devel@gisce.net', ...
Use egg attribute of the links
Use egg attribute of the links To correct install it you must do: $ python setup.py install or $ pip install --process-dependency-links bankbarcode
Python
agpl-3.0
gisce/bankbarcode
--- +++ @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from setuptools import setup, find_packages + setup( name='bankbarcode', @@ -13,7 +14,7 @@ # We need python-barcode v0.8, to have Code128 (EAN128), not released yet # https://bitbucket.org/whitie/python-barcode/issues/16/pypi-08-release-request ...
b138a3428f91cd9917b7c0943e6b63c7787084d3
setup.py
setup.py
import os import sys from setuptools import setup from oauth2 import VERSION if sys.version_info < (3, 0, 0): memcache_require = "python-memcached" else: memcache_require = "python3-memcached" setup(name="python-oauth2", version=VERSION, description="OAuth 2.0 provider for python", long_des...
import os import sys from setuptools import setup from oauth2 import VERSION if sys.version_info < (3, 0, 0): memcache_require = "python-memcached" else: memcache_require = "python3-memcached" setup(name="python-oauth2", version=VERSION, description="OAuth 2.0 provider for python", long_des...
Add support for Python 3.5
Add support for Python 3.5
Python
mit
wndhydrnt/python-oauth2,wndhydrnt/python-oauth2,wndhydrnt/python-oauth2
--- +++ @@ -32,5 +32,6 @@ "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", ] )
fa672b56da73283013e8bc93809cb112ac399c40
datacats/error.py
datacats/error.py
from clint.textui import colored class DatacatsError(Exception): def __init__(self, message, format_args=(), parent_exception=None): self.message = message if parent_exception: self.message += '\n\n' + '~' * 30 + \ "\nTechnical Details:\n" + \ parent_e...
from clint.textui import colored class DatacatsError(Exception): def __init__(self, message, format_args=(), parent_exception=None): self.message = message if parent_exception: self.message += '\n\n' + '~' * 30 + \ "\nTechnical Details:\n" + \ parent_e...
Fix capitalization of datacats to match command name.
Fix capitalization of datacats to match command name.
Python
agpl-3.0
JackMc/datacats,deniszgonjanin/datacats,reneenoble/datacats,poguez/datacats,JackMc/datacats,wardi/datacats,datawagovau/datacats,dborzov/datacats,poguez/datacats,datawagovau/datacats,florianm/datacats,reneenoble/datacats,datacats/datacats,deniszgonjanin/datacats,wardi/datacats,datacats/datacats,florianm/datacats,dborzov...
--- +++ @@ -21,7 +21,7 @@ Print the error message to stdout with colors and borders """ print colored.blue("-" * 40) - print colored.red("DataCats: problem was encountered:") + print colored.red("datacats: problem was encountered:") for line in self.message.format(*se...
3a1eaebe08243839c5e593245a2c4a6eaa716048
enthought/traits/ui/editors/date_editor.py
enthought/traits/ui/editors/date_editor.py
#------------------------------------------------------------------------------ # # Copyright (c) 2008, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions...
#------------------------------------------------------------------------------ # # Copyright (c) 2008, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions...
Upgrade to an EditorFactory, so Custom, Text, and Readonly can be written.
Upgrade to an EditorFactory, so Custom, Text, and Readonly can be written.
Python
bsd-3-clause
burnpanck/traits,burnpanck/traits
--- +++ @@ -20,26 +20,21 @@ import datetime from enthought.traits.traits import Property -from enthought.traits.ui.basic_editor_factory import BasicEditorFactory +from enthought.traits.ui.editor_factory import EditorFactory from enthought.traits.ui.toolkit import toolkit_object #-- DateEditor definition ...
666b011ef95ef6e82e59cc134b52fb29443ff9d8
iroha_cli/crypto.py
iroha_cli/crypto.py
import base64 import sha3 import os from collections import namedtuple class KeyPair: def __init__(self, pub, pri): self.private_key = pri self.public_key = pub from iroha_cli.crypto_ed25519 import generate_keypair_ed25519, sign_ed25519, verify_ed25519, ed25519_sha3_512, \ ed25519_sha3_256...
import base64 import sha3 import os from collections import namedtuple class KeyPair: def __init__(self, pub, pri): self.private_key = pri self.public_key = pub def raw_public_key(self): return base64.b64decode(self.public_key) from iroha_cli.crypto_ed25519 import generate_keypair_...
Add get raw key from KeyPair
Add get raw key from KeyPair
Python
apache-2.0
MizukiSonoko/iroha-cli,MizukiSonoko/iroha-cli
--- +++ @@ -11,6 +11,8 @@ self.private_key = pri self.public_key = pub + def raw_public_key(self): + return base64.b64decode(self.public_key) from iroha_cli.crypto_ed25519 import generate_keypair_ed25519, sign_ed25519, verify_ed25519, ed25519_sha3_512, \ ed25519_sha3_256
43783e4ff07c9a2ff9f9a11b92515d49e66abcb2
lms/djangoapps/open_ended_grading/controller_query_service.py
lms/djangoapps/open_ended_grading/controller_query_service.py
import json import logging import requests from requests.exceptions import RequestException, ConnectionError, HTTPError import sys from grading_service import GradingService from grading_service import GradingServiceError from django.conf import settings from django.http import HttpResponse, Http404 log = logging.get...
import json import logging import requests from requests.exceptions import RequestException, ConnectionError, HTTPError import sys from grading_service import GradingService from grading_service import GradingServiceError from django.conf import settings from django.http import HttpResponse, Http404 log = logging.get...
Add in an item to check for combined notifications
Add in an item to check for combined notifications
Python
agpl-3.0
apigee/edx-platform,motion2015/edx-platform,fly19890211/edx-platform,angelapper/edx-platform,yokose-ks/edx-platform,itsjeyd/edx-platform,chudaol/edx-platform,dkarakats/edx-platform,dsajkl/123,DNFcode/edx-platform,ferabra/edx-platform,iivic/BoiseStateX,marcore/edx-platform,UXE/local-edx,cyanna/edx-platform,praveen-pal/e...
--- +++ @@ -19,6 +19,7 @@ super(ControllerQuery, self).__init__(config) self.check_eta_url = self.url + '/get_submission_eta/' self.is_unique_url = self.url + '/is_name_unique/' + self.combined_notifications_url = self.url + '/combined_notifications/' def check_if_name_is_uniq...
24ab943904339b5479912b8b70a7a2a0433c60da
src/interpreter/interpreter.py
src/interpreter/interpreter.py
''' Created on 03.02.2016. @author: Lazar ''' from textx.metamodel import metamodel_from_file from concepts.layout import Layout from concepts.object import Object from concepts.property import Property from concepts.selector_object import SelectorObject, selector_object_processor from concepts.selector_view import S...
''' Created on 03.02.2016. @author: Lazar ''' import os from textx.metamodel import metamodel_from_file from concepts.layout import Layout from concepts.object import Object from concepts.property import Property from concepts.selector_object import SelectorObject, selector_object_processor from concepts.selector_vie...
Use os.path.join to join paths. Use relative paths.
Use os.path.join to join paths. Use relative paths.
Python
mit
theshammy/GenAn,theshammy/GenAn,theshammy/GenAn
--- +++ @@ -3,6 +3,7 @@ @author: Lazar ''' +import os from textx.metamodel import metamodel_from_file from concepts.layout import Layout @@ -15,33 +16,39 @@ if __name__ == "__main__": - + builtins = {x : View(None,x, []) for x in View.basic_type_names} layouts = { - 'border' :...
b11399713d004a95da035ffceed9a1db8b837d11
diffs/__init__.py
diffs/__init__.py
from __future__ import absolute_import, unicode_literals __version__ = '0.1.6' default_app_config = 'diffs.apps.DiffLogConfig' klasses_to_connect = [] def register(cls): """ Decorator function that registers a class to record diffs. @diffs.register class ExampleModel(models.Model): ... ...
from __future__ import absolute_import, unicode_literals __version__ = '0.1.7' default_app_config = 'diffs.apps.DiffLogConfig' klasses_to_connect = [] def register(cls): """ Decorator function that registers a class to record diffs. @diffs.register class ExampleModel(models.Model): ... ...
Update decorator to optionally include DirtyFieldsMixin
Update decorator to optionally include DirtyFieldsMixin Update logic so the class is skipped if it hasattr get_dirty_fields * Release 0.1.7
Python
mit
linuxlewis/django-diffs
--- +++ @@ -1,6 +1,6 @@ from __future__ import absolute_import, unicode_literals -__version__ = '0.1.6' +__version__ = '0.1.7' default_app_config = 'diffs.apps.DiffLogConfig' klasses_to_connect = [] @@ -19,8 +19,8 @@ from .models import DiffModelManager, DiffModelDescriptor from .signals import con...
260beeaae9daeadb3319b895edc5328504e779b2
cansen.py
cansen.py
#! /usr/bin/python3 print('Test')
#! /usr/bin/python3 import cantera as ct gas = ct.Solution('mech.cti') gas.TPX = 1000,101325,'H2:2,O2:1,N2:3.76' reac = ct.Reactor(gas) netw = ct.ReactorNet([reac]) tend = 10 time = 0 while time < tend: time = netw.step(tend) print(time,reac.T,reac.thermo.P) if reac.T > 1400: break
Create working constant volume reactor test
Create working constant volume reactor test
Python
mit
kyleniemeyer/CanSen,bryanwweber/CanSen
--- +++ @@ -1,3 +1,13 @@ #! /usr/bin/python3 - -print('Test') +import cantera as ct +gas = ct.Solution('mech.cti') +gas.TPX = 1000,101325,'H2:2,O2:1,N2:3.76' +reac = ct.Reactor(gas) +netw = ct.ReactorNet([reac]) +tend = 10 +time = 0 +while time < tend: + time = netw.step(tend) + print(time,reac.T,reac.thermo.P...
105111b0ed02a7c698ba79f88a54636ec3d5b2a8
madrona/common/management/commands/install_cleangeometry.py
madrona/common/management/commands/install_cleangeometry.py
from django.core.management.base import BaseCommand, AppCommand from django.db import connection, transaction import os class Command(BaseCommand): help = "Installs a cleangeometry function in postgres required for processing incoming geometries." def handle(self, **options): path = os.path.abspath(os...
from django.core.management.base import BaseCommand, AppCommand from django.db import connection, transaction import os class Command(BaseCommand): help = "Installs a cleangeometry function in postgres required for processing incoming geometries." def handle(self, **options): path = os.path.abspath(os...
Use transactions to make sure cleangeometry function sticks
Use transactions to make sure cleangeometry function sticks
Python
bsd-3-clause
Ecotrust/madrona_addons,Ecotrust/madrona_addons
--- +++ @@ -14,5 +14,15 @@ sql = sql.replace('%','%%') cursor = connection.cursor() + cursor.db.enter_transaction_management() + cursor.execute(sql) print cursor.statusmessage + print "TESTING" + + cursor.execute("select cleangeometry(st_geomfromewkt('SRID=43...
17345dd298860ddfe61f58234d2a38e0a7187d2c
rbm2m/worker.py
rbm2m/worker.py
# -*- coding: utf-8 -*- """ Task entry points """ from sqlalchemy.exc import SQLAlchemyError from action import scanner from helpers import make_config, make_session, make_redis config = make_config() sess = make_session(None, config) redis = make_redis(config) scanner = scanner.Scanner(config, sess, redis) def...
# -*- coding: utf-8 -*- """ Task entry points """ from sqlalchemy.exc import SQLAlchemyError from action import scanner from helpers import make_config, make_session, make_redis config = make_config() sess = make_session(None, config) redis = make_redis(config) scanner = scanner.Scanner(config, sess, redis) def...
Print SQLAlchemy exceptions to stdout and reraise
Print SQLAlchemy exceptions to stdout and reraise
Python
apache-2.0
notapresent/rbm2m,notapresent/rbm2m
--- +++ @@ -20,6 +20,7 @@ method(*args, **kwargs) except SQLAlchemyError as e: sess.rollback() + raise else: sess.commit() finally:
e9b5930e7b1865ff1835680c14de58fc9a88d043
dominus/main.py
dominus/main.py
import logging import chryso.connection import flask import dominus.tables import dominus.views def run(): logging.basicConfig() logging.getLogger().setLevel(logging.DEBUG) app = flask.Flask('dominus') app.config.update(dict( FLASK_DEBUG = True, SECRET_KEY = 'development key', )...
import logging import chryso.connection import flask import dominus.tables import dominus.views def setup_db(): db = "postgres://dev:development@localhost:5432/dominus" engine = chryso.connection.Engine(db, dominus.tables) chryso.connection.store(engine) def run(): logging.basicConfig() logging....
Break out DB setup separately, enable debug
Break out DB setup separately, enable debug
Python
mit
EliRibble/dominus,EliRibble/dominus,EliRibble/dominus,EliRibble/dominus
--- +++ @@ -6,23 +6,27 @@ import dominus.tables import dominus.views +def setup_db(): + db = "postgres://dev:development@localhost:5432/dominus" + engine = chryso.connection.Engine(db, dominus.tables) + chryso.connection.store(engine) def run(): logging.basicConfig() logging.getLogger().setL...
f943aa57d6ee462146ff0ab2a091c406d009acce
polyaxon/scheduler/spawners/templates/services/default_env_vars.py
polyaxon/scheduler/spawners/templates/services/default_env_vars.py
from django.conf import settings from scheduler.spawners.templates.env_vars import get_from_app_secret def get_service_env_vars(): return [ get_from_app_secret('POLYAXON_SECRET_KEY', 'polyaxon-secret'), get_from_app_secret('POLYAXON_INTERNAL_SECRET_TOKEN', 'polyaxon-internal-secret-token'), ...
from django.conf import settings from libs.api import API_KEY_NAME, get_settings_api_url from scheduler.spawners.templates.env_vars import get_env_var, get_from_app_secret def get_service_env_vars(): return [ get_from_app_secret('POLYAXON_SECRET_KEY', 'polyaxon-secret'), get_from_app_secret('POLY...
Add api url to default env vars
Add api url to default env vars
Python
apache-2.0
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
--- +++ @@ -1,6 +1,7 @@ from django.conf import settings -from scheduler.spawners.templates.env_vars import get_from_app_secret +from libs.api import API_KEY_NAME, get_settings_api_url +from scheduler.spawners.templates.env_vars import get_env_var, get_from_app_secret def get_service_env_vars(): @@ -8,5 +9,6 ...
deef4ac0d34409727d36f273cc63420deae982f7
setup.py
setup.py
from setuptools import setup, find_packages import sys reqs = [ "decorator>=3.3.2", "Pillow>=2.5.0" ] if sys.version_info[0] == 2: # simplejson is not python3 compatible reqs.append("simplejson>=2.0.9") if [sys.version_info[0], sys.version_info[1]] < [2, 7]: reqs.append("argparse>=1.2") setup( ...
from setuptools import setup, find_packages import sys install_reqs = [ "decorator>=3.3.2" ] test_reqs = [ "Pillow>=2.5.0" ] if sys.version_info[0] == 2: # simplejson is not python3 compatible install_reqs.append("simplejson>=2.0.9") if [sys.version_info[0], sys.version_info[1]] < [2, 7]: instal...
Move Pillow to tests requirements
Move Pillow to tests requirements
Python
bsd-3-clause
DataDog/dogapi,DataDog/dogapi
--- +++ @@ -1,16 +1,19 @@ from setuptools import setup, find_packages import sys -reqs = [ - "decorator>=3.3.2", - "Pillow>=2.5.0" +install_reqs = [ + "decorator>=3.3.2" ] +test_reqs = [ + "Pillow>=2.5.0" +] + if sys.version_info[0] == 2: # simplejson is not python3 compatible - reqs.append...
08016cfbc2c0d4dc90158166ef96e0571a581006
setup.py
setup.py
from setuptools import setup, find_packages version = '1.0a1' setup(name='pystunnel', version=version, description='Python interface to stunnel', #long_description=open('README.rst').read() + '\n' + # open('CHANGES.rst').read(), classifiers=[ 'Development Status...
from setuptools import setup, find_packages version = '1.0a1' import sys, functools if sys.version_info[0] >= 3: open = functools.partial(open, encoding='utf-8') setup(name='pystunnel', version=version, description='Python interface to stunnel', long_description=open('README.rst').read() + '\n'...
Use README in long description.
Use README in long description.
Python
agpl-3.0
zero-db/pystunnel
--- +++ @@ -2,11 +2,15 @@ version = '1.0a1' +import sys, functools +if sys.version_info[0] >= 3: + open = functools.partial(open, encoding='utf-8') + setup(name='pystunnel', version=version, description='Python interface to stunnel', - #long_description=open('README.rst').read() + '\n' + -...
f84d6c2361e78f4ac8a615d28f64a0fd6386c661
setup.py
setup.py
# -*- encoding: UTF-8 -* from setuptools import setup with open('README.md') as fp: README = fp.read() setup( name='steeve', version='0.1', author='Sviatoslav Abakumov', author_email='dust.harvesting@gmail.com', description=u'Tiny GNU Stow–based package manager', long_description=README, ...
# -*- encoding: UTF-8 -* from setuptools import setup with open('README.rst') as fp: README = fp.read() setup( name='steeve', version='0.1', author='Sviatoslav Abakumov', author_email='dust.harvesting@gmail.com', description=u'Tiny GNU Stow–based package manager', long_description=README, ...
Read long description from README.rst
Read long description from README.rst
Python
bsd-3-clause
Perlence/steeve,Perlence/steeve
--- +++ @@ -1,7 +1,7 @@ # -*- encoding: UTF-8 -* from setuptools import setup -with open('README.md') as fp: +with open('README.rst') as fp: README = fp.read() setup(
a87866811cbdecfc32126a314073a6203ae87b63
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup(name='programmabletuple', version='0.1', description='Python metaclass for making named tuples with programmability', long_description=open('README.rst').read(), author='Tschijnmo TSCHAU', author_email='tschijnmotschau@gmail.com', ...
#!/usr/bin/env python from setuptools import setup setup(name='programmabletuple', version='0.2.0', description='Python metaclass for making named tuples with programmability', long_description=open('README.rst').read(), author='Tschijnmo TSCHAU', author_email='tschijnmotschau@gmail.com'...
Change the version number to 0.2.0
Change the version number to 0.2.0
Python
mit
tschijnmo/programmabletuple
--- +++ @@ -3,7 +3,7 @@ from setuptools import setup setup(name='programmabletuple', - version='0.1', + version='0.2.0', description='Python metaclass for making named tuples with programmability', long_description=open('README.rst').read(), author='Tschijnmo TSCHAU',
96bc1cbf4d67d16753b3dbf9b5b32d6e2d1c521b
setup.py
setup.py
""" Flask-Celery ------------ Celery integration for Flask """ from setuptools import setup setup( name='Flask-Celery', version='2.4.1', url='http://github.com/ask/flask-celery/', license='BSD', author='Ask Solem', author_email='ask@celeryproject.org', description='Celery integration for ...
""" Flask-Celery ------------ Celery integration for Flask """ from setuptools import setup setup( name='Flask-Celery', version='2.4.1', url='http://github.com/ask/flask-celery/', license='BSD', author='Ask Solem', author_email='ask@celeryproject.org', description='Celery integration for ...
Use official Flask-Script distribution (>= 0.3.2)
Use official Flask-Script distribution (>= 0.3.2)
Python
bsd-3-clause
ask/flask-celery
--- +++ @@ -22,7 +22,7 @@ test_suite="nose.collector", install_requires=[ 'Flask>=0.8', - 'Flask-Script-fix', + 'Flask-Script>=0.3.2', 'celery>=2.3.0', ], tests_require=[
3ac9c317e266d79e96c20121996a4af4d82776dd
setup.py
setup.py
from distutils.core import setup import winsys if __name__ == '__main__': setup ( name='WinSys', version=winsys.__version__, url='http://svn.timgolden.me.uk/winsys', download_url='http://timgolden.me.uk/python/downloads', license='MIT', author='Tim Golden', auth...
from distutils.core import setup import winsys if __name__ == '__main__': setup ( name='WinSys', version=winsys.__version__, url='http://code.google.com/p/winsys', download_url='http://timgolden.me.uk/python/downloads/winsys', license='MIT', author='Tim Golden', ...
Correct the packaging of packages on winsys
Correct the packaging of packages on winsys modified setup.py
Python
mit
one2pret/winsys,one2pret/winsys
--- +++ @@ -6,8 +6,8 @@ setup ( name='WinSys', version=winsys.__version__, - url='http://svn.timgolden.me.uk/winsys', - download_url='http://timgolden.me.uk/python/downloads', + url='http://code.google.com/p/winsys', + download_url='http://timgolden.me.uk/python/downloads/winsys',...
abce8024f998dd62a3f0bfac57391c3aebe647fa
setup.py
setup.py
#!/usr/bin/env python3 from setuptools import setup from ipyrmd import __version__ setup(name="ipyrmd", version=__version__, description="Convert between IPython/Jupyter notebooks and RMarkdown", author="Gordon Ball", author_email="gordon@chronitis.net", url="https://github.com/chronitis...
#!/usr/bin/env python3 from setuptools import setup from ipyrmd import __version__ with open("README.md") as f: long_desc = f.read() setup(name="ipyrmd", version=__version__, description="Convert between IPython/Jupyter notebooks and RMarkdown", long_description=long_desc, author="Gordon ...
Use contents of README as long_description
Use contents of README as long_description
Python
mit
chronitis/ipyrmd
--- +++ @@ -3,9 +3,13 @@ from setuptools import setup from ipyrmd import __version__ +with open("README.md") as f: + long_desc = f.read() + setup(name="ipyrmd", version=__version__, description="Convert between IPython/Jupyter notebooks and RMarkdown", + long_description=long_desc, a...
a3770920919f02f9609fe0a48789b70ec548cd3d
setup.py
setup.py
import sys from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext ext_modules = [ Extension("nerven.epoc._parse", ["src/nerven/epoc/_parse.pyx"]) ] setup(name='nerven', version='0.1', author='Sharif Olorin', author_email='sio@tesser.org'...
import sys import numpy from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext ext_modules = [ Extension("nerven.epoc._parse", sources=["src/nerven/epoc/_parse.pyx"], include_dirs=[".", numpy.get_include()]), ] setup(name='nerven', ...
Fix the numpy include path used by the Cython extension
Fix the numpy include path used by the Cython extension Apparently this only worked because I had numpy installed system-wide (broke on virtualenv-only installs).
Python
mit
olorin/nerven,fractalcat/nerven,fractalcat/nerven,olorin/nerven
--- +++ @@ -1,10 +1,15 @@ import sys + +import numpy + from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext ext_modules = [ - Extension("nerven.epoc._parse", ["src/nerven/epoc/_parse.pyx"]) + Extension("nerven.epoc._parse", + sources=["s...
e0fb70d632553e11f6dd08b31bb81872c3b7bc65
setup.py
setup.py
#!/usr/bin/env python # coding: utf-8 from setuptools import find_packages, setup setup( name="django-flexible-images", version="1.0.0", url="https://github.com/lewiscollard/django-flexible-images", author="Lewis Collard", author_email="lewis.collard@onespacemedia.com", packages=find_packages()...
#!/usr/bin/env python # coding: utf-8 from setuptools import find_packages, setup setup( name="django-flexible-images", version="1.0.0", url="https://github.com/lewiscollard/django-flexible-images", author="Lewis Collard", author_email="lewis.collard@onespacemedia.com", packages=find_packages()...
Add sorl-thumbnail and Django as installation requirements.
Add sorl-thumbnail and Django as installation requirements.
Python
cc0-1.0
lewiscollard/django-flexible-images,lewiscollard/django-flexible-images,lewiscollard/django-flexible-images
--- +++ @@ -22,4 +22,8 @@ 'Programming Language :: Python :: 2.7', 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication', ], + install_requires=[ + 'django', + 'sorl-thumbnail' + ] )
00ebbcb50ada0369dde02b114efc573d9aceea67
setup.py
setup.py
from setuptools import setup setup( name='realex-client', version='0.8.0', packages=['realexpayments'], url='https://github.com/viniciuschiele/realex-client', license='MIT', author='Vinicius Chiele', author_email='vinicius.chiele@gmail.com', description='Python interface to Realex Payme...
from setuptools import setup setup( name='realexpayments', version='0.8.0', packages=['realexpayments'], url='https://github.com/viniciuschiele/realex-sdk', license='MIT', author='Vinicius Chiele', author_email='vinicius.chiele@gmail.com', description='Realex Payments SDK for Python', ...
Rename project name to realexpayments
Rename project name to realexpayments
Python
mit
viniciuschiele/realex-sdk,viniciuschiele/realex-client
--- +++ @@ -1,14 +1,14 @@ from setuptools import setup setup( - name='realex-client', + name='realexpayments', version='0.8.0', packages=['realexpayments'], - url='https://github.com/viniciuschiele/realex-client', + url='https://github.com/viniciuschiele/realex-sdk', license='MIT', ...
a349fceba7d4c22be8b44323dc759aa5bc605e73
setup.py
setup.py
from distutils.core import setup setup( name='cmsplugin-simple-markdown', version=".".join(map(str, __import__('cmsplugin_simple_markdown').__version__)), packages=['cmsplugin_simple_markdown', 'cmsplugin_simple_markdown.migrations'], package_dir={'cmsplugin_simple_markdown': 'cmsplugin_simple_markdown...
from setuptools import setup setup( name='cmsplugin-simple-markdown', version=".".join(map(str, __import__('cmsplugin_simple_markdown').__version__)), packages=['cmsplugin_simple_markdown', 'cmsplugin_simple_markdown.migrations'], package_dir={'cmsplugin_simple_markdown': 'cmsplugin_simple_markdown'}, ...
Install Python Markdown when installing cmsplugin-simple-markdown.
Install Python Markdown when installing cmsplugin-simple-markdown.
Python
bsd-3-clause
Alir3z4/cmsplugin-simple-markdown,Alir3z4/cmsplugin-simple-markdown
--- +++ @@ -1,4 +1,4 @@ -from distutils.core import setup +from setuptools import setup setup( name='cmsplugin-simple-markdown', @@ -6,6 +6,7 @@ packages=['cmsplugin_simple_markdown', 'cmsplugin_simple_markdown.migrations'], package_dir={'cmsplugin_simple_markdown': 'cmsplugin_simple_markdown'}, ...
e5a5dfd8a8c50d3df2070dc52ad09c440507a869
setup.py
setup.py
from setuptools import setup setup( name='fapistrano', version='0.5.1', license='MIT', description='Capistrano style deployment with fabric', zip_safe=False, include_package_data=True, platforms='any', packages=['fapistrano'], install_requires=[ 'Fabric', 'requests'...
from setuptools import setup setup( name='fapistrano', version='0.5.1', license='MIT', description='Capistrano style deployment with fabric', zip_safe=False, include_package_data=True, platforms='any', packages=['fapistrano'], install_requires=[ 'Fabric', 'requests'...
Add `fap` as a console script.
Add `fap` as a console script.
Python
mit
liwushuo/fapistrano
--- +++ @@ -15,6 +15,10 @@ 'requests', 'PyYaml', ], + entry_points=''' + [console_scripts] + fap=fapistrano.cli:fap + ''' classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License',
47dff0e6847889f386cbf0faf5db567a56bf5eef
setup.py
setup.py
import os from distutils.core import setup from setuptools import find_packages VERSION = __import__("django_shop_payer_backend").VERSION CLASSIFIERS = [ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Topic :: Software Development',...
import os from distutils.core import setup from setuptools import find_packages VERSION = __import__("django_shop_payer_backend").VERSION CLASSIFIERS = [ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Topic :: Software Development',...
Use pip version of python-payer-api instead.
Use pip version of python-payer-api instead.
Python
mit
dessibelle/django-shop-payer-backend
--- +++ @@ -14,7 +14,7 @@ install_requires = [ 'django-shop>=0.2.0', - 'python-payer-api==dev', + 'python-payer-api>=0.1.0', ] setup( @@ -26,9 +26,7 @@ url="https://github.com/dessibelle/django-shop-payer-backend", download_url="https://github.com/dessibelle/django-shop-payer-backend/archi...
fd1e904e1f2b6297801a1c8cd6626bdf1d73a3ec
setup.py
setup.py
from setuptools import setup __version_info__ = ('0', '2', '0') __version__ = '.'.join(__version_info__) setup( name="staticjinja", version=__version__, description="jinja based static site generator", author="Ceasar Bautista", author_email="cbautista2010@gmail.com", url="https://github.com/Ce...
from setuptools import setup __version_info__ = ('0', '2', '0') __version__ = '.'.join(__version_info__) setup( name="staticjinja", version=__version__, description="jinja based static site generator", author="Ceasar Bautista", author_email="cbautista2010@gmail.com", url="https://github.com/Ce...
Update the Python version classifiers, and remove use_2to3
Update the Python version classifiers, and remove use_2to3 staticjinja supports Python 2.6, 2.7 and 3.3. This change also removes support for Python 2.5, which isn't supported by tox (so ensuring staticjinja works with 2.5 is tricky).
Python
mit
Ceasar/staticjinja,Ceasar/staticjinja,jerivas/staticjinja,jerivas/staticjinja
--- +++ @@ -18,12 +18,13 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2.5", + "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", ...
785cbf2f296b425bf0079cba99ee7bae662fc6d1
setup.py
setup.py
""" A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description f...
""" A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup # To use a consistent encoding from codecs import open as codecopen from os import path here = path.abspath(path.dirname(__file__)) # Get the long ...
Fix reserved keyword override with import
Fix reserved keyword override with import
Python
apache-2.0
aquatix/paragoo,aquatix/paragoo
--- +++ @@ -7,13 +7,13 @@ from setuptools import setup # To use a consistent encoding -from codecs import open +from codecs import open as codecopen from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file -with open(path.join(here, 'README.rst'), en...
6131430ff7d1e9e8cd95f8d2793e82cc72679d81
auditlog/admin.py
auditlog/admin.py
from django.contrib import admin from .filters import ResourceTypeFilter from .mixins import LogEntryAdminMixin from .models import LogEntry class LogEntryAdmin(admin.ModelAdmin, LogEntryAdminMixin): list_display = ["created", "resource_url", "action", "msg_short", "user_url"] search_fields = [ "time...
from django.contrib import admin from auditlog.filters import ResourceTypeFilter from auditlog.mixins import LogEntryAdminMixin from auditlog.models import LogEntry class LogEntryAdmin(admin.ModelAdmin, LogEntryAdminMixin): list_display = ["created", "resource_url", "action", "msg_short", "user_url"] search_...
Change relative imports to absolute.
Change relative imports to absolute.
Python
mit
jjkester/django-auditlog
--- +++ @@ -1,8 +1,8 @@ from django.contrib import admin -from .filters import ResourceTypeFilter -from .mixins import LogEntryAdminMixin -from .models import LogEntry +from auditlog.filters import ResourceTypeFilter +from auditlog.mixins import LogEntryAdminMixin +from auditlog.models import LogEntry class L...
649dc183ecce5586483155a9bc3699e73b6c4601
plugins/configuration/preferences/preferences.py
plugins/configuration/preferences/preferences.py
#!/usr/bin/env python #-*- coding: utf-8 -*- #This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software. #The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif...
#!/usr/bin/env python #-*- coding: utf-8 -*- #This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software. #The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif...
Prepare once plug-ins are loaded
Prepare once plug-ins are loaded With the new version of the listen hook.
Python
cc0-1.0
Ghostkeeper/Luna
--- +++ @@ -8,12 +8,20 @@ Provides a class that allows for creating global application preferences. """ +import luna.listen #To prepare the preferences for use when plug-ins are loaded. import luna.plugins #To get the configuration data type to extend from. class Preferences: """ Offers a system to create...
0c2305db6c6792f624cf09a9134aaa090c82d5c1
tasks.py
tasks.py
from invoke import task import jschema @task def pip(ctx): ctx.run("rm -rf dist jschema.egg-info") ctx.run("./setup.py sdist") ctx.run("twine upload dist/jschema-{}.tar.gz".format(jschema.__version__)) @task def doc(ctx): ctx.run("./setup.py build_sphinx") ctx.run("./setup.py upload_sphinx")
from invoke import task from invoke.util import cd import jschema @task def pip(ctx): ctx.run("rm -rf dist jschema.egg-info") ctx.run("./setup.py sdist") ctx.run("twine upload dist/jschema-{}.tar.gz".format(jschema.__version__)) @task def doc(ctx): ctx.run("./setup.py build_sphinx") ctx.run("./se...
Add mezzo task, for copy project to mezzo
Add mezzo task, for copy project to mezzo
Python
mit
stepan-perlov/jschema,stepan-perlov/jschema
--- +++ @@ -1,4 +1,5 @@ from invoke import task +from invoke.util import cd import jschema @@ -12,3 +13,12 @@ def doc(ctx): ctx.run("./setup.py build_sphinx") ctx.run("./setup.py upload_sphinx") + +@task +def mezzo(ctx): + ctx.run("mkdir -p build/jschema") + ctx.run("cp -R jschema setup.py buil...
fa862fdd6be62eb4e79d0dfcef60471aecd46981
rest_framework_push_notifications/tests/test_serializers.py
rest_framework_push_notifications/tests/test_serializers.py
from django.test import TestCase from .. import serializers class TestAPNSDeviceSerializer(TestCase): def test_fields(self): expected = {'url', 'name', 'device_id', 'registration_id', 'active'} fields = serializers.APNSDevice().fields.keys() self.assertEqual(expected, set(fields)) de...
from django.test import TestCase from .. import serializers class TestAPNSDeviceSerializer(TestCase): def test_fields(self): expected = {'url', 'name', 'device_id', 'registration_id', 'active'} fields = serializers.APNSDevice().fields.keys() self.assertEqual(expected, set(fields)) de...
Check for registration_id in serializer errors
Check for registration_id in serializer errors
Python
bsd-2-clause
incuna/rest-framework-push-notifications
--- +++ @@ -16,3 +16,4 @@ def test_registration_id_required(self): serializer = serializers.APNSDevice(data={}) self.assertFalse(serializer.is_valid()) + self.assertIn('registration_id', serializer.errors)
4f1c4f75a3576c4bfb3517e6e9168fc8433a5c4b
engine/gobject.py
engine/gobject.py
from .meta import GObjectMeta from . import signals from . import meta @meta.apply class GObject(metaclass=GObjectMeta): # Attributes of the object __attributes__ = () def __init__(self, **kwargs): for key in self.__attributes__: setattr(self, key, kwargs.pop(key)) if kwargs: ...
from .meta import GObjectMeta from . import signals from . import meta @meta.apply class GObject(metaclass=GObjectMeta): # Attributes of the object __attributes__ = () def __init__(self, **kwargs): for key in self.__attributes__: setattr(self, key, kwargs.pop(key)) if kwargs: ...
Add method set to GObject to set attributes
Add method set to GObject to set attributes
Python
bsd-3-clause
entwanne/NAGM
--- +++ @@ -13,6 +13,12 @@ if kwargs: raise TypeError('Unexpected attributes {}'.format(', '.join(kwargs.keys()))) + def set(self, **kwargs): + for key, value in kwargs.items(): + if key not in self.__attributes__: + raise TypeError('Unexpected attribute {}'...
70931f5d0d1b90ce2f7853ffcab94838cab0dab5
api/base/views.py
api/base/views.py
from rest_framework.decorators import api_view from rest_framework.response import Response from .utils import absolute_reverse from api.users.serializers import UserSerializer @api_view(('GET',)) def root(request, format=None): if request.user and not request.user.is_anonymous(): user = request.user ...
from rest_framework.decorators import api_view from rest_framework.response import Response from .utils import absolute_reverse from api.users.serializers import UserSerializer @api_view(('GET',)) def root(request, format=None): if request.user and not request.user.is_anonymous(): user = request.user ...
Add context when calling UserSerializer
Add context when calling UserSerializer
Python
apache-2.0
brianjgeiger/osf.io,rdhyee/osf.io,billyhunt/osf.io,alexschiller/osf.io,samchrisinger/osf.io,acshi/osf.io,sbt9uc/osf.io,brandonPurvis/osf.io,amyshi188/osf.io,chrisseto/osf.io,baylee-d/osf.io,cosenal/osf.io,samchrisinger/osf.io,jnayak1/osf.io,petermalcolm/osf.io,monikagrabowska/osf.io,mfraezz/osf.io,mluo613/osf.io,Merlin...
--- +++ @@ -8,7 +8,7 @@ def root(request, format=None): if request.user and not request.user.is_anonymous(): user = request.user - current_user = UserSerializer(user).data + current_user = UserSerializer(user, context={'request': request}).data else: current_user = None ...
cdee18e9a937f3dd7e788b92927f35652320e743
api/streams/views.py
api/streams/views.py
from api.streams.models import StreamConfiguration from django.http import JsonResponse from django.http.request import HttpRequest import requests def get_stream_status(request: HttpRequest, stream_slug: str): stream = StreamConfiguration.objects.get(slug=stream_slug) r = requests.get('http://{stream.host}:{...
from api.streams.models import StreamConfiguration from django.http import JsonResponse, Http404 from django.http.request import HttpRequest import requests def get_stream_status(request: HttpRequest, stream_slug: str): try: stream = StreamConfiguration.objects.get(slug=stream_slug) except StreamConfig...
Improve error handling in stream status view
Improve error handling in stream status view - Check if stream exists and raise a 404 otherwise - Check if upstream returned a success status code and raise a 500 otherwise
Python
mit
urfonline/api,urfonline/api,urfonline/api
--- +++ @@ -1,12 +1,17 @@ from api.streams.models import StreamConfiguration -from django.http import JsonResponse +from django.http import JsonResponse, Http404 from django.http.request import HttpRequest import requests def get_stream_status(request: HttpRequest, stream_slug: str): - stream = StreamConfigu...
583a32cd1e9e77d7648978d20a5b7631a4fe2334
tests/sentry/interfaces/tests.py
tests/sentry/interfaces/tests.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import pickle from sentry.interfaces import Interface from sentry.testutils import TestCase class InterfaceTests(TestCase): def test_init_sets_attrs(self): obj = Interface(foo=1) self.assertEqual(obj.attrs, ['foo']) def test_...
# -*- coding: utf-8 -*- from __future__ import absolute_import import pickle from sentry.interfaces import Interface, Message, Stacktrace from sentry.models import Event from sentry.testutils import TestCase, fixture class InterfaceBase(TestCase): @fixture def event(self): return Event( ...
Improve test coverage on base Interface and Message classes
Improve test coverage on base Interface and Message classes
Python
bsd-3-clause
songyi199111/sentry,JTCunning/sentry,JackDanger/sentry,fotinakis/sentry,JamesMura/sentry,kevinlondon/sentry,mitsuhiko/sentry,felixbuenemann/sentry,fotinakis/sentry,jean/sentry,drcapulet/sentry,ifduyue/sentry,alexm92/sentry,pauloschilling/sentry,fuziontech/sentry,jokey2k/sentry,fotinakis/sentry,argonemyth/sentry,zenefit...
--- +++ @@ -4,18 +4,69 @@ import pickle -from sentry.interfaces import Interface - -from sentry.testutils import TestCase +from sentry.interfaces import Interface, Message, Stacktrace +from sentry.models import Event +from sentry.testutils import TestCase, fixture -class InterfaceTests(TestCase): +class Inte...
ac02378dcc611fb2c3b8a98e7480e02f64ee716d
polling_stations/apps/data_collection/management/commands/import_shepway.py
polling_stations/apps/data_collection/management/commands/import_shepway.py
from data_collection.morph_importer import BaseMorphApiImporter class Command(BaseMorphApiImporter): srid = 4326 districts_srid = 4326 council_id = 'E07000112' elections = ['parl.2017-06-08'] scraper_name = 'wdiv-scrapers/DC-PollingStations-Shepway' geom_type = 'geojson' def district_rec...
from data_collection.morph_importer import BaseMorphApiImporter class Command(BaseMorphApiImporter): srid = 4326 districts_srid = 4326 council_id = 'E07000112' #elections = ['parl.2017-06-08'] scraper_name = 'wdiv-scrapers/DC-PollingStations-Shepway' geom_type = 'geojson' def district_re...
Remove Shepway election id (waiting on feedback)
Remove Shepway election id (waiting on feedback)
Python
bsd-3-clause
chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
--- +++ @@ -5,7 +5,7 @@ srid = 4326 districts_srid = 4326 council_id = 'E07000112' - elections = ['parl.2017-06-08'] + #elections = ['parl.2017-06-08'] scraper_name = 'wdiv-scrapers/DC-PollingStations-Shepway' geom_type = 'geojson'
abbe40d2f65c8a4f8d9bae1322b1ec76466a27fb
modules/__init__.py
modules/__init__.py
import pkgutil, os, sys def getmodules(): """Returns all modules that are found in the current package. Excludes modules starting with '__'""" return [ name for _,name, _ in pkgutil.iter_modules( [ os.path.dirname( __file__ ) ] ) if name[0:2] != '__' ] def getmodule( module ): """Import module <module> and return...
import pkgutil, os, sys def getmodules(): """Returns all modules that are found in the current package. Excludes modules starting with '_'""" return [ name for _,name, _ in pkgutil.iter_modules( [ os.path.dirname( __file__ ) ] ) if name[0] != '_' ] def getmodule( module ): """Import module <module> and return the...
Change module finder to ignore modules starting with '_'
Change module finder to ignore modules starting with '_'
Python
mit
jawsper/modularirc
--- +++ @@ -2,8 +2,8 @@ def getmodules(): """Returns all modules that are found in the current package. - Excludes modules starting with '__'""" - return [ name for _,name, _ in pkgutil.iter_modules( [ os.path.dirname( __file__ ) ] ) if name[0:2] != '__' ] + Excludes modules starting with '_'""" + return [ name ...
a0c636714530dac69edd02d821e7868a4a560541
utils/swift_build_support/swift_build_support/compiler_stage.py
utils/swift_build_support/swift_build_support/compiler_stage.py
# ===--- compiler_stage.py -----------------------------------------------===# # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https:#swift.org/LICENSE.txt...
# ===--- compiler_stage.py -----------------------------------------------===# # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https:#swift.org/LICENSE.txt...
Address Python lint issue in unrelated file
Address Python lint issue in unrelated file
Python
apache-2.0
benlangmuir/swift,xwu/swift,xwu/swift,rudkx/swift,atrick/swift,apple/swift,gregomni/swift,benlangmuir/swift,roambotics/swift,xwu/swift,JGiola/swift,JGiola/swift,apple/swift,apple/swift,glessard/swift,benlangmuir/swift,JGiola/swift,gregomni/swift,roambotics/swift,benlangmuir/swift,atrick/swift,xwu/swift,rudkx/swift,greg...
--- +++ @@ -9,6 +9,7 @@ # See https:#swift.org/CONTRIBUTORS.txt for the list of Swift project authors # # ===---------------------------------------------------------------------===# + class StageArgs(object): def __init__(self, stage, args):
ed2580c14c9e1a0c00fc2df17abb85ab26f86f9f
tools/examples/check-modified.py
tools/examples/check-modified.py
#!/usr/bin/python # # USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ... # # prints out the URL associated with each item # import sys import os import os.path import svn.util import svn.client import svn.wc def usage(): print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n" sys.exit(0) def run(files...
#!/usr/bin/python # # USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ... # # prints out the URL associated with each item # import sys import os import os.path import svn.util import svn.client import svn.wc FORCE_COMPARISON = 0 def usage(): print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n" sys....
Fix a broken example script.
Fix a broken example script. * check-modified.py (FORCE_COMPARISON): New variable. (run): Add FORCE_COMPARISON arg to call to svn_wc_text_modified_p.
Python
apache-2.0
jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion
--- +++ @@ -11,6 +11,8 @@ import svn.util import svn.client import svn.wc + +FORCE_COMPARISON = 0 def usage(): print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n" @@ -31,7 +33,8 @@ try: entry = svn.wc.svn_wc_entry(fullpath, adm_baton, 0, pool) - if svn.wc.svn_wc_text_modified_p(...
3ad9029b6bfddb5cef1afed7e0093e8e26fe2884
shcol/config.py
shcol/config.py
# -*- coding: utf-8 -*- # Copyright (c) 2013-2015, Sebastian Linke # Released under the Simplified BSD license # (see LICENSE file for details). """ Constants that are used by `shcol` in many places. This is meant to modified (if needed) only *before* running `shcol`, since most of these constants are only read durin...
# -*- coding: utf-8 -*- # Copyright (c) 2013-2015, Sebastian Linke # Released under the Simplified BSD license # (see LICENSE file for details). """ Constants that are used by `shcol` in many places. This is meant to modified (if needed) only *before* running `shcol`, since most of these constants are only read durin...
Use "utf-8"-encoding if `TERMINAL_STREAM` lacks `encoding`-attribute.
Use "utf-8"-encoding if `TERMINAL_STREAM` lacks `encoding`-attribute.
Python
bsd-2-clause
seblin/shcol
--- +++ @@ -27,4 +27,4 @@ TERMINAL_STREAM = sys.stdout UNICODE_TYPE = type(u'') -ENCODING = TERMINAL_STREAM.encoding or 'utf-8' +ENCODING = getattr(TERMINAL_STREAM, 'encoding', 'utf-8')
6af05b8af7bb284388af4960bbf240122f7f3dae
plugins/PerObjectSettingsTool/__init__.py
plugins/PerObjectSettingsTool/__init__.py
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. from . import PerObjectSettingsTool from UM.i18n import i18nCatalog i18n_catalog = i18nCatalog("uranium") def getMetaData(): return { "plugin": { "name": i18n_catalog.i18nc("@label", "Per Object...
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. from . import PerObjectSettingsTool from UM.i18n import i18nCatalog i18n_catalog = i18nCatalog("uranium") def getMetaData(): return { "plugin": { "name": i18n_catalog.i18nc("@label", "Per Object...
Add order to PerObjectSettings tool
Add order to PerObjectSettings tool
Python
agpl-3.0
ynotstartups/Wanhao,hmflash/Cura,fieldOfView/Cura,senttech/Cura,hmflash/Cura,fieldOfView/Cura,Curahelper/Cura,senttech/Cura,Curahelper/Cura,totalretribution/Cura,totalretribution/Cura,ynotstartups/Wanhao
--- +++ @@ -19,7 +19,8 @@ "name": i18n_catalog.i18nc("@label", "Per Object Settings"), "description": i18n_catalog.i18nc("@info:tooltip", "Configure Per Object Settings"), "icon": "setting_per_object", - "tool_panel": "PerObjectSettingsPanel.qml" + "tool_pa...
0aa1fb5d7f4eca6423a7d4b5cdd166bf29f48423
ordering/__init__.py
ordering/__init__.py
from fractions import Fraction class Ordering: _start = object() _end = object() def __init__(self): self._labels = { self._start: Fraction(0), self._end: Fraction(1) } self._successors = { self._start: self._end } self._predeces...
from fractions import Fraction from functools import total_ordering class Ordering: _start = object() _end = object() def __init__(self): self._labels = { self._start: Fraction(0), self._end: Fraction(1) } self._successors = { self._start: self....
Add class representing an element in the ordering
Add class representing an element in the ordering
Python
mit
madman-bob/python-order-maintenance
--- +++ @@ -1,4 +1,5 @@ from fractions import Fraction +from functools import total_ordering class Ordering: @@ -25,14 +26,26 @@ self._predecessors[self._successors[existing_item]] = new_item self._successors[existing_item] = new_item + return OrderingItem(self, new_item) + def i...
b0e3585251445776683ba18441adae6ed3f0e210
ueberwachungspaket/decorators.py
ueberwachungspaket/decorators.py
from flask import abort, current_app, request from functools import wraps from twilio.util import RequestValidator from config import * def validate_twilio_request(f): @wraps(f) def decorated_function(*args, **kwargs): validator = RequestValidator(TWILIO_SECRET) request_valid = validator.valid...
from flask import abort, current_app, request from functools import wraps from twilio.util import RequestValidator from config import * def validate_twilio_request(f): @wraps(f) def decorated_function(*args, **kwargs): validator = RequestValidator(TWILIO_SECRET) request_valid = validator.valid...
Convert Twilio URL to IDN.
Convert Twilio URL to IDN.
Python
mit
PeterTheOne/ueberwachungspaket.at,PeterTheOne/ueberwachungspaket.at,PeterTheOne/ueberwachungspaket.at
--- +++ @@ -9,7 +9,7 @@ validator = RequestValidator(TWILIO_SECRET) request_valid = validator.validate( - request.url, + request.url.encode("idna"), request.form, request.headers.get("X-TWILIO-SIGNATURE", ""))
3b61b9dfeda38e0a7afd5ec90b32f8abab18ef4f
unzip.py
unzip.py
#!/usr/bin/env python3 # vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: import argparse import os import zipfile parser = argparse.ArgumentParser(description = "Extract zip file includes cp932 encoding file name") parser.add_argument("file") args = parser.parse_args() with zipfile.ZipFile(args.file, 'r...
#!/usr/bin/env python3 # vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: import argparse import os import zipfile parser = argparse.ArgumentParser(description = "Extract zip file includes cp932 encoding file name") parser.add_argument("file") parser.add_argument("-d", "--directory", nargs="?", type=str, ...
Add -d / --directory option
Add -d / --directory option
Python
mit
fujimakishouten/unzip-cp932
--- +++ @@ -11,11 +11,12 @@ parser = argparse.ArgumentParser(description = "Extract zip file includes cp932 encoding file name") parser.add_argument("file") +parser.add_argument("-d", "--directory", nargs="?", type=str, default="") args = parser.parse_args() with zipfile.ZipFile(args.file, 'r') as archive: ...
4d29aa24b39285c491182edd69ecb7c22a9d643d
ceph_medic/tests/test_main.py
ceph_medic/tests/test_main.py
import pytest import ceph_medic.main class TestMain(object): def test_main(self): assert ceph_medic.main def test_invalid_ssh_config(self, capsys): argv = ["ceph-medic", "--ssh-config", "/does/not/exist"] with pytest.raises(SystemExit): ceph_medic.main.Medic(argv) ...
import pytest import ceph_medic.main from mock import patch class TestMain(object): def test_main(self): assert ceph_medic.main def test_invalid_ssh_config(self, capsys): argv = ["ceph-medic", "--ssh-config", "/does/not/exist"] with pytest.raises(SystemExit): ceph_medic.m...
Fix test breakage when ssh_config missing
tests: Fix test breakage when ssh_config missing I assumed /etc/ssh/ssh_config would be present, but it turns out in a mock chroot environment it isn't. Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com>
Python
mit
alfredodeza/ceph-doctor
--- +++ @@ -1,5 +1,7 @@ import pytest import ceph_medic.main + +from mock import patch class TestMain(object): @@ -16,7 +18,17 @@ def test_valid_ssh_config(self, capsys): ssh_config = '/etc/ssh/ssh_config' argv = ["ceph-medic", "--ssh-config", ssh_config] - ceph_medic.main.Medic(a...
93acb34d999f89d23d2b613f12c1c767304c2ad6
gor/middleware.py
gor/middleware.py
# coding: utf-8 import os, sys from .base import Gor from tornado import gen, ioloop, queues class TornadoGor(Gor): def __init__(self, *args, **kwargs): super(TornadoGor, self).__init__(*args, **kwargs) self.q = queues.Queue() self.concurrency = kwargs.get('concurrency', 2) @gen.c...
# coding: utf-8 import sys import errno import logging from .base import Gor from tornado import gen, ioloop, queues import contextlib from tornado.stack_context import StackContext @contextlib.contextmanager def die_on_error(): try: yield except Exception: logging.error("exception in asyn...
Exit as soon as KeyboardInterrupt catched
Exit as soon as KeyboardInterrupt catched
Python
mit
amyangfei/GorMW
--- +++ @@ -1,10 +1,24 @@ # coding: utf-8 -import os, sys +import sys +import errno +import logging from .base import Gor from tornado import gen, ioloop, queues + + +import contextlib +from tornado.stack_context import StackContext + +@contextlib.contextmanager +def die_on_error(): + try: + yield ...
aaaab0d93723e880119afb52840718634b184054
falcom/logtree.py
falcom/logtree.py
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. class MutableTree: value = None def full_length (self): return 0 def walk (self): return iter(()) def __l...
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. class MutableTree: def __init__ (self): self.value = None def full_length (self): return 0 def walk (self): ...
Set MutableTree.value on the object only
Set MutableTree.value on the object only
Python
bsd-3-clause
mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation
--- +++ @@ -4,7 +4,8 @@ class MutableTree: - value = None + def __init__ (self): + self.value = None def full_length (self): return 0
918e1c59aa2d0e790eb993e091fd7a327fd12cc4
utils.py
utils.py
import re import textwrap import html2text text_maker = html2text.HTML2Text() text_maker.body_width = 0 def strip_html_tags(text): text = re.sub(r'<a.*?</a>', '', text) return re.sub('<[^<]+?>', '', text) def html_to_md(string, strip_html=True, markdown=False): if not string: return 'No Descri...
import re import textwrap import html2text text_maker = html2text.HTML2Text() text_maker.body_width = 0 def strip_html_tags(text): text = re.sub(r'<a.*?</a>', '', text) return re.sub('<[^<]+?>', '', text) def html_to_md(string, strip_html=True, markdown=False): if not string: return 'No Descri...
Update `get_formatted_book_data` to include page number and year
Update `get_formatted_book_data` to include page number and year
Python
mit
avinassh/Laozi,avinassh/Laozi
--- +++ @@ -27,6 +27,7 @@ *Title:* {0} by {1} *Rating:* {2} by {3} users *Description:* {4} + Pages: {7}, Year: {8} *Link*: [click me]({5}) Tip: {6}""") @@ -36,8 +37,11 @@ ratings_count = book_data['ratings_count'] description = html_to_md(book_data.get(...
7b0bd58c359f5ea21af907cb90234171a6cfca5c
photobox/photobox.py
photobox/photobox.py
from photofolder import Photofolder from folder import RealFolder from gphotocamera import Gphoto from main import Photobox from rcswitch import RCSwitch ########## # config # ########## photodirectory = '/var/www/html/' cheesepicfolder = '/home/pi/cheesepics/' windowwidth = 1024 windowheight = 768 camera = Gphoto() s...
from cheesefolder import Cheesefolder from photofolder import Photofolder from folder import RealFolder from gphotocamera import Gphoto from main import Photobox from rcswitch import RCSwitch ########## # config # ########## photodirectory = '/var/www/html/' cheesepicpath = '/home/pi/cheesepics/' windowwidth = 1024 wi...
Use the correct chesefolder objects
Use the correct chesefolder objects
Python
mit
MarkusAmshove/Photobox
--- +++ @@ -1,3 +1,4 @@ +from cheesefolder import Cheesefolder from photofolder import Photofolder from folder import RealFolder from gphotocamera import Gphoto @@ -8,14 +9,15 @@ # config # ########## photodirectory = '/var/www/html/' -cheesepicfolder = '/home/pi/cheesepics/' +cheesepicpath = '/home/pi/cheesepi...
c3ab90da466e2c4479c9c1865f4302c9c8bdb8e9
tests/extmod/ujson_loads.py
tests/extmod/ujson_loads.py
try: import ujson as json except: import json def my_print(o): if isinstance(o, dict): print('sorted dict', sorted(o.items())) else: print(o) my_print(json.loads('null')) my_print(json.loads('false')) my_print(json.loads('true')) my_print(json.loads('1')) my_print(json.loads('1.2')) my...
try: import ujson as json except: import json def my_print(o): if isinstance(o, dict): print('sorted dict', sorted(o.items())) elif isinstance(o, float): print('%.3f' % o) else: print(o) my_print(json.loads('null')) my_print(json.loads('false')) my_print(json.loads('true'))...
Make printing of floats hopefully more portable.
tests: Make printing of floats hopefully more portable.
Python
mit
dinau/micropython,selste/micropython,danicampora/micropython,turbinenreiter/micropython,tobbad/micropython,SungEun-Steve-Kim/test-mp,SungEun-Steve-Kim/test-mp,turbinenreiter/micropython,matthewelse/micropython,dxxb/micropython,ahotam/micropython,torwag/micropython,swegener/micropython,jmarcelino/pycom-micropython,marti...
--- +++ @@ -6,6 +6,8 @@ def my_print(o): if isinstance(o, dict): print('sorted dict', sorted(o.items())) + elif isinstance(o, float): + print('%.3f' % o) else: print(o)
6cb6b3d0f9bc3bf8f1662129cd4bd55eec42e6ff
pyqode/python/folding.py
pyqode/python/folding.py
""" Contains the python code folding mode """ from pyqode.core.api import IndentFoldDetector, TextBlockHelper, TextHelper class PythonFoldDetector(IndentFoldDetector): def detect_fold_level(self, prev_block, block): # Python is an indent based language so use indentation for folding # makes sense ...
""" Contains the python code folding mode """ from pyqode.core.api import IndentFoldDetector, TextBlockHelper, TextHelper class PythonFoldDetector(IndentFoldDetector): def detect_fold_level(self, prev_block, block): # Python is an indent based language so use indentation for folding # makes sense ...
Fix bug with end of line comments which prevent detection of new fold level
Fix bug with end of line comments which prevent detection of new fold level
Python
mit
zwadar/pyqode.python,pyQode/pyqode.python,pyQode/pyqode.python,mmolero/pyqode.python
--- +++ @@ -13,9 +13,11 @@ prev_lvl = TextBlockHelper.get_fold_lvl(prev_block) # cancel false indentation, indentation can only happen if there is # ':' on the previous line - if(prev_block and - lvl > prev_lvl and - not prev_block.text().strip().endswit...
6ffa10ad56acefe3d3178ff140ebe048bb1a1df9
Code/Python/Kamaelia/Kamaelia/Apps/SocialBookmarks/Print.py
Code/Python/Kamaelia/Kamaelia/Apps/SocialBookmarks/Print.py
import sys import os import inspect def __LINE__ (): caller = inspect.stack()[1] return int (caller[2]) def __FUNC__ (): caller = inspect.stack()[1] return caller[3] def __BOTH__(): caller = inspect.stack()[1] return int (caller[2]), caller[3], caller[1] def Print(*args): caller = ...
import sys import os import inspect import time def __LINE__ (): caller = inspect.stack()[1] return int (caller[2]) def __FUNC__ (): caller = inspect.stack()[1] return caller[3] def __BOTH__(): caller = inspect.stack()[1] return int (caller[2]), caller[3], caller[1] def Print(*args): ...
Add in the timestamp for each message, to enable tracking of how long problems take to resolve
Add in the timestamp for each message, to enable tracking of how long problems take to resolve
Python
apache-2.0
sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia
--- +++ @@ -2,6 +2,7 @@ import sys import os import inspect +import time def __LINE__ (): caller = inspect.stack()[1] @@ -19,6 +20,7 @@ caller = inspect.stack()[1] filename = str(os.path.basename(caller[1])) sys.stdout.write(filename+ " : "+ str(int (caller[2])) + " : ") + sys.stdout.writ...
0a7b88df526016672e18608339524cdb527e5928
aspen/__main__.py
aspen/__main__.py
""" python -m aspen =============== Aspen ships with a server (wsgiref.simple_server) that is suitable for development and testing. It can be invoked via: python -m aspen though even for development you'll likely want to specify a project root, so a more likely incantation is: ASPEN_PROJECT_ROOT=/path/to/w...
""" python -m aspen =============== Aspen ships with a server (wsgiref.simple_server) that is suitable for development and testing. It can be invoked via: python -m aspen though even for development you'll likely want to specify a project root, so a more likely incantation is: ASPEN_PROJECT_ROOT=/path/to/w...
Fix ImportError in `python -m aspen`
Fix ImportError in `python -m aspen`
Python
mit
gratipay/aspen.py,gratipay/aspen.py
--- +++ @@ -21,8 +21,7 @@ from __future__ import print_function from __future__ import unicode_literals -from aspen import serve, Website +from aspen import serve, website if __name__ == '__main__': - website = Website() - serve(website) + serve(website.Website())
b7dffc28ebef45293a70561348512d513eaf857c
migrations/versions/19b8969073ab_add_latest_green_build_table.py
migrations/versions/19b8969073ab_add_latest_green_build_table.py
"""add latest green build table Revision ID: 19b8969073ab Revises: 2b7153fe25af Create Date: 2014-07-10 10:53:34.415990 """ # revision identifiers, used by Alembic. revision = '19b8969073ab' down_revision = '2b7153fe25af' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table( '...
"""add latest green build table Revision ID: 19b8969073ab Revises: 4d235d421320 Create Date: 2014-07-10 10:53:34.415990 """ # revision identifiers, used by Alembic. revision = '19b8969073ab' down_revision = '4d235d421320' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table( '...
Update latest green build migration
Update latest green build migration
Python
apache-2.0
wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,dropbox/changes
--- +++ @@ -1,14 +1,14 @@ """add latest green build table Revision ID: 19b8969073ab -Revises: 2b7153fe25af +Revises: 4d235d421320 Create Date: 2014-07-10 10:53:34.415990 """ # revision identifiers, used by Alembic. revision = '19b8969073ab' -down_revision = '2b7153fe25af' +down_revision = '4d235d421320' ...