commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
238494a1323d82a791b244a84af64eda3d9be750 | tests/services/test_reverse_proxy.py | tests/services/test_reverse_proxy.py | from unittest.mock import Mock
from jupyterhub import orm
from remoteappmanager.services.reverse_proxy import ReverseProxy
from tornado import gen, testing
class TestReverseProxy(testing.AsyncTestCase):
@testing.gen_test
def test_reverse_proxy_operations(self):
coroutine_out = None
@gen.coro... | from unittest.mock import Mock
from jupyterhub import orm
from remoteappmanager.services.reverse_proxy import ReverseProxy
from tornado import gen, testing
class TestReverseProxy(testing.AsyncTestCase):
@testing.gen_test
def test_reverse_proxy_operations(self):
coroutine_out = None
@gen.coro... | Solve deprecation warning from Traitlets | Solve deprecation warning from Traitlets
| Python | bsd-3-clause | simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote |
dac770314da39c5494ff6c1ccd46d507ff1b2540 | tests/test_errorware.py | tests/test_errorware.py | from tg.error import ErrorReporter
def simple_app(environ, start_response):
status = '200 OK'
headers = [('Content-type', 'text/plain')]
start_response(status, headers)
return ['HELLO']
class TestErrorReporterConfig(object):
def test_disable_all(self):
app = ErrorReporter(simple_app, {})... | from tg.error import ErrorReporter
from tg.error import SlowReqsReporter
def simple_app(environ, start_response):
status = '200 OK'
headers = [('Content-type', 'text/plain')]
start_response(status, headers)
return ['HELLO']
class TestErrorReporterConfig(object):
def test_disable_all(self):
... | Add tests for slow requests reporting configuration | Add tests for slow requests reporting configuration
| Python | mit | lucius-feng/tg2,lucius-feng/tg2 |
6b9cc519deaecd093087d5190888b97b7b7eaf02 | icekit/project/settings/_production.py | icekit/project/settings/_production.py | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | Remove vestigial hard coded production settings. These should be defined in a dotenv file, now. | Remove vestigial hard coded production settings. These should be defined in a dotenv file, now.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit |
96d798685c53f4568edaaf990b0bbe8e2e10e24a | tests_tf/test_mnist_tutorial_jsma.py | tests_tf/test_mnist_tutorial_jsma.py | import unittest
class TestMNISTTutorialJSMA(unittest.TestCase):
def test_mnist_tutorial_jsma(self):
from tutorials import mnist_tutorial_jsma
# Run the MNIST tutorial on a dataset of reduced size
# and disable visualization.
jsma_tutorial_args = {'train_start': 0,
... | import unittest
class TestMNISTTutorialJSMA(unittest.TestCase):
def test_mnist_tutorial_jsma(self):
from tutorials import mnist_tutorial_jsma
# Run the MNIST tutorial on a dataset of reduced size
# and disable visualization.
jsma_tutorial_args = {'train_start': 0,
... | Update JSMA test tutorial constant | Update JSMA test tutorial constant
| Python | mit | cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,openai/cleverhans,carlini/cleverhans,cihangxie/cleverhans,cleverhans-lab/cleverhans,carlini/cleverhans,fartashf/cleverhans |
e19b11c8598fe7a7e68640638a3489c05002f968 | tests/test_supercron.py | tests/test_supercron.py | #!/usr/bin/env python
import sys
import os
import unittest
from subprocess import Popen, PIPE
ROOT_DIR = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(ROOT_DIR)
from supercron import SuperCron
class RunTests(unittest.TestCase):
"""class that tests supercron for behavior correctness"""
def setUp... | #!/usr/bin/env python
import sys
import os
import unittest
from subprocess import Popen, PIPE
ROOT_DIR = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(ROOT_DIR)
from supercron import SuperCron
class RunTests(unittest.TestCase):
"""class that tests supercron for behavior correctness"""
def setUp... | Delete the jobs in tearDown() in tests | Delete the jobs in tearDown() in tests
| Python | bsd-3-clause | linostar/SuperCron |
566fa441f3864be4f813673dbaf8ffff87d28e17 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup, Extension
elp_srcs = ['src/periodic.c', 'src/prdic_math.c', \
'src/prdic_fd.c', \
'src/prdic_pfd.c', \
'src/prdic_main_fd.c', 'src/prdic_main_pfd.c', \
'src/prdic_main.c', \
'src/prdic_recfilter.c', 'src/prdic_shmtrig.c', \
'src/prdic_sign.c']
module1 = E... | #!/usr/bin/env python
from distutils.core import setup, Extension
import os
elp_srcs = ['src/periodic.c', 'src/prdic_math.c', \
'src/prdic_fd.c', \
'src/prdic_pfd.c', \
'src/prdic_main_fd.c', 'src/prdic_main_pfd.c', \
'src/prdic_main.c', \
'src/prdic_recfilter.c', 'src/prdic_shmtrig.c', \
'src/prdic_sign.c']
m... | Add NO_PY_EXT environment variable to disable compilation of the C module, which is not working very well in cross-compile mode. | Add NO_PY_EXT environment variable to disable compilation of
the C module, which is not working very well in cross-compile
mode.
| Python | bsd-2-clause | sobomax/libelperiodic,sobomax/libelperiodic,sobomax/libelperiodic,sobomax/libelperiodic |
a6b13f81ce7e39462ec188fad998755a2b66d26c | setup.py | setup.py | #! /usr/bin/env python
from distutils.core import setup
from youtube_dl_gui import version
setup(name='Youtube-DLG',
version=version.__version__,
description='Youtube-dl GUI',
long_description='A cross platform front-end GUI of the popular youtube-dl written in wxPython.',
license='UNLICENSE',... | #! /usr/bin/env python
from distutils.core import setup
from youtube_dl_gui import version
name = 'Youtube-DLG'
desc = 'Youtube-dl GUI'
ldesc = 'A cross platform front-end GUI of the popular youtube-dl written in wxPython'
license = 'UNLICENSE'
platform = 'Cross-Platform'
author = 'Sotiris Papadopoulos'
author_email ... | Add icons on package install | Add icons on package install
| Python | unlicense | Sofronio/youtube-dl-gui,pr0d1r2/youtube-dl-gui,dstftw/youtube-dl-gui,dstftw/youtube-dl-gui,pr0d1r2/youtube-dl-gui,MrS0m30n3/youtube-dl-gui,Sofronio/youtube-dl-gui,ukazap/youtube-dl-gui,MrS0m30n3/youtube-dl-gui,ukazap/youtube-dl-gui |
e7ea098a4700c6f338fc7ef223b696aaed448629 | test/test_gn.py | test/test_gn.py | '''
GotoNewest tests
'''
import unittest
import sys
sys.path.append('../src/')
import gn
TEST_DIR = '/tmp/test'
class TestGotoNewest(unittest.TestCase):
''' Test class for GotoNewest
'''
def test_empty_base_dir(self):
''' If the base directory is empty, raise an
AttributeError
''... | '''
GotoNewest tests
'''
import unittest
import sys
sys.path.append('../src/')
import gn
TEST_DIR = '/tmp/test'
class TestGotoNewest(unittest.TestCase):
''' Test class for GotoNewest
'''
def test_empty_base_dir(self):
''' If the base directory is empty, raise an
AttributeError
''... | Add test for one subdirectory | Add test for one subdirectory
| Python | bsd-2-clause | ambidextrousTx/GotoNewest |
9e88d6eb6d6d97ea9046dbf842cdc0b5beb62b90 | src/main.py | src/main.py | import tweepy, time, random
def main():
CONSUMER_KEY = 'your_consumer_key'
CONSUMER_SECRET = 'your_consumer_secret'
ACCESS_KEY = 'your_access_key'
ACCESS_SECRET = 'your_access_secret'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
... | import tweepy, time, random
def main():
CONSUMER_KEY = 'your_consumer_key'
CONSUMER_SECRET = 'your_consumer_secret'
ACCESS_KEY = 'your_access_key'
ACCESS_SECRET = 'your_access_secret'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
... | Add better error support for answers file | Add better error support for answers file
| Python | mit | djangokillen/minion-hate-bot |
ab417052f3d41ee5b140e3044a6a925c3895d1ee | setup.py | setup.py | # -*- coding: utf-8 -*-
from distutils.core import setup
import ibei
setup(name = "ibei",
version = ibei.__version__,
author = "Joshua Ryan Smith",
author_email = "joshua.r.smith@gmail.com",
packages = ["ibei"],
url = "https://github.com/jrsmith3/ibei",
description = "Calculator for... | # -*- coding: utf-8 -*-
from distutils.core import setup
import ibei
setup(name = "ibei",
version = ibei.__version__,
author = "Joshua Ryan Smith",
author_email = "joshua.r.smith@gmail.com",
packages = ["ibei", "physicalproperty"],
url = "https://github.com/jrsmith3/ibei",
descripti... | Add 'physicalproperty' to pkg list for install | Add 'physicalproperty' to pkg list for install
| Python | mit | jrsmith3/ibei |
db76777575162aab69aec9429455f2e7d841a605 | lambdas/dynamo_to_sns/dynamo_to_sns.py | lambdas/dynamo_to_sns/dynamo_to_sns.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
"""
import json
import os
from sns_utils import publish_sns_message
def main(event, _):
print(f'Received event:\n{event}')
stream_topic_map = json.loads(os.environ["STREAM_TOPIC_MAP"])
new_image = event['Records'][0]['dynamodb']['NewImage']
topic_a... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
"""
import os
from sns_utils import publish_sns_message
def main(event, _):
print(f'Received event:\n{event}')
stream_topic_map = os.environ["STREAM_TOPIC_MAP"]
new_image = event['Records'][0]['dynamodb']['NewImage']
topic_arn = stream_topic_map[ev... | Fix loading of map from environment variables | Fix loading of map from environment variables
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api |
270c9e61646f4fe45e01b06e45dde15ea0856106 | setup.py | setup.py | from distutils.core import setup
version = __import__('shopify_auth').__version__
setup(
name = 'django-shopify-auth',
version = version,
description = 'An simple package for adding Shopify authentication to Django apps.',
long_description = open('README.md').read(),
author = 'Gavin Ballard',
... | from distutils.core import setup
version = __import__('shopify_auth').__version__
setup(
name = 'django-shopify-auth',
version = version,
description = 'An simple package for adding Shopify authentication to Django apps.',
long_description = open('README.md').read(),
author = 'Gavin Ballard',
... | Add the ShopifyAPI package as a dependency. | Add the ShopifyAPI package as a dependency. | Python | mit | discolabs/django-shopify-auth,funkybob/django-shopify-auth,discolabs/django-shopify-auth,RafaAguilar/django-shopify-auth,RafaAguilar/django-shopify-auth,funkybob/django-shopify-auth |
2adfcea14f292bacfbae906a70d6395304acf607 | addons/bestja_volunteer_pesel/models.py | addons/bestja_volunteer_pesel/models.py | # -*- coding: utf-8 -*-
from operator import mul
from openerp import models, fields, api, exceptions
class Volunteer(models.Model):
_inherit = 'res.users'
pesel = fields.Char(string=u"PESEL")
def __init__(self, pool, cr):
super(Volunteer, self).__init__(pool, cr)
self._add_permitted_fiel... | # -*- coding: utf-8 -*-
from operator import mul
from openerp import models, fields, api, exceptions
class Volunteer(models.Model):
_inherit = 'res.users'
pesel = fields.Char(string=u"PESEL")
def __init__(self, pool, cr):
super(Volunteer, self).__init__(pool, cr)
self._add_permitted_fiel... | Fix a problem with PESEL validation | Fix a problem with PESEL validation
| Python | agpl-3.0 | KrzysiekJ/bestja,ludwiktrammer/bestja,EE/bestja,ludwiktrammer/bestja,EE/bestja,EE/bestja,KrzysiekJ/bestja,ludwiktrammer/bestja,KrzysiekJ/bestja |
f6b818222d8e6eb9bb6ad3a0d8ab55513eb90673 | gui/driver.py | gui/driver.py | from __future__ import print_function, division
from sys import argv, stderr
def run_gui():
'''Start the event loop to calucate spectra interactively'''
# Import Qt functions. Do so here to handle errors better
try:
from PyQt4.QtGui import QApplication
except ImportError:
print("Cannot... | from __future__ import print_function, division
from sys import argv, stderr
def run_gui():
'''Start the event loop to calucate spectra interactively'''
# Import Qt functions. Do so here to handle errors better
try:
from PyQt4.QtGui import QApplication
except ImportError:
print("Cannot... | Raise window to focus on Mac | Raise window to focus on Mac
| Python | mit | jensengrouppsu/rapid,jensengrouppsu/rapid |
f8e800219ac2c2c76bb5ac10b2dfdac038edbb5d | circuits/tools/__init__.py | circuits/tools/__init__.py | # Module: __init__
# Date: 8th November 2008
# Author: James Mills, prologic at shortcircuit dot net dot au
"""Circuits Tools
circuits.tools contains a standard set of tools for circuits. These
tools are installed as executables with a prefix of "circuits."
"""
try:
from cStringIO import StringIO
except ImportE... | # Module: __init__
# Date: 8th November 2008
# Author: James Mills, prologic at shortcircuit dot net dot au
"""Circuits Tools
circuits.tools contains a standard set of tools for circuits. These
tools are installed as executables with a prefix of "circuits."
"""
def graph(x):
s = []
d = 0
i = 0
done... | Remove StringIO import. Use a simple list to build up the output and return .join(s) | tools: Remove StringIO import. Use a simple list to build up the output and return .join(s)
| Python | mit | treemo/circuits,eriol/circuits,eriol/circuits,treemo/circuits,treemo/circuits,nizox/circuits,eriol/circuits |
ec24e051e9d10b4cb24d135a3c08e9e9f87c6b8c | social/apps/django_app/utils.py | social/apps/django_app/utils.py | from functools import wraps
from django.conf import settings
from django.core.urlresolvers import reverse
from social.utils import setting_name, module_member
from social.strategies.utils import get_strategy
BACKENDS = settings.AUTHENTICATION_BACKENDS
STRATEGY = getattr(settings, setting_name('STRATEGY'),
... | from functools import wraps
from django.conf import settings
from django.core.urlresolvers import reverse
from social.utils import setting_name, module_member
from social.strategies.utils import get_strategy
BACKENDS = settings.AUTHENTICATION_BACKENDS
STRATEGY = getattr(settings, setting_name('STRATEGY'),
... | Allow to override strategy getter | Allow to override strategy getter
| Python | bsd-3-clause | fearlessspider/python-social-auth,MSOpenTech/python-social-auth,clef/python-social-auth,JJediny/python-social-auth,firstjob/python-social-auth,muhammad-ammar/python-social-auth,henocdz/python-social-auth,ariestiyansyah/python-social-auth,python-social-auth/social-app-django,falcon1kr/python-social-auth,lamby/python-soc... |
04f7f28ef3123452d8eb06ab1f3cbfa6dded8be4 | go_metrics/metrics/tests/test_dummy.py | go_metrics/metrics/tests/test_dummy.py | from twisted.trial.unittest import TestCase
from go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend
DummyBackend, DummyMetrics
class TestFixtures(TestCase):
def test_add(self):
fixtures = Fixtures()
fixtures.add(foo='bar', result={'baz': 'quux'})
self.assertEqual(fixture... | from twisted.trial.unittest import TestCase
from go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend
class TestFixtures(TestCase):
def test_add(self):
fixtures = Fixtures()
fixtures.add(foo='bar', result={'baz': 'quux'})
self.assertEqual(fixtures.items, [{
'fo... | Remove no longer needed references for keeping pep8 happy | Remove no longer needed references for keeping pep8 happy
| Python | bsd-3-clause | praekelt/go-metrics-api,praekelt/go-metrics-api |
823e767f52bc6e3bf78a91950e9407a1acf811d2 | tests/test_server.py | tests/test_server.py | import os
import unittest
import tempfile
# Local modules
import library.server as server
class ServerTestCase(unittest.TestCase):
@classmethod
def setUp(self):
self.db_fd, server.app.config['DATABASE'] = tempfile.mkstemp()
server.app.config['TESTING'] = True
self.app = server.app.te... | import os
import unittest
import tempfile
# Local modules
import library.server as server
class ServerTestCase(unittest.TestCase):
@classmethod
def setUp(self):
self.db_fd, server.app.config['DATABASE'] = tempfile.mkstemp()
server.app.config['TESTING'] = True
self.app = server.app.te... | Refactor test case into two classes | Refactor test case into two classes
| Python | mit | HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library,HoldYourBreath/Library |
e5d88beba41de18ebab33e0770ddd8bb5174491e | pyfr/quadrules/__init__.py | pyfr/quadrules/__init__.py | # -*- coding: utf-8 -*-
import re
from pyfr.quadrules.base import BaseQuadRule, BaseTabulatedQuadRule
from pyfr.quadrules.line import BaseLineQuadRule
from pyfr.quadrules.tri import BaseTriQuadRule
from pyfr.util import subclass_map
def get_quadrule(basecls, rule, npts):
# See if rule looks like the name of a s... | # -*- coding: utf-8 -*-
import re
from pyfr.quadrules.base import BaseQuadRule, BaseTabulatedQuadRule
from pyfr.quadrules.line import BaseLineQuadRule
from pyfr.util import subclass_map
def get_quadrule(basecls, rule, npts):
# See if rule looks like the name of a scheme
if re.match(r'[a-zA-Z0-9\-+_]+$', rul... | Fix a bug in the quadrules. | Fix a bug in the quadrules.
| Python | bsd-3-clause | tjcorona/PyFR,tjcorona/PyFR,iyer-arvind/PyFR,BrianVermeire/PyFR,tjcorona/PyFR,Aerojspark/PyFR |
010de29acb284250667b393f9e1ba7b34b53aaf5 | pygametemplate/__init__.py | pygametemplate/__init__.py | """pygametemplate module for making creating games with Pygame easier."""
from __future__ import absolute_import
__version__ = "0.2.0"
__author__ = "Andrew Dean"
from pygametemplate.game import Game
| """pygametemplate module for making creating games with Pygame easier."""
from __future__ import absolute_import
__version__ = "0.2.0"
__author__ = "Andrew Dean"
from pygametemplate.game import Game
from pygametemplate.view import View
| Add View as a first class member of pygametemplate | Add View as a first class member of pygametemplate
| Python | mit | AndyDeany/pygame-template |
c39c60de325f5ce827de423abc646bd8662c80fb | pyp2rpmlib/package_data.py | pyp2rpmlib/package_data.py | class PackageData(object):
def __init__(self, local_file, name, version):
self.local_file = local_file
self.name = name
self.version = version
class PypiData(PackageData):
def __init__(self, local_file, name, version, md5, url):
super(PackageData, self).__init__(local_file, name... | class PackageData(object):
def __init__(self, local_file, name, version):
self.local_file = local_file
self.name = name
self.version = version
def __getattr__(self, name):
if name in self.__dict__:
return self.__dict__[name]
return None
class PypiData(Packa... | Package data objects should return None for missing attributes. | Package data objects should return None for missing attributes.
| Python | mit | mcyprian/pyp2rpm,henrysher/spec4pypi,MichaelMraka/pyp2rpm,pombredanne/pyp2rpm,yuokada/pyp2rpm,fedora-python/pyp2rpm,joequant/pyp2rpm |
7f38276fddc3d94f791d29d3bcbff4bfc9d4ee98 | tests/chainer_tests/datasets_tests/test_tuple_dataset.py | tests/chainer_tests/datasets_tests/test_tuple_dataset.py | import unittest
import numpy
from chainer import cuda
from chainer import datasets
from chainer import testing
from chainer.testing import attr
class TestTupleDataset(unittest.TestCase):
def setUp(self):
self.x0 = numpy.random.rand(3, 4)
self.x1 = numpy.random.rand(3, 5)
def check_tuple_da... | import unittest
import numpy
from chainer import cuda
from chainer import datasets
from chainer import testing
from chainer.testing import attr
class TestTupleDataset(unittest.TestCase):
def setUp(self):
self.x0 = numpy.random.rand(3, 4)
self.x1 = numpy.random.rand(3, 5)
self.z0 = numpy... | Add exception test cases for TupleDataset | Add exception test cases for TupleDataset
| Python | mit | okuta/chainer,cupy/cupy,hvy/chainer,keisuke-umezawa/chainer,niboshi/chainer,anaruse/chainer,ronekko/chainer,keisuke-umezawa/chainer,jnishi/chainer,chainer/chainer,hvy/chainer,keisuke-umezawa/chainer,ktnyt/chainer,kikusu/chainer,okuta/chainer,delta2323/chainer,niboshi/chainer,niboshi/chainer,rezoo/chainer,wkentaro/chain... |
16091eebd0242782715600df9f6db9596f5797fe | tagging_autocomplete/urls.py | tagging_autocomplete/urls.py | from django.conf.urls import patterns, url
urlpatterns = patterns(
'tagging_autocomplete.views',
url(r'^list$', 'list_tags', name='tagging_autocomplete-list'),
)
| from django.conf.urls import url
urlpatterns = [
'tagging_autocomplete.views',
url(r'^list$', 'list_tags', name='tagging_autocomplete-list'),
]
| Drop the deprecated way of specifying url patterns | Drop the deprecated way of specifying url patterns | Python | mit | ludwiktrammer/django-tagging-autocomplete |
397099cc8e2628a548c66957168dfab3de7f7f59 | estudios_socioeconomicos/tests.py | estudios_socioeconomicos/tests.py | # from django.test import TestCase
# Create your tests here.
| from django.test import TestCase
from .models import Pregunta, Seccion, Subseccion
from .load import load_data
class TestLoadPreguntas(TestCase):
""" Suite to test the script to load questions.
"""
def test_load_preguntas(self):
""" Test that the script to load questions works properly.
... | Add test for loading script. | Add test for loading script.
| Python | mit | erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online |
5a764e0b91db628efd20d63d70c5ed688695f8b1 | app/routes.py | app/routes.py | from app import app
from flask import redirect, render_template
@app.route('/')
def index():
return render_template('index.html')
# default 'catch all' route
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def catch_all(path):
return redirect('/')
| from app import app
from app.models import Digit
from flask import redirect, render_template, request, jsonify
@app.route('/')
def index():
return render_template('index.html')
# api route
# parameters
#
# id: id to query, will return all otherwise
# select: one value per item in the query
# limit: limit, obvious... | Add basic functional DB /api route | Add basic functional DB /api route
| Python | mit | starcalibre/MNIST3D,starcalibre/MNIST3D,starcalibre/MNIST3D |
e6d9524d6e29077cfb805cbafd99caf2b080a1c6 | src/hyperloop/aero.py | src/hyperloop/aero.py | from openmdao.main.api import Component
from openmdao.lib.datatypes.api import Float
#put inside pod
class Aero(Component):
"""Place holder for real aerodynamic calculations of the capsule"""
#Inputs
coef_drag = Float(1, iotype="in", desc="capsule drag coefficient")
area_capsule = Float(18000, iotype... | from openmdao.main.api import Component
from openmdao.lib.datatypes.api import Float
#put inside pod
class Aero(Component):
"""Place holder for real aerodynamic calculations of the capsule"""
#Inputs
coef_drag = Float(1, iotype="in", desc="capsule drag coefficient")
area_capsule = Float(18000, iotype... | Fix velocity_capsule description and drag formula | Fix velocity_capsule description and drag formula
Drag force should be quadratically dependent on speed instead of linearly dependent. | Python | apache-2.0 | HyperloopTeam/Hyperloop,paulopperman/Hyperloop,whiplash01/Hyperloop,whiplash01/Hyperloop,UwHyperloop/Hyperloop,UwHyperloop/Hyperloop,HyperloopTeam/Hyperloop,paulopperman/Hyperloop,kishenr12/Hyperloop,kishenr12/Hyperloop |
e6cf8c244cdffa08d67a45c3a44236c3b91aab78 | examples/rmg/liquid_phase/input.py | examples/rmg/liquid_phase/input.py | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = 'default',
kineticsEstimator = 'rate rules',
)
# List of species
species(
label='octane',
reactive=True,
structur... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = 'default',
kineticsEstimator = 'rate rules',
)
# Constraints on generated species
generatedSpeciesConstraints(
maximumRad... | Update RMG example liquid_phase with multiplicity label | Update RMG example liquid_phase with multiplicity label
| Python | mit | chatelak/RMG-Py,pierrelb/RMG-Py,enochd/RMG-Py,comocheng/RMG-Py,chatelak/RMG-Py,nyee/RMG-Py,enochd/RMG-Py,nickvandewiele/RMG-Py,nyee/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,comocheng/RMG-Py |
9541fd723308d51f7c380649a81b4992074a1193 | workout_manager/urls.py | workout_manager/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('manager.urls')),
url(r'exercise/', include('exercises.urls')),
url(r'weight/', include('weight.urls')),
... | from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
admin.autodiscover()
urlpatterns = i18n_patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('manager.urls')),
url(r'exercise/', include('exercises.ur... | Append the name of the current language to the URLs | Append the name of the current language to the URLs
--HG--
branch : 1.1-dev
| Python | agpl-3.0 | DeveloperMal/wger,petervanderdoes/wger,DeveloperMal/wger,kjagoo/wger_stark,petervanderdoes/wger,wger-project/wger,kjagoo/wger_stark,rolandgeider/wger,wger-project/wger,DeveloperMal/wger,kjagoo/wger_stark,DeveloperMal/wger,petervanderdoes/wger,wger-project/wger,rolandgeider/wger,rolandgeider/wger,kjagoo/wger_stark,peter... |
cca7dee87863219b382321ba563cb48b1e58a4fb | tests/chainer_tests/functions_tests/pooling_tests/test_pooling_nd_kernel.py | tests/chainer_tests/functions_tests/pooling_tests/test_pooling_nd_kernel.py | import unittest
import mock
import chainer
from chainer.functions.pooling import pooling_nd_kernel
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'ndim': [2, 3, 4],
}))
@attr.gpu
class TestPoolingNDKernelMemo(unittest.TestCase):
def setUp(self):
... | import unittest
import mock
import chainer
from chainer.functions.pooling import pooling_nd_kernel
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'ndim': [2, 3, 4],
}))
@attr.gpu
class TestPoolingNDKernelMemo(unittest.TestCase):
def setUp(self):
... | Add comments for tests of caching. | Add comments for tests of caching.
| Python | mit | cupy/cupy,hvy/chainer,jnishi/chainer,ysekky/chainer,kashif/chainer,jnishi/chainer,delta2323/chainer,keisuke-umezawa/chainer,jnishi/chainer,niboshi/chainer,niboshi/chainer,hvy/chainer,keisuke-umezawa/chainer,okuta/chainer,wkentaro/chainer,wkentaro/chainer,tkerola/chainer,ronekko/chainer,ktnyt/chainer,chainer/chainer,kei... |
5e4c12067ee2b1d9affceaea789405422f7233a1 | ce/common.py | ce/common.py | #!/usr/bin/env python
# vim: set fileencoding=UTF-8 :
import inspect
class DynamicMethods(object):
def list_methods(self, predicate):
"""Find all transform methods within the class that satisfies the
predicate.
Returns:
A list of tuples containing method names and correspon... | #!/usr/bin/env python
# vim: set fileencoding=UTF-8 :
import inspect
class DynamicMethods(object):
def list_methods(self, predicate):
"""Find all transform methods within the class that satisfies the
predicate.
Returns:
A list of tuples containing method names and correspon... | Fix broken list_methods due to inspect behaviour | Fix broken list_methods due to inspect behaviour
| Python | mit | admk/soap |
012ab9bf79ae2f70079534ce6ab527f8e08a50f3 | doc/tutorials/python/secure-msg-template.py | doc/tutorials/python/secure-msg-template.py | async def init():
me = input('Who are you? ').strip()
wallet_name = '%s-wallet' % me
# 1. Create Wallet and Get Wallet Handle
try:
await wallet.create_wallet(pool_name, wallet_name, None, None, None)
except:
pass
wallet_handle = await wallet.open_wallet(wallet_name, None, None)
... | import asyncio
import time
import re
async def prep(wallet_handle, my_vk, their_vk, msg):
print('prepping %s' % msg)
async def init():
return None, None, None, None, None
async def read(wallet_handle, my_vk):
print('reading')
async def demo():
wallet_handle, my_did, my_vk, their_did, their_vk = awai... | Fix template that was accidentally overwritten | Fix template that was accidentally overwritten
| Python | apache-2.0 | anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,Art... |
a118e2b7133cf4391c1df41d95f9e4329a0bf5e9 | tests/__init__.py | tests/__init__.py | import logging
import unittest
import os
import shutil
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure sessio... | import logging
import unittest
import os
import shutil
from sqlalchemy import create_engine
from rtrss import config, database
logging.disable(logging.ERROR)
engine = create_engine(config.SQLALCHEMY_DATABASE_URI,
echo=False,
client_encoding='utf8')
# Reconfigure sessio... | Remove test data folder with all contents during setUp | Remove test data folder with all contents during setUp
| Python | apache-2.0 | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss |
1de254b56eba45ecdc88d26272ab1f123e734e25 | tests/test_dem.py | tests/test_dem.py | import unittest
import numpy as np
class CalculationMethodsTestCase(unittest.TestCase):
def setUp(self):
self.dem = DEMGrid()
def test_calculate_slope(self):
sx, sy = self.dem._calculate_slope()
def test_calculate_laplacian(self):
del2z = self.dem._calculate_lapalacian()
... | import unittest
import numpy as np
import filecmp
TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), 'data/big_basin.tif')
class CalculationMethodsTestCase(unittest.TestCase):
def setUp(self):
self.dem = DEMGrid(TESTDATA_FILENAME)
def test_calculate_slope(self):
... | Add test for writing spatial grid to file | Add test for writing spatial grid to file
| Python | mit | stgl/scarplet,rmsare/scarplet |
28f25bb7ca5a415bbc3ca2aabd7e290339140a9f | tests/test_dns.py | tests/test_dns.py | from .utils import TestCase, skipUnless
from dynsupdate import client
import os
class DnsTests(TestCase):
@skipUnless(os.getenv("SLOW"), "To slow")
def test_build_resolver(self):
domain = 'google-public-dns-a.google.com'
res = client.NameUpdate.build_resolver(domain)
self.assertListEq... | from .utils import TestCase, skipUnless, mock
from dynsupdate import client
import os
class DnsTests(TestCase):
@skipUnless(os.getenv("SLOW"), "To slow")
def test_build_resolver(self):
domain = 'google-public-dns-a.google.com'
res = client.NameUpdate.build_resolver(domain)
self.assert... | Add mocked test of build_resolver | Add mocked test of build_resolver
| Python | bsd-3-clause | bacher09/dynsupdate |
7653f2c6e4f72e40eefee5d70d83ceafb8bc4282 | lib/extend.py | lib/extend.py | from collections import OrderedDict
import ruamel.yaml
yaml = ruamel.yaml.YAML()
class Operation():
def __init__(self, extension):
self.extension = extension
class Merge(Operation):
def apply(self, base):
ret = base.copy()
for key, value in self.extension.items():
if key i... | from collections import OrderedDict
import ruamel.yaml
yaml = ruamel.yaml.YAML()
class Operation():
def __init__(self, extension):
self.extension = extension
class Merge(Operation):
def apply(self, base):
ret = base.copy()
for key, value in self.extension.items():
if key i... | Use context manager to read syntax file | Use context manager to read syntax file
| Python | mit | Thom1729/YAML-Macros |
616e542ee32b1ac83dd4d1977119ef670520c476 | saleor/warehouse/models.py | saleor/warehouse/models.py | import uuid
from django.db import models
from django.utils.translation import pgettext_lazy
from ..account.models import Address
from ..shipping.models import ShippingZone
class WarehouseQueryset(models.QuerySet):
def prefetch_data(self):
return self.select_related("address").prefetch_related("shipping_... | import uuid
from typing import Set
from django.db import models
from django.utils.translation import pgettext_lazy
from ..account.models import Address
from ..shipping.models import ShippingZone
class WarehouseQueryset(models.QuerySet):
def prefetch_data(self):
return self.select_related("address").pref... | Simplify getting countries associated with warehouse | Simplify getting countries associated with warehouse
| Python | bsd-3-clause | mociepka/saleor,mociepka/saleor,mociepka/saleor |
b6d9e7c24b0185d6a715adee4fc457afda6078f4 | src/waldur_core/core/migrations/0008_changeemailrequest_uuid.py | src/waldur_core/core/migrations/0008_changeemailrequest_uuid.py | from django.db import migrations
import waldur_core.core.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0007_changeemailrequest'),
]
operations = [
migrations.AddField(
model_name='changeemailrequest',
name='uuid',
field=wald... | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_changeemailrequest'),
]
operations = [
migrations.AddField(
model_name='changeemailrequest', name='uuid', field=models.UUIDField(),
),
]
| Fix UUID field migration for change email request model. | Fix UUID field migration for change email request model.
We should have been used builtin UUID field because our own field has uniqueness constraint.
| Python | mit | opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind |
a06ca6899062bab407cb4c6884d0bf148a380b1f | netsecus/task.py | netsecus/task.py | from __future__ import unicode_literals
class Task(object):
def __init__(self, number, description, maxPoints):
self.number = number
self.description = description
self.maxPoints = maxPoints
| from __future__ import unicode_literals
class Task(object):
def __init__(self, number, description, maxPoints, reachedPoints):
self.number = number
self.description = description
self.maxPoints = maxPoints
self.reachedPoints = reachedPoints
| Add a variable to hold reached points | Add a variable to hold reached points
| Python | mit | hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem |
f5bbdea74c0f8a0cc8ac4331ea8adc45c3f266c8 | converter.py | converter.py | #
# MIT License
# Copyright (c) 2017 Hampus Tågerud
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, m... | #
# MIT License
# Copyright (c) 2017 Hampus Tågerud
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, m... | Read files defined as argument | Read files defined as argument
| Python | mit | hampustagerud/colorconverter |
33e88c063fedb11211e3786a9d722a9d12f72ce8 | contrib/dn42_whoisd.py | contrib/dn42_whoisd.py | #!/bin/python
# coding: utf-8
import argparse
import asyncio
import lglass.dn42
import lglass.whois.engine
import lglass.whois.server
def create_database(db_path):
return lglass.dn42.DN42Database(db_path)
if __name__ == "__main__":
argparser = argparse.ArgumentParser(description="DN42 Whois server")
arg... | #!/bin/python
# coding: utf-8
import argparse
import asyncio
import lglass.dn42
import lglass.whois.engine
import lglass.whois.server
def create_database(db_path):
return lglass.dn42.DN42Database(db_path)
if __name__ == "__main__":
argparser = argparse.ArgumentParser(description="DN42 Whois server")
arg... | Add type hint for -DN42 | Add type hint for -DN42
| Python | mit | fritz0705/lglass |
56327baa67d5f05551bc52a1c0466e8d8b905797 | metrics.py | metrics.py | """The metrics module implements functions assessing prediction error for specific purposes."""
import numpy as np
def trapz(x, y):
"""Trapezoidal rule for integrating
the curve defined by x-y pairs.
Assume x and y are in the range [0,1]
"""
assert len(x) == len(y), 'x and y need to be of same len... | """The metrics module implements functions assessing prediction error for specific purposes."""
import numpy as np
def trapz(x, y):
"""Trapezoidal rule for integrating
the curve defined by x-y pairs.
Assume x and y are in the range [0,1]
"""
assert len(x) == len(y), 'x and y need to be of same le... | Add the missing 'np.' before 'array' | Add the missing 'np.' before 'array'
| Python | mit | ceshine/isml15-wed |
222628c6747bdc3574bcb7cf6257c785ffa6451d | inventory_control/database/sql.py | inventory_control/database/sql.py | """
So this is where all the SQL commands live
"""
CREATE_SQL = """
CREATE TABLE component_type (
id INT PRIMARY KEY AUTO_INCREMENT,
type VARCHAR(255) UNIQUE
);
CREATE TABLE components (
id INT PRIMARY KEY AUTO_INCREMENT,
sku TEXT,
type INT,
status INT,
FOREIGN KEY (type) REFERENCES compo... | """
So this is where all the SQL commands live
"""
CREATE_SQL = """
CREATE TABLE component_type (
id INT PRIMARY KEY AUTO_INCREMENT,
type VARCHAR(255) UNIQUE
);
CREATE TABLE components (
id INT PRIMARY KEY AUTO_INCREMENT,
serial_number VARCHAR(255),
sku TEXT,
type INT,
status INT,
FOR... | Add product_number and serial_number identifiers | Add product_number and serial_number identifiers
| Python | mit | worldcomputerxchange/inventory-control,codeforsanjose/inventory-control |
4a4a3eed7b959e342e3ff00dfc28f116158839d6 | tests/test_result.py | tests/test_result.py | import unittest
from performance_testing.result import Result, File
import os
import shutil
class ResultTestCase(unittest.TestCase):
def setUp(self):
self.current_directory = os.path.dirname(os.path.abspath(__file__))
self.result_directory = os.path.join(self.current_directory, 'assets/test_result... | import unittest
from performance_testing.result import Result, File
import os
import shutil
class ResultTestCase(unittest.TestCase):
def setUp(self):
self.current_directory = os.path.dirname(os.path.abspath(__file__))
self.result_directory = os.path.join(self.current_directory, 'assets/test_result... | Split up tests for Result and File | Split up tests for Result and File
| Python | mit | BakeCode/performance-testing,BakeCode/performance-testing |
a2997b5f76c658ba8ddd933275aa6f37c1bedc50 | promgen/util.py | promgen/util.py | # Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
import requests.sessions
from promgen.version import __version__
def post(url, **kwargs):
with requests.sessions.Session() as session:
session.headers['User-Agent'] = 'promgen/{}'.format(__... | # Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
import requests.sessions
from promgen.version import __version__
def post(url, *args, **kwargs):
with requests.sessions.Session() as session:
session.headers['User-Agent'] = 'promgen/{}'.fo... | Make sure we pass *args to the requests session object | Make sure we pass *args to the requests session object
| Python | mit | kfdm/promgen,kfdm/promgen,kfdm/promgen,kfdm/promgen |
aaf0d25cae834222f14303f33ab126be7ae29142 | pambox/intelligibility_models/__init__.py | pambox/intelligibility_models/__init__.py | import sepsm
import sii
| """
The :mod:`pambox.intelligibility_modesl` module gather speech intelligibility
models.
"""
from .mrsepsm import MrSepsm
from .sepsm import Sepsm
from .sii import Sii
__all__ = ['Sepsm',
'MrSepsm',
'Sii']
| Define __all__ in intelligibility_models package | Define __all__ in intelligibility_models package
Define to import all intelligibility models available if one imports
with *. Also, allows to import the models directly from
intelligibility_models, rather than having to import the modules.
| Python | bsd-3-clause | achabotl/pambox |
e90cc22226189b8950957cbf8637e49ee7798c4b | django_token/middleware.py | django_token/middleware.py | from django.http import HttpResponseBadRequest
from django.contrib import auth
class TokenMiddleware(object):
"""
Middleware that authenticates against a token in the http authorization header.
"""
def process_request(self, request):
auth_header = request.META.get('HTTP_AUTHORIZATIO... | from django.http import HttpResponseBadRequest
from django.contrib import auth
class TokenMiddleware(object):
"""
Middleware that authenticates against a token in the http authorization header.
"""
def process_request(self, request):
auth_header = request.META.get('HTTP_AUTHORIZATIO... | Use partition instead of split. | Use partition instead of split.
| Python | mit | jasonbeverage/django-token |
721be562a175227fa496789e9ce642416c5993b7 | enactiveagents/controller/controller.py | enactiveagents/controller/controller.py | """
Main world controller.
"""
from appstate import AppState
import pygame
import events
class Controller(events.EventListener):
"""
Controller class.
"""
def __init__(self):
pass
def _quit(self):
"""
Gracefully quit the simulator.
"""
quitEvent = events... | """
Main world controller.
"""
from appstate import AppState
import pygame
import events
class Controller(events.EventListener):
"""
Controller class.
"""
def __init__(self):
pass
def _quit(self):
"""
Gracefully quit the simulator.
"""
quitEvent = events... | Fix bug crashing the experiment on a non-recognized keypress. | Fix bug crashing the experiment on a non-recognized keypress.
| Python | mit | Beskhue/enactive-agents,Beskhue/enactive-agents,Beskhue/enactive-agents |
53acdb65defa43db67f11a5c5a41c1353e9498f7 | tests/test__utils.py | tests/test__utils.py | # -*- coding: utf-8 -*-
| # -*- coding: utf-8 -*-
import pytest
import numpy as np
import dask.array as da
import dask.array.utils as dau
import dask_ndfourier._utils
@pytest.mark.parametrize(
"a, s, n, axis", [
(da.ones((3, 4), chunks=(3, 4)), da.ones((2,), chunks=(2,)), -1, -1),
]
)
def test_norm_args(a, s, n, axis):
... | Test that `s` as a Dask Array is preserved | Test that `s` as a Dask Array is preserved
Ensure that if `s` is a Dask Array, it will still be a Dask Array after
type normalization is done on the input arguments of the Fourier
filters. This allows Fourier filters to construct a computation around
an unknown `s` in addition to an unknown input array.
| Python | bsd-3-clause | dask-image/dask-ndfourier |
a13829a0c2b95773832e68e6f0a1dc661a288ec4 | tests/test_action.py | tests/test_action.py | import unittest
from unittest import mock
from action import PrintAction
@mock.patch("builtins.print")
class PrintActionTest(unittest.TestCase):
def test_executing_action_prints_message(self, mock_print):
action = PrintAction()
action.execute("GOOG > $10")
mock_print.assert_called_with("G... | import smtplib
import unittest
from unittest import mock
from action import PrintAction, EmailAction
@mock.patch("builtins.print")
class PrintActionTest(unittest.TestCase):
def test_executing_action_prints_message(self, mock_print):
action = PrintAction()
action.execute("GOOG > $10")
mock... | Add EmailActionTest class and as well as a test to check if email is sent to the right server. | Add EmailActionTest class and as well as a test to check if email is sent to the right server.
| Python | mit | bsmukasa/stock_alerter |
ef27b615702d9ce84db9087898c1f66286e66cf2 | PRESUBMIT.py | PRESUBMIT.py | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit... | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | Fix the license header regex. | Fix the license header regex.
Most of the files are attributed to Google Inc so I used this instead of
Chromium Authors.
R=mark@chromium.org
BUG=
TEST=
Review URL: http://codereview.chromium.org/7108074
| Python | bsd-3-clause | csulmone/gyp,csulmone/gyp,csulmone/gyp,csulmone/gyp |
0819957eda318205e17591dccd81482701eab25c | tests/test_sqlite.py | tests/test_sqlite.py | # This is an example test settings file for use with the Django test suite.
#
# The 'sqlite3' backend requires only the ENGINE setting (an in-
# memory database will be used). All other backends will require a
# NAME and potentially authentication information. See the
# following section in the docs for more informatio... | # This is an example test settings file for use with the Django test suite.
#
# The 'sqlite3' backend requires only the ENGINE setting (an in-
# memory database will be used). All other backends will require a
# NAME and potentially authentication information. See the
# following section in the docs for more informatio... | Use faster password hasher in sqlite tests | Use faster password hasher in sqlite tests
Fixed #18163
| Python | bsd-3-clause | dbaxa/django,gunchleoc/django,varunnaganathan/django,yamila-moreno/django,dracos/django,savoirfairelinux/django,crazy-canux/django,mattseymour/django,charettes/django,MatthewWilkes/django,dsanders11/django,ccn-2m/django,beck/django,dgladkov/django,litchfield/django,MounirMesselmeni/django,jyotsna1820/django,ojake/djang... |
43b8e4de31d0659561ffedfeb0ab4a42f035eade | dev/test_all.py | dev/test_all.py | # Copyright 2021 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | # Copyright 2021 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | Exclude chamber workflow from targets tested by j2 testall | Exclude chamber workflow from targets tested by j2 testall
PiperOrigin-RevId: 384424406
| Python | apache-2.0 | google/j2cl,google/j2cl,google/j2cl,google/j2cl,google/j2cl |
a3c3c5f4cbbea80aada1358ca52c698cf13136cc | unittests/test_xmp.py | unittests/test_xmp.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import evaluates_to
from blister.xmp import XMP
class XMPTest (unittest.TestCase):
... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest import *
import unittest
from .hamcrest import evaluates_to
from blister.xmp import XMP
class XMPTest (unittest.TestCase):
... | Move XMP init into setUp() | Move XMP init into setUp()
| Python | bsd-3-clause | daaang/blister |
c5cf8df78106e15a81f976f99d26d361b036318a | indra/tools/reading/run_drum_reading.py | indra/tools/reading/run_drum_reading.py | import sys
import json
from indra.sources.trips.drum_reader import DrumReader
from indra.sources.trips import process_xml
def read_content(content):
sentences = []
for k, v in content.items():
sentences += v
dr = DrumReader(to_read=sentences)
try:
dr.start()
except SystemExit:
... | import sys
import json
import time
import pickle
from indra.sources.trips import process_xml
from indra.sources.trips.drum_reader import DrumReader
def set_pmid(statements, pmid):
for stmt in statements:
for evidence in stmt.evidence:
evidence.pmid = pmid
def read_content(content, host):
... | Improve batch Drum reading implementation | Improve batch Drum reading implementation
| Python | bsd-2-clause | bgyori/indra,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra,bgyori/indra,sorgerlab/indra,sorgerlab/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,pvtodorov/indra,bgyori/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/indra |
9942b7b6e550ec6f76def44a7470f747c47b13a8 | utils/00-cinspect.py | utils/00-cinspect.py | """ A startup script for IPython to patch it to 'inspect' using cinspect. """
# Place this file in ~/.ipython/<PROFILE_DIR>/startup to patch your IPython to
# use cinspect for the code inspection.
import inspect
from cinspect import getsource, getfile
import IPython.core.oinspect as OI
from IPython.utils.py3compat ... | """ A startup script for IPython to patch it to 'inspect' using cinspect. """
# Place this file in ~/.ipython/<PROFILE_DIR>/startup to patch your IPython to
# use cinspect for the code inspection.
import inspect
from cinspect import getsource, getfile
import IPython.core.oinspect as OI
from IPython.utils.py3compat ... | Patch the colorized formatter to not break for C modules. | Patch the colorized formatter to not break for C modules.
| Python | bsd-3-clause | punchagan/cinspect,punchagan/cinspect |
886539f4bd3d67938f90b6500ee625db470284a2 | UM/View/CompositePass.py | UM/View/CompositePass.py | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Resources import Resources
from UM.View.RenderPass import RenderPass
from UM.View.GL.OpenGL import OpenGL
class CompositePass(RenderPass):
def __init__(self, name, width, height):
super().__init__(name... | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Application import Application
from UM.Resources import Resources
from UM.Math.Matrix import Matrix
from UM.View.RenderPass import RenderPass
from UM.View.GL.OpenGL import OpenGL
class CompositePass(RenderPass):
... | Make basic composite pass work | Make basic composite pass work
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium |
a2e4e8593ec4c09d504b74544b134d27d1428ce3 | emma2/msm/flux/__init__.py | emma2/msm/flux/__init__.py | from .api import *
| r"""
===================================================================
flux - Reactive flux an transition pathways (:mod:`emma2.msm.flux`)
===================================================================
.. currentmodule:: emma2.msm.flux
This module contains functions to compute reactive flux networks and
find ... | Include flux package in doc | [msm/flux] Include flux package in doc
| Python | bsd-2-clause | arokem/PyEMMA,trendelkampschroer/PyEMMA,trendelkampschroer/PyEMMA,arokem/PyEMMA |
5ae5c27f69cdfb1c53ada0a2aa90d76c4d3ce421 | memcached.py | memcached.py | #!/usr/bin/env python
#
# igcollect - Memcached
#
# Copyright (c) 2016, InnoGames GmbH
#
import telnetlib
import sys
import socket
import time
def main(host='127.0.0.1', port='11211'):
hostname = socket.gethostname().replace('.', '_')
ts = str(int(time.time()))
template = 'servers.' + hostname + '.softwa... | #!/usr/bin/env python
#
# igcollect - Memcached
#
# Copyright (c) 2016, InnoGames GmbH
#
import telnetlib
import sys
import socket
import time
import re
def main(host='127.0.0.1', port='11211'):
hostname = socket.gethostname().replace('.', '_')
ts = str(int(time.time()))
template = 'servers.' + hostname ... | Use regexp for checking the line | Use regexp for checking the line
| Python | mit | innogames/igcollect |
9a791b9c5e79011edaa2a9d2f25bf92e0bf17543 | client/libsinan/version_check_handler.py | client/libsinan/version_check_handler.py | import libsinan
from libsinan import handler, output, jsax
class VersionCheckTaskHandler(output.SimpleTaskHandler):
def object_end(self):
""" We only get one object per right now so
lets print it out when we get it """
if self.task == "version":
if self.event_type == 'info':... | import libsinan
from libsinan import handler, output, jsax
class VersionCheckTaskHandler(output.SimpleTaskHandler):
def __init__(self):
output.SimpleTaskHandler.__init__(self)
self.version = None
def object_end(self):
""" We only get one object per right now so
lets print it ... | Make sure version is initialized | Make sure version is initialized
| Python | mit | erlware-deprecated/sinan,erlware-deprecated/sinan,ericbmerritt/sinan,ericbmerritt/sinan,erlware-deprecated/sinan,ericbmerritt/sinan |
5abe9a29ae586907304649fe6682e3e8997da310 | app/views.py | app/views.py | from index import app
from flask import render_template, request
from config import BASE_URL
from query import get_callout, get_billboard
SHEET_ID = 'tzE2PsqJoWRpENlMr-ZlS8A'
#SHEET_ID = 'tIk5itVcfOHUmakkmpjCcxw' # Demo sheet
#@app.route('/')
#def index():
# page_url = BASE_URL + request.path
# page_title = '... | from index import app
from flask import render_template, request
from config import BASE_URL
from query import get_callout, get_billboard
SHEET_ID = 'tzE2PsqJoWRpENlMr-ZlS8A'
#SHEET_ID = 'tIk5itVcfOHUmakkmpjCcxw' # Demo sheet
@app.route('/')
def index():
page_url = BASE_URL + request.path
page_title = 'Audi... | Update stream name to Replay | Update stream name to Replay
| Python | apache-2.0 | vprnet/audio-player,vprnet/audio-player,vprnet/audio-player |
738b0e1344572d000f51e862000fb719c7035c2c | st2reactor/st2reactor/cmd/rulesengine.py | st2reactor/st2reactor/cmd/rulesengine.py | import os
from oslo.config import cfg
from st2common import log as logging
from st2common.models.db import db_setup
from st2common.models.db import db_teardown
from st2common.constants.logging import DEFAULT_LOGGING_CONF_PATH
from st2reactor.rules import config
from st2reactor.rules import worker
LOG = logging.getLo... | import os
import sys
from oslo.config import cfg
from st2common import log as logging
from st2common.models.db import db_setup
from st2common.models.db import db_teardown
from st2common.constants.logging import DEFAULT_LOGGING_CONF_PATH
from st2reactor.rules import config
from st2reactor.rules import worker
LOG = lo... | Fix rules engine version reporting. | Fix rules engine version reporting.
| Python | apache-2.0 | Itxaka/st2,punalpatel/st2,grengojbo/st2,grengojbo/st2,jtopjian/st2,nzlosh/st2,lakshmi-kannan/st2,peak6/st2,jtopjian/st2,peak6/st2,alfasin/st2,jtopjian/st2,Itxaka/st2,Itxaka/st2,pinterb/st2,StackStorm/st2,punalpatel/st2,tonybaloney/st2,punalpatel/st2,pixelrebel/st2,StackStorm/st2,pixelrebel/st2,lakshmi-kannan/st2,StackS... |
77b5680794a7a60dedf687f4a199e48121f96955 | tests/performance/benchmark_aggregator.py | tests/performance/benchmark_aggregator.py | """
Performance tests for the agent/dogstatsd metrics aggregator.
"""
from aggregator import MetricsAggregator
class TestAggregatorPerf(object):
def test_aggregation_performance(self):
ma = MetricsAggregator('my.host')
flush_count = 10
loops_per_flush = 10000
metric_count = 5... | """
Performance tests for the agent/dogstatsd metrics aggregator.
"""
from aggregator import MetricsAggregator
class TestAggregatorPerf(object):
def test_aggregation_performance(self):
ma = MetricsAggregator('my.host')
flush_count = 10
loops_per_flush = 10000
metric_count = 5... | Add sets + a float value to the benchmark. | Add sets + a float value to the benchmark.
| Python | bsd-3-clause | yuecong/dd-agent,darron/dd-agent,oneandoneis2/dd-agent,AniruddhaSAtre/dd-agent,packetloop/dd-agent,remh/dd-agent,guruxu/dd-agent,jyogi/purvar-agent,relateiq/dd-agent,JohnLZeller/dd-agent,citrusleaf/dd-agent,lookout/dd-agent,citrusleaf/dd-agent,zendesk/dd-agent,zendesk/dd-agent,JohnLZeller/dd-agent,oneandoneis2/dd-agent... |
c9d1a3ad2c3c64f49ec83cf8d09cc6d35915990c | airtravel.py | airtravel.py | """Model for aircraft flights"""
class Flight:
def __init__(self, number):
if not number[:4].isalpha():
raise ValueError("No airline code in '{}'".format(number))
if not number[:4].isupper():
raise ValueError("Invalid airline code'{}'".format(number))
if not (numb... | """Model for aircraft flights"""
class Flight:
"""A flight with a specific passenger aircraft."""
def __init__(self, number, aircraft):
if not number[:4].isalpha():
raise ValueError("No airline code in '{}'".format(number))
if not number[:4].isupper():
raise ValueErro... | Add aircraft and seating arrangement to Flight | Add aircraft and seating arrangement to Flight
| Python | mit | kentoj/python-fundamentals |
adcb7af597c77d85eb9234d91e2c0bd8575630e1 | fcm_django/api/__init__.py | fcm_django/api/__init__.py | from django.conf import settings
if "tastypie" in settings.INSTALLED_APPS:
# Tastypie resources are importable from the api package level (backwards compatibility)
from .tastypie import APNSDeviceResource, GCMDeviceResource, WNSDeviceResource, APNSDeviceAuthenticatedResource, \
GCMDeviceAuthenticatedResource, WNSD... | from django.conf import settings
if "tastypie" in settings.INSTALLED_APPS:
# Tastypie resources are importable from the api package level (backwards compatibility)
from .tastypie import APNSDeviceAuthenticatedResource, FCMDeviceResource
__all__ = [
"APNSDeviceAuthenticatedResource",
"FCMDeviceResource",
]
| Remove references to old resources | Remove references to old resources
| Python | mit | xtrinch/fcm-django |
0e5b2af3fe04bd12b95b15215db0416b79c25df6 | fake_useragent/fake.py | fake_useragent/fake.py | import os
import random
try:
import json
except ImportError:
import simplejson as json
from fake_useragent import settings
from fake_useragent.build import build_db
class UserAgent(object):
def __init__(self):
super(UserAgent, self).__init__()
# check db json file exists
if not os... | import os
import random
try:
import json
except ImportError:
import simplejson as json
from fake_useragent import settings
from fake_useragent.build import build_db
class UserAgent(object):
def __init__(self):
super(UserAgent, self).__init__()
# check db json file exists
if not os... | Fix non existing useragents shortcut | Fix non existing useragents shortcut
| Python | apache-2.0 | sebalas/fake-useragent,hellysmile/fake-useragent,hellysmile/fake-useragent,hellysmile/fake-useragent,mochawich/fake-useragent |
13dc6443500d09432c6410b766c5c6eda05fdf7a | froide/publicbody/forms.py | froide/publicbody/forms.py | from django import forms
from django.utils.translation import ugettext_lazy as _
from froide.helper.form_utils import JSONMixin
from .models import PublicBody
from .widgets import PublicBodySelect
class PublicBodyForm(JSONMixin, forms.Form):
publicbody = forms.ModelChoiceField(
queryset=PublicBody.o... | from django import forms
from django.utils.translation import ugettext_lazy as _
from froide.helper.form_utils import JSONMixin
from .models import PublicBody
from .widgets import PublicBodySelect
class PublicBodyForm(JSONMixin, forms.Form):
publicbody = forms.ModelChoiceField(
queryset=PublicBody.o... | Add as_data to multiple publicbody form | Add as_data to multiple publicbody form | Python | mit | stefanw/froide,fin/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide |
96cbe6cd5b1d86663fe44c7fb4351fdb9bf7b2eb | metafunctions/map.py | metafunctions/map.py | import typing as tp
import itertools
from metafunctions.concurrent import FunctionMerge
from metafunctions.operators import concat
class MergeMap(FunctionMerge):
def __init__(self, function:tp.Callable, merge_function:tp.Callable=concat):
super().__init__(merge_function, (function, ))
def _get_call_... | import typing as tp
import itertools
from metafunctions.concurrent import FunctionMerge
from metafunctions.operators import concat
class MergeMap(FunctionMerge):
def __init__(self, function:tp.Callable, merge_function:tp.Callable=concat):
'''
MergeMap is a FunctionMerge with only one function. Wh... | Add a docstring for MergeMap | Add a docstring for MergeMap
| Python | mit | ForeverWintr/metafunctions |
c465b1f0c995ac2cb7c6c8b4ad5f721f800e2864 | argparams.py | argparams.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ARG parameters class
"""
from __future__ import print_function, division
class ARGparams(object):
"""Class for ARG model parameters.
Attributes
----------
scale : float
rho : float
delta : float
Methods
-------
convert_to_theta
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ARG parameters class
"""
from __future__ import print_function, division
class ARGparams(object):
"""Class for ARG model parameters.
Attributes
----------
scale : float
rho : float
delta : float
beta : float
theta : list
Raises
... | Fix incorrect attributes in ARGparams class | Fix incorrect attributes in ARGparams class
| Python | mit | khrapovs/argamma |
c2598058722531662aab8831640fc367689d2a43 | tests/utils/test_process_word_vectors.py | tests/utils/test_process_word_vectors.py | import inspect
import os
import pytest
import numpy as np
from subprocess import call
from utils.preprocess_text_word_vectors import txtvec2npy
def test_text_word2vec2npy():
# check whether files are present in folder
vectors_name = 'wiki.fiu_vro.vec'
path = os.path.dirname(inspect.getfile(inspect.current... | import inspect
import os
import pytest
import numpy as np
from subprocess import call
from utils.preprocess_text_word_vectors import txtvec2npy
def test_text_word2vec2npy():
# check whether files are present in folder
vectors_name = 'wiki.fiu_vro.vec'
path = os.path.dirname(inspect.getfile(inspect.current... | Update Fasttext pretrained vectors location | Update Fasttext pretrained vectors location
| Python | mit | lvapeab/nmt-keras,lvapeab/nmt-keras |
bca338a0f945e74c97b4d7dd044090ed3b3f5b11 | aspen/tests/test_restarter.py | aspen/tests/test_restarter.py | from aspen import restarter
from aspen.tests.fsfix import attach_teardown
class Foo:
pass
def test_startup_basically_works():
website = Foo()
website.changes_kill = True
website.dotaspen = 'bar'
website.root = 'foo'
restarter.startup(website)
expected = []
actual = restarter.extras
... | from aspen.cli import restarter
from aspen.tests.fsfix import attach_teardown
class Foo:
pass
def test_startup_basically_works():
website = Foo()
website.changes_kill = True
website.dotaspen = 'bar'
website.root = 'foo'
restarter.install(website)
expected = []
actual = restarter.extras... | Fix up test for recent changes to restarter. | Fix up test for recent changes to restarter.
| Python | mit | gratipay/aspen.py,gratipay/aspen.py |
dd39c73f9044815e82fa950f605b4b929d4f17f5 | assistscraper/lxml_helpers.py | assistscraper/lxml_helpers.py | from lxml import html
def document(resource_name):
return html.parse("http://www.assist.org/web-assist/" + resource_name)
# TODO: catch IndexErrors in callers
def find_by_name(tag, name, *, parent):
return parent.xpath('//{tag}[@name="{name}"]'.format(tag=tag,
... | from lxml import html
def document(resource_name):
return html.parse("http://www.assist.org/web-assist/" + resource_name)
def find_by_name(tag, name, *, parent):
return parent.find('.//{tag}[@name="{name}"]'.format(tag=tag, name=name))
def find_select(name, *, parent):
return find_by_name("select", na... | Return None instead of IndexError when there is no match! | Return None instead of IndexError when there is no match!
| Python | mit | karinassuni/assistscraper |
68f68a7c29dd49a9306445d02f5a7050aa84259e | openacademy/model/openacademy_course.py | openacademy/model/openacademy_course.py | from openerp import models, fields, api
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string ='Title', required=True) # Field reserved to identified name rec
... | from openerp import models, fields, api
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string ='Title', required=True) # Field reserved to identified name rec
... | Modify copy method into inherit | [REF] openacademy: Modify copy method into inherit
| Python | apache-2.0 | KarenKawaii/openacademy-project |
6b5e0249374f1adc7e6eafb2e050cd6a2f03d1c9 | examples/create_repository.py | examples/create_repository.py | from pyolite import Pyolite
# initial olite object
admin_repository = '~/presslabs/ansible-playbooks/gitolite-admin'
olite = Pyolite(admin_repository=admin_repository)
# create a repo
repo = olite.repos.get_or_create('awesome_name')
repo = olite.repos.get('awesome_name')
repo = olite.repos.create('awesome_name')
# a... | from pyolite import Pyolite
# initial olite object
admin_repository = '~/presslabs/ansible-playbooks/gitolite-admin'
olite = Pyolite(admin_repository=admin_repository)
# create a repo
repo = olite.repos.get_or_create('awesome_name')
repo = olite.repos.get('awesome_name')
repo = olite.repos.create('awesome_name')
# a... | Change the api a little bit | Change the api a little bit
| Python | bsd-2-clause | shawkinsl/pyolite,PressLabs/pyolite |
840dce03718947498e72e561e7ddca22c4174915 | django_olcc/olcc/context_processors.py | django_olcc/olcc/context_processors.py | from olcc.models import ImportRecord
"""
Inject the last import date into the request context.
"""
def last_updated(request):
record = ImportRecord.objects.latest()
if record:
return {
'last_updated': record.created_at
}
| from olcc.models import ImportRecord
"""
Inject the last import date into the request context.
"""
def last_updated(request):
try:
return {
'last_updated': ImportRecord.objects.latest().created_at
}
except ImportRecord.DoesNotExist:
pass
| Fix a DoesNotExist bug in the olcc context processor. | Fix a DoesNotExist bug in the olcc context processor.
| Python | mit | twaddington/django-olcc,twaddington/django-olcc,twaddington/django-olcc |
dfce2472c81c84a6e73315f288c41683ede92363 | pydarkstar/auction/auctionbase.py | pydarkstar/auction/auctionbase.py | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, rollback=True, fail=False, *a... | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
import contextlib
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, rollback=Tr... | Add session and scoped session to AuctionBase. | Add session and scoped session to AuctionBase.
| Python | mit | AdamGagorik/pydarkstar,LegionXI/pydarkstar |
466b8a8fb2bdf7ca8f74316fac3e483c3ba763b5 | net/data/websocket/protocol-test_wsh.py | net/data/websocket/protocol-test_wsh.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if len(r) == 1:
... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if len(r) == 1:
... | Make Pepper WebSocket UtilityGetProtocol test less flaky by making the wsh wait for close | Make Pepper WebSocket UtilityGetProtocol test less flaky by making the wsh wait for close
Attempt to fix the flakiness by making sure the server handler doesn't exit
before the client closes.
BUG=389084
R=jgraettinger,yhirano
Review URL: https://codereview.chromium.org/410383003
git-svn-id: de016e52bd170d2d4f2344f9... | Python | bsd-3-clause | TheTypoMaster/chromium-crosswalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswal... |
cd13ddd24df33e3a34cd5fc71c3ad0b352952f8b | police_api/exceptions.py | police_api/exceptions.py | from requests.exceptions import HTTPError
class BaseException(Exception):
pass
class APIError(BaseException, HTTPError):
"""
The API responded with a non-200 status code.
"""
def __init__(self, http_error):
self.message = getattr(http_error, 'message', None)
self.response = geta... | from requests.exceptions import HTTPError
class BaseException(Exception):
pass
class APIError(BaseException, HTTPError):
"""
The API responded with a non-200 status code.
"""
def __init__(self, http_error):
self.message = getattr(http_error, 'message', None)
self.response = geta... | Add __str__ to APIError exception | Add __str__ to APIError exception
| Python | mit | rkhleics/police-api-client-python |
f525d04e978c35132db6ff77f455cf22b486482f | mod/httpserver.py | mod/httpserver.py | """wrap SimpleHTTPServer and prevent Ctrl-C stack trace output"""
import SimpleHTTPServer
import SocketServer
import log
try :
log.colored(log.GREEN, 'serving on http://localhost:8000 (Ctrl-C to quit)')
httpd = SocketServer.TCPServer(('localhost', 8000), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.s... | """wrap SimpleHTTPServer and prevent Ctrl-C stack trace output"""
import SimpleHTTPServer
import SocketServer
import log
try :
log.colored(log.GREEN, 'serving on http://localhost:8000 (Ctrl-C to quit)')
SocketServer.TCPServer.allow_reuse_address = True
httpd = SocketServer.TCPServer(('localhost', 8000), ... | Allow resuse-addr at http server start | Allow resuse-addr at http server start
| Python | mit | floooh/fips,floooh/fips,michaKFromParis/fips,floooh/fips,michaKFromParis/fips,anthraxx/fips,mgerhardy/fips,anthraxx/fips,mgerhardy/fips,code-disaster/fips,code-disaster/fips |
ad6670874f37c52f4a15f30e1ab2682bd81f40f8 | python/helpers/profiler/yappi_profiler.py | python/helpers/profiler/yappi_profiler.py | import yappi
class YappiProfile(object):
""" Wrapper class that represents Yappi profiling backend with API matching
the cProfile.
"""
def __init__(self):
self.stats = None
def runcall(self, func, *args, **kw):
self.enable()
try:
return func(*args, **kw)
... | import yappi
class YappiProfile(object):
""" Wrapper class that represents Yappi profiling backend with API matching
the cProfile.
"""
def __init__(self):
self.stats = None
def runcall(self, func, *args, **kw):
self.enable()
try:
return func(*args, **kw)
... | Fix 2nd and more capturing snapshot (PY-15823). | Fix 2nd and more capturing snapshot (PY-15823).
| Python | apache-2.0 | adedayo/intellij-community,muntasirsyed/intellij-community,da1z/intellij-community,vvv1559/intellij-community,vvv1559/intellij-community,diorcety/intellij-community,da1z/intellij-community,asedunov/intellij-community,akosyakov/intellij-community,fitermay/intellij-community,orekyuu/intellij-community,ThiagoGarciaAlves/i... |
9c762d01b6dafd48d227c0ef927b844a257ff1b9 | joommf/energies/test_demag.py | joommf/energies/test_demag.py | from demag import Demag
def test_demag_mif():
demag = Demag()
mif_string = demag.get_mif()
assert 'Specify Oxs_Demag {}' in mif_string
def test_demag_formatting():
demag = Demag()
mif_string = demag.get_mif()
assert mif_string[0] == 'S'
assert mif_string[-1] == '\n'
assert mif_string... | from demag import Demag
def test_demag_mif():
demag = Demag()
mif_string = demag.get_mif()
assert 'Specify Oxs_Demag {}' in mif_string
assert demag.__repr__() == "This is the energy class of type Demag"
def test_demag_formatting():
demag = Demag()
mif_string = demag.get_mif()
assert mif_s... | Increase test coverage for energy classes | Increase test coverage for energy classes
| Python | bsd-2-clause | ryanpepper/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python |
3dce48f228caec9b317f263af3c5e7a71372f0be | project/members/tests/test_application.py | project/members/tests/test_application.py | # -*- coding: utf-8 -*-
import pytest
from members.tests.fixtures.memberlikes import MembershipApplicationFactory
from members.tests.fixtures.types import MemberTypeFactory
from members.models import Member
@pytest.mark.django_db
def test_application_approve():
mtypes = [MemberTypeFactory(label='Normal member')]
... | # -*- coding: utf-8 -*-
import pytest
from django.core.urlresolvers import reverse
from members.tests.fixtures.memberlikes import MembershipApplicationFactory
from members.tests.fixtures.types import MemberTypeFactory
from members.models import Member
@pytest.mark.django_db
def test_application_approve():
mtypes =... | Test that we can get the application form | Test that we can get the application form
| Python | mit | hacklab-fi/asylum,HelsinkiHacklab/asylum,rambo/asylum,jautero/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,hacklab-fi/asylum,rambo/asylum,rambo/asylum,rambo/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,jautero/asylum,jautero/asylum,HelsinkiHacklab/asylum |
a233f685f6cb514420fd534388d51ee92459d886 | src/diamond/__init__.py | src/diamond/__init__.py | # coding=utf-8
import os
import sys
import string
import logging
import time
import traceback
import configobj
import socket
import re
import os
import sys
import re
import logging
import time
import datetime
import random
import urllib2
import base64
import csv
import platform
import string
import traceback
import co... | # coding=utf-8
"""
Diamond module init code
"""
import os
import sys
import logging
import time
import traceback
import configobj
import socket
import re
import datetime
import random
import urllib2
import base64
import csv
import platform
from urlparse import urlparse
| Remove duplicate imports and remove entirly unused string | Remove duplicate imports and remove entirly unused string
| Python | mit | szibis/Diamond,russss/Diamond,TAKEALOT/Diamond,szibis/Diamond,signalfx/Diamond,dcsquared13/Diamond,python-diamond/Diamond,eMerzh/Diamond-1,jumping/Diamond,codepython/Diamond,socialwareinc/Diamond,actmd/Diamond,cannium/Diamond,Slach/Diamond,eMerzh/Diamond-1,saucelabs/Diamond,zoidbergwill/Diamond,disqus/Diamond,bmhatfiel... |
6a08dc8ae70ebb7d759514991033a54e35ef0a93 | bin/desi_make_bricks.py | bin/desi_make_bricks.py | #!/usr/bin/env python
#
# See top-level LICENSE file for Copyright information
#
# -*- coding: utf-8 -*-
import argparse
import desispec.io
def main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--fibermap', default = None, metavar = 'FILE',... | #!/usr/bin/env python
#
# See top-level LICENSE file for Copyright information
#
# -*- coding: utf-8 -*-
import argparse
import os.path
import glob
import desispec.io
def main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--verbose', action ... | Update brick maker to use new meta functionality | Update brick maker to use new meta functionality
| Python | bsd-3-clause | profxj/desispec,timahutchinson/desispec,profxj/desispec,gdhungana/desispec,desihub/desispec,gdhungana/desispec,timahutchinson/desispec,desihub/desispec |
69dd9057c1009d9c047f45908080a55ac3223e4c | examples/svm/plot_svm_regression.py | examples/svm/plot_svm_regression.py | """Non linear regression with Support Vector Regression (SVR)
using RBF kernel
"""
###############################################################################
# Generate sample data
import numpy as np
X = np.sort(5*np.random.rand(40, 1), axis=0)
y = np.sin(X).ravel()
##############################################... | """Non linear regression with Support Vector Regression (SVR)
using RBF kernel
"""
###############################################################################
# Generate sample data
import numpy as np
X = np.sort(5*np.random.rand(40, 1), axis=0)
y = np.sin(X).ravel()
##############################################... | Fix forgotten import in example | BUG: Fix forgotten import in example
| Python | bsd-3-clause | NunoEdgarGub1/scikit-learn,f3r/scikit-learn,mehdidc/scikit-learn,icdishb/scikit-learn,xiaoxiamii/scikit-learn,MatthieuBizien/scikit-learn,Vimos/scikit-learn,walterreade/scikit-learn,lesteve/scikit-learn,hugobowne/scikit-learn,cauchycui/scikit-learn,joshloyal/scikit-learn,shangwuhencc/scikit-learn,mattilyra/scikit-learn... |
8905993c0daa140b10cb04dca1e7bed7b813ea7a | imagedownloader/libs/console.py | imagedownloader/libs/console.py | import sys
import pyttsx
import aspects
from datetime import datetime
engine = pyttsx.init()
def show(*objs):
begin = '' if '\r' in objs[0] or '\b' in objs[0] else '\n'
sys.stdout.write(begin)
for part in objs:
sys.stdout.write(str(part))
sys.stdout.flush()
def say(speech):
#NOT engine.startLoop()
show(speec... | import sys
import pyttsx
import aspects
from datetime import datetime
engine = pyttsx.init()
def show(*objs):
begin = '' if '\r' in objs[0] or '\b' in objs[0] else '\n'
sys.stdout.write(begin)
for part in objs:
sys.stdout.write(str(part))
sys.stdout.flush()
def say(speech):
#NOT engine.startLoop()
show(speec... | Add UTC timezone to datetimes in the libs folder. | Add UTC timezone to datetimes in the libs folder.
| Python | mit | ahMarrone/solar_radiation_model,scottlittle/solar_radiation_model,gersolar/solar_radiation_model |
41beca23fff6eab718550d0ce8d22769653c3109 | sauce_test/test_suite.py | sauce_test/test_suite.py | # This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
))
if __name__ == "__main__":
result = unittest.TextTestRunne... | # This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
import test_dataverse
import test_dataset
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
unittest.makeSuite(test_... | Update test suite to include dataverse and dataset tests. | Update test suite to include dataverse and dataset tests. | Python | apache-2.0 | ekoi/DANS-DVN-4.6.1,ekoi/DANS-DVN-4.6.1,quarian/dataverse,leeper/dataverse-1,leeper/dataverse-1,bmckinney/dataverse-canonical,bmckinney/dataverse-canonical,JayanthyChengan/dataverse,quarian/dataverse,quarian/dataverse,leeper/dataverse-1,leeper/dataverse-1,JayanthyChengan/dataverse,JayanthyChengan/dataverse,quarian/data... |
5c1fad9e6a75ee43d3a3b7bce6c9249cf601b4b9 | tendrl/commons/objects/cluster_tendrl_context/__init__.py | tendrl/commons/objects/cluster_tendrl_context/__init__.py | import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
integra... | import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
integra... | Write cluster_tendrl_context to proper location | Write cluster_tendrl_context to proper location
Currently it is written to clusters/<node-id>/TendrlContext
This is fixed in this PR
tendrl-bug-id: Tendrl/commons#302
Signed-off-by: nnDarshan <d2c6d450ab98b078f2f1942c995e6d92dd504bc8@gmail.com>
| Python | lgpl-2.1 | r0h4n/commons,Tendrl/commons,rishubhjain/commons |
c6fbba9da9d1cf2a5a0007a56d192e267d19fcff | flexget/utils/database.py | flexget/utils/database.py | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
passed_session = kwargs.get('session')
if not passed_session:
session = Session(autoflush=True)
... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
if not kwargs.get('session'):
kwargs['session'] = Session(autoflush=True)
try:
... | Fix with_session decorator for python 2.5 | Fix with_session decorator for python 2.5
git-svn-id: ad91b9aa7ba7638d69f912c9f5d012e3326e9f74@1957 3942dd89-8c5d-46d7-aeed-044bccf3e60c
| Python | mit | vfrc2/Flexget,tobinjt/Flexget,Pretagonist/Flexget,oxc/Flexget,Danfocus/Flexget,jacobmetrick/Flexget,Flexget/Flexget,spencerjanssen/Flexget,ianstalk/Flexget,xfouloux/Flexget,malkavi/Flexget,asm0dey/Flexget,v17al/Flexget,camon/Flexget,ZefQ/Flexget,cvium/Flexget,jacobmetrick/Flexget,crawln45/Flexget,camon/Flexget,OmgOhnoe... |
e0d631b4aab431c31689ccd7aa6ac92d95e32e80 | tests/test_frontend.py | tests/test_frontend.py | import os
from tvrenamr.cli import helpers
from .base import BaseTest
class TestFrontEnd(BaseTest):
def setup(self):
super(TestFrontEnd, self).setup()
self.config = helpers.get_config()
def test_passing_current_dir_makes_file_list_a_list(self):
assert isinstance(helpers.build_file_l... | import collections
import os
import sys
from tvrenamr.cli import helpers
from .utils import random_files
def test_passing_current_dir_makes_file_list_a_list(files):
file_list = helpers.build_file_list([files])
assert isinstance(file_list, collections.Iterable)
PY3 = sys.version_info[0] == 3
string... | Move to function only tests & fix test for generator based build_file_list | Move to function only tests & fix test for generator based build_file_list
build_file_list is a generator now so we need to make sure it returns an
iterable but not a string.
| Python | mit | wintersandroid/tvrenamr,ghickman/tvrenamr |
1d6c17e5adc3df4de86636ef77fc0a406bf065e9 | scrapi/harvesters/dryad.py | scrapi/harvesters/dryad.py | '''
Harvester for Dryad for the SHARE project
Example API call: http://www.datadryad.org/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class DryadHarvester(OAIHarvester):
short_name = 'dryad'
long_name = 'Dryad Data Reposi... | '''
Harvester for Dryad for the SHARE project
Example API call: http://www.datadryad.org/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from lxml import etree
import logging
from scrapi.base import OAIHarvester
logger = logging.getLogger(__name__)
class DryadHarvest... | Add custom normaluze function that will not get non existant items | Add custom normaluze function that will not get non existant items
| Python | apache-2.0 | icereval/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,mehanig/scrapi,alexgarciac/scrapi,erinspace/scrapi,felliott/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,ostwald/scrapi,fabianvf/scrapi,jeffreyliu3230/scrapi,mehanig/scrapi |
63709e388ed86892e9771b86daad4a9ec3c0bd44 | ibei/__init__.py | ibei/__init__.py | # -*- coding: utf-8 -*-
"""
Base Library (:mod:`ibei`)
==========================
.. currentmodule:: ibei
"""
from .version import __version__
from .uibei import uibei
from .sqsolarcell import SQSolarcell
from .devossolarcell import DeVosSolarcell
| # -*- coding: utf-8 -*-
"""
Base Library (:mod:`ibei`)
==========================
.. currentmodule:: ibei
"""
from .version import __version__
from .uibei import uibei
| Remove import of specific models | Remove import of specific models
| Python | mit | jrsmith3/ibei |
3ed70bcc0c699744fd4dc3259ca2f0b6ee7e5d6a | swampdragon/pubsub_providers/redis_sub_provider.py | swampdragon/pubsub_providers/redis_sub_provider.py | import json
import tornadoredis.pubsub
import tornadoredis
from .base_provider import BaseProvider
from .redis_settings import get_redis_host, get_redis_port, get_redis_db
class RedisSubProvider(BaseProvider):
def __init__(self):
self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client(... | import json
import tornadoredis.pubsub
import tornadoredis
from .base_provider import BaseProvider
from .redis_settings import get_redis_host, get_redis_port, get_redis_db, get_redis_password
class RedisSubProvider(BaseProvider):
def __init__(self):
self._subscriber = tornadoredis.pubsub.SockJSSubscriber(... | Add auth step to baseprovider for Redis connection pools | Add auth step to baseprovider for Redis connection pools
| Python | bsd-3-clause | denizs/swampdragon,jonashagstedt/swampdragon,jonashagstedt/swampdragon,denizs/swampdragon,denizs/swampdragon,jonashagstedt/swampdragon |
0c1a0a70154ddf107a6174d49793e369d28f1beb | openstack_dashboard/views.py | openstack_dashboard/views.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | Fix default get_user_home with dynamic dashboards | Fix default get_user_home with dynamic dashboards
The existing get_user_home implementation expects both the 'admin'
and 'project' dashboards to exist and throws an exception if they
are missing. With the inclusion of configurable dashboard loading,
we can no longer count on certain dashboards being loaded.
Closes-B... | Python | apache-2.0 | bigswitch/horizon,tsufiev/horizon,froyobin/horizon,NeCTAR-RC/horizon,kfox1111/horizon,NeCTAR-RC/horizon,yjxtogo/horizon,RudoCris/horizon,watonyweng/horizon,philoniare/horizon,philoniare/horizon,noironetworks/horizon,eayunstack/horizon,CiscoSystems/avos,Dark-Hacker/horizon,zouyapeng/horizon,nvoron23/avos,mrunge/horizon,... |
da466b391470333492a56395569812653ed6658f | compose/cli/__init__.py | compose/cli/__init__.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import subprocess
import sys
# Attempt to detect https://github.com/docker/compose/issues/4344
try:
# We don't try importing pip because it messes with package imports
# on some Linux distros (... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import subprocess
import sys
# Attempt to detect https://github.com/docker/compose/issues/4344
try:
# We don't try importing pip because it messes with package imports
# on some Linux distros (... | Change docker-py dependency error to a warning, update fix command | Change docker-py dependency error to a warning, update fix command
Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com>
| Python | apache-2.0 | thaJeztah/compose,shin-/compose,vdemeester/compose,sdurrheimer/compose,sdurrheimer/compose,schmunk42/compose,hoogenm/compose,jrabbit/compose,dnephin/compose,dnephin/compose,schmunk42/compose,swoopla/compose,funkyfuture/docker-compose,shin-/compose,thaJeztah/compose,hoogenm/compose,funkyfuture/docker-compose,jrabbit/com... |
74b31ba7fec330ec167c2e001f60695272da71b8 | pages/views.py | pages/views.py | from django.views import generic
from django.contrib.auth.models import Group
from django_countries.fields import Country
from hosting.models import Profile, Place
from hosting.utils import sort_by_name
class AboutView(generic.TemplateView):
template_name = 'pages/about.html'
about = AboutView.as_view()
class ... | from django.views import generic
from django.contrib.auth.models import Group
from hosting.models import Place
from hosting.utils import sort_by_name
class AboutView(generic.TemplateView):
template_name = 'pages/about.html'
about = AboutView.as_view()
class TermsAndConditionsView(generic.TemplateView):
tem... | Fix numbers in LO list. | Fix numbers in LO list.
| Python | agpl-3.0 | batisteo/pasportaservo,tejo-esperanto/pasportaservo,tejo-esperanto/pasportaservo,tejo-esperanto/pasportaservo,tejo-esperanto/pasportaservo,batisteo/pasportaservo,batisteo/pasportaservo,batisteo/pasportaservo |
1f947d6cfe05f32ffa6566714e5aeeb74543a932 | osf/migrations/0095_migration_comments.py | osf/migrations/0095_migration_comments.py | from __future__ import unicode_literals
from django.db import migrations
import logging
logger = logging.getLogger(__file__)
def update_comment_root_target(state, *args, **kwargs):
Comment = state.get_model('osf', 'comment')
comments = Comment.objects.filter(is_deleted=False)
count = 0
for comment i... | from __future__ import unicode_literals
import logging
from django.db import migrations
from django_bulk_update.helper import bulk_update
logger = logging.getLogger(__file__)
def update_comment_root_target(state, *args, **kwargs):
Comment = state.get_model('osf', 'comment')
comments = Comment.objects.exclud... | Fix loading root_target in migration | Fix loading root_target in migration
Migrations don't allow accessing generic foreign keys, so we
need to load root_target manually.
Also:
* add more logging
* Bulk-update comments
| Python | apache-2.0 | caseyrollins/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,erinspace/osf.io,mfraezz/osf.io,mfraezz/osf.io,felliott/osf.io,sloria/osf.io,aaxelb/osf.io,icereval/osf.io,felliott/osf.io,mattclark/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,erinspace/osf.io,pattisdr/osf.io,sloria/osf.io,Johnetordoff/osf.io,mfraezz/osf.io,icer... |
98f37bb6fff90d9a4385ceea5454f0b5146e6dee | wagtail/wagtailimages/rich_text.py | wagtail/wagtailimages/rich_text.py | from wagtail.wagtailimages.models import get_image_model
from wagtail.wagtailimages.formats import get_image_format
class ImageEmbedHandler(object):
"""
ImageEmbedHandler will be invoked whenever we encounter an element in HTML content
with an attribute of data-embedtype="image". The resulting element in ... | from wagtail.wagtailimages.models import get_image_model
from wagtail.wagtailimages.formats import get_image_format
class ImageEmbedHandler(object):
"""
ImageEmbedHandler will be invoked whenever we encounter an element in HTML content
with an attribute of data-embedtype="image". The resulting element in ... | Remove bare except in unnecessary try block | Remove bare except in unnecessary try block
From a comment by @gasman on #1684:
> It appears the try/catch in ImageEmbedHandler was added here: 74b9f43
>
> Since the rest of the commit doesn't deal with images at all, and the
> commit makes it clear that the corresponding change to
> MediaEmbedHandler was intended to... | Python | bsd-3-clause | mikedingjan/wagtail,Toshakins/wagtail,nutztherookie/wagtail,quru/wagtail,mayapurmedia/wagtail,iansprice/wagtail,mixxorz/wagtail,zerolab/wagtail,iansprice/wagtail,takeflight/wagtail,gogobook/wagtail,mixxorz/wagtail,hamsterbacke23/wagtail,FlipperPA/wagtail,kurtw/wagtail,davecranwell/wagtail,chrxr/wagtail,nrsimha/wagtail,... |
87e8d128fcd944c265c06bc82d8947fcdbb2c360 | pyconcz_2016/team/models.py | pyconcz_2016/team/models.py | from django.db import models
class Organizer(models.Model):
full_name = models.CharField(max_length=200)
email = models.EmailField(
default='', blank=True,
help_text="This is private")
twitter = models.CharField(max_length=255, blank=True)
github = models.CharField(max_length=255, blan... | from django.db import models
class Organizer(models.Model):
full_name = models.CharField(max_length=200)
email = models.EmailField(
default='', blank=True,
help_text="This is private")
twitter = models.CharField(max_length=255, blank=True)
github = models.CharField(max_length=255, blan... | Revert "Revert "Add string representation of organizer object"" | Revert "Revert "Add string representation of organizer object""
This reverts commit 36aff772ba6720acb8f629e89954162f98a932e3.
| Python | mit | benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,benabraham/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2017 |
81b1cf6973dde3ca23bbe5ac071d3decad81079a | pydsa/sleep_sort.py | pydsa/sleep_sort.py | from time import sleep
from threading import Timer
# Sleep Sort ;)
# Complexity: O(max(input)+n)
def sleep_sort(a):
"""
Sorts the list 'a' using Sleep sort algorithm
>>> from pydsa import sleep_sort
>>> a = [3, 4, 2]
>>> sleep_sort(a)
[2, 3, 4]
"""
sleep_sort.result = []
def add1... | from time import sleep
from threading import Timer
# Sleep Sort ;)
# Complexity: O(max(input)+n)
def sleep_sort(a):
"""
Sorts the list 'a' using Sleep sort algorithm
>>> from pydsa import sleep_sort
>>> a = [3, 4, 2]
>>> sleep_sort(a)
[2, 3, 4]
"""
sleep_sort.result = []
def ad... | Format code according to PEP8 | Format code according to PEP8
| Python | bsd-3-clause | rehassachdeva/pydsa,aktech/pydsa |
eca911a1b1623368f991dbf47002c0b59abc15db | script/lib/config.py | script/lib/config.py | #!/usr/bin/env python
NODE_VERSION = 'v0.11.10'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '1df8e7cdac8aa74c91c19ae0691ce512d560ab3e'
| #!/usr/bin/env python
NODE_VERSION = 'v0.11.10'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'aa4874a6bcc51fdd87ca7ae0928514ce83645988'
| Update libchromiumcontent: Suppress CFAllocator warning. | Update libchromiumcontent: Suppress CFAllocator warning.
| Python | mit | jjz/electron,Ivshti/electron,howmuchcomputer/electron,simonfork/electron,takashi/electron,SufianHassan/electron,micalan/electron,tylergibson/electron,Gerhut/electron,mattdesl/electron,edulan/electron,edulan/electron,d-salas/electron,gerhardberger/electron,micalan/electron,brenca/electron,stevekinney/electron,pandoraui/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.