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 |
|---|---|---|---|---|---|---|---|---|---|---|
d42b9da06d5cde89a6116d711fc6ae216256cabc | shell/view/home/IconLayout.py | shell/view/home/IconLayout.py | import random
class IconLayout:
def __init__(self, width, height):
self._icons = []
self._width = width
self._height = height
def add_icon(self, icon):
self._icons.append(icon)
self._layout_icon(icon)
def remove_icon(self, icon):
self._icons.remove(icon)
def _is_valid_position(self, icon, x, y):
i... | import random
class IconLayout:
def __init__(self, width, height):
self._icons = []
self._width = width
self._height = height
def add_icon(self, icon):
self._icons.append(icon)
self._layout_icon(icon)
def remove_icon(self, icon):
self._icons.remove(icon)
def _is_valid_position(self, icon, x, y):
i... | Use get/set_property rather than direct accessors | Use get/set_property rather than direct accessors
| Python | lgpl-2.1 | Daksh/sugar-toolkit-gtk3,manuq/sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,quozl/sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_sugartoolkit,quozl/sugar-toolkit-gtk3,godiard/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit,tchx84/debian-pkg-sugar-toolkit,ceibal-tatu/suga... | ---
+++
@@ -14,7 +14,7 @@
self._icons.remove(icon)
def _is_valid_position(self, icon, x, y):
- icon_size = icon.props.size
+ icon_size = icon.get_property('size')
border = 20
if not (border < x < self._width - icon_size - border and \
@@ -30,5 +30,5 @@
if self._is_valid_position(icon, x, y):
... |
161cd07fca220494e675b1da674dbf57254a28b3 | scripts/spat_gencomms.py | scripts/spat_gencomms.py | import spat_community_generation as sg
import sys
Svals = [10, 11, 13, 14, 16, 18, 21, 23, 26, 30, 34, 38, 43, 48, 55, 62, 70,
78, 89, 100]
Nvals = [120, 186, 289, 447, 694, 1076, 1668, 2587, 4011, 6220, 9646, 14957,
23193, 35965, 55769, 86479, 134099, 207941, 322444, 500000]
if len... | import spat_community_generation as sg
import sys
Svals = [10, 11, 13, 14, 16, 18, 21, 23, 26, 30, 34, 38, 43, 48, 55, 62, 70,
78, 89, 100]
Nvals = [120, 186, 289, 447, 694, 1076, 1668, 2587, 4011, 6220, 9646, 14957,
23193, 35965, 55769, 86479, 134099, 207941, 322444, 500000]
if len... | Change to ensure that the Svals were handled as a list | Change to ensure that the Svals were handled as a list
| Python | mit | weecology/mete-spatial,weecology/mete-spatial,weecology/mete-spatial,weecology/mete-spatial | ---
+++
@@ -9,6 +9,6 @@
if len(sys.argv) > 1:
Sindex = int(sys.argv[1])
- Svals = Svals[Sindex]
+ Svals = [Svals[Sindex]]
sg.explore_parameter_space(Svals, Nvals, 200, 12) |
911094754fc908d99009c5cfec22ac9033ffd472 | my_account_helper/model/__init__.py | my_account_helper/model/__init__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __open... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emmanuel Mathier <emmanuel.mathier@gmail.ch>
#
# The licence is in the f... | Fix comment header on init | Fix comment header on init
| Python | agpl-3.0 | Secheron/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,Secheron/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,MickSandoz/compassion-switzerland,ecino/compassion-swit... | ---
+++
@@ -3,7 +3,7 @@
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
-# @author: Emanuel Cino <ecino@compassion.ch>
+# @author: Emmanuel Mathier <emmanuel.mathier@gmail.ch>
#
# The licence is in the file __openerp__.py
# |
5c61d7f125078cb6b3bd0c5700ae9219baab0078 | webapp/tests/test_dashboard.py | webapp/tests/test_dashboard.py | from django.core.urlresolvers import reverse
from django.test import TestCase
class DashboardTest(TestCase):
def test_dashboard(self):
url = reverse('graphite.dashboard.views.dashboard')
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
| from django.core.urlresolvers import reverse
from django.test import TestCase
class DashboardTest(TestCase):
def test_dashboard(self):
url = reverse('dashboard')
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
| Update reverse call to use named URL | Update reverse call to use named URL
| Python | apache-2.0 | redice/graphite-web,dbn/graphite-web,Skyscanner/graphite-web,penpen/graphite-web,lyft/graphite-web,esnet/graphite-web,bpaquet/graphite-web,atnak/graphite-web,section-io/graphite-web,kkdk5535/graphite-web,cosm0s/graphite-web,cgvarela/graphite-web,gwaldo/graphite-web,redice/graphite-web,edwardmlyte/graphite-web,atnak/gra... | ---
+++
@@ -4,6 +4,6 @@
class DashboardTest(TestCase):
def test_dashboard(self):
- url = reverse('graphite.dashboard.views.dashboard')
+ url = reverse('dashboard')
response = self.client.get(url)
self.assertEqual(response.status_code, 200) |
4124297475fb7d77bf492e721a74fcfa02547a14 | benchmark/bench_logger_level_low.py | benchmark/bench_logger_level_low.py | """Benchmarks too low logger levels"""
from logbook import Logger, ERROR
log = Logger('Test logger')
log.level = ERROR
def run():
for x in xrange(500):
log.warning('this is not handled')
| """Benchmarks too low logger levels"""
from logbook import Logger, StreamHandler, ERROR
from cStringIO import StringIO
log = Logger('Test logger')
log.level = ERROR
def run():
out = StringIO()
with StreamHandler(out):
for x in xrange(500):
log.warning('this is not handled')
| Create a stream handler even though it's not used to have the same overhead on both logbook and logging | Create a stream handler even though it's not used to have the same overhead on both logbook and logging
| Python | bsd-3-clause | DasIch/logbook,maykinmedia/logbook,alonho/logbook,fayazkhan/logbook,maykinmedia/logbook,Rafiot/logbook,dvarrazzo/logbook,mbr/logbook,mitsuhiko/logbook,dvarrazzo/logbook,RazerM/logbook,FintanH/logbook,omergertel/logbook,dommert/logbook,DasIch/logbook,alex/logbook,alonho/logbook,pombredanne/logbook,alonho/logbook,alex/lo... | ---
+++
@@ -1,5 +1,6 @@
"""Benchmarks too low logger levels"""
-from logbook import Logger, ERROR
+from logbook import Logger, StreamHandler, ERROR
+from cStringIO import StringIO
log = Logger('Test logger')
@@ -7,5 +8,7 @@
def run():
- for x in xrange(500):
- log.warning('this is not handled')
+... |
912b2e1f1ce3dbca94e8cdf869c9906c43d5cc8d | opentreemap/ecobenefits/__init__.py | opentreemap/ecobenefits/__init__.py | from species import CODES
def all_region_codes():
return CODES.keys
def all_species_codes():
return species_codes_for_regions(all_region_codes)
def species_codes_for_regions(region_codes):
if region_codes is None:
return None
species_codes = []
for region_code in region_codes:
... | from species import CODES
def all_region_codes():
return CODES.keys
def all_species_codes():
return species_codes_for_regions(all_region_codes())
def species_codes_for_regions(region_codes):
if region_codes is None:
return None
species_codes = []
for region_code in region_codes:
... | Fix typo that prevented instance creation | Fix typo that prevented instance creation
| Python | agpl-3.0 | recklessromeo/otm-core,RickMohr/otm-core,clever-crow-consulting/otm-core,RickMohr/otm-core,RickMohr/otm-core,maurizi/otm-core,recklessromeo/otm-core,maurizi/otm-core,RickMohr/otm-core,maurizi/otm-core,clever-crow-consulting/otm-core,recklessromeo/otm-core,recklessromeo/otm-core,clever-crow-consulting/otm-core,maurizi/o... | ---
+++
@@ -6,7 +6,7 @@
def all_species_codes():
- return species_codes_for_regions(all_region_codes)
+ return species_codes_for_regions(all_region_codes())
def species_codes_for_regions(region_codes): |
b71db5eb72fd5529be060d5f90ad744f0ea0870e | library.py | library.py | class Library:
"""This class represents a simaris target and is initialized with
data in JSON format
"""
def __init__(self, data):
self.target = data['CurrentTarget']['EnemyType']
self.scans = data['CurrentTarget']['PersonalScansRequired']
self.progress ... | class Library:
"""This class represents a simaris target and is initialized with
data in JSON format
"""
def __init__(self, data):
if 'CurrentTarget' in data:
self.target = data['CurrentTarget']['EnemyType']
self.scans = data['CurrentTarget']['Persona... | Add is_active() method to the Library class | Add is_active() method to the Library class
| Python | mit | pabletos/Hubot-Warframe,pabletos/Hubot-Warframe | ---
+++
@@ -5,14 +5,20 @@
"""
def __init__(self, data):
- self.target = data['CurrentTarget']['EnemyType']
- self.scans = data['CurrentTarget']['PersonalScansRequired']
- self.progress = data['CurrentTarget']['ProgressPercent']
+ if 'CurrentTarget' in ... |
5c6f277caf3496da5f10b0150abb2c3b856e6584 | nagare/services/prg.py | nagare/services/prg.py | # --
# Copyright (c) 2008-2020 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
# --
"""If the ``activated`` parameter of the ``[redirect_after_post]``
section is `on`` (the default... | # --
# Copyright (c) 2008-2020 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
# --
"""If the ``activated`` parameter of the ``[redirect_after_post]``
section is `on`` (the default... | Store in the current state, not the previous one | Store in the current state, not the previous one
| Python | bsd-3-clause | nagareproject/core,nagareproject/core | ---
+++
@@ -20,20 +20,19 @@
LOAD_PRIORITY = 120
@staticmethod
- def handle_request(chain, request, response, session_id, previous_state_id, **params):
+ def handle_request(chain, request, response, session_id, state_id, **params):
if (request.method == 'POST') and not request.is_xhr:
... |
175a8fa2aa595132cf6dbf8ed405bb0682ab95dd | mkdocs/gh_deploy.py | mkdocs/gh_deploy.py | import subprocess
import os
def gh_deploy(config):
if not os.path.exists('.git'):
print 'Cannot deploy - this directory does not appear to be a git repository'
return
print "Copying '%s' to `gh-pages` branch and pushing to GitHub." % config['site_dir']
try:
subprocess.check_call(['... | import subprocess
import os
def gh_deploy(config):
if not os.path.exists('.git'):
print 'Cannot deploy - this directory does not appear to be a git repository'
return
print "Copying '%s' to `gh-pages` branch and pushing to GitHub." % config['site_dir']
try:
subprocess.check_call([... | Fix build error caused by wrong indentation | Fix build error caused by wrong indentation
| Python | bsd-2-clause | fujita-shintaro/mkdocs,peter1000/mkdocs,waylan/mkdocs,fujita-shintaro/mkdocs,mlzummo/mkdocs,michaelmcandrew/mkdocs,jimporter/mkdocs,kubikusrubikus/mkdocs,samhatfield/mkdocs,d0ugal/mkdocs,williamjmorenor/mkdocs,ericholscher/mkdocs,jeoygin/mkdocs,michaelmcandrew/mkdocs,nicoddemus/mkdocs,tedmiston/mkdocs,cazzerson/mkdocs,... | ---
+++
@@ -9,9 +9,9 @@
print "Copying '%s' to `gh-pages` branch and pushing to GitHub." % config['site_dir']
try:
- subprocess.check_call(['ghp-import', '-p', config['site_dir']])
+ subprocess.check_call(['ghp-import', '-p', config['site_dir']])
except:
- return
+ return
... |
c1d8bf0916e1f59610fc69f0b11909964755ee38 | pyaavso/formats/visual.py | pyaavso/formats/visual.py | from __future__ import unicode_literals
class VisualFormatWriter(object):
"""
A class responsible for writing observation data in AAVSO
`Visual File Format`_.
The API here mimics the ``csv`` module in Python standard library.
.. _`Visual File Format`: http://www.aavso.org/aavso-visual-file-forma... | from __future__ import unicode_literals
import pyaavso
class VisualFormatWriter(object):
"""
A class responsible for writing observation data in AAVSO
`Visual File Format`_.
The API here mimics the ``csv`` module in Python standard library.
.. _`Visual File Format`: http://www.aavso.org/aavso-v... | Write name and version to output file. | Write name and version to output file.
| Python | mit | zsiciarz/pyaavso | ---
+++
@@ -1,4 +1,6 @@
from __future__ import unicode_literals
+
+import pyaavso
class VisualFormatWriter(object):
@@ -22,3 +24,4 @@
self.obstype = obstype
fp.write('#TYPE=Visual\n')
fp.write('#OBSCODE=%s\n' % observer_code)
+ fp.write("#SOFTWARE=pyaavso %s\n" % pyaavso.get_ve... |
533ed337dd5f6087ac059ed47f1a0ce344ce48ce | src/utils/playbook.py | src/utils/playbook.py | from django.conf import settings
from ansible.models import Playbook
import os
def content_loader(pk, slug):
playbook = Playbook.query_set.get(pk=pk)
playbook_dir = playbook.directory
# TODO: for now assume without validation
playbook_file = os.path.join(playbook_dir, slug + '.yml')
with open(pla... | from django.conf import settings
from ansible.models import Playbook
import os
def content_loader(pk, slug):
playbook = Playbook.query_set.get(pk=pk)
playbook_dir = playbook.directory
# TODO: for now assume without validation
playbook_file = os.path.join(playbook_dir, slug + '.yml')
with open(play... | Add util func to write content | Add util func to write content
| Python | bsd-3-clause | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin | ---
+++
@@ -8,8 +8,17 @@
playbook_dir = playbook.directory
# TODO: for now assume without validation
playbook_file = os.path.join(playbook_dir, slug + '.yml')
-
with open(playbook_file, 'r') as f:
content = f.read()
+ return content
- return content
+
+def write_content(pk, slug, ... |
313aee17c8e2e1c86b96b40017ac4618c66df463 | __init__.py | __init__.py | # -*- coding: utf-8 -*-
# This file is part of OpenFisca
# Copyright © 2012 Mahdi Ben Jelloul, Clément Schaff
# Licensed under the terms of the GPL License v3 or later version
# (see src/__init__.py for details)
# Model parameters
ENTITIES_INDEX = ['men', 'foy']
# Some variables needed by the test case plugins
CUR... | # -*- coding: utf-8 -*-
# This file is part of OpenFisca
# Copyright © 2012 Mahdi Ben Jelloul, Clément Schaff
# Licensed under the terms of the GPL License v3 or later version
# (see src/__init__.py for details)
# Model parameters
ENTITIES_INDEX = ['men', 'foy']
# Some variables needed by the test case plugins
CUR... | Generalize graph and some new example scripts | Generalize graph and some new example scripts
| Python | agpl-3.0 | openfisca/openfisca-tunisia,openfisca/openfisca-tunisia | ---
+++
@@ -14,7 +14,10 @@
# Some variables needed by the test case graph widget
-# REVENUES_CATEGORIES
+
+
+REVENUES_CATEGORIES = {'imposable' : ['sal',]}
+
XAXIS_PROPERTIES = { 'sali': {
'name' : 'sal', |
2b1b4ab1bfa494021197756d3877f38e1b290435 | server_common/helpers.py | server_common/helpers.py | import json
import os
import sys
from server_common.ioc_data_source import IocDataSource
from server_common.mysql_abstraction_layer import SQLAbstraction
from server_common.utilities import print_and_log, SEVERITY
def register_ioc_start(ioc_name, pv_database=None, prefix=None):
"""
A helper function to regis... | import json
import os
import sys
from server_common.ioc_data_source import IocDataSource
from server_common.mysql_abstraction_layer import SQLAbstraction
from server_common.utilities import print_and_log, SEVERITY
def register_ioc_start(ioc_name, pv_database=None, prefix=None):
"""
A helper function to regis... | Return empty dict if not defined rather than error | Return empty dict if not defined rather than error
| Python | bsd-3-clause | ISISComputingGroup/EPICS-inst_servers,ISISComputingGroup/EPICS-inst_servers | ---
+++
@@ -34,6 +34,6 @@
Returns: Macro Key:Value pairs as dict
"""
- macros = json.loads(os.environ.get("REFL_MACROS", ""))
+ macros = json.loads(os.environ.get("REFL_MACROS", "{}"))
macros = {key: value for (key, value) in macros.items()}
return macros |
fb4d11f1c96d48dd71bc12921763681149da4616 | eultheme/context_processors.py | eultheme/context_processors.py | import datetime
from django.conf import settings
from django.contrib.sites.models import get_current_site
from django.utils.functional import SimpleLazyObject
from django.utils.timezone import utc
from downtime.models import Period
from .models import Banner
def template_settings(request):
'''Template context pro... | import datetime
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.utils.functional import SimpleLazyObject
from django.utils.timezone import utc
from downtime.models import Period
from .models import Banner
def template_settings(request):
'''Template context ... | Update to import for for Django 1.9 compatibility. | Update to import for for Django 1.9 compatibility.
| Python | apache-2.0 | emory-libraries/django-eultheme,emory-libraries/django-eultheme,emory-libraries/django-eultheme | ---
+++
@@ -1,6 +1,6 @@
import datetime
from django.conf import settings
-from django.contrib.sites.models import get_current_site
+from django.contrib.sites.shortcuts import get_current_site
from django.utils.functional import SimpleLazyObject
from django.utils.timezone import utc
from downtime.models import Pe... |
09fc3d53b2814f940bcaf7d6136ed2ce0595fb2f | hyperion/importers/tests/test_sph.py | hyperion/importers/tests/test_sph.py | import os
import h5py
import numpy as np
from ..sph import construct_octree
DATA = os.path.join(os.path.dirname(__file__), 'data')
def test_construct_octree():
np.random.seed(0)
N = 5000
px = np.random.uniform(-10., 10., N)
py = np.random.uniform(-10., 10., N)
pz = np.random.uniform(-10., 10.... | import os
import h5py
import numpy as np
from numpy.testing import assert_allclose
from ..sph import construct_octree
DATA = os.path.join(os.path.dirname(__file__), 'data')
def test_construct_octree():
np.random.seed(0)
N = 5000
px = np.random.uniform(-10., 10., N)
py = np.random.uniform(-10., 10... | Use assert_allclose for comparison of octree densities | Use assert_allclose for comparison of octree densities
| Python | bsd-2-clause | hyperion-rt/hyperion,bluescarni/hyperion,hyperion-rt/hyperion,hyperion-rt/hyperion,bluescarni/hyperion | ---
+++
@@ -2,6 +2,7 @@
import h5py
import numpy as np
+from numpy.testing import assert_allclose
from ..sph import construct_octree
@@ -36,4 +37,4 @@
f.close()
assert np.all(o_ref.refined == o.refined)
- assert np.all(o_ref['density'][0].array == o['density'][0].array)
+ assert_allclose(o_... |
30f32266a1f8ac698d9da5da79c88867e781084a | packages/reward-root-submitter/reward_root_submitter/config.py | packages/reward-root-submitter/reward_root_submitter/config.py | from functools import lru_cache
import boto3
from pydantic import BaseSettings, Field, root_validator
@lru_cache
def get_secrets_client():
return boto3.client("secretsmanager")
@lru_cache
def get_secret(secret_id):
client = get_secrets_client()
secret_value = client.get_secret_value(SecretId=secret_id)... | from functools import lru_cache
import boto3
from pydantic import BaseSettings, Field, root_validator
@lru_cache
def get_secrets_client():
return boto3.client("secretsmanager")
@lru_cache
def get_secret(secret_id):
client = get_secrets_client()
secret_value = client.get_secret_value(SecretId=secret_id)... | Set default logging to info | Set default logging to info
| Python | mit | cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack | ---
+++
@@ -23,7 +23,7 @@
reward_root_submitter_address: str
reward_root_submitter_private_key: str
reward_root_submitter_sentry_dsn: str
- log_level: str = Field("WARNING")
+ log_level: str = Field("INFO")
@root_validator(pre=True)
def load_secrets(cls, values): |
fd96170fd15ccbe0b42463fe8d4ac78f511d10c7 | example/testtags/admin.py | example/testtags/admin.py | from django.contrib import admin
from models import TestName
class TestNameAdmin(admin.ModelAdmin):
model = TestName
alphabet_filter = 'sorted_name'
admin.site.register(TestName, TestNameAdmin) | from django.contrib import admin
from models import TestName
class TestNameAdmin(admin.ModelAdmin):
model = TestName
alphabet_filter = 'sorted_name'
## Testing a custom Default Alphabet
#DEFAULT_ALPHABET = 'ABC'
## Testing a blank alphabet-- only shows the characters in the database
#... | Put in some testing code to test the new overrides | Put in some testing code to test the new overrides
| Python | apache-2.0 | bltravis/django-alphabetfilter,affan2/django-alphabetfilter,affan2/django-alphabetfilter,affan2/django-alphabetfilter,bltravis/django-alphabetfilter,bltravis/django-alphabetfilter | ---
+++
@@ -4,5 +4,15 @@
class TestNameAdmin(admin.ModelAdmin):
model = TestName
alphabet_filter = 'sorted_name'
+
+ ## Testing a custom Default Alphabet
+ #DEFAULT_ALPHABET = 'ABC'
+
+ ## Testing a blank alphabet-- only shows the characters in the database
+ #DEFAULT_ALPHABET = ''
+ ... |
8165aa65e96d32ed908cdf8e3c475c28181e0d93 | hierarchical_auth/admin.py | hierarchical_auth/admin.py | from django.contrib import admin
from django.conf import settings
from django.contrib.auth.models import Group, User
from django.contrib.auth.admin import GroupAdmin, UserAdmin
from django.contrib.auth.forms import UserChangeForm
from mptt.forms import TreeNodeMultipleChoiceField
if getattr(settings, 'MPTT_USE_FEINC... | from django.contrib import admin
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth.admin import GroupAdmin
from django.contrib.auth.forms import UserChangeForm
try:
User = settings.AUTH_USER_MODEL
except:
from django.contrib.auth.models import User
try... | Work with custom user models in django >= 1.5 | Work with custom user models in django >= 1.5
Work with Custom User Models introduced in django >= 1.5
Also tries to get a AUTH_USER_ADMIN_MODEL, not only AUTH_USER_MODEL | Python | bsd-3-clause | zhangguiyu/django-hierarchical-auth,digitalemagine/django-hierarchical-auth | ---
+++
@@ -1,9 +1,19 @@
from django.contrib import admin
from django.conf import settings
-from django.contrib.auth.models import Group, User
-from django.contrib.auth.admin import GroupAdmin, UserAdmin
+from django.contrib.auth.models import Group
+from django.contrib.auth.admin import GroupAdmin
from django.c... |
731e48b1b81e9249fc8bdd0f826c6e009559fcc3 | mempoke.py | mempoke.py | import gdb
import struct
class DeviceMemory:
def __init__(self):
self.inferior = gdb.selected_inferior()
def __del__(self):
del self.inferior
def read(self, address):
return struct.unpack('I', self.inferior.read_memory(address, 4))[0]
def write(self, address, value):
... | import gdb
import struct
class DeviceMemory:
def __init__(self):
self.inferior = gdb.selected_inferior()
def __del__(self):
del self.inferior
def read(self, address):
return struct.unpack('I', self.inferior.read_memory(address, 4))[0]
def write(self, address, value):
... | Add mechanism for defining MCU control structures | Add mechanism for defining MCU control structures
| Python | mit | fmfi-svt-deadlock/hw-testing,fmfi-svt-deadlock/hw-testing | ---
+++
@@ -15,3 +15,28 @@
def write(self, address, value):
value_bytes = struct.pack('I', value)
self.inferior.write_memory(address, value_bytes)
+
+
+def create_memory_reg(offset, name):
+ def reg_getter(self):
+ return self.device_memory.read(self.address + offset)
+
+ def reg_s... |
65cd0c8865761af434756b313c7e29b1904e647c | h2o-py/tests/testdir_algos/rf/pyunit_bigcatRF.py | h2o-py/tests/testdir_algos/rf/pyunit_bigcatRF.py | import sys
sys.path.insert(1, "../../../")
import h2o
def bigcatRF(ip,port):
# Connect to h2o
h2o.init(ip,port)
# Training set has 100 categories from cat001 to cat100
# Categories cat001, cat003, ... are perfect predictors of y = 1
# Categories cat002, cat004, ... are perfect predictors of y = 0
... | import sys
sys.path.insert(1, "../../../")
import h2o
def bigcatRF(ip,port):
# Connect to h2o
h2o.init(ip,port)
# Training set has 100 categories from cat001 to cat100
# Categories cat001, cat003, ... are perfect predictors of y = 1
# Categories cat002, cat004, ... are perfect predictors of y = 0
... | Add usage of nbins_cats to RF pyunit. | Add usage of nbins_cats to RF pyunit.
| Python | apache-2.0 | spennihana/h2o-3,h2oai/h2o-3,PawarPawan/h2o-v3,mathemage/h2o-3,datachand/h2o-3,mrgloom/h2o-3,printedheart/h2o-3,weaver-viii/h2o-3,weaver-viii/h2o-3,bospetersen/h2o-3,mathemage/h2o-3,h2oai/h2o-3,pchmieli/h2o-3,mathemage/h2o-3,datachand/h2o-3,YzPaul3/h2o-3,ChristosChristofidis/h2o-3,mathemage/h2o-3,mrgloom/h2o-3,madmax98... | ---
+++
@@ -18,8 +18,8 @@
#bigcat.summary()
# Train H2O DRF Model:
- #Log.info("H2O DRF (Naive Split) with parameters:\nclassification = TRUE, ntree = 1, depth = 1, nbins = 100\n")
- model = h2o.random_forest(x=bigcat[["X"]], y=bigcat["y"], ntrees=1, max_depth=1, nbins=100)
+ #Log.info("H2O DRF (... |
392af193a2059bd7b25c3014fa8cbdf6fbade032 | pastas/version.py | pastas/version.py | # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.9.6b'
| # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.9.5.1'
| Update master branch to 0.9.5.1 | Update master branch to 0.9.5.1
| Python | mit | pastas/pasta,pastas/pastas,gwtsa/gwtsa | ---
+++
@@ -1,3 +1,3 @@
# This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
-__version__ = '0.9.6b'
+__version__ = '0.9.5.1' |
973496ad5111e408ea4832962987098d8c9ca003 | example/example/urls.py | example/example/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'example.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'example.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
# Add an entry in you... | Add an entry in URLconf | Add an entry in URLconf
| Python | mit | dkdndes/django-flatpages-example | ---
+++
@@ -10,3 +10,11 @@
url(r'^admin/', include(admin.site.urls)),
)
+
+# Add an entry in your URLconf
+urlpatterns += patterns("",
+ #
+ urlpatterns = patterns('',
+ (r'^pages/', include('django.contrib.flatpages.urls')),
+ #
+) |
afa3cd7c6e4c82f94eef7edd4bc8db609943226c | api/urls.py | api/urls.py | from django.conf.urls import url
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = [
url(r'^learningcircles/$', views.LearningCircleListView.as_view(), name='api_learningcircles'),
]
| from django.conf.urls import url
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = [
url(r'^learningcircles/$', views.LearningCircleListView.as_view(), name='api_learningcircles'),
url(r'^signup/$', views.SignupView.as_vie... | Add URL for signup api endpoint | Add URL for signup api endpoint
| Python | mit | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles | ---
+++
@@ -6,5 +6,6 @@
urlpatterns = [
url(r'^learningcircles/$', views.LearningCircleListView.as_view(), name='api_learningcircles'),
+ url(r'^signup/$', views.SignupView.as_view(), name='api_learningcircles_signup')
]
|
f59ac3cc752698ce1755d8953c8771dc978ae6b7 | opendebates/urls.py | opendebates/urls.py | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^healthcheck.html$', 'opendebates.views.health_check', name='health_check'),
url(r'^(?P<prefix>[-\w]+)/', include('opendebates.prefixed_urls')),
]
| from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
urlpatterns = [
url(r'^$', RedirectView.as_view(url='https://opendebatecoalition.com', permanent=False)),
url(r'^admin/', include(admin.site.urls)),
url(r'^healthcheck.html$', 'ope... | Add a (temporary) redirect to opendebatecoalition.com from / | Add a (temporary) redirect to opendebatecoalition.com from /
Temporary because permanent is really hard to take back, if you decide
later that you wanted something else.
| Python | apache-2.0 | caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates | ---
+++
@@ -1,8 +1,10 @@
from django.conf.urls import include, url
from django.contrib import admin
+from django.views.generic.base import RedirectView
urlpatterns = [
+ url(r'^$', RedirectView.as_view(url='https://opendebatecoalition.com', permanent=False)),
url(r'^admin/', include(admin.site.urls)),
... |
c6c397dab0e5549ddce59c388dbf0235bc6b44c3 | app/groups/utils.py | app/groups/utils.py | from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
def send_group_mail(request, to_email, subject, email_text_template, email_html_template):
"""Sends a email to a group of people using a standard ... | from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
from django.contrib.sites.models import Site
def send_group_email(request, to_email, subject, email_text_template, email_html_template):
"""Sends ... | Rename the function, and provide the "domain" context for url linking in the emails | Rename the function, and provide the "domain" context for url linking in the emails
| Python | bsd-3-clause | nikdoof/test-auth | ---
+++
@@ -2,14 +2,14 @@
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
+from django.contrib.sites.models import Site
-def send_group_mail(request, to_email, subject, email_text_template, email_html_template):
+def send_gro... |
aa0b61b44e631c3a12a16025e93d7e962de23c2f | fabix/system/crontab.py | fabix/system/crontab.py | # coding: utf-8
import fabric.api as fab
import cuisine
def install(filename, user="root", append=False):
"""
Installs crontab from a given cronfile
"""
new_crontab = fab.run("mktemp fabixcron.XXXX")
cuisine.file_upload(new_crontab, filename)
if append is True:
sorted_crontab = fab.run... | # coding: utf-8
import fabric.api as fab
import cuisine
def install(filename, user="root", append=False):
"""
Installs crontab from a given cronfile
"""
new_crontab = fab.run("mktemp fabixcron.XXXX")
cuisine.file_upload(new_crontab, filename)
if append is True:
# When user have no cron... | Remove duplicate lines from cron file without sorting | Remove duplicate lines from cron file without sorting
| Python | mit | vmalavolta/fabix | ---
+++
@@ -10,10 +10,7 @@
new_crontab = fab.run("mktemp fabixcron.XXXX")
cuisine.file_upload(new_crontab, filename)
if append is True:
- sorted_crontab = fab.run("mktemp fabixcron.XXXX")
# When user have no crontab, then crontab command returns 1 error code
with fab.settings(w... |
02da417b238256878cfab7c0adef8f86f5532b01 | tamper/randomcomments.py | tamper/randomcomments.py | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.common import randomRange
from lib.core.data import kb
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.LOW
def tamper(payload, **kwargs)... | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.common import randomRange
from lib.core.data import kb
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.LOW
def tamper(payload, **kwargs)... | Fix for a tamper script (in some cases comments were not inserted) | Fix for a tamper script (in some cases comments were not inserted)
| Python | mit | dtrip/.ubuntu,RexGene/monsu-server,RexGene/monsu-server,dtrip/.ubuntu | ---
+++
@@ -26,7 +26,7 @@
retVal = payload
if payload:
- for match in re.finditer(r"[A-Za-z_]+", payload):
+ for match in re.finditer(r"\b[A-Za-z_]+\b", payload):
word = match.group()
if len(word) < 2:
@@ -39,6 +39,11 @@
_ += "%s%s" % ("/**/" ... |
858c029ccadcbdb7365c6f7d28fa426bb11c9ab2 | appengine_config.py | appengine_config.py | # appengine_config.py
from google.appengine.ext import vendor
# Add any libraries install in the "lib" folder.
vendor.add('lib')
import os
if os.environ.get('SERVER_SOFTWARE', '').startswith('Development'):
import imp
import os.path
import inspect
from google.appengine.tools.devappserver2.python impo... | # appengine_config.py
from google.appengine.ext import vendor
# Add any libraries install in the "lib" folder.
vendor.add('lib')
import os
if os.environ.get('SERVER_SOFTWARE', '').startswith('Development'):
import imp
import os.path
import inspect
from google.appengine.tools.devappserver2.python.runt... | Fix issue with latest sdk: cannot import name sandbox | Fix issue with latest sdk: cannot import name sandbox
| Python | mit | egenerat/flight-manager,egenerat/flight-manager,egenerat/flight-manager,egenerat/flight-manager,egenerat/gae-django,egenerat/gae-django,egenerat/gae-django | ---
+++
@@ -10,7 +10,7 @@
import imp
import os.path
import inspect
- from google.appengine.tools.devappserver2.python import sandbox
+ from google.appengine.tools.devappserver2.python.runtime import sandbox
sandbox._WHITE_LIST_C_MODULES += ['_ssl', '_socket']
# Use the system socket. |
2b758185e0de0d41c5ecc9a5511308ee36c60c91 | Python_Data/smpl4.py | Python_Data/smpl4.py | '''
2.1 - Numpy Array library
'''
#!/usr/bin/env
import numpy as np
def main():
''''
# 1) Create two vectors 'a' and 'b', and sum them.
# Standart
n = 3
a = [x**2 for x in range(1, n + 1)]
b = [x**3 for x in range(1, n + 1)]
v = plainVectorAddition(a, b)
# Numpy
n = 3
a = np.ara... | '''
2.1 - Numpy Array library
- Sum of two vectors -
Usage: python smpl4.py n
Where 'n' specifies the size of the vector.
The program make performance comparisons and print the results.
'''
#!/usr/bin/env
import numpy as np
import sys
from datetime import datetime
def main():
size = int(sys.argv[1])
s... | Add file with linear algebra numpy operations | Add file with linear algebra numpy operations
| Python | unlicense | robotenique/RandomAccessMemory,robotenique/RandomAccessMemory,robotenique/RandomAccessMemory | ---
+++
@@ -1,35 +1,56 @@
'''
2.1 - Numpy Array library
+ - Sum of two vectors -
+
+ Usage: python smpl4.py n
+
+ Where 'n' specifies the size of the vector.
+ The program make performance comparisons and print the results.
+
'''
#!/usr/bin/env
import numpy as np
+import sys
+from datetime import datetime
d... |
b83acdc08ed0211c8b53d8f8a158c4ac43c8587c | test/test_issue655.py | test/test_issue655.py | from rdflib import Graph, Namespace, URIRef, Literal
from rdflib.compare import to_isomorphic
import unittest
class TestIssue655(unittest.TestCase):
def test_issue655(self):
PROV = Namespace('http://www.w3.org/ns/prov#')
bob = URIRef("http://example.org/object/Bob")
value = Literal(float... | from rdflib import Graph, Namespace, URIRef, Literal
from rdflib.compare import to_isomorphic
import unittest
class TestIssue655(unittest.TestCase):
def test_issue655(self):
PROV = Namespace('http://www.w3.org/ns/prov#')
bob = URIRef("http://example.org/object/Bob")
value = Literal(float... | Remove test on serialisation (order is not fixed) | Remove test on serialisation (order is not fixed)
| Python | bsd-3-clause | RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib | ---
+++
@@ -19,8 +19,6 @@
g2 = Graph()
g2.parse(data=g1.serialize(format='turtle'), format='turtle')
- self.assertTrue(g1.serialize(
- format='turtle') == g2.serialize(format='turtle'))
self.assertTrue(to_isomorphic(g1) == to_isomorphic(g2))
self.assertTrue(Li... |
1fe790a152d2397a4437a791bdb60db2aa823589 | tests/test_load_model.py | tests/test_load_model.py | """Test GitHub issue #4.
Diagram could not be loaded due to JuggleError (presumed cyclic
resolving of diagram items).
"""
from gi.repository import GLib, Gtk
from gaphor.storage.storage import load
class TestCyclicDiagram:
def test_bug(self, case, test_models):
"""Load file.
Thi... | # flake8: noqa F401,F811
"""Diagram could not be loaded due to JuggleError (presumed cyclic resolving of
diagram items)."""
from gi.repository import GLib, Gtk
from gaphor.diagram.tests.fixtures import (
element_factory,
event_manager,
modeling_language,
)
from gaphor.storage.storage import loa... | Convert load_model tests to pytest functions | Convert load_model tests to pytest functions
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | ---
+++
@@ -1,39 +1,40 @@
-"""Test GitHub issue #4.
-
-Diagram could not be loaded due to JuggleError (presumed cyclic
-resolving of diagram items).
-"""
+# flake8: noqa F401,F811
+"""Diagram could not be loaded due to JuggleError (presumed cyclic resolving of
+diagram items)."""
from gi.repository import GLib, Gt... |
8b7aef341aadefb859790684f41453f561813083 | tmi/views/__init__.py | tmi/views/__init__.py | from flask import g
from flask.ext.login import current_user
from tmi.core import app
from tmi.assets import assets # noqa
from tmi.views.ui import ui # noqa
from tmi.views.auth import login, logout # noqa
from tmi.views.admin import admin # noqa
from tmi.views.cards_api import blueprint as cards_api
@app.before_req... | from flask import g, request
from flask.ext.login import current_user
from werkzeug.exceptions import HTTPException
from tmi.core import app
from tmi.forms import Invalid
from tmi.util import jsonify
from tmi.assets import assets # noqa
from tmi.views.ui import ui # noqa
from tmi.views.auth import login, logout # noqa... | Handle errors with JSON messages. | Handle errors with JSON messages. | Python | mit | pudo/storyweb,pudo/storyweb | ---
+++
@@ -1,7 +1,10 @@
-from flask import g
+from flask import g, request
from flask.ext.login import current_user
+from werkzeug.exceptions import HTTPException
from tmi.core import app
+from tmi.forms import Invalid
+from tmi.util import jsonify
from tmi.assets import assets # noqa
from tmi.views.ui import ... |
f5f728074b257aac371fc59af8de02e440e57819 | furikura/desktop/unity.py | furikura/desktop/unity.py | import gi
gi.require_version('Unity', '7.0')
from gi.repository import Unity, Dbusmenu
launcher = Unity.LauncherEntry.get_for_desktop_id("furikura.desktop")
def update_counter(count):
launcher.set_property("count", count)
launcher.set_property("count_visible", True)
def add_quicklist_item(item):
quick_l... | import gi
from threading import Timer
gi.require_version('Unity', '7.0')
from gi.repository import Unity, Dbusmenu
launcher = Unity.LauncherEntry.get_for_desktop_id("furikura.desktop")
def update_counter(count):
launcher.set_property("count", count)
launcher.set_property("count_visible", True)
if count... | Apply "Urgent" icon animation on new message | Apply "Urgent" icon animation on new message
| Python | mit | benjamindean/furi-kura,benjamindean/furi-kura | ---
+++
@@ -1,13 +1,20 @@
import gi
+from threading import Timer
gi.require_version('Unity', '7.0')
from gi.repository import Unity, Dbusmenu
+
launcher = Unity.LauncherEntry.get_for_desktop_id("furikura.desktop")
def update_counter(count):
launcher.set_property("count", count)
launcher.set_prope... |
a02258643b4109ba862f8f927a8a2612b81c2a36 | ghtools/command/browse.py | ghtools/command/browse.py | from __future__ import print_function
import json
from argh import ArghParser, arg
from ghtools import cli
from ghtools.api import GithubAPIClient
parser = ArghParser(description="Browse the GitHub API")
@arg('github', nargs='?', help='GitHub instance nickname (e.g "enterprise")')
@arg('url', help='URL to browse')... | from __future__ import print_function
import json
from argh import ArghParser, arg
from ghtools import cli
from ghtools.api import GithubAPIClient
parser = ArghParser(description="Browse the GitHub API")
@arg('github', nargs='?', help='GitHub instance nickname (e.g "enterprise")')
@arg('url', help='URL to browse')... | Add missed json to json() tweak | Add missed json to json() tweak
| Python | mit | alphagov/ghtools | ---
+++
@@ -27,7 +27,7 @@
print()
if res.json() is not None:
- print(json.dumps(res.json, indent=2))
+ print(json.dumps(res.json(), indent=2))
else:
print(res.content)
parser.set_default_command(browse) |
3b5ad132f3670d1c1210190ecd7b41a379fbd10e | trakt/core/helpers.py | trakt/core/helpers.py | import arrow
def to_datetime(value):
if value is None:
return None
# Parse ISO8601 datetime
dt = arrow.get(value)
# Return python datetime object
return dt.datetime
| import arrow
def to_datetime(value):
if value is None:
return None
# Parse ISO8601 datetime
dt = arrow.get(value)
# Convert to UTC
dt = dt.to('UTC')
# Return naive datetime object
return dt.naive
| Convert all datetime properties to UTC | Convert all datetime properties to UTC
| Python | mit | shad7/trakt.py,fuzeman/trakt.py | ---
+++
@@ -8,5 +8,8 @@
# Parse ISO8601 datetime
dt = arrow.get(value)
- # Return python datetime object
- return dt.datetime
+ # Convert to UTC
+ dt = dt.to('UTC')
+
+ # Return naive datetime object
+ return dt.naive |
5e3b712c4c2eac7227d6e894ce05db6f1ede074a | hgtools/tests/conftest.py | hgtools/tests/conftest.py | import os
import pytest
from hgtools import managers
def _ensure_present(mgr):
try:
mgr.version()
except Exception:
pytest.skip()
@pytest.fixture
def hg_repo(tmpdir):
tmpdir.chdir()
mgr = managers.MercurialManager()
_ensure_present(mgr)
mgr._invoke('init', '.')
os.makedirs('bar')
touch('bar/baz')
mgr... | import os
import pytest
from hgtools import managers
def _ensure_present(mgr):
try:
mgr.version()
except Exception:
pytest.skip()
@pytest.fixture
def tmpdir_as_cwd(tmpdir):
with tmpdir.as_cwd():
yield tmpdir
@pytest.fixture
def hg_repo(tmpdir_as_cwd):
mgr = managers.MercurialManager()
_ensure_present... | Fix test failures by restoring working directory in fixtures. | Fix test failures by restoring working directory in fixtures.
| Python | mit | jaraco/hgtools | ---
+++
@@ -13,8 +13,13 @@
@pytest.fixture
-def hg_repo(tmpdir):
- tmpdir.chdir()
+def tmpdir_as_cwd(tmpdir):
+ with tmpdir.as_cwd():
+ yield tmpdir
+
+
+@pytest.fixture
+def hg_repo(tmpdir_as_cwd):
mgr = managers.MercurialManager()
_ensure_present(mgr)
mgr._invoke('init', '.')
@@ -25,12 +30,11 @@
with ... |
f953a5e6b52301defc3aee1f191507ed7005caa1 | azurerm/restfns.py | azurerm/restfns.py | # restfns - REST functions for azurerm
import requests
# do_get(endpoint, access_token)
# do an HTTP GET request and return JSON
def do_get(endpoint, access_token):
headers = {"Authorization": 'Bearer ' + access_token}
return requests.get(endpoint, headers=headers).json()
# do_delete(endpoint, access_token)
... | # restfns - REST functions for azurerm
import requests
# do_get(endpoint, access_token)
# do an HTTP GET request and return JSON
def do_get(endpoint, access_token):
headers = {"Authorization": 'Bearer ' + access_token}
return requests.get(endpoint, headers=headers).json()
# do_delete(endpoint, access_token)
... | Fix REST function comments for POST | Fix REST function comments for POST
| Python | mit | gbowerman/azurerm | ---
+++
@@ -20,8 +20,8 @@
headers = {"content-type": "application/json", "Authorization": 'Bearer ' + access_token}
return requests.put(endpoint, data=body, headers=headers)
-# do_put(endpoint, body, access_token)
-# do an HTTP PUT request and return JSON
+# do_post(endpoint, body, access_token)
+# do an... |
cf83c92ee2160a9d27d18347137b55b4a111228d | zvm/zcpu.py | zvm/zcpu.py | #
# A class which represents the CPU itself, the brain of the virtual
# machine. It ties all the systems together and runs the story.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZCpuError(Exception):
"General exception for Zcpu class"
... | #
# A class which represents the CPU itself, the brain of the virtual
# machine. It ties all the systems together and runs the story.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZCpuError(Exception):
"General exception for Zcpu class"
... | Make the CPU use lovely decorator syntax for registering opcode implementations. | Make the CPU use lovely decorator syntax for registering opcode implementations.
| Python | bsd-3-clause | sussman/zvm,sussman/zvm | ---
+++
@@ -13,27 +13,32 @@
class ZCpu(object):
+ _opcodes = {}
+
def __init__(self, zmem):
- ""
self._memory = zmem
- self._opcode_handlers = {}
- # Introspect ourselves, discover all functions that look like
- # opcode handlers, and add them to our mapper
- ... |
e5b98d072017c8a70cf033cdb34233b2d0a56b2e | pyfirmata/boards.py | pyfirmata/boards.py | BOARDS = {
'arduino': {
'digital': tuple(x for x in range(14)),
'analog': tuple(x for x in range(6)),
'pwm': (3, 5, 6, 9, 10, 11),
'use_ports': True,
'disabled': (0, 1) # Rx, Tx, Crystal
},
'arduino_mega': {
'digital': tuple(x for x in range(54)),
'an... | BOARDS = {
'arduino': {
'digital': tuple(x for x in range(14)),
'analog': tuple(x for x in range(6)),
'pwm': (3, 5, 6, 9, 10, 11),
'use_ports': True,
'disabled': (0, 1) # Rx, Tx, Crystal
},
'arduino_mega': {
'digital': tuple(x for x in range(54)),
'an... | Correct class name of arduino nano | Correct class name of arduino nano
| Python | mit | JoseU/pyFirmata,tino/pyFirmata | ---
+++
@@ -21,7 +21,7 @@
'disabled': (0, 1) # Rx, Tx, Crystal
},
- 'nano': {
+ 'arduino_nano': {
'digital': tuple(x for x in range(14)),
'analog': tuple(x for x in range(8)),
'pwm': (3, 5, 6, 9, 10, 11), |
c2eccb4ce1259830dd641d19624358af83c09549 | webcomix/comic_spider.py | webcomix/comic_spider.py | from urllib.parse import urljoin
import scrapy
class ComicSpider(scrapy.Spider):
name = "My spider"
def __init__(self, *args, **kwargs):
self.start_urls = kwargs.get('start_urls') or []
self.next_page_selector = kwargs.get('next_page_selector', None)
self.comic_image_selector = kwarg... | from urllib.parse import urljoin
import click
import scrapy
class ComicSpider(scrapy.Spider):
name = "Comic Spider"
def __init__(self, *args, **kwargs):
self.start_urls = kwargs.get('start_urls') or []
self.next_page_selector = kwargs.get('next_page_selector', None)
self.comic_image_... | Copy logging from previous version and only yield item to pipeline if a comic image was found | Copy logging from previous version and only yield item to pipeline if a comic image was found
| Python | mit | J-CPelletier/webcomix,J-CPelletier/webcomix,J-CPelletier/WebComicToCBZ | ---
+++
@@ -1,10 +1,11 @@
from urllib.parse import urljoin
+import click
import scrapy
class ComicSpider(scrapy.Spider):
- name = "My spider"
+ name = "Comic Spider"
def __init__(self, *args, **kwargs):
self.start_urls = kwargs.get('start_urls') or []
@@ -13,14 +14,18 @@
super(... |
e1c9828354036279469260ab498d8c979baa1562 | code/get_licenses.py | code/get_licenses.py | #!/usr/bin/python
import requests
import json
import csv
import sys
def parse_dataset_metadata(dataset):
if 'rights' in dataset.keys():
rights = dataset['rights'].encode('utf-8').strip()
rights = rights.replace("\n", "")
else:
rights = 'not supplied'
return [dataset['key'].encode('utf-8'), rights]
def ... | #!/usr/bin/python
import requests
import json
import csv
import sys
def parse_dataset_metadata(dataset):
if 'rights' in dataset.keys():
rights = dataset['rights'].encode('utf-8').strip()
rights = rights.replace("\n", "")
else:
rights = 'not supplied'
return [dataset['key'].encode('utf-8'), rights]
def ... | Remove quotes from header line | Remove quotes from header line
| Python | mit | Datafable/gbif-data-licenses,Datafable/gbif-data-licenses,Datafable/gbif-data-licenses | ---
+++
@@ -22,7 +22,7 @@
more_results_to_find = True
offset = 0
limit = 20
-print '"#dataset-key","rights"'
+print '#dataset-key,rights'
csvwriter = csv.writer(sys.stdout)
while more_results_to_find:
datasets = get_gbif_datasets(limit, offset) |
1a6344ea1fac51a8024e1803a0391662d4ab81e0 | pyeda/boolalg/vexpr.py | pyeda/boolalg/vexpr.py | """
Boolean Vector Logic Expressions
This module is deprecated.
The functionality has been superceded by the bfarray module.
Interface Functions:
bitvec
"""
from pyeda.boolalg import expr
from pyeda.boolalg import bfarray
def bitvec(name, *dims):
"""Return a new array of given dimensions, filled with Expres... | """
Boolean Vector Logic Expressions
This module is deprecated.
The functionality has been superceded by the bfarray module.
Interface Functions:
bitvec
"""
from warnings import warn
from pyeda.boolalg import expr
from pyeda.boolalg import bfarray
def bitvec(name, *dims):
"""Return a new array of given dim... | Add deprecation warning to bitvec function | Add deprecation warning to bitvec function
| Python | bsd-2-clause | pombredanne/pyeda,GtTmy/pyeda,karissa/pyeda,sschnug/pyeda,sschnug/pyeda,cjdrake/pyeda,sschnug/pyeda,cjdrake/pyeda,GtTmy/pyeda,GtTmy/pyeda,karissa/pyeda,pombredanne/pyeda,karissa/pyeda,cjdrake/pyeda,pombredanne/pyeda | ---
+++
@@ -7,6 +7,8 @@
Interface Functions:
bitvec
"""
+
+from warnings import warn
from pyeda.boolalg import expr
from pyeda.boolalg import bfarray
@@ -21,6 +23,7 @@
An int N means a slice from [0:N]
A tuple (M, N) means a slice from [M:N]
"""
+ warn("The 'bitvec' function is de... |
2339fa64974184c8174917be305c45a34013bae9 | easy/lowest_unique/lowest_unique.py | easy/lowest_unique/lowest_unique.py | import sys
def lowest_unique(int_list):
numbers = {}
for index in range(len(int_list)):
group = numbers.setdefault(int(int_list[index]), [])
group.append(index)
for number in numbers:
retval = numbers[number]
if len(retval) == 1:
return retval[0] + 1
return ... | import sys
def lowest_unique(int_list):
numbers = {}
for index, number in enumerate(int_list):
group = numbers.setdefault(int(number), [])
group.append(index)
for number in sorted(numbers.keys()):
retval = numbers[number]
if len(retval) == 1:
return retval[0] + ... | Improve solution by using enumerate | Improve solution by using enumerate
| Python | mit | MikeDelaney/CodeEval | ---
+++
@@ -3,10 +3,10 @@
def lowest_unique(int_list):
numbers = {}
- for index in range(len(int_list)):
- group = numbers.setdefault(int(int_list[index]), [])
+ for index, number in enumerate(int_list):
+ group = numbers.setdefault(int(number), [])
group.append(index)
- for nu... |
a5faf69efd3a53b937b0bd27d42ad0ca8b0af9a9 | centinel/backend.py | centinel/backend.py | import requests
import config
def request(slug):
url = "%s%s" % (config.server_url, slug)
req = requests.get(url)
if req.status_code != requests.codes.ok:
raise req.raise_for_status()
return req.json()
def get_recommended_versions():
return request("/versions")
def get_experiments():
... | import requests
import config
def request(slug):
url = "%s%s" % (config.server_url, slug)
req = requests.get(url)
if req.status_code != requests.codes.ok:
raise req.raise_for_status()
return req.json()
def get_recommended_versions():
return request("/versions")
def get_experiments():
... | Add ability to submit results | Add ability to submit results
| Python | mit | iclab/centinel,JASONews/centinel,lianke123321/centinel,Ashish1805/centinel,lianke123321/centinel,iclab/centinel,iclab/centinel,ben-jones/centinel,rpanah/centinel,lianke123321/centinel,rpanah/centinel,rpanah/centinel | ---
+++
@@ -22,7 +22,11 @@
def get_clients():
return request("/clients")
-def request(slug):
- url = "%s%s" % (config.server_url, slug)
- req = requests.get(url)
- return req.json()
+def submit_result(file_name):
+ with open(file_name) as result_file:
+ file = {'result' : result_file}
+ ... |
de4f395d75d7307a79d8db44399a6feaa0118c0a | wrappers/python/setup.py | wrappers/python/setup.py | from distutils.core import setup
setup(
name='python3-indy',
version='1.6.1',
packages=['indy'],
url='https://github.com/hyperledger/indy-sdk',
license='MIT/Apache-2.0',
author='Vyacheslav Gudkov',
author_email='vyacheslav.gudkov@dsr-company.com',
description='This is the official SDK f... | from distutils.core import setup
setup(
name='python3-indy',
version='1.6.1',
packages=['indy'],
url='https://github.com/hyperledger/indy-sdk',
license='MIT/Apache-2.0',
author='Vyacheslav Gudkov',
author_email='vyacheslav.gudkov@dsr-company.com',
description='This is the official SDK f... | Fix pytest version in python wrapper deps. | Fix pytest version in python wrapper deps.
Signed-off-by: Sergey Minaev <322af3f2df10918c6ef5280f56be0b711278b1ae@dsr-company.com>
| Python | apache-2.0 | anastasia-tarasova/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy... | ---
+++
@@ -9,6 +9,6 @@
author='Vyacheslav Gudkov',
author_email='vyacheslav.gudkov@dsr-company.com',
description='This is the official SDK for Hyperledger Indy (https://www.hyperledger.org/projects), which provides a distributed-ledger-based foundation for self-sovereign identity (https://sovrin.org).... |
cd621061773b7eafcea9358c9b762663a070ccc5 | cc/license/jurisdiction.py | cc/license/jurisdiction.py | import RDF
import zope.interface
import interfaces
import rdf_helper
class Jurisdiction(object):
zope.interface.implements(interfaces.IJurisdiction)
def __init__(self, short_name):
'''@param short_name can be e.g. mx'''
model = rdf_helper.init_model(
rdf_helper.JURI_RDF_PATH)
... | import RDF
import zope.interface
import interfaces
import rdf_helper
class Jurisdiction(object):
zope.interface.implements(interfaces.IJurisdiction)
def __init__(self, short_name):
"""Creates an object representing a jurisdiction.
short_name is a (usually) two-letter code representing
... | Add documentation and make Jurisdiction calls not fail when some of the values aren't found. | Add documentation and make Jurisdiction calls not fail when some of the values aren't found.
| Python | mit | creativecommons/cc.license,creativecommons/cc.license | ---
+++
@@ -6,14 +6,23 @@
class Jurisdiction(object):
zope.interface.implements(interfaces.IJurisdiction)
def __init__(self, short_name):
- '''@param short_name can be e.g. mx'''
+ """Creates an object representing a jurisdiction.
+ short_name is a (usually) two-letter code represen... |
d8f1b1151ff917cad924bd6f8fac330602c259c9 | warreport/__main__.py | warreport/__main__.py | import asyncio
import logging
from warreport import battle_monitor, battle_reporting
logger = logging.getLogger("warreport")
def main():
logger.info("Starting main loop.")
logger.debug("Debug logging enabled.")
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.gather(
battle_mo... | import asyncio
import logging
import os
from warreport import battle_monitor, battle_reporting
logger = logging.getLogger("warreport")
def main():
logger.info("Starting main loop.")
logger.debug("Debug logging enabled.")
loop = asyncio.get_event_loop()
gathered_future = asyncio.gather(
batt... | Make another try at graceful exiting. | Make another try at graceful exiting.
This still does use os._exit() after all coroutines have finished, but it's significantly less spaghetti code, and it makes it nicer to exit the program.
| Python | mit | daboross/screeps-warreport | ---
+++
@@ -1,5 +1,7 @@
import asyncio
import logging
+
+import os
from warreport import battle_monitor, battle_reporting
@@ -10,11 +12,25 @@
logger.info("Starting main loop.")
logger.debug("Debug logging enabled.")
loop = asyncio.get_event_loop()
- loop.run_until_complete(asyncio.gather(
+ ... |
9c39105f2dcb296590e895aaf35de5d4c3105ddb | ephypype/commands/tests/test_cli.py | ephypype/commands/tests/test_cli.py | """Test neuropycon command line interface"""
# Authors: Dmitrii Altukhov <daltuhov@hse.ru>
#
# License: BSD (3-clause)
import os
import os.path as op
from ephypype.commands import neuropycon
from click.testing import CliRunner
def test_input_linear():
"""Test input node with Linear plugin (serial workflow execu... | """Test neuropycon command line interface"""
# Authors: Dmitrii Altukhov <daltuhov@hse.ru>
#
# License: BSD (3-clause)
import matplotlib # noqa
matplotlib.use('Agg') # noqa; for testing don't use X server
import os
import os.path as op
from ephypype.commands import neuropycon
from click.testing import CliRunner
d... | FIX matplotlib backend problem in cli tests | FIX matplotlib backend problem in cli tests
| Python | bsd-3-clause | neuropycon/ephypype | ---
+++
@@ -3,6 +3,9 @@
# Authors: Dmitrii Altukhov <daltuhov@hse.ru>
#
# License: BSD (3-clause)
+
+import matplotlib # noqa
+matplotlib.use('Agg') # noqa; for testing don't use X server
import os
import os.path as op |
3204b2d5110a1a5cd16bad36ba5d5e916741fd2b | sensomatic/ui/persistence/models.py | sensomatic/ui/persistence/models.py | from peewee import *
db = SqliteDatabase('sensors.db')
class Sensor(Model):
name = CharField()
value = CharField()
timestamp = DateField()
class Meta:
database = db # This model uses the "people.db" database.
def get_last_record(sensor_name):
records = list(Sensor.select(Sensor.value)... | from peewee import *
db = SqliteDatabase('sensors.db')
class Sensor(Model):
name = CharField()
value = CharField()
timestamp = DateTimeField()
class Meta:
database = db # This model uses the "people.db" database.
def get_last_record(sensor_name):
records = list(Sensor.select(Sensor.va... | Store datetime instead of only date | Store datetime instead of only date
| Python | mit | rrader/sens-o-matic,rrader/sens-o-matic,rrader/sens-o-matic | ---
+++
@@ -6,7 +6,7 @@
class Sensor(Model):
name = CharField()
value = CharField()
- timestamp = DateField()
+ timestamp = DateTimeField()
class Meta:
database = db # This model uses the "people.db" database. |
92d25e86620fcdc415e94d5867cc22a95f88ca3a | mint/rest/db/awshandler.py | mint/rest/db/awshandler.py | #
# Copyright (c) 2009 rPath, Inc.
#
# All Rights Reserved
#
from mint import amiperms
class AWSHandler(object):
def __init__(self, cfg, db):
self.db = db
self.amiPerms = amiperms.AMIPermissionsManager(cfg, db)
def notify_UserProductRemoved(self, event, userId, projectId, userlevel = None):
... | #
# Copyright (c) 2009 rPath, Inc.
#
# All Rights Reserved
#
from mint import amiperms
class AWSHandler(object):
def __init__(self, cfg, db):
self.db = db
self.amiPerms = amiperms.AMIPermissionsManager(cfg, db)
def notify_UserProductRemoved(self, event, userId, projectId, userlevel = None):
... | Fix typo when setting up handler. | Fix typo when setting up handler.
| Python | apache-2.0 | sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint | ---
+++
@@ -11,10 +11,10 @@
self.amiPerms = amiperms.AMIPermissionsManager(cfg, db)
def notify_UserProductRemoved(self, event, userId, projectId, userlevel = None):
- self.amiPerms.addMemberToProject(userId, projectId)
+ self.amiPerms.deleteMemberFromProject(userId, projectId)
def... |
09b2fe8b248e70300470fcf71f6df0741376c548 | misc/disassemble_linear.py | misc/disassemble_linear.py | import sys
import time
import bracoujl.processor.gb_z80 as proc
dis = proc.CPU_CONF['disassembler']()
def disassemble(lines):
res = ''
for line in lines:
op = proc.CPU_CONF['parse_line'](line)
if op is None:
continue
res += '{:04X}'.format(op['pc']) + ' - ' + dis.disassembl... | import argparse
import sys
import time
import bracoujl.processor.gb_z80 as proc
dis = proc.CPU_CONF['disassembler']()
def disassemble(lines, keep_logs=False):
res = []
for line in lines:
op, gline = proc.CPU_CONF['parse_line'](line), ''
if keep_logs:
gline += line + (' | DIS: ' if ... | Fix and enhance disassemble miscellaneous script. | Fix and enhance disassemble miscellaneous script.
| Python | bsd-3-clause | fmichea/bracoujl | ---
+++
@@ -1,33 +1,48 @@
+import argparse
import sys
import time
import bracoujl.processor.gb_z80 as proc
dis = proc.CPU_CONF['disassembler']()
-def disassemble(lines):
- res = ''
+def disassemble(lines, keep_logs=False):
+ res = []
for line in lines:
- op = proc.CPU_CONF['parse_line'](line... |
e0063c0d5604372c1a07a179f5206a0a27570817 | package_reviewer/check/repo/check_semver_tags.py | package_reviewer/check/repo/check_semver_tags.py | import re
from . import RepoChecker
class CheckSemverTags(RepoChecker):
def check(self):
if not self.semver_tags:
msg = "No semantic version tags found. See http://semver.org."
for tag in self.tags:
if re.search(r"(v|^)\d+\.\d+$", tag.name):
m... | import re
from . import RepoChecker
class CheckSemverTags(RepoChecker):
def check(self):
if not self.semver_tags:
msg = "No semantic version tags found"
for tag in self.tags:
if re.search(r"(v|^)\d+\.\d+$", tag.name):
msg += " (semantic versio... | Change message of semver tag check | Change message of semver tag check
| Python | mit | packagecontrol/st_package_reviewer,packagecontrol/package_reviewer | ---
+++
@@ -8,9 +8,9 @@
def check(self):
if not self.semver_tags:
- msg = "No semantic version tags found. See http://semver.org."
+ msg = "No semantic version tags found"
for tag in self.tags:
if re.search(r"(v|^)\d+\.\d+$", tag.name):
- ... |
d3163d8a7695da9687f82d9d40c6767322998fc2 | python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep-py3/test_collections.py | python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep-py3/test_collections.py | # Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib... | # Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib... | Add iterable-unpacking in for test | Python: Add iterable-unpacking in for test
| Python | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | ---
+++
@@ -16,6 +16,15 @@
tainted_list.copy(), # $ tainted
)
+ for ((x, y, *z), a, b) in tainted_list:
+ ensure_tainted(
+ x, # $ tainted
+ y, # $ tainted
+ z, # $ tainted
+ a, # $ tainted
+ b, # $ tainted
+ )
+
def list_clear... |
679abfdd2b6a3c4d18170d93bfd42d73c47ff9c5 | phasm/typing.py | phasm/typing.py | """
Several type aliases used througout PHASM
-----------------------------------------
This is a separate module to prevent circular imports.
"""
from typing import Mapping, Set, Callable, Union, Tuple, Iterable
# Pairwise local alignments
OrientedDNASegment = 'phasm.alignments.OrientedDNASegment'
OrientedRead = 'p... | """
Several type aliases used througout PHASM
-----------------------------------------
This is a separate module to prevent circular imports.
"""
from typing import Mapping, Set, Callable, Union, Tuple, Iterable
# Pairwise local alignments
OrientedDNASegment = 'phasm.alignments.OrientedDNASegment'
OrientedRead = 'p... | Change Node type a bit | Change Node type a bit
In a reconstructed assembly graph sometimes the nodes can be str
| Python | mit | AbeelLab/phasm,AbeelLab/phasm | ---
+++
@@ -15,7 +15,7 @@
# Assembly Graphs
AssemblyGraph = 'phasm.assembly_graph.AssemblyGraph'
-Node = OrientedDNASegment
+Node = Union[OrientedDNASegment, str]
Edge = Tuple[Node, Node]
Path = Iterable[Edge]
Bubble = Tuple[Node, Node] |
fea07e0fe53049963a744b52c38a9abdfeb1c09e | commands.py | commands.py | from os import path
import shutil
import sublime
import sublime_plugin
SUBLIME_ROOT = path.normpath(path.join(sublime.packages_path(), '..'))
COMMANDS_FILEPATH = path.join('Packages', 'User', 'Commands.sublime-commands')
COMMANDS_FULL_FILEPATH = path.join(SUBLIME_ROOT, COMMANDS_FILEPATH)
COMMANDS_SOURCE_FULL_FILEPATH... | from os import path
import shutil
import sublime
import sublime_plugin
SUBLIME_ROOT = path.normpath(path.join(sublime.packages_path(), '..'))
COMMANDS_FILEPATH = path.join('Packages', 'User', 'Commands.sublime-commands')
COMMANDS_FULL_FILEPATH = path.join(SUBLIME_ROOT, COMMANDS_FILEPATH)
COMMANDS_SOURCE_FULL_FILEPATH... | Revert "Started exploring using argument but realizing this is a rabbit hole" | Revert "Started exploring using argument but realizing this is a rabbit hole"
This reverts commit b899d5613c0f4425aa4cc69bac9561b503ba83d4.
| Python | unlicense | twolfson/sublime-edit-command-palette,twolfson/sublime-edit-command-palette,twolfson/sublime-edit-command-palette | ---
+++
@@ -10,17 +10,14 @@
COMMANDS_SOURCE_FULL_FILEPATH = path.abspath('default-prompt.json')
class CommandsOpenCommand(sublime_plugin.WindowCommand):
- def run(self, **kwargs):
- """Open `.sublime-commands` file for custom definitions"""
- # If no file is provided, default to `COMMANDS_FULL_FI... |
b21c5a1b0f8d176cdd59c8131a316f142540d9ec | materials.py | materials.py | import color
def parse(mat_node):
materials = []
for node in mat_node:
materials.append(Material(node))
class Material:
''' it’s a material
'''
def __init__(self, node):
for c in node:
if c.tag == 'ambient':
self.ambient_color = color.parse(c[0])
... | import color
def parse(mat_node):
materials = []
for node in mat_node:
materials.append(Material(node))
class Material:
''' it’s a material
'''
def __init__(self, node):
for c in node:
if c.tag == 'ambient':
self.ambient_color = color.parse(c[0])
... | Remove replacement of commas by points | Remove replacement of commas by points
| Python | mit | cocreature/pytracer | ---
+++
@@ -14,13 +14,13 @@
for c in node:
if c.tag == 'ambient':
self.ambient_color = color.parse(c[0])
- self.ambient_color *= float(c.attrib['factor'].replace(',', '.'))
+ self.ambient_color *= float(c.attrib['factor'])
elif c.tag ==... |
2fe72f41b1b62cf770869b8d3ccefeef1096ea11 | conftest.py | conftest.py | # -*- coding: UTF-8 -*-
"""
Configure pytest environment.
Add project-specific information.
.. seealso::
* https://github.com/pytest-dev/pytest-html
"""
import behave
import pytest
@pytest.fixture(autouse=True)
def _annotate_environment(request):
"""Add project-specific information to test-run environment:
... | # -*- coding: UTF-8 -*-
"""
Configure pytest environment.
Add project-specific information.
.. seealso::
* https://github.com/pytest-dev/pytest-html
"""
import behave
import pytest
@pytest.fixture(autouse=True)
def _annotate_environment(request):
"""Add project-specific information to test-run environment:
... | FIX when pytest-html is not installed. | FIX when pytest-html is not installed.
| Python | bsd-2-clause | Abdoctor/behave,Abdoctor/behave,jenisys/behave,jenisys/behave | ---
+++
@@ -19,6 +19,9 @@
NOTE: autouse: Fixture is automatically used when test-module is imported.
"""
# -- USEFULL FOR: pytest --html=report.html ...
- behave_version = behave.__version__
- request.config._environment.append(("behave", behave_version))
+ environment = getattr(request.config... |
6df2a6e82a04c6cb19a789c55f758d0958a9b690 | nipype/interfaces/setup.py | nipype/interfaces/setup.py | def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('interfaces', parent_package, top_path)
config.add_data_dir('tests')
config.add_data_dir('script_templates')
return config
if __name__ == '__main__':
from numpy.dist... | def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('interfaces', parent_package, top_path)
config.add_subpackage('fsl')
config.add_data_dir('tests')
config.add_data_dir('script_templates')
return config
if __name__ ... | Add fsl subpackage on install. | Add fsl subpackage on install.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1050 ead46cd0-7350-4e37-8683-fc4c6f79bf00
| Python | bsd-3-clause | glatard/nipype,rameshvs/nipype,arokem/nipype,wanderine/nipype,wanderine/nipype,FredLoney/nipype,dmordom/nipype,arokem/nipype,Leoniela/nipype,blakedewey/nipype,wanderine/nipype,dmordom/nipype,FCP-INDI/nipype,FredLoney/nipype,gerddie/nipype,FCP-INDI/nipype,christianbrodbeck/nipype,iglpdc/nipype,mick-d/nipype,satra/NiPype... | ---
+++
@@ -2,6 +2,8 @@
from numpy.distutils.misc_util import Configuration
config = Configuration('interfaces', parent_package, top_path)
+
+ config.add_subpackage('fsl')
config.add_data_dir('tests')
config.add_data_dir('script_templates') |
1f6fb7bb0e20cafbe4392bf8a0cafa3e9fa2fbc1 | main.py | main.py | #!/usr/bin/python
from pytun import TunTapDevice
from binascii import hexlify
if __name__ == '__main__':
tun = TunTapDevice(name='ipsec-tun')
tun.up()
tun.persist(True)
while True:
try:
buf = tun.read(tun.mtu)
print hexlify(buf[4:])
IPpayload = buf[4:]
# TODO encrypt buf
# TODO send to wlan0
... | #!/usr/bin/env python
from pytun import TunTapDevice
from binascii import hexlify
if __name__ == '__main__':
tun = TunTapDevice(name='ipsec-tun')
tun.up()
tun.persist(True)
while True:
try:
buf = tun.read(tun.mtu)
print hexlify(buf[4:])
IPpayload = buf[4:]
... | Change shebang to use python from environment. Fix Indentation. | Change shebang to use python from environment. Fix Indentation.
| Python | mit | adrian-nicolau/ipsec-poc,adrian-nicolau/ipsec-poc | ---
+++
@@ -1,21 +1,20 @@
-#!/usr/bin/python
+#!/usr/bin/env python
from pytun import TunTapDevice
from binascii import hexlify
+if __name__ == '__main__':
+ tun = TunTapDevice(name='ipsec-tun')
+ tun.up()
+ tun.persist(True)
-if __name__ == '__main__':
- tun = TunTapDevice(name='ipsec-tun')
- tun.up... |
6267fa5d9a3ff2573dc33a23d3456942976b0b7e | cyder/base/models.py | cyder/base/models.py | from django.db import models
from django.utils.safestring import mark_safe
from cyder.base.utils import classproperty
class BaseModel(models.Model):
"""
Base class for models to abstract some common features.
* Adds automatic created and modified fields to the model.
"""
created = models.DateTim... | from django.db import models
from django.utils.safestring import mark_safe
from cyder.base.utils import classproperty
class BaseModel(models.Model):
"""
Base class for models to abstract some common features.
* Adds automatic created and modified fields to the model.
"""
created = models.DateTim... | Add help_text to interface 'expire' field | Add help_text to interface 'expire' field
| Python | bsd-3-clause | OSU-Net/cyder,zeeman/cyder,drkitty/cyder,zeeman/cyder,OSU-Net/cyder,murrown/cyder,OSU-Net/cyder,murrown/cyder,murrown/cyder,drkitty/cyder,drkitty/cyder,OSU-Net/cyder,akeym/cyder,murrown/cyder,akeym/cyder,akeym/cyder,drkitty/cyder,zeeman/cyder,zeeman/cyder,akeym/cyder | ---
+++
@@ -42,7 +42,8 @@
class ExpirableMixin(models.Model):
- expire = models.DateTimeField(null=True, blank=True)
+ expire = models.DateTimeField(null=True, blank=True,
+ help_text='Format: MM/DD/YYYY')
class Meta:
abstract = True |
2150f99461e4790477ad90483a7f716f09679ef1 | p025.py | p025.py | #!/usr/bin/env python3
"""Solves problem xxx from the Project Euler website"""
from common.fibonacci import fibonacci_numbers_until_n_digits
def solve():
"""Solve the problem and return the result"""
fibonacci_numbers = fibonacci_numbers_until_n_digits(1000)
result = len(fibonacci_numbers)
return res... | #!/usr/bin/env python3
"""Solves problem 025 from the Project Euler website"""
from common.fibonacci import fibonacci_numbers_until_n_digits
def solve():
"""Solve the problem and return the result"""
fibonacci_numbers = fibonacci_numbers_until_n_digits(1000)
result = len(fibonacci_numbers)
return res... | Fix comment in previous commit. | Fix comment in previous commit.
| Python | mit | janhenke/project-euler | ---
+++
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-"""Solves problem xxx from the Project Euler website"""
+"""Solves problem 025 from the Project Euler website"""
from common.fibonacci import fibonacci_numbers_until_n_digits
|
f29a6b205a872d7df63e8c45b5829959c98de227 | comics/comics/pcweenies.py | comics/comics/pcweenies.py | from comics.aggregator.crawler import CrawlerBase, CrawlerResult
from comics.meta.base import MetaBase
class Meta(MetaBase):
name = 'The PC Weenies'
language = 'en'
url = 'http://www.pcweenies.com/'
start_date = '1998-10-21'
rights = 'Krishna M. Sadasivam'
class Crawler(CrawlerBase):
history_c... | from comics.aggregator.crawler import CrawlerBase, CrawlerResult
from comics.meta.base import MetaBase
class Meta(MetaBase):
name = 'The PC Weenies'
language = 'en'
url = 'http://www.pcweenies.com/'
start_date = '1998-10-21'
rights = 'Krishna M. Sadasivam'
class Crawler(CrawlerBase):
history_c... | Update CSS selector which matched two img elements | Update CSS selector which matched two img elements
| Python | agpl-3.0 | klette/comics,jodal/comics,jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,klette/comics,klette/comics,datagutten/comics,datagutten/comics | ---
+++
@@ -18,5 +18,5 @@
for entry in feed.for_date(pub_date):
if 'Comic' in entry.tags:
title = entry.title
- url = entry.content0.src(u'img')
+ url = entry.content0.src(u'img[src*="/comics/"]')
return CrawlerResult(url, title) |
5f0f1da10ebc01d95bb8659f5dc7782e57365b53 | .conda/to_cargoport.py | .conda/to_cargoport.py | #!/usr/bin/env python
import sys
import yaml
def extDetect(url):
if url.endswith('.tar.gz'):
return '.tar.gz'
elif url.endswith('.tgz'):
return '.tar.gz'
elif url.endswith('.tar.bz2'):
return '.tar.bz2'
elif url.endswith('.tar.xz'):
return '.tar.xz'
else:
re... | #!/usr/bin/env python
import sys
import yaml
def extDetect(url):
if url.endswith('.tar.gz'):
return '.tar.gz'
elif url.endswith('.tgz'):
return '.tar.gz'
elif url.endswith('.tar.bz2'):
return '.tar.bz2'
elif url.endswith('.tar.xz'):
return '.tar.xz'
else:
gu... | Fix download issue for a few packages | Fix download issue for a few packages
| Python | mit | erasche/community-package-cache,erasche/community-package-cache,gregvonkuster/cargo-port,gregvonkuster/cargo-port,galaxyproject/cargo-port,galaxyproject/cargo-port,erasche/community-package-cache,gregvonkuster/cargo-port | ---
+++
@@ -13,7 +13,12 @@
elif url.endswith('.tar.xz'):
return '.tar.xz'
else:
- return url[url.rindex('.'):]
+ guess = url[url.rindex('.'):]
+ # If there's a slash, that's DEFINITELY not an extension. Return empty
+ # and hope downstream handles that OK.
+ if '/... |
54f53815653f807c17c33e9d3262d9d3a31abfcf | scripts/fill_events.py | scripts/fill_events.py | #!/usr/bin/env python
import sys
import os
sys.path.append(os.path.join(os.path.dirname('__file__'), '..', 'src'))
from random import randint
from datetime import datetime, timedelta
from logsandra.model.client import CassandraClient
client = CassandraClient('test', 'localhost', 9160, 3)
today = datetime.now()
ke... | #!/usr/bin/env python
import sys
import os
sys.path.append(os.path.join(os.path.dirname('__file__'), '..', 'src'))
from random import randint
from datetime import datetime, timedelta
from logsandra.model.client import CassandraClient
client = CassandraClient('test', 'localhost', 9160, 3)
keywords = ['foo', 'bar', ... | Print info about keywords when loading sample data | Print info about keywords when loading sample data
| Python | mit | thobbs/logsandra | ---
+++
@@ -9,11 +9,12 @@
from logsandra.model.client import CassandraClient
-
client = CassandraClient('test', 'localhost', 9160, 3)
+keywords = ['foo', 'bar', 'baz']
+print "Loading sample data for the following keywords:", ', '.join(keywords)
+
today = datetime.now()
-keywords = ['foo', 'bar', 'baz']
for... |
6ad647899d044cb46be6172cbea9c93a369ddc78 | pymanopt/solvers/theano_functions/comp_diff.py | pymanopt/solvers/theano_functions/comp_diff.py | # Module containing functions to compile and differentiate Theano graphs.
import theano.tensor as T
import theano
# Compile objective function defined in Theano.
def compile(objective, argument):
return theano.function([argument], objective)
# Compute the gradient of 'objective' with respect to 'argument' and re... | # Module containing functions to compile and differentiate Theano graphs.
import theano.tensor as T
import theano
# Compile objective function defined in Theano.
def compile(objective, argument):
return theano.function([argument], objective)
# Compute the gradient of 'objective' with respect to 'argument' and re... | Use `compile` function for `gradient` function | Use `compile` function for `gradient` function
Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>
| Python | bsd-3-clause | j-towns/pymanopt,nkoep/pymanopt,pymanopt/pymanopt,tingelst/pymanopt,nkoep/pymanopt,pymanopt/pymanopt,nkoep/pymanopt | ---
+++
@@ -11,4 +11,5 @@
# compiled function.
def gradient(objective, argument):
g = T.grad(objective, argument)
- return theano.function([argument], g)
+ return compile(g, argument)
+ |
48e4203bc87fda407d0e5f804c854b53f7bf54fc | lemon/publications/managers.py | lemon/publications/managers.py | from django.db import models
from lemon.publications.querysets import PublicationQuerySet
class PublicationManager(models.Manager):
def expired(self):
return self.get_query_set().expired()
def future(self):
return self.get_query_set().future()
def enabled(self):
return self... | from django.db import models
from lemon.publications.querysets import PublicationQuerySet
class PublicationManager(models.Manager):
def expired(self):
return self.get_query_set().expired()
def future(self):
return self.get_query_set().future()
def enabled(self):
return self... | Fix handling of the _db attribute on the PublicationManager in get_query_set | Fix handling of the _db attribute on the PublicationManager in get_query_set
| Python | bsd-3-clause | trilan/lemon,trilan/lemon,trilan/lemon | ---
+++
@@ -24,4 +24,4 @@
return self.get_query_set().published()
def get_query_set(self):
- return PublicationQuerySet(self.model)
+ return PublicationQuerySet(self.model, using=self._db) |
3c4565dcf6222af0e3b7cabf5c52f9ab18488be2 | tests/test_main.py | tests/test_main.py | from cookiecutter.main import is_repo_url, expand_abbreviations
def test_is_repo_url():
"""Verify is_repo_url works."""
assert is_repo_url('gitolite@server:team/repo') is True
assert is_repo_url('git@github.com:audreyr/cookiecutter.git') is True
assert is_repo_url('https://github.com/audreyr/cookiecut... | # -*- coding: utf-8 -*-
import pytest
from cookiecutter.main import is_repo_url, expand_abbreviations
@pytest.fixture(params=[
'gitolite@server:team/repo',
'git@github.com:audreyr/cookiecutter.git',
'https://github.com/audreyr/cookiecutter.git',
'https://bitbucket.org/pokoli/cookiecutter.hg',
])
def... | Refactor tests for is_repo_url to be parametrized | Refactor tests for is_repo_url to be parametrized
| Python | bsd-3-clause | luzfcb/cookiecutter,terryjbates/cookiecutter,michaeljoseph/cookiecutter,willingc/cookiecutter,pjbull/cookiecutter,stevepiercy/cookiecutter,hackebrot/cookiecutter,dajose/cookiecutter,Springerle/cookiecutter,dajose/cookiecutter,stevepiercy/cookiecutter,terryjbates/cookiecutter,audreyr/cookiecutter,pjbull/cookiecutter,aud... | ---
+++
@@ -1,21 +1,40 @@
+# -*- coding: utf-8 -*-
+
+import pytest
+
from cookiecutter.main import is_repo_url, expand_abbreviations
-def test_is_repo_url():
+@pytest.fixture(params=[
+ 'gitolite@server:team/repo',
+ 'git@github.com:audreyr/cookiecutter.git',
+ 'https://github.com/audreyr/cookiecutter.... |
d312815697a3457ee0b3d12da9d07c0cab7a5622 | media.py | media.py | # media.py
class Movie(object):
def __init__(self,
title,
storyline,
poster_image_url,
trailer_youtube_url,
lead_actors,
release_date,
mpaa_rating,
language,
runt... | # media.py
class Movie(object):
def __init__(self,
title,
storyline,
poster_image_url,
trailer_youtube_url,
lead_actors,
release_date,
mpaa_rating,
language,
runt... | Change Movie parameter from production_company to production_companies | Change Movie parameter from production_company to production_companies
| Python | mit | vishallama/udacity-fullstack-movie-trailer,vishallama/udacity-fullstack-movie-trailer | ---
+++
@@ -11,7 +11,7 @@
mpaa_rating,
language,
runtime,
- production_company,
+ production_companies,
trivia
):
self.title = title
@@ -23,6 +23,6 @@
self.mpaa_rating = mpaa_rat... |
4b6bb7b7d258a9f130b7d10f390f44dec855cc19 | admin/src/gui/NewScoville.py | admin/src/gui/NewScoville.py | #!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# Copyright 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Scoville.
#
# Scoville is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as... | #!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# Copyright 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Scoville.
#
# Scoville is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as... | Revert "added constructor (testcommit for new git interface)" | Revert "added constructor (testcommit for new git interface)"
This reverts commit d5c0252b75e97103d61c3203e2a8d04a061c8a2f.
| Python | agpl-3.0 | skarphed/skarphed,skarphed/skarphed | ---
+++
@@ -30,5 +30,4 @@
builder.add_from_file(os.path[0]+"/src/gui/NewScoville.ui")
class NewScovilleWindow(object):
- def __init__(self):
- pass
+ pass |
f5c8c9909a8b7288503f1ed3dcd87c5e59d3817c | settings.py | settings.py | import os
class Config(object):
"""
The shared configuration settings for the flask app.
"""
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__)))
CSRF_ENABLED = True
CSRF_SESSION_KEY = "supersecretpassword"
SECRET_KEY = 'supersecretpassword'
class ProdConfig(Config):
... | import os
class Config(object):
"""
The shared configuration settings for the flask app.
"""
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__)))
CSRF_ENABLED = True
CSRF_SESSION_KEY = "supersecretpassword"
SECRET_KEY = 'supersecretpassword'
class ProdConfig(Config):
... | Use environment db url, otherwise a service specific one. | Use environment db url, otherwise a service specific one.
| Python | mit | jawrainey/atc,jawrainey/atc | ---
+++
@@ -20,11 +20,8 @@
"""
ENV = 'prod'
DEBUG = False
- heroku = os.environ.get('DATABASE_URL')
- if heroku:
- SQLALCHEMY_DATABASE_URI = heroku
- else:
- SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/example'
+ SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL',
+... |
8a43c573ebb606cfc6436396f2062fb9f00189d2 | asynctnt/__init__.py | asynctnt/__init__.py | from .connection import Connection, connect
from .iproto.protocol import Iterator, Response
__version__ = '0.1.5'
| from .connection import Connection, connect
from .iproto.protocol import Iterator, Response
__version__ = '0.1.6'
| Fix schema refetch bug. Version increase | Fix schema refetch bug. Version increase
| Python | apache-2.0 | igorcoding/asynctnt,igorcoding/asynctnt,igorcoding/asynctnt | ---
+++
@@ -1,4 +1,4 @@
from .connection import Connection, connect
from .iproto.protocol import Iterator, Response
-__version__ = '0.1.5'
+__version__ = '0.1.6' |
589598a9fc3871fe534e4dde60b61c9a0a56e224 | legistar/ext/pupa/orgs.py | legistar/ext/pupa/orgs.py | import pupa.scrape
from legistar.utils.itemgenerator import make_item
from legistar.ext.pupa.base import Adapter, Converter
class OrgsAdapter(Adapter):
'''Converts legistar data into a pupa.scrape.Person instance.
Note the make_item methods are popping values out the dict,
because the associated keys are... | import pupa.scrape
from legistar.utils.itemgenerator import make_item
from legistar.ext.pupa.base import Adapter, Converter
class OrgsAdapter(Adapter):
'''Converts legistar data into a pupa.scrape.Person instance.
Note the make_item methods are popping values out the dict,
because the associated keys are... | Remove cruft copied from Memberships adapter | Remove cruft copied from Memberships adapter
| Python | bsd-3-clause | opencivicdata/python-legistar-scraper,datamade/python-legistar-scraper | ---
+++
@@ -11,12 +11,31 @@
'''
pupa_model = pupa.scrape.Organization
aliases = []
- extras_keys = ['meeting_location', 'num_members', 'num_vacancies']
+ extras_keys = [
+ 'meeting_location', 'num_members', 'num_vacancies', 'type']
@make_item('classification')
def get_classn(se... |
42d06a15dd30e770dfccfccbd20fbf9bba52494d | platforms/m3/programming/goc_gdp_test.py | platforms/m3/programming/goc_gdp_test.py | #!/usr/bin/env python2
import code
try:
import Image
except ImportError:
from PIL import Image
import gdp
gdp.gdp_init()
gcl_name = gdp.GDP_NAME("edu.umich.eecs.m3.test01")
gcl_handle = gdp.GDP_GCL(gcl_name, gdp.GDP_MODE_RA)
#j = Image.open('/tmp/capture1060.jpeg')
#d = {"data": j.tostring()}
#gcl_handle.append(... | #!/usr/bin/env python2
import code
try:
import Image
except ImportError:
from PIL import Image
import gdp
gdp.gdp_init()
gcl_name = gdp.GDP_NAME("edu.umich.eecs.m3.test01")
gcl_handle = gdp.GDP_GCL(gcl_name, gdp.GDP_MODE_RA)
#j = Image.open('/tmp/capture1060.jpeg')
#d = {"data": j.tostring()}
#gcl_handle.append(... | Update gdp test to open random images | Update gdp test to open random images
| Python | apache-2.0 | lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator | ---
+++
@@ -17,10 +17,16 @@
#gcl_handle.append(d)
-record = gcl_handle.read(3)
-raw = record['data']
+while True:
+ try:
+ idx = int(raw_input("Image index: "))
-image = Image.fromstring('RGB', (640,640), raw)
-image.show()
+ record = gcl_handle.read(idx)
+ raw = record['data']
+
+ image = Image.fromstring... |
e29039cf5b1cd0b40b8227ef73c2d5327450c162 | app/core/servicemanager.py | app/core/servicemanager.py | """
Contains components that manage services, their sequences and interdependence (later)
"""
import threading
import logging
logger = logging.getLogger(__name__)
class ServiceManager(threading.Thread):
"""
Sequentially starts services using service.service_start(). When a new
service is activated, vie... | """
Contains components that manage services, their sequences and interdependence.
"""
import importlib
import logging
from collections import namedtuple
from app.core.toposort import toposort
logger = logging.getLogger(__name__)
Module = namedtuple('Module', ["name", "deps", "meta"])
def list_modules(module):
... | Use toposort for sequencing services. | Use toposort for sequencing services.
| Python | mit | supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer | ---
+++
@@ -1,12 +1,35 @@
"""
-Contains components that manage services, their sequences and interdependence (later)
+Contains components that manage services, their sequences and interdependence.
"""
-import threading
+import importlib
import logging
+from collections import namedtuple
+
+from app.core.toposort... |
fc1505865f919764aa066e5e43dcde1bc7e760b2 | frappe/patches/v13_0/rename_desk_page_to_workspace.py | frappe/patches/v13_0/rename_desk_page_to_workspace.py | import frappe
from frappe.model.rename_doc import rename_doc
def execute():
if frappe.db.exists("DocType", "Desk Page"):
if frappe.db.exists('DocType', 'Workspace'):
# this patch was not added initially, so this page might still exist
frappe.delete_doc('DocType', 'Desk Page')
else:
rename_doc('DocType', ... | import frappe
from frappe.model.rename_doc import rename_doc
def execute():
if frappe.db.exists("DocType", "Desk Page"):
if frappe.db.exists('DocType', 'Workspace'):
# this patch was not added initially, so this page might still exist
frappe.delete_doc('DocType', 'Desk Page')
else:
rename_doc('DocType', ... | Rename Desk Link only if it exists | fix(Patch): Rename Desk Link only if it exists
| Python | mit | frappe/frappe,StrellaGroup/frappe,StrellaGroup/frappe,saurabh6790/frappe,StrellaGroup/frappe,mhbu50/frappe,almeidapaulopt/frappe,yashodhank/frappe,saurabh6790/frappe,mhbu50/frappe,frappe/frappe,yashodhank/frappe,almeidapaulopt/frappe,mhbu50/frappe,saurabh6790/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,yashodhan... | ---
+++
@@ -10,7 +10,8 @@
rename_doc('DocType', 'Desk Page', 'Workspace')
rename_doc('DocType', 'Desk Chart', 'Workspace Chart', ignore_if_exists=True)
- rename_doc('DocType', 'Desk Link', 'Workspace Link', ignore_if_exists=True)
rename_doc('DocType', 'Desk Shortcut', 'Workspace Shortcut', ignore_if_exists=... |
bac71c099f0196d5ab74a8ec08cedc32ab008e1c | graphite/post-setup-graphite-web.py | graphite/post-setup-graphite-web.py | #!/usr/bin/env python
import os
import random
import string
import sys
from django.utils.crypto import get_random_string
## Check if the script was already executed
flag_filename = '/opt/graphite/post-setup-complete'
if os.path.isfile(flag_filename):
sys.exit(0)
## Add SECRET_KEY to local_settings.py
settings... | #!/usr/bin/env python
import os
import random
import string
import sys
from django.utils.crypto import get_random_string
## Check if the script was already executed
flag_filename = '/opt/graphite/post-setup-complete'
if os.path.isfile(flag_filename):
sys.exit(0)
## Add SECRET_KEY to local_settings.py
settings... | Check if admin user exists before creating one | Check if admin user exists before creating one
| Python | mit | rvernica/Dockerfile,rvernica/docker-library,rvernica/docker-library | ---
+++
@@ -36,8 +36,9 @@
(random.choice(string.letters + string.digits + string.punctuation))
for x in range(20))
-User.objects.create_superuser('admin', 'admin@localhost', password)
-print '[graphite-web] Superuser: admin, Password: %s' % (password, )
+if not User.objects.filter(username='admin').exists... |
828fec30b5b1deddcca79eae8fd1029bd5bd7b54 | py/desispec/io/__init__.py | py/desispec/io/__init__.py | #
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
"""
desispec.io
===========
Tools for data and metadata I/O.
"""
# help with 2to3 support
from __future__ import absolute_import, division
from .meta import findfile, get_exposures, get_files, rawdata_root, specprod_root
from .fra... | #
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
"""
desispec.io
===========
Tools for data and metadata I/O.
"""
# help with 2to3 support
from __future__ import absolute_import, division
from .meta import (findfile, get_exposures, get_files, rawdata_root,
specprod_root, va... | Add validate_night to public API | Add validate_night to public API
| Python | bsd-3-clause | desihub/desispec,gdhungana/desispec,timahutchinson/desispec,gdhungana/desispec,desihub/desispec,timahutchinson/desispec | ---
+++
@@ -12,7 +12,8 @@
# help with 2to3 support
from __future__ import absolute_import, division
-from .meta import findfile, get_exposures, get_files, rawdata_root, specprod_root
+from .meta import (findfile, get_exposures, get_files, rawdata_root,
+ specprod_root, validate_night)
from .frame import read... |
6699526ab04684ca9af3f6eb0f5361221e46e195 | src/purkinje/purkinje.py | src/purkinje/purkinje.py | #!/usr/bin/env python
from gevent.wsgi import WSGIServer
import werkzeug.serving
from werkzeug.debug import DebuggedApplication
from app import get_app
APP_PORT = 5000
DEBUG = True
@werkzeug.serving.run_with_reloader
def main():
"""Starts web application
"""
app = get_app()
app.debug = DEBUG
# ap... | #!/usr/bin/env python
import gevent.monkey
gevent.monkey.patch_all()
from gevent.wsgi import WSGIServer
import werkzeug.serving
from werkzeug.debug import DebuggedApplication
from app import get_app
APP_PORT = 5000
DEBUG = True
@werkzeug.serving.run_with_reloader
def main():
"""Starts web application
"""
... | Apply gevent monkey patching, so it will get invoked when main is called via the entry point script and not via shell script | Apply gevent monkey patching, so it will get invoked when main
is called via the entry point script and not via shell script
| Python | mit | bbiskup/purkinje,bbiskup/purkinje,bbiskup/purkinje,bbiskup/purkinje | ---
+++
@@ -1,4 +1,6 @@
#!/usr/bin/env python
+import gevent.monkey
+gevent.monkey.patch_all()
from gevent.wsgi import WSGIServer
import werkzeug.serving
from werkzeug.debug import DebuggedApplication |
a15513ee5fc45cb974129a9097ab0a7dbb9769fc | apps/metricsmanager/api.py | apps/metricsmanager/api.py | from rest_framework.views import APIView
from rest_framework.reverse import reverse
from rest_framework.response import Response
from rest_framework import generics
from rest_framework import generics, status
from django.core.exceptions import ValidationError
from .models import *
from .serializers import *
from .formu... | from rest_framework.views import APIView
from rest_framework.reverse import reverse
from rest_framework.response import Response
from rest_framework import generics, status
from django.core.exceptions import ValidationError
from .models import *
from .serializers import *
from .formula import validate_formula
class Me... | Change formula validation error to consistent form | Change formula validation error to consistent form
| Python | agpl-3.0 | almey/policycompass-services,mmilaprat/policycompass-services,mmilaprat/policycompass-services,policycompass/policycompass-services,almey/policycompass-services,almey/policycompass-services,policycompass/policycompass-services,policycompass/policycompass-services,mmilaprat/policycompass-services | ---
+++
@@ -1,7 +1,6 @@
from rest_framework.views import APIView
from rest_framework.reverse import reverse
from rest_framework.response import Response
-from rest_framework import generics
from rest_framework import generics, status
from django.core.exceptions import ValidationError
from .models import *
@@ -3... |
ae5a0b42ed6e0e44868e7a0e0a4d5901e2cf9e6b | src/info_retrieval/info_retrieval.py | src/info_retrieval/info_retrieval.py | # LING 573 Question Answering System
# Code last updated 4/17/14 by Clara Gordon
# This code implements an InfoRetriever for the question answering system.
from pymur import *
from general_classes import *
class InfoRetriever:
# builds a QueryEnvironment associated with the indexed document collection
def... | # LING 573 Question Answering System
# Code last updated 4/17/14 by Clara Gordon
# This code implements an InfoRetriever for the question answering system.
from pymur import *
from general_classes import *
class InfoRetriever:
# builds a QueryEnvironment associated with the indexed document collection
def... | Fix semicolon :/ in info_retriever | Fix semicolon :/ in info_retriever
| Python | mit | amkahn/question-answering,amkahn/question-answering | ---
+++
@@ -15,7 +15,7 @@
# how to get this to link up to the doc collection?
self.path_to_idx = index_path
- self.index = new Index(self.path_to_idx);
+ self.index = new Index(self.path_to_idx)
self.query_env = QueryEnvironment()
self.query_env.addIndex(self.path_t... |
caf4c29bada9d5b819d028469424ec195ffbc144 | tests/test_redefine_colors.py | tests/test_redefine_colors.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test redefinition of colors."""
import colorise
import pytest
@pytest.mark.skip_on_windows
def test_redefine_colors_error():
with pytest.raises(colorise.error.NotSupportedError):
colorise.redefine_colors({})
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test redefinition of colors."""
import colorise
import pytest
@pytest.mark.skip_on_windows
def test_redefine_colors_error():
assert not colorise.can_redefine_colors()
with pytest.raises(colorise.error.NotSupportedError):
colorise.redefine_colors({})
| Test color redefinition on nix | Test color redefinition on nix
| Python | bsd-3-clause | MisanthropicBit/colorise | ---
+++
@@ -9,5 +9,7 @@
@pytest.mark.skip_on_windows
def test_redefine_colors_error():
+ assert not colorise.can_redefine_colors()
+
with pytest.raises(colorise.error.NotSupportedError):
colorise.redefine_colors({}) |
6d2f9bfbe1011c04e014016171d98fef1d12e840 | tests/test_samtools_python.py | tests/test_samtools_python.py | import pysam
def test_idxstats_parse():
bam_filename = "./pysam_data/ex2.bam"
lines = pysam.idxstats(bam_filename)
for line in lines:
_seqname, _seqlen, nmapped, _nunmapped = line.split()
def test_bedcov():
bam_filename = "./pysam_data/ex1.bam"
bed_filename = "./pysam_data/ex1.bed"
lin... | import pysam
def test_idxstats_parse_old_style_output():
bam_filename = "./pysam_data/ex2.bam"
lines = pysam.idxstats(bam_filename, old_style_output=True)
for line in lines:
_seqname, _seqlen, nmapped, _nunmapped = line.split()
def test_bedcov_old_style_output():
bam_filename = "./pysam_data/... | Add test for both new and old style output | Add test for both new and old style output
| Python | mit | pysam-developers/pysam,kyleabeauchamp/pysam,pysam-developers/pysam,TyberiusPrime/pysam,bioinformed/pysam,TyberiusPrime/pysam,bioinformed/pysam,TyberiusPrime/pysam,pysam-developers/pysam,bioinformed/pysam,kyleabeauchamp/pysam,TyberiusPrime/pysam,kyleabeauchamp/pysam,kyleabeauchamp/pysam,kyleabeauchamp/pysam,pysam-develo... | ---
+++
@@ -1,15 +1,34 @@
import pysam
+
+def test_idxstats_parse_old_style_output():
+ bam_filename = "./pysam_data/ex2.bam"
+ lines = pysam.idxstats(bam_filename, old_style_output=True)
+ for line in lines:
+ _seqname, _seqlen, nmapped, _nunmapped = line.split()
+
+
+def test_bedcov_old_style_outpu... |
1ff19fcd0bcbb396b7cb676c5dddf8d3c8652419 | live/components/misc.py | live/components/misc.py | from live.helpers import Timer
def timed(fun, time, next_fun=None):
"""A component that runs another component for a fixed length of time. Can optionally be given a follow-up component for chaining.
:param callable fun: The component to be run:
:param number time: The amount of time to run the component
... | from live.helpers import Timer
def timed(fun, time, next_fun=None):
"""A component that runs another component for a fixed length of time. Can optionally be given a follow-up component for chaining.
:param callable fun: The component to be run:
:param number time: The amount of time to run the component
... | Update timed_callback to support collision callbacks. | Update timed_callback to support collision callbacks.
| Python | lgpl-2.1 | GalanCM/BGELive | ---
+++
@@ -8,15 +8,20 @@
:keyword callable next_fun: A component to run after the timed component is finished
"""
timer = Timer(time)
- def timed_callback(self, id):
+ def timed_callback(self, id, *args):
nonlocal timer
if timer > 0.0:
fun(self, id)
else:
+ if len(args) == 0:
+ correct_que... |
28ac2b259d89c168f1e822fe087c66f2f618321a | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
scripts = ['sed_fit', 'sed_plot', 'sed_filter_output', 'sed_fitinfo2data', 'sed_fitinfo2ascii']
setup(name='sedfitter',
version='0.1.1',
description='SED Fitter in python',
author='Thomas Robitaille',
author_email='trobitaille@cfa.harvard... | #!/usr/bin/env python
from distutils.core import setup
scripts = ['sed_fit', 'sed_plot', 'sed_filter_output', 'sed_fitinfo2data', 'sed_fitinfo2ascii']
setup(name='sedfitter',
version='0.1.1',
description='SED Fitter in python',
author='Thomas Robitaille',
author_email='trobitaille@cfa.harvard... | Add sedfitter.source to list of sub-packages to install (otherwise results in ImportError) | Add sedfitter.source to list of sub-packages to install (otherwise results in ImportError) | Python | bsd-2-clause | astrofrog/sedfitter | ---
+++
@@ -9,6 +9,6 @@
description='SED Fitter in python',
author='Thomas Robitaille',
author_email='trobitaille@cfa.harvard.edu',
- packages=['sedfitter', 'sedfitter.convolve', 'sedfitter.filter', 'sedfitter.sed', 'sedfitter.utils'],
+ packages=['sedfitter', 'sedfitter.convolve', 'sed... |
3ef25d7105226aadebc5db46ac8c9c290d527164 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'psqlgraph',
'gdcdictionary',
'cdisutils',
'python-dateutil==2.4.2',
],
... | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'psqlgraph',
'gdcdictionary',
'cdisutils',
'python-dateutil==2.4.2',
],
... | Update dictionary to same pin as API for Horton | chore(pins): Update dictionary to same pin as API for Horton
- Update dictionary to the same pin as the API uses
| Python | apache-2.0 | NCI-GDC/gdcdatamodel,NCI-GDC/gdcdatamodel | ---
+++
@@ -20,7 +20,7 @@
dependency_links=[
'git+https://github.com/NCI-GDC/cdisutils.git@4a75cc05c7ba2174e70cca9c9ea7e93947f7a868#egg=cdisutils',
'git+https://github.com/NCI-GDC/psqlgraph.git@7b5de7d56aa3159a9526940eb273579ddbf084ca#egg=psqlgraph',
- 'git+https://github.com/NCI-GDC/gdc... |
1a12f250088d92544a277e3d683dc397687a4188 | setup.py | setup.py | #!/usr/bin/env python
# Copyright 2009-2014 Eucalyptus Systems, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by app... | #!/usr/bin/env python
# Copyright 2009-2014 Eucalyptus Systems, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by app... | Add mock as a dep | Add mock as a dep
| Python | apache-2.0 | ccassler/DeploymentManager,tbeckham/DeploymentManager,tbeckham/DeploymentManager,ccassler/DeploymentManager,tbeckham/DeploymentManager,ccassler/DeploymentManager | ---
+++
@@ -26,7 +26,7 @@
url='https://github.com/eucalyptus/DeploymentManager.git',
license='Apache License 2.0',
packages=find_packages(),
- install_requires=['paramiko', 'PrettyTable', 'eve', 'requests',
+ install_requires=['paramiko', 'PrettyTable', 'eve', 'requests', 'mock',
... |
8cbbf6b4b4b1cc87f25b2047e183dd1bfd7dc8a0 | setup.py | setup.py | #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | Remove incorrect note about global reqs | Remove incorrect note about global reqs
| Python | apache-2.0 | Frostman/SalaryZenAggregator_Old,Frostman/SalaryZenAggregator | ---
+++
@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
setuptools.setup( |
b6af395f816609801e1973b56c61dc5fc52d49d0 | setup.py | setup.py | #!/usr/bin/env python3.8
# Copyright (C) 2017-2019 Andrew Hamilton. All rights reserved.
# Licensed under the Artistic License 2.0.
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name="eris",
version="18.12",
description=("Eris maintains an up-to-da... | #!/usr/bin/env python3.8
# Copyright (C) 2017-2019 Andrew Hamilton. All rights reserved.
# Licensed under the Artistic License 2.0.
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name="eris",
version="20.04",
description=("Eris maintains an up-to-da... | Bring version number up to date. | Bring version number up to date.
| Python | artistic-2.0 | ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil | ---
+++
@@ -11,7 +11,7 @@
setup(name="eris",
- version="18.12",
+ version="20.04",
description=("Eris maintains an up-to-date set of reports for every"
" file in a codebase."),
url="https://github.com/ahamilton/eris", |
ad579b09e691811a39714f816721bba615dcc651 | setup.py | setup.py | """Utiltiy functions for workign on the NinaPro Databases (1 & 2)."""
from setuptools import setup, find_packages
setup(name='nina_helper',
version='2.1',
description='Utiltiy functions for workign on the NinaPro Databases (1 & 2)',
author='Lif3line',
author_email='adamhartwell2@gmail.com',
... | """Utiltiy functions for workign on the NinaPro Databases (1 & 2)."""
from setuptools import setup, find_packages
setup(name='nina_helper',
version='2.2',
description='Utiltiy functions for workign on the NinaPro Databases (1 & 2)',
author='Lif3line',
author_email='adamhartwell2@gmail.com',
... | Use local upload for release | Use local upload for release
| Python | mit | Lif3line/nina_helper_package_mk2 | ---
+++
@@ -4,19 +4,17 @@
setup(name='nina_helper',
- version='2.1',
+ version='2.2',
description='Utiltiy functions for workign on the NinaPro Databases (1 & 2)',
author='Lif3line',
author_email='adamhartwell2@gmail.com',
license='MIT',
packages=find_packages(),
... |
4c1ec733615b0fd21677f8b4e9a8acd9381dff53 | setup.py | setup.py | from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
# Cython extensions
sources = ["FastxIO/fastx.pyx", "FastxIO/reverse_complement.c"]
extensions = [Extension("FastxIO.fastx", sources, extra_compile_args=['-O3'])]
setup(
name = "FastxIO",
version = '0.0.0',
packages ... | from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
# Cython extensions
sources = ["FastxIO/fastx.pyx", "FastxIO/reverse_complement.c"]
extensions = [Extension("FastxIO.fastx",
sources,
extra_compile_args=['-O3'],
... | Add -lz to cython flags. | Add -lz to cython flags.
| Python | mit | mckinsel/FastxIO,mckinsel/FastxIO | ---
+++
@@ -3,7 +3,10 @@
# Cython extensions
sources = ["FastxIO/fastx.pyx", "FastxIO/reverse_complement.c"]
-extensions = [Extension("FastxIO.fastx", sources, extra_compile_args=['-O3'])]
+extensions = [Extension("FastxIO.fastx",
+ sources,
+ extra_compile_args=['-O3... |
b5523a7f3bfd67eac646ee1313bcbb6c9e069f8c | setup.py | setup.py | # Copyright 2015 UnitedStack, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | # Copyright 2015 UnitedStack, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | Make stetho agent when install stetho | Make stetho agent when install stetho
| Python | apache-2.0 | unitedstack/stetho,unitedstack/stetho,openstack/steth,openstack/steth | ---
+++
@@ -28,7 +28,8 @@
url = "https://www.ustack.com",
entry_points={
'console_scripts': [
- 'stetho = stetho.stethoclient.shell:main'
+ 'stetho = stetho.stethoclient.shell:main',
+ 'stetho-agent = stetho.agent.agent:main',
]
}
) |
c8bf52d51a5cc678160add7db937ed92aaa6bb09 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'psqlgraph',
'gdcdictionary',
'cdisutils',
'python-dateutil==2.4.2',
],
... | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'psqlgraph',
'gdcdictionary',
'cdisutils',
'python-dateutil==2.4.2',
],
... | Update to point to release/horton | chore(pins): Update to point to release/horton
- Update to point to release/horton of gdcdictionary
| Python | apache-2.0 | NCI-GDC/gdcdatamodel,NCI-GDC/gdcdatamodel | ---
+++
@@ -20,7 +20,7 @@
dependency_links=[
'git+https://github.com/NCI-GDC/cdisutils.git@4a75cc05c7ba2174e70cca9c9ea7e93947f7a868#egg=cdisutils',
'git+https://github.com/NCI-GDC/psqlgraph.git@7b5de7d56aa3159a9526940eb273579ddbf084ca#egg=psqlgraph',
- 'git+https://github.com/NCI-GDC/gdc... |
873572d6731d35647dca90b4aea4d7f26866f676 | setup.py | setup.py | from setuptools import setup
version = '0.4.2'
setup(
name='sqlalchemy-vertica-python',
version=version,
description='Vertica dialect for sqlalchemy using vertica_python',
long_description=open("README.rst").read(),
license="MIT",
url='https://github.com/LocusEnergy/sqlalchemy-vertica-python',
... | from setuptools import setup
version = '0.4.2'
setup(
name='sqlalchemy-vertica-python',
version=version,
description='Vertica dialect for sqlalchemy using vertica_python',
long_description=open("README.rst").read(),
license="MIT",
url='https://github.com/LocusEnergy/sqlalchemy-vertica-python',
... | Add optional named parameters dependencies for vertica-python | Add optional named parameters dependencies for vertica-python
This will allow to play nicely with sqlalchemy-vertica-python and safrs
Ref: https://github.com/vertica/vertica-python/pull/247 | Python | mit | LocusEnergy/sqlalchemy-vertica-python | ---
+++
@@ -19,7 +19,7 @@
vertica.vertica_python = sqla_vertica_python.vertica_python:VerticaDialect
""",
install_requires=[
- 'vertica_python'
+ 'vertica_python[namedparams]'
],
)
|
4a7221a67b23933a2e9314f3bbd2b886d7276b7d | setup.py | setup.py | #!/usr/bin/env python
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="autograd-gamma",
version="0.4.2",
description="Autograd compatible approximations to the gamma family of functions",
author="Cameron Davidson-Pilon",
author_email="c... | #!/usr/bin/env python
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="autograd-gamma",
version="0.4.2",
description="Autograd compatible approximations to the gamma family of functions",
license='MIT License',
author="Cameron Davidson-... | Add license to package metadata | Add license to package metadata | Python | mit | CamDavidsonPilon/autograd-gamma | ---
+++
@@ -9,6 +9,7 @@
name="autograd-gamma",
version="0.4.2",
description="Autograd compatible approximations to the gamma family of functions",
+ license='MIT License',
author="Cameron Davidson-Pilon",
author_email="cam.davidson.pilon@gmail.com",
url="https://github.com/CamDavidson... |
d2cc077bfce9bef654a8ef742996e5aca8858fc7 | setup.py | setup.py | from distutils.core import setup
setup(name='Pyranha',
description='Elegant IRC client',
version='0.1',
author='John Reese',
author_email='john@noswap.com',
url='https://github.com/jreese/pyranha',
classifiers=['License :: OSI Approved :: MIT License',
'Topic :: C... | from distutils.core import setup
setup(name='Pyranha',
description='Elegant IRC client',
version='0.1',
author='John Reese',
author_email='john@noswap.com',
url='https://github.com/jreese/pyranha',
classifiers=['License :: OSI Approved :: MIT License',
'Topic :: C... | Install default dotfiles with package | Install default dotfiles with package
| Python | mit | jreese/pyranha | ---
+++
@@ -12,6 +12,6 @@
],
license='MIT License',
packages=['pyranha', 'pyranha.irc'],
- package_data={'pyranha': []},
+ package_data={'pyranha': ['dotfiles/*']},
scripts=['bin/pyranha'],
) |
eb2827a94e477c64eeb67076288007326c34a2f9 | setup.py | setup.py | """setup.py"""
from codecs import open as codecs_open
from setuptools import setup
with codecs_open('README.rst', 'r', 'utf-8') as f:
__README = f.read()
with codecs_open('HISTORY.rst', 'r', 'utf-8') as f:
__HISTORY = f.read()
setup(
name='jsonrpcclient',
version='2.2.4',
description='Send JSON-R... | """setup.py"""
from codecs import open as codecs_open
from setuptools import setup
with codecs_open('README.rst', 'r', 'utf-8') as f:
__README = f.read()
with codecs_open('HISTORY.rst', 'r', 'utf-8') as f:
__HISTORY = f.read()
setup(
name='jsonrpcclient',
version='2.2.4',
description='Send JSON-R... | Add aiohttpClient plus example usage | Add aiohttpClient plus example usage
Closes #20
| Python | mit | bcb/jsonrpcclient | ---
+++
@@ -22,12 +22,14 @@
include_package_data=True,
install_requires=['future', 'jsonschema'],
extras_require={
+ 'aiohttp': ['aiohttp'],
'requests': ['requests'],
'requests_security': ['requests[security]'],
- 'zmq': ['pyzmq'],
'tornado': ['tornado'],
... |
6ca0407f1666a67478832bc72f0ac740cb699598 | setup.py | setup.py | from setuptools import setup
setup(
name='ChannelWorm',
long_description=open('README.md').read(),
install_requires=[
'cypy',
'sciunit',
'PyOpenWorm',
'PyNeuroML>=0.0.6'
],
dependency_links=[
'git+https://github.com/scidash/sciunit.git#egg=sciunit',
'... | from setuptools import setup
setup(
name='ChannelWorm',
long_description=open('README.md').read(),
install_requires=[
'cypy',
'sciunit',
'PyOpenWorm',
'PyNeuroML>=0.0.5'
],
dependency_links=[
'git+https://github.com/scidash/sciunit.git#egg=sciunit',
'... | Revert to installing PyNeuroML without version specification | Revert to installing PyNeuroML without version specification
| Python | mit | joebowen/ChannelWorm,joebowen/ChannelWorm,VahidGh/ChannelWorm,openworm/ChannelWorm,joebowen/ChannelWorm,joebowen/ChannelWormDjango,openworm/ChannelWorm,joebowen/ChannelWorm,gsarma/ChannelWorm,VahidGh/ChannelWorm,openworm/ChannelWorm,joebowen/ChannelWormDjango,joebowen/ChannelWormDjango,cheelee/ChannelWorm,gsarma/Channe... | ---
+++
@@ -7,11 +7,11 @@
'cypy',
'sciunit',
'PyOpenWorm',
- 'PyNeuroML>=0.0.6'
+ 'PyNeuroML>=0.0.5'
],
dependency_links=[
'git+https://github.com/scidash/sciunit.git#egg=sciunit',
'git+https://github.com/openworm/PyOpenWorm.git#egg=PyOpenWorm',
- ... |
2e9808561c55a729fef493b03e5bcdd13422a92c | setup.py | setup.py | """
edx-lint
========
A collection of code quality tools:
- A few pylint plugins to check for quality issues pylint misses.
- A command-line tool to generate config files like pylintrc from a master
file (part of edx_lint), and a repo-specific tweaks file.
"""
from setuptools import setup
setup(
setup_requi... | """
edx-lint
========
A collection of code quality tools:
- A few pylint plugins to check for quality issues pylint misses.
- A command-line tool to generate config files like pylintrc from a master
file (part of edx_lint), and a repo-specific tweaks file.
"""
import os
from setuptools import setup
# pbr does ... | Stop pbr from writing ChangeLog and AUTHORS | Stop pbr from writing ChangeLog and AUTHORS
| Python | apache-2.0 | edx/edx-lint | ---
+++
@@ -11,7 +11,13 @@
"""
+import os
+
from setuptools import setup
+
+# pbr does some things we don't need. Turn them off the only way pbr gives us.
+os.environ['SKIP_GENERATE_AUTHORS'] = '1'
+os.environ['SKIP_WRITE_GIT_CHANGELOG'] = '1'
setup(
setup_requires=['pbr>=1.9', 'setuptools>=17.1'], |
0b5e16ad77aebdde05dbffef78265755c779bb8b | setup.py | setup.py | from setuptools import setup, find_packages
import os
version = '0.5.1'
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'docs/HISTORY.txt')).read()
except IOError:
README = CHANGES = ''
setup(name='tgext.admin'... | from setuptools import setup, find_packages
import os
version = '0.5.1'
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'docs/HISTORY.txt')).read()
except IOError:
README = CHANGES = ''
setup(name='tgext.admin'... | Make it work with new tg Jinja quickstart | Make it work with new tg Jinja quickstart
| Python | mit | TurboGears/tgext.admin,TurboGears/tgext.admin | ---
+++
@@ -30,7 +30,7 @@
zip_safe=True,
install_requires=[
'setuptools',
- 'tgext.crud>=0.4',
+ 'tgext.crud>=0.5.1',
# -*- Extra requirements: -*-
],
entry_points=""" |
a890b8099779aaece5cb3a963c9b86bb3f8156f7 | setup.py | setup.py | from setuptools import setup, find_packages
from itertools import imap, ifilter
from os import path
from ast import parse
if __name__ == '__main__':
package_name = 'gitim'
get_vals = lambda var0, var1: imap(lambda buf: next(imap(lambda e: e.value.s, parse(buf).body)),
if... | from setuptools import setup, find_packages
try:
from itertools import imap, ifilter
except ImportError:
imap = map
ifilter = filter
from os import path
from ast import parse
if __name__ == '__main__':
package_name = 'gitim'
get_vals = lambda var0, var1: imap(lambda buf: next(imap(lambda e: e.valu... | Use native `map`, `filter` for Python 3 | Use native `map`, `filter` for Python 3
| Python | mit | muhasturk/gitim | ---
+++
@@ -1,5 +1,9 @@
from setuptools import setup, find_packages
-from itertools import imap, ifilter
+try:
+ from itertools import imap, ifilter
+except ImportError:
+ imap = map
+ ifilter = filter
from os import path
from ast import parse
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.