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 |
|---|---|---|---|---|---|---|---|---|---|
3f00fc50b0eba9516cfc92b2448df299a68b5524 | main_test.py | main_test.py | fuckit('checktz')
import asyncio
import sys, os
import fuckit
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
def test_time():
assert checktz.GetTime("test") == "Finished with no errors!"
| import asyncio
import sys, os
import fuckit
fuckit('checktz')
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
def test_time():
assert checktz.GetTime("test") == "Finished with no errors!"
| Make the builds actually pass | Make the builds actually pass | Python | epl-1.0 | Bentechy66/Interlaced-Minds-Bot |
ca917fa28c5bf8fe3c431868951f429c48b58e0a | buysafe/urls.py | buysafe/urls.py | from django.conf.urls import patterns, url
urlpatterns = patterns(
'buysafe.views',
url(r'^entry/(?P<order_id>\d+)/$', 'entry', name='buysafe_pay'),
(r'^start/$', 'start'),
(r'^success/(?P<payment_type>[01])/$', 'success'),
(r'^fail/(?P<payment_type>[01])/$', 'fail'),
(r'^check/(?P<payment_typ... | from django.conf.urls import patterns, url
urlpatterns = patterns(
'buysafe.views',
url(r'^entry/(?P<order_id>\d+)/$', 'entry', name='buysafe_pay'),
url(r'^start/$', 'start', name="buysafe_start"),
(r'^success/(?P<payment_type>[01])/$', 'success'),
(r'^fail/(?P<payment_type>[01])/$', 'fail'),
... | Add view label to buysafe_start | Add view label to buysafe_start
| Python | bsd-3-clause | uranusjr/django-buysafe |
320981553f589d801d17b000d6f74c301f552811 | survey/tests/test_default_settings.py | survey/tests/test_default_settings.py | from survey.tests import BaseTest
from django.test import override_settings
from django.conf import settings
from survey import set_default_settings
@override_settings()
class TestDefaultSettings(BaseTest):
def test_set_choices_separator(self):
url = "/admin/survey/survey/1/change/"
del settings.C... | from django.conf import settings
from django.test import override_settings
from survey import set_default_settings
from survey.tests import BaseTest
@override_settings()
class TestDefaultSettings(BaseTest):
def test_set_choices_separator(self):
url = "/admin/survey/survey/1/change/"
del settings.... | Apply black following @gjelsas MR | Apply black following @gjelsas MR
| Python | agpl-3.0 | Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey |
15030074c73f41a2a298c5de77b584875b7a5441 | sympy/logic/benchmarks/run-solvers.py | sympy/logic/benchmarks/run-solvers.py | from __future__ import print_function, division
from sympy.logic.utilities import load_file
from sympy.logic import satisfiable
import time
import os
import sys
input_path = os.getcwd() + '/' + '/'.join(sys.argv[0].split('/')[:-1])
INPUT = [5 * i for i in range(2, 16)]
ALGORITHMS = ['dpll', 'dpll2']
results = {}
fo... | from __future__ import print_function, division
from sympy.logic.utilities import load_file
from sympy.logic import satisfiable
import time
import os
import sys
input_path = os.path.dirname(__file__)
INPUT = [5 * i for i in range(2, 16)]
ALGORITHMS = ['dpll', 'dpll2']
results = {}
if __name__ == '__main__':
for... | Make logic benchmarks runner more portable | Make logic benchmarks runner more portable
| Python | bsd-3-clause | abloomston/sympy,wyom/sympy,madan96/sympy,sunny94/temp,liangjiaxing/sympy,kaichogami/sympy,Davidjohnwilson/sympy,shikil/sympy,AunShiLord/sympy,shipci/sympy,sahilshekhawat/sympy,pbrady/sympy,jaimahajan1997/sympy,MechCoder/sympy,Davidjohnwilson/sympy,mcdaniel67/sympy,atreyv/sympy,debugger22/sympy,madan96/sympy,sampadsaha... |
adfcd15e8c9f3c4b08bdb358d041401bf77d2a25 | calicoctl/calico_ctl/__init__.py | calicoctl/calico_ctl/__init__.py | __version__ = "0.13.0-dev"
__kubernetes_plugin_version__ = "v0.6.0"
__rkt_plugin_version__ = "v0.1.0"
__libnetwork_plugin_version__ = "v0.6.0"
__libcalico_version__ = "v0.6.0"
__felix_version__ = "1.2.1"
| __version__ = "0.13.0-dev"
__kubernetes_plugin_version__ = "v0.7.0"
__rkt_plugin_version__ = "v0.1.0"
__libnetwork_plugin_version__ = "v0.7.0"
__libcalico_version__ = "v0.7.0"
__felix_version__ = "1.3.0-pre5"
| Fix release numbers to be latest values | Fix release numbers to be latest values
| Python | apache-2.0 | caseydavenport/calico-containers,Metaswitch/calico-docker,caseydavenport/calico-containers,projectcalico/calico-containers,quater/calico-containers,Metaswitch/calico-docker,insequent/calico-docker,projectcalico/calico-containers,TrimBiggs/calico-containers,tomdee/calico-docker,TrimBiggs/calico-docker,caseydavenport/cal... |
2060a89cc008e3fc19b90b2278001350ef6b49ad | stellar/data/stellargraph.py | stellar/data/stellargraph.py | # -*- coding: utf-8 -*-
#
# Copyright 2017-2018 Data61, CSIRO
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | # -*- coding: utf-8 -*-
#
# Copyright 2017-2018 Data61, CSIRO
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | Split StellarGraph class into two: undirected and directed graph classes | Split StellarGraph class into two: undirected and directed graph classes
| Python | apache-2.0 | stellargraph/stellargraph,stellargraph/stellargraph |
0f9d3b0ed9efc72b8b3fd4d466caa4517691546c | strategies/alexStrategies.py | strategies/alexStrategies.py | class FixFoldStrategy:
"""This strategy folds every time there is a small card available."""
def __init__(self, N=3):
self.N = N
def play(self, info):
if info.bestFold(self.player)[1] > self.N:
return 'Hit me'
else:
return 'fold'
class RatioFoldStrategy:
... | class FixFoldStrategy:
"""This strategy folds every time there is a small card available."""
def __init__(self, N=3):
self.N = N
def play(self, info):
if info.bestFold(self.player)[1] > self.N:
return 'Hit me'
else:
return 'fold'
class RatioFoldStrategy:
... | Add a simple card counting strategy | Add a simple card counting strategy
| Python | mit | AlexMooney/pairsTournament |
619462203f3369b807e14e4715f992c40224b37a | account_fiscal_position_no_source_tax/account.py | account_fiscal_position_no_source_tax/account.py | from openerp import models, api, fields
class account_fiscal_position(models.Model):
_inherit = 'account.fiscal.position'
@api.v7
def map_tax(self, cr, uid, fposition_id, taxes, context=None):
result = super(account_fiscal_position, self).map_tax(
cr, uid, fposition_id, taxes, contex... | from openerp import models, api, fields
class account_fiscal_position(models.Model):
_inherit = 'account.fiscal.position'
@api.v7
def map_tax(self, cr, uid, fposition_id, taxes, context=None):
result = super(account_fiscal_position, self).map_tax(
cr, uid, fposition_id, taxes, contex... | FIX fiscal position no source tax | FIX fiscal position no source tax
| Python | agpl-3.0 | csrocha/account_check,csrocha/account_check |
5c341fc463840bc2e237e1529a43aa5915a70c77 | luhn/luhn.py | luhn/luhn.py | # File: luhn.py
# Purpose: Write a program that can take a number and determine whether
# or not it is valid per the Luhn formula.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Sunday 18 September 2016, 09:55 PM
def Luhn(card_number):
def digits_of(n):
return [in... | # File: luhn.py
# Purpose: Write a program that can take a number and determine whether
# or not it is valid per the Luhn formula.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Sunday 18 September 2016, 09:55 PM
def Luhn(card_number):
def digits_of(n):
return [in... | Return the remainder of checksum | Return the remainder of checksum
| Python | mit | amalshehu/exercism-python |
c4d2e4c4f49db961dae59780fa8f5ec351a11353 | projects/models.py | projects/models.py | # -*- encoding:utf-8 -*-
from django.db import models
class Project(models.Model):
STATUS = (
('unrevised', u'Неразгледан'),
('returned', u'Върнат за корекция'),
('pending', u'Предстои да бъде разгледан на СИС'),
('approved', u'Разгледан и одобрен на СИС'),
('rejected', u'Р... | # -*- encoding:utf-8 -*-
from django.db import models
class Project(models.Model):
STATUS = (
('unrevised', u'Неразгледан'),
('returned', u'Върнат за корекция'),
('pending', u'Предстои да бъде разгледан на СИС'),
('approved', u'Разгледан и одобрен на СИС'),
('rejected', u'Р... | Add incoming number for the project and attutude | Add incoming number for the project and attutude
| Python | mit | Hackfmi/Diaphanum,Hackfmi/Diaphanum |
30a16da0089d0f7afa46fb129a6f426c75cbcd3b | modules/test_gitdata.py | modules/test_gitdata.py | from nose import with_setup
from nose.tools import *
import os
import sys
from gitdata import GitData
import simplejson as json
def test_fetch():
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loads(study_nexson)
except... | import unittest
import os
import sys
from gitdata import GitData
import simplejson as json
class TestGitData(unittest.TestCase):
def test_fetch(self):
gd = GitData(repo="./treenexus")
study_id = 438
study_nexson = gd.fetch_study(study_id)
valid = 1
try:
json.loa... | Convert GitData tests to a unittest suite | Convert GitData tests to a unittest suite
| Python | bsd-2-clause | leto/new_opentree_api,leto/new_opentree_api |
9beb8378831f33c2256b5a7bf73f24d155122bea | nasa_data.py | nasa_data.py |
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY").json()
image_url = apod_data["url"]
if image_url.endswith(".gif"):
return
image_data = requests.get(... |
import requests
import os
def get_apod():
os.makedirs("APODs", exist_ok=True)
try:
apod_data = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY").json()
image_url = apod_data["url"]
if image_url.endswith(".gif"):
raise TypeError
image_data = requ... | Update 0.6.4 - Fixed exception error | Update 0.6.4
- Fixed exception error
| Python | mit | FXelix/space_facts_bot |
f35494ebc7c710af45c8973eb1c2b4d31ec1c7c0 | tests/fakes.py | tests/fakes.py | class FakeHttpRequest(object):
def __init__(self, method='GET', body=''):
self.method = method.upper()
self.body = body
class FakeHttpResponse(object):
def __init__(self, body, content_type='text/html'):
self.body = body
self.content_type = content_type
self.status_code... | import six
class FakeHttpRequest(object):
def __init__(self, method='GET', body=''):
self.method = method.upper()
self.body = body
if six.PY3:
self.body = body.encode('utf-8')
class FakeHttpResponse(object):
def __init__(self, body, content_type='text/html'):
self... | Update tests to reproduce bug | Update tests to reproduce bug
| Python | bsd-3-clause | pobear/restless,viniciuscainelli/restless,toastdriven/restless,tonybajan/restless,CraveFood/restkiss,jangeador/restless |
ed85bde14d8c37144352d7526c674c26fa577407 | dnsimple/record.py | dnsimple/record.py | from .model import Model
class Record(Model, object):
def __init__(self, request, domain, attributes):
self.domain = domain
super(Record, self).__init__(request, attributes)
def update(self, attributes):
success = False
self.assign(attributes)
response = self.reque... | from .model import Model
class Record(Model, object):
def __init__(self, request, domain, attributes):
self.domain = domain
super(Record, self).__init__(request, attributes)
def update(self, attributes):
self.assign(attributes)
response = self.request.put(
'doma... | Remove unused assignment in `Record` class | Remove unused assignment in `Record` class | Python | mit | vigetlabs/dnsimple |
bb0728a6e73f3995968ee7c59ffcb03fae65d983 | quotes/templatetags/quote_tags.py | quotes/templatetags/quote_tags.py | from django import template
from quotes.models import Quote
register = template.Library()
@register.inclusion_tag('quotes/random_quote.html')
def show_random_quote():
"""
For generating a single random quote
"""
random_quote = Quote.objects.order_by('?')[0]
return {'random_quote': random_quote} | from django import template
from quotes.models import Quote
register = template.Library()
@register.inclusion_tag('quotes/random_quote.html')
def show_random_quote():
"""
For generating a single random quote
"""
try:
random_quote = Quote.objects.order_by('?')[0]
except ValueError:
... | Fix for allowing for empty database | Fix for allowing for empty database | Python | bsd-3-clause | davemerwin/django-quotes |
724b80b44229b531d7a11cb7cc9f6ad88d9aedb0 | bnw_handlers/command_userinfo.py | bnw_handlers/command_userinfo.py | from twisted.internet import defer
import bnw_core.bnw_objects as objs
@defer.inlineCallbacks
def cmd_userinfo(request, user=''):
if not user:
defer.returnValue(dict(ok=False, desc='Username required.'))
user_obj = yield objs.User.find_one({'name': user})
subscribers = yield objs.Subscription.fin... | from twisted.internet import defer
import bnw_core.bnw_objects as objs
@defer.inlineCallbacks
def cmd_userinfo(request, user=''):
if not user:
defer.returnValue(dict(ok=False, desc='Username required.'))
user_obj = yield objs.User.find_one({'name': user})
subscribers = yield objs.Subscription.fin... | Fix userinfo api command (send ok=True) | Fix userinfo api command (send ok=True)
| Python | bsd-2-clause | ojab/bnw,stiletto/bnw,stiletto/bnw,ojab/bnw,un-def/bnw,ojab/bnw,stiletto/bnw,ojab/bnw,un-def/bnw,un-def/bnw,un-def/bnw,stiletto/bnw |
1afebd46c8cf786673adface7724e9488df17a7e | appengine-experimental/src/models.py | appengine-experimental/src/models.py | from datetime import datetime, timedelta
from google.appengine.ext import db
class CHPIncident(db.Model):
CenterID = db.StringProperty(required=True)
DispatchID = db.StringProperty(required=True)
LogID = db.StringProperty(required=True)
LogTime = db.DateTimeProperty()
LogType = db.StringProperty()
LogTypeID = ... | from datetime import datetime, timedelta
from google.appengine.ext import db
class CHPIncident(db.Model):
CenterID = db.StringProperty(required=True)
DispatchID = db.StringProperty(required=True)
LogID = db.StringProperty(required=True)
LogTime = db.DateTimeProperty()
LogType = db.StringProperty()
LogTypeID = ... | Tweak the "inactive" timeout a bit to take latency into account. | Tweak the "inactive" timeout a bit to take latency into account.
| Python | isc | lectroidmarc/SacTraffic,lectroidmarc/SacTraffic |
fbb532473bc6434628c6f01fabb8eae3ad60a171 | nn/linear.py | nn/linear.py | import tensorflow as tf
from . import var_init
from .util import static_shape
from .variable import variable
def linear(x, output_layer_size):
weight = variable([static_shape(x)[1], output_layer_size])
bias = variable([output_layer_size])
tf.add_to_collection(tf.GraphKeys.WEIGHTS, weight)
tf.add_to_collecti... | import tensorflow as tf
from .util import static_shape
from .variable import variable
def linear(x, output_layer_size):
weight = variable([static_shape(x)[1], output_layer_size])
bias = variable([output_layer_size])
tf.add_to_collection(tf.GraphKeys.WEIGHTS, weight)
tf.add_to_collection(tf.GraphKeys.BIASES,... | Remove an extra import statement | Remove an extra import statement
| Python | unlicense | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten |
dcecd75cae428bb27ec8759a21e52267a55f149a | django_comments/signals.py | django_comments/signals.py | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... | Remove Signal(providing_args) argument b/c it is deprecated | Remove Signal(providing_args) argument b/c it is deprecated
RemovedInDjango40Warning: The providing_args argument is deprecated.
As it is purely documentational, it has no replacement. If you rely
on this argument as documentation, you can move the text to a code
comment or docstring.
| Python | bsd-3-clause | django/django-contrib-comments,django/django-contrib-comments |
75dca1c2d39126556ded5f328461986a9eabb230 | django_webtest/backends.py | django_webtest/backends.py | from __future__ import absolute_import
from django.contrib.auth.backends import RemoteUserBackend
from .compat import from_wsgi_safe_string
class WebtestUserBackend(RemoteUserBackend):
""" Auth backend for django-webtest auth system """
def authenticate(self, request, django_webtest_user):
return sup... | from __future__ import absolute_import
from django.utils.version import get_complete_version
from django.contrib.auth.backends import RemoteUserBackend
from .compat import from_wsgi_safe_string
class WebtestUserBackend(RemoteUserBackend):
""" Auth backend for django-webtest auth system """
if get_complete_ver... | Define WebtestUserBackend.authenticate based on Django version | Define WebtestUserBackend.authenticate based on Django version
This is required because the signature of RemoteUserBackend.authenticate
has changed in Django 1.11.
| Python | mit | django-webtest/django-webtest,kmike/django-webtest,django-webtest/django-webtest,kmike/django-webtest |
03d628abc4711bb0de4a7a0ef13cc4c0ecb92032 | opps/articles/tests/models.py | opps/articles/tests/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from opps.articles.models import Post
class PostModelTest(TestCase):
fixtures = ['tests/initial_data.json']
def test_basic_post_exist(self):
post = Post.objects.all()
self.assertTrue(post)
self.assertEqu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from opps.articles.models import Post
class PostModelTest(TestCase):
fixtures = ['tests/initial_data.json']
def test_basic_post_exist(self):
post = Post.objects.all()
self.assertTrue(post)
self.assertEqu... | Add test articles (post), check child_class | Add test articles (post), check child_class
| Python | mit | YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps |
dc1b2ce87bdd5aa3b891d43f5d8b5c465dc909d1 | project_user_story/project.py | project_user_story/project.py | # -*- coding: utf-8 -*-
from openerp import models, fields, api, _
class task(models.Model):
_inherit = 'project.task'
user_story = fields.Boolean(
'Is User Story?',
default=False)
@api.multi
def action_open_task(self):
return {
'name': _('User Story'),
... | # -*- coding: utf-8 -*-
from openerp import models, fields, api, _
class task(models.Model):
_inherit = 'project.task'
user_story = fields.Boolean(
'Is User Story?',
default=False)
@api.multi
def action_open_task(self):
print 'context', self._context
return {
... | FIX don loose context when creating from story form view | FIX don loose context when creating from story form view
| Python | agpl-3.0 | levkar/odoo-addons,ingadhoc/partner,ingadhoc/odoo-addons,ingadhoc/stock,dvitme/odoo-addons,ingadhoc/product,ingadhoc/account-analytic,ingadhoc/product,adhoc-dev/odoo-addons,sysadminmatmoz/ingadhoc,maljac/odoo-addons,levkar/odoo-addons,maljac/odoo-addons,ClearCorp/account-financial-tools,sysadminmatmoz/ingadhoc,adhoc-de... |
f845fcfc145edd2ef55df3275971f5c940a61bb4 | tests/list_match.py | tests/list_match.py | from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = Cons(1, Cons(2, Cons(3, Nil)))
b = match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
("_", lambda: 4))
assert b == 2, "List pattern match"
return 0
| from bedrock import *
@annot('void -> int')
def main():
a = hint(Cons(0, Cons(1, Nil())), a='int')
a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
#b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
# ("_", lambda: 4)), a='int')
#assert b == 2, "List pattern match"
... | Disable match() test for now | Disable match() test for now
| Python | mit | pshc/archipelago,pshc/archipelago,pshc/archipelago |
6233207fd57d499bc2bcd313a5b6d829ed712eab | tests/test_check.py | tests/test_check.py | # -*- coding: utf-8 -*-
from unittest.mock import patch
import semver
from chaostoolkit import __version__
from chaostoolkit.check import check_newer_version
class FakeResponse:
def __init__(self, status=200, url=None, response=None):
self.status_code = status
self.url = url
self.respons... | # -*- coding: utf-8 -*-
from unittest.mock import patch
import semver
from chaostoolkit import __version__
from chaostoolkit.check import check_newer_version
class FakeResponse:
def __init__(self, status=200, url=None, response=None):
self.status_code = status
self.url = url
self.respons... | Handle differences between semver and PEP440 | Handle differences between semver and PEP440
Signed-off-by: Sylvain Hellegouarch <16795633e2c1543064a3ad70ac3ba71d3d589b3b@defuze.org>
| Python | apache-2.0 | chaostoolkit/chaostoolkit |
d89747e26371b1986b4cec5a7514ba2c99480487 | tests/test_codec.py | tests/test_codec.py | from .common import *
from av.codec import Codec, Encoder, Decoder
class TestCodecs(TestCase):
def test_codec_mpeg4(self):
for cls in (Encoder, Decoder):
c = cls('mpeg4')
self.assertEqual(c.name, 'mpeg4')
self.assertEqual(c.long_name, 'MPEG-4 part 2')
self.... | from .common import *
from av.codec import Codec, Encoder, Decoder
class TestCodecs(TestCase):
def test_codec_mpeg4(self):
for cls in (Encoder, Decoder):
c = cls('mpeg4')
self.assertEqual(c.name, 'mpeg4')
self.assertEqual(c.long_name, 'MPEG-4 part 2')
self.... | Allow codec test to have more than just the one format | Allow codec test to have more than just the one format
| Python | bsd-3-clause | mcpv/PyAV,danielballan/PyAV,pupil-labs/PyAV,PyAV-Org/PyAV,markreidvfx/PyAV,PyAV-Org/PyAV,xxr3376/PyAV,pupil-labs/PyAV,pupil-labs/PyAV,xxr3376/PyAV,mikeboers/PyAV,markreidvfx/PyAV,danielballan/PyAV,danielballan/PyAV,xxr3376/PyAV,markreidvfx/PyAV,mcpv/PyAV,mikeboers/PyAV,mcpv/PyAV,pupil-labs/PyAV |
82380cc6631ae91e0ef961e3bdfde70b9710af0f | reddit_liveupdate/activity.py | reddit_liveupdate/activity.py | from r2.lib import amqp, websockets
from reddit_liveupdate.models import ActiveVisitorsByLiveUpdateEvent
def broadcast_update():
event_ids = ActiveVisitorsByLiveUpdateEvent._cf.get_range(
column_count=1, filter_empty=False)
for event_id, is_active in event_ids:
if is_active:
coun... | from r2.lib import amqp, websockets
from reddit_liveupdate.models import ActiveVisitorsByLiveUpdateEvent
def broadcast_update():
event_ids = ActiveVisitorsByLiveUpdateEvent._cf.get_range(
column_count=1, filter_empty=False)
for event_id, is_active in event_ids:
if is_active:
coun... | Add comment to amqp.worker.join call. | Add comment to amqp.worker.join call.
| Python | bsd-3-clause | florenceyeun/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate |
6fee21a630a9ba3b54f58152cb4549b4170b833f | docdata/urls.py | docdata/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('docdata.views',
# Status change notifications
url(r'^status_change/$', 'status_change', name='status_change'),
) | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('docdata.views',
# Status change notifications
url(r'^status_change/$', 'status_change', name='status_change'),
)
| Fix URL's to work with Django 1.5 | Fix URL's to work with Django 1.5 | Python | agpl-3.0 | dokterbob/django-docdata |
3f2d27f63c1cfe2cc4616a4314420fa23daca487 | django_lightweight_queue/task.py | django_lightweight_queue/task.py | from .job import Job
from .utils import get_backend
from . import app_settings
class task(object):
def __init__(self, queue='default', timeout=None, sigkill_on_stop=False):
self.queue = queue
self.timeout = timeout
self.sigkill_on_stop = sigkill_on_stop
app_settings.WORKERS.setdef... | from .job import Job
from .utils import get_backend
from . import app_settings
class task(object):
def __init__(self, queue='default', timeout=None, sigkill_on_stop=False):
self.queue = queue
self.timeout = timeout
self.sigkill_on_stop = sigkill_on_stop
app_settings.WORKERS.setdef... | Allow overriding timeout and sigkill_on_stop too. | Allow overriding timeout and sigkill_on_stop too.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@thread.com>
| Python | bsd-3-clause | thread/django-lightweight-queue,prophile/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,lamby/django-lightweight-queue |
2c013f4fd30e93dc50f844a6c507b6b9f7d1c80e | doc/users/figures/background2.py | doc/users/figures/background2.py | from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# setup Lambert Conformal basemap.
# set resolution=None to skip processing of boundary datasets.
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
# draw a land-sea ma... | from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# setup Lambert Conformal basemap.
# set resolution=None to skip processing of boundary datasets.
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
# draw a land-sea ma... | Remove a redudant "plt.show()" statement | Remove a redudant "plt.show()" statement
| Python | mit | matplotlib/basemap,guziy/basemap,guziy/basemap,matplotlib/basemap |
442567a959b9fd5796de2f13154f66cdb25534b3 | python/default_crab_config.py | python/default_crab_config.py | __author__ = 'sbrochet'
def create_config(is_mc):
"""
Create a default CRAB configuration suitable to run the framework
:return:
"""
from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.General.workArea = 'tasks'
config.General.transferOutputs = ... | __author__ = 'sbrochet'
def create_config(is_mc):
"""
Create a default CRAB configuration suitable to run the framework
:return:
"""
from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.General.workArea = 'tasks'
config.General.transferOutputs = ... | Allow crab to run on PRODUCTION datasets | Allow crab to run on PRODUCTION datasets
| Python | mit | cp3-llbb/GridIn,cp3-llbb/GridIn |
5834fd76b74650366eb73c759541116cfbbfcbbe | radar/web/template_filters.py | radar/web/template_filters.py | from jinja2 import escape, Markup, evalcontextfilter
from radar.lib.utils import date_to_datetime, is_date
def strftime(dt, dt_format):
if dt is None:
return ''
else:
return dt.strftime(dt_format)
def year_format(dt):
if dt is None:
return ''
else:
return '%04d' % dt... | from jinja2 import escape, Markup, evalcontextfilter
from radar.lib.utils import date_to_datetime, is_date
def strftime(dt, dt_format):
if dt is None:
return ''
else:
return dt.strftime(dt_format)
def year_format(dt):
if dt is None:
return ''
else:
return '%04d' % dt... | Update nl2br to work with None as input | Update nl2br to work with None as input
| Python | agpl-3.0 | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar |
50c44a5708d1c054207eba264e1cdf9d1f6718da | deployer/logger.py | deployer/logger.py | from __future__ import absolute_import
import logging
from logging.handlers import SysLogHandler
from conf.appconfig import LOG_FORMAT, LOG_DATE, LOG_ROOT_LEVEL, TOTEM_ENV, \
LOG_IDENTIFIER
def init_logging(name=None):
app_logger = logging.getLogger(name)
app_logger.setLevel(LOG_ROOT_LEVEL)
app_logge... | from __future__ import absolute_import
import logging
from logging.handlers import SysLogHandler
from conf.appconfig import LOG_FORMAT, LOG_DATE, LOG_ROOT_LEVEL, TOTEM_ENV, \
LOG_IDENTIFIER
def init_logging(name=None):
app_logger = logging.getLogger(name)
app_logger.setLevel(LOG_ROOT_LEVEL)
app_logge... | Set log level for handler | Set log level for handler
| Python | mit | totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer |
01d812f83c5526cc304f8d691ce9203d3e95633a | sampleproj/settings/travis.py | sampleproj/settings/travis.py | """
Django settings for travis-ci builds.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
from __future__ import absolute_import
from .base import *
# SECURITY WAR... | """
Django settings for travis-ci builds.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
from __future__ import absolute_import
from .base import *
# SECURITY WAR... | Add dummy email addresses for unit tests. | Add dummy email addresses for unit tests.
| Python | apache-2.0 | charlon/mdot,uw-it-aca/mdot,uw-it-aca/mdot,charlon/mdot,uw-it-aca/mdot,uw-it-aca/mdot,charlon/mdot |
e0f80de15d1ddabc3bd47d6396edbaaac5a08041 | examples/motion_example.py | examples/motion_example.py | #!/usr/bin/env python3
"""This example shows how to use the Motion Click wrapper of the LetMeCreate
library.
Whenever the motion click detects an event, it flashes all LED's ten times.
The user must press Ctrl+C to terminate the program.
The Motion Click must be inserted in Mikrobus 1 before running this program.
"""... | #!/usr/bin/env python3
"""This example shows how to use the Motion Click wrapper of the LetMeCreate
library.
Whenever the motion click detects an event, it flashes all LED's ten times.
The user must press Ctrl+C to terminate the program.
The Motion Click must be inserted in Mikrobus 1 before running this program.
"""... | Add missing import for sleep | motion: Add missing import for sleep
Signed-off-by: Francois Berder <59eaf4bb0211c66c3d7532da6d77ecf42a779d82@outlook.fr>
| Python | bsd-3-clause | francois-berder/PyLetMeCreate |
14d9b5fd2e24245ac3333d1a1fe6a4a9fd33751a | example/example.py | example/example.py | from collections import OrderedDict
import os
import sys
from plumbium import call, record, pipeline, recorders
@record()
def pipeline_stage_1():
call([os.path.expanduser('~/programming/Plumbium/example/example_script.sh')])
@record()
def pipeline_stage_2():
call([os.path.expanduser('~/programming/Plumbium/... | from collections import OrderedDict
import os
import sys
from plumbium import call, record, pipeline
from plumbium.recorders import CSVFile
@record()
def pipeline_stage_1():
call(['echo', 'foo'])
@record()
def pipeline_stage_2():
call(['echo', 'data: 55'])
def my_pipeline():
pipeline_stage_1()
pip... | Update to work with recorders submodule | Update to work with recorders submodule
| Python | mit | jstutters/Plumbium |
3c573e2b02a18627b82f4a25fef67adae295d653 | rbm2m/models/setting.py | rbm2m/models/setting.py | # -*- coding: utf-8 -*-
from sqlalchemy import Column, String
from .base import Base
class Setting(Base):
__tablename__ = 'settings'
name = Column(String(32), nullable=False, primary_key=True)
value = Column(String(512))
default_value = Column(String(512))
title = Column(String(127), nullable=Fa... | # -*- coding: utf-8 -*-
from sqlalchemy import Column, String, Text
from .base import Base
class Setting(Base):
__tablename__ = 'settings'
name = Column(String(32), nullable=False, primary_key=True)
value = Column(Text)
default_value = Column(Text)
title = Column(String(127), nullable=False)
... | Set setings.value type to text | Set setings.value type to text
| Python | apache-2.0 | notapresent/rbm2m,notapresent/rbm2m |
599ec99b6f57e37f7f4009afb9498abffd70ff34 | grammpy_transforms/SplittedRules/splitted_rules.py | grammpy_transforms/SplittedRules/splitted_rules.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.12.2017 16:05
:Licence GNUv3
Part of transofmer
"""
from grammpy import Nonterminal
def splitted_rules(root: Nonterminal):
return root
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.12.2017 16:05
:Licence GNUv3
Part of transofmer
"""
from grammpy import Nonterminal, Rule, EPSILON
from grammpy.Grammars.MultipleRulesGrammar import SplitRule
class Adding:
def __init__(self, rule: Rule):
self.rule = rule
self.process... | Add implementation of splitted rules | Add implementation of splitted rules
| Python | mit | PatrikValkovic/grammpy |
1db16a65b114d514257d4525c41e0b3f74d1d479 | dataset/dataset/settings.py | dataset/dataset/settings.py | # Scrapy settings for dataset project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'dataset'
SPIDER_MODULES = ['dataset.spiders']
NEWSPIDER_MODULE = 'dataset.s... | # Scrapy settings for dataset project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'dataset'
SPIDER_MODULES = ['dataset.spiders']
NEWSPIDER_MODULE = 'dataset.s... | Enable Feed Exports and set to JSONLines | Enable Feed Exports and set to JSONLines
| Python | mit | MaxLikelihood/CODE |
1160a10a3d78eee3be61d760849e70e645272355 | analytical/__init__.py | analytical/__init__.py | """
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | """
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | Add 'and others' to copyright | Add 'and others' to copyright
| Python | mit | jcassee/django-analytical,ericdwang/django-analytical,machtfit/django-analytical,apocquet/django-analytical,bittner/django-analytical,ChristosChristofidis/django-analytical,pjdelport/django-analytical |
b2a977a7285cbe832350492b967213b5261ad6b4 | flask_app/tasks.py | flask_app/tasks.py | from __future__ import absolute_import
import functools
import os
import sys
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from .app import create_app
_logger = logbook.Logger(__name__)
queue = Celery('tasks', broker='redis://localhost')
queue.con... | from __future__ import absolute_import
import functools
import os
import sys
import logging
import logging.handlers
import logbook
from celery import Celery
from celery.signals import after_setup_logger, after_setup_task_logger
from celery.log import redirect_stdouts_to_logger
from .app import create_app
_logger =... | Fix celery logging in deployment | Fix celery logging in deployment
| Python | mit | getslash/mailboxer,getslash/mailboxer,getslash/mailboxer,vmalloc/mailboxer,vmalloc/mailboxer,vmalloc/mailboxer,Infinidat/lanister,Infinidat/lanister |
16256c57de5b12b2a1ef148d2ba15db2dfce7407 | foundry/settings_dev.py | foundry/settings_dev.py | from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
FOUNDRY['layers'] = ('web', 'basic',)
#FOUNDRY['layers'] = ('mid', 'basic',)
#FOUNDRY['layers'] = ('smart', 'mid', 'basic',)
compute_settings(sys.modules[__name__])
| from foundry.settings import *
#FOUNDRY['layers'] = ('basic',)
#FOUNDRY['layers'] = ('smart', 'basic',)
FOUNDRY['layers'] = ('web', 'basic',)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
| Disable caching in development mode | Disable caching in development mode
| Python | bsd-3-clause | praekelt/jmbo-foundry,praekelt/jmbo-foundry,praekelt/jmbo-foundry |
796f9ff27f579557237c48196eb50d40269c6840 | glitch/__main__.py | glitch/__main__.py | from . import config
from . import apikeys
import argparse
import logging
parser = argparse.ArgumentParser(description="Invoke the Infinite Glitch server(s)")
parser.add_argument("server", help="Server to invoke", choices=["main", "renderer"], nargs="?", default="main")
parser.add_argument("-l", "--log", help="Logging... | from . import config
from . import apikeys
import argparse
# Hack: Allow "python -m glitch database" to be the same as "glitch.database"
import sys
if len(sys.argv) > 1 and sys.argv[1] == "database":
from . import database
import clize
sys.exit(clize.run(*database.commands, args=sys.argv[1:]))
import logging
parse... | Allow 'python -m glitch database' as well as with a dot | Allow 'python -m glitch database' as well as with a dot
| Python | artistic-2.0 | MikeiLL/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension,MikeiLL/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension |
452b48b9313af8126052a32230e789dff2c69df7 | frontui/data.py | frontui/data.py | """ Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/checklists'
... | """ Data layer """
# pylint: disable=line-too-long
import json
import os
from frontui.models import ChecklistInfo
class DataProvider:
""" Data provider (objects, questions, etc) """
def __init__(self):
self.data_dir = './frontui/app_data'
self.checklists_dir = self.data_dir + '/checklists'
... | Fix non ascii symbols in json | Fix non ascii symbols in json
| Python | mit | nixxa/SecretShopper,nixxa/SecretShopper,nixxa/SecretShopper |
0d572d60522ae0e80105330981a66bc541434b99 | rip/filter_operators.py | rip/filter_operators.py |
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else None
if filte... |
EQUALS = 'equals'
GT = 'gt'
LT = 'lt'
IN = 'in'
OPERATOR_SEPARATOR = '__'
REVERSE_ORDER = '-'
ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1, IN: 1}
def split_to_field_and_filter_type(filter_name):
filter_split = filter_name.split(OPERATOR_SEPARATOR)
filter_type = filter_split[-1] if len(filter_split) > 0 else N... | Support __in as operator for backwards comp | Support __in as operator for backwards comp
| Python | mit | Aplopio/rip,Aplopio/django_rip |
dc6819f67a5f348d260c36c496bc9d116a875ef7 | backend/backend/serializers.py | backend/backend/serializers.py | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') | from rest_framework import serializers
from .models import Animal
class AnimalSerializer(serializers.ModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'dob', 'gender', 'active', 'own', 'father', 'mother') | Change sanitizer to normal model sanitizer, so it sends ids of parents. | Change sanitizer to normal model sanitizer, so it sends ids of parents.
| Python | apache-2.0 | mmlado/animal_pairing,mmlado/animal_pairing |
988cac30eeb3ca9ee25378581371e5ea61faec3e | paypal/exceptions.py | paypal/exceptions.py | from oscar.apps.payment.exceptions import PaymentError
class PayPalError(PaymentError):
pass
| try:
from oscar.apps.payment.exceptions import PaymentError
except ImportError:
class PaymentError(Exception):
pass
class PayPalError(PaymentError):
pass | Make gateway importable without django-oscar installed. | Make gateway importable without django-oscar installed.
| Python | bsd-3-clause | vintasoftware/django-oscar-paypal,ZachGoldberg/django-oscar-paypal,bharling/django-oscar-worldpay,britco/django-oscar-paypal,st8st8/django-oscar-paypal,evonove/django-oscar-paypal,embedded1/django-oscar-paypal,bharling/django-oscar-worldpay,FedeDR/django-oscar-paypal,django-oscar/django-oscar-paypal,django-oscar/django... |
8fa0c30cce8d47344ea66a26d4d627fe12c46ee9 | pombola/settings/south_africa.py | pombola/settings/south_africa.py | import re
from .base import *
from .south_africa_base import *
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_APPS += OPTIONAL_APPS
# This is needed by the speeches application
MIDDLEWARE_CLASSES += ( 'pombola... | import re
from .base import *
from .south_africa_base import *
HAYSTACK_CONNECTIONS['default']['EXCLUDED_INDEXES'] = ['pombola.search.search_indexes.PlaceIndex']
INSTALLED_APPS = insert_after(INSTALLED_APPS,
'markitup',
'pombola.' + COUNTRY_APP)
INSTALLED_... | Add PlaceIndex to the Haystack EXCLUDED_INDEXES | ZA: Add PlaceIndex to the Haystack EXCLUDED_INDEXES
This was a mistake in the earlier rearrangement of the settings
modules; PlaceIndex needed to be added to Haystack EXCLUDED_INDEXES
in the south_africa module as well as tests_south_africa.
| Python | agpl-3.0 | hzj123/56th,mysociety/pombola,geoffkilpin/pombola,patricmutwiri/pombola,mysociety/pombola,ken-muturi/pombola,patricmutwiri/pombola,patricmutwiri/pombola,hzj123/56th,hzj123/56th,hzj123/56th,geoffkilpin/pombola,patricmutwiri/pombola,ken-muturi/pombola,mysociety/pombola,mysociety/pombola,ken-muturi/pombola,hzj123/56th,geo... |
8a28dee1bc3ca8ec83705cc431768ef18be7798c | segments/virtual_env.py | segments/virtual_env.py | import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
| import os
def add_virtual_env_segment():
env = os.getenv('VIRTUAL_ENV') or os.getenv('CONDA_ENV_PATH')
if env is None:
return
env_name = os.path.basename(env)
bg = Color.VIRTUAL_ENV_BG
fg = Color.VIRTUAL_ENV_FG
powerline.append(' %s ' % env_name, fg, bg)
add_virtual_env_segment()
| Allow venv segment to be from Anaconda | Allow venv segment to be from Anaconda
| Python | mit | banga/powerline-shell,tswsl1989/powerline-shell,paulhybryant/powerline-shell,b-ryan/powerline-shell,rbanffy/powerline-shell,b-ryan/powerline-shell,Menci/powerline-shell,iKrishneel/powerline-shell,milkbikis/powerline-shell,paulhybryant/powerline-shell,torbjornvatn/powerline-shell,banga/powerline-shell,bitIO/powerline-sh... |
6b762607914e1c79bc05f7e8d5cdbe6c6d7a49e4 | hiro/patches.py | hiro/patches.py | """
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
objects creat... | """
patched builtin time classes for use by :class:`hiro.Timeline`
"""
import abc
from datetime import date as realdate
from datetime import datetime as realdatetime
import time
import six
class DatetimeMeta(abc.ABCMeta):
"""
meta class to allow interaction between :class:`datetime.datetime`
objects creat... | Fix issue with daylight saving time + utcnow | Fix issue with daylight saving time + utcnow
Fixes issue #2
| Python | mit | alisaifee/hiro,alisaifee/hiro |
3d91950735d8b42e030f6f479a32369804e90ac0 | gaphas/picklers.py | gaphas/picklers.py | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow instancemethod to be pickled:
def construct_instancemethod(funcname, self, clazz):
func = getattr(clazz, funcname)
... | """
Some extra picklers needed to gracefully dump and load a canvas.
"""
import copyreg
import types
import cairo
from future import standard_library
standard_library.install_aliases()
# Allow cairo.Matrix to be pickled:
def construct_cairo_matrix(*args):
return cairo.Matrix(*args)
def reduce_cairo_matrix(m):... | Remove ununsed pickle code for instance methods | Remove ununsed pickle code for instance methods
| Python | lgpl-2.1 | amolenaar/gaphas |
a4a139e4476fefe431e6561bd0ef950cb74c0db4 | htpt/buffers.py | htpt/buffers.py | from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the data, there's n... | from constants import *
class Buffer:
"""Stores data, buffers it and sends it to the Framer"""
def __init__(self):
self.buffer = []
self.callback = None
def attach(self, callback):
self.callback = callback
def addData(self, data):
# we can't add all the data, there's not enough space
if l... | Change indentation to 2 spaces | Change indentation to 2 spaces
| Python | mit | gsathya/htpt,gsathya/htpt |
ee7a49fa7094160f27993adb25fb2d98db518cb9 | pinax/wiki/urls.py | pinax/wiki/urls.py | import os
from django.conf.urls import patterns, url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = patterns(
"",
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pin... | import os
from django.conf.urls import url
from .conf import settings
from .views import index, page, edit, file_download, file_upload
urlpatterns = [
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pinax_wiki_file_upload")
]
f... | Fix for patterns() being deprecated and now removed in Django 1.10 | Fix for patterns() being deprecated and now removed in Django 1.10 | Python | mit | pinax/pinax-wiki |
c9534dfb1b2aaa8cb4aaee3a3471ac39d956e5b7 | plugins/spotify.py | plugins/spotify.py | from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIFY_URI_REGEX, m.... | from plugins.util import command, get_url
import json
import re
SPOTIFY_URI_REGEX = r"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}"
ENDPOINT = "https://api.spotify.com/v1/{0}s/{1}"
@command()
def spotify(m):
"""Retrieve information about a Spotify URI."""
spotify_uris = re.findall(SPOTIFY_URI_REGEX, m.... | Remove URL from Spotify response | Remove URL from Spotify response
| Python | mit | molly/GorillaBot,molly/GorillaBot,quanticle/GorillaBot,quanticle/GorillaBot |
794868448bc9740bc76f9c3381ff75385f72c769 | kinetic_widget/admin.py | kinetic_widget/admin.py | from django.contrib import admin
from kinetic_widget.models import *
admin.site.register(TestWidgetSimple)
admin.site.register(TestWidgetMulti)
| from django.contrib import admin
from django.http import HttpResponse
from django.conf.urls import url, patterns
from django.shortcuts import render_to_response, render, get_object_or_404, redirect
from kinetic_widget.models import *
class TestWidgetSimpleAdmin(admin.ModelAdmin):
def get_urls(self):
urls ... | Test Widget: added support for displaying raw json | Test Widget: added support for displaying raw json
| Python | bsd-2-clause | knaperek/gits,knaperek/gits,knaperek/gits |
b6eaabd47e98d51e4392c5419a59a75a0db45bf1 | geotrek/core/tests/test_forms.py | geotrek/core/tests/test_forms.py | from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with dynamic segmentation onl... | from django.conf import settings
from django.test import TestCase
from unittest import skipIf
from geotrek.core.factories import TrailFactory, PathFactory
from geotrek.authent.factories import UserFactory
from geotrek.core.forms import TrailForm, PathForm
@skipIf(not settings.TREKKING_TOPOLOGY_ENABLED, 'Test with d... | Add tests for path overlapping check | Add tests for path overlapping check
| Python | bsd-2-clause | makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin |
8ef82138d513630f5d83adef6233c6a9386019a1 | main.py | main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | Fix problem with repeating rows. Good data on 3x3. | Fix problem with repeating rows. Good data on 3x3.
| Python | apache-2.0 | zimolzak/ffuu,zimolzak/ffuu |
a83949ef067a5302bd1bb1f428c40c1c244b9f0d | main.py | main.py | from createCollection import createCollection
from ObjectFactories.albumFactory import AlbumFactory
from ObjectFactories.bookFactory import BookFactory
from ObjectFactories.itemFactory import ItemFactory
from ObjectFactories.movieFactory import MovieFactory
def main():
createCollection('agarner','books')
... | from createCollection import createCollection
from ObjectFactories.ItemFactory import ItemFactory
from DataObjects.Collection import Collection
import datetime
import json
def main():
#createCollection('agarner','books')
now = datetime.datetime.now()
items = []
for i in range(0,10):
... | Implement export data to json test | Implement export data to json test
| Python | apache-2.0 | AmosGarner/PyInventory |
cd5802850fab20648748b4be4a47ad4cc050c32d | tests/test_fields/common_tests.py | tests/test_fields/common_tests.py | from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error = field.submit(f... | from unittest import TestCase
from lie2me import Field
class CommonTests(object):
def get_instance(self):
return self.Field()
def test_submitting_empty_value_on_required_field_returns_error(self):
field = self.get_instance()
field.required = True
value, error = field.submit(f... | Fix detail in one of the common tests | Fix detail in one of the common tests
The value returned by the submit will not necessarily be truish.
| Python | mit | hugollm/lie2me,hugollm/lie2me |
2306478f67a93e27dd9d7d397f97e3641df3516a | ipython_startup.py | ipython_startup.py | import scipy as sp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
| from __future__ import division
from __future__ import absolute_import
import scipy as sp
import itertools as it
import functools as ft
import operator as op
import sys
import sympy
# Plotting
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.pyplot import subplots
from matplotl... | Add lots of useful default imports to ipython | Add lots of useful default imports to ipython
| Python | cc0-1.0 | davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles |
109085a9f5f6eded6ea2afe1f6aabaf183980d7c | scripts/jenkins/cloud/ansible/roles/heat-generator/files/dns-update.py | scripts/jenkins/cloud/ansible/roles/heat-generator/files/dns-update.py | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | Add option for name and path of cloudConfig.yml file | Add option for name and path of cloudConfig.yml file
This change adds a command line option to the dns script to specify
the name and location of the `cloudConfig.yml` file.
Signed-off-by: Nicolas Bock <4ad6fd604400c7892c7a2cb53bf674987bcaa405@suse.com>
| Python | apache-2.0 | aspiers/automation,SUSE-Cloud/automation,gosipyan/automation,gosipyan/automation,gosipyan/automation,gosipyan/automation,SUSE-Cloud/automation,aspiers/automation,aspiers/automation,aspiers/automation,SUSE-Cloud/automation,SUSE-Cloud/automation |
58ae075463518e477185816094eb83f42ce5b77c | gcloud/bigquery/__init__.py | gcloud/bigquery/__init__.py | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Add public API entties from 'bigquery.table'. | Add public API entties from 'bigquery.table'.
| Python | apache-2.0 | CyrusBiotechnology/gcloud-python,tseaver/google-cloud-python,Fkawala/gcloud-python,waprin/gcloud-python,jonparrott/gcloud-python,EugenePig/gcloud-python,dhermes/google-cloud-python,tswast/google-cloud-python,thesandlord/gcloud-python,tswast/google-cloud-python,EugenePig/gcloud-python,jbuberel/gcloud-python,dhermes/goog... |
661baf5e280f64824bf983b710c54efccb93a41a | oscar/apps/wishlists/forms.py | oscar/apps/wishlists/forms.py | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args, **kwargs):
... | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import get_model
from django.forms.models import inlineformset_factory, fields_for_model
WishList = get_model('wishlists', 'WishList')
Line = get_model('wishlists', 'Line')
class WishListForm(forms.ModelForm):
def __init__(self, user, *args,... | Set size on wishlist line quantity form field | Set size on wishlist line quantity form field
This doesn't actually work since there is an overriding CSS style. When
issue #851 is resolved, this should start working.
| Python | bsd-3-clause | sasha0/django-oscar,nickpack/django-oscar,elliotthill/django-oscar,DrOctogon/unwash_ecom,josesanch/django-oscar,bnprk/django-oscar,kapari/django-oscar,marcoantoniooliveira/labweb,solarissmoke/django-oscar,kapt/django-oscar,nickpack/django-oscar,machtfit/django-oscar,jlmadurga/django-oscar,marcoantoniooliveira/labweb,Bo... |
e5322958f14b2428b74de726476fd98adae8c454 | app.py | app.py | from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
@app.route('/')
def main():
return redirect('/index')
@app.route('/index', methods=['GET', 'POS... | from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save
app = Flask(__name__)
# @app.route('/')
# def main():
# return redirect('/index')
@app.route('/', methods=['GET', 'PO... | Remove redirect to avoid Chrome privacy error | Remove redirect to avoid Chrome privacy error
| Python | mit | gsganden/pitcher-reports,gsganden/pitcher-reports |
67a102e5da283e318928028e54f6a85b4d266043 | nipap/nipap/nipapconfig.py | nipap/nipap/nipapconfig.py | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | Remove requirement on presence of config file | Remove requirement on presence of config file
The NipapConfig object required the presence of a configuration file. As
it is benficial to be able to load the NipapConfig without a
configuration file (for example when building docs using Sphinx), this
requirement has been removed.
| Python | mit | fredsod/NIPAP,ettrig/NIPAP,SoundGoof/NIPAP,ettrig/NIPAP,fredsod/NIPAP,ettrig/NIPAP,ettrig/NIPAP,garberg/NIPAP,bbaja42/NIPAP,bbaja42/NIPAP,SoundGoof/NIPAP,SpriteLink/NIPAP,plajjan/NIPAP,fredsod/NIPAP,bbaja42/NIPAP,garberg/NIPAP,fredsod/NIPAP,SoundGoof/NIPAP,SpriteLink/NIPAP,SoundGoof/NIPAP,plajjan/NIPAP,SpriteLink/NIPAP... |
441ecd25c9fdbc3acbe0e345bbaeafd8de9e3b73 | tests/test_srvy.py | tests/test_srvy.py | import unittest
import context
from srvy.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.assertEqual(get_c... | import unittest
import context
from collection.srvy import get_current_questions
class MyTest(unittest.TestCase):
def setUp(self):
self.questions = ["Question 1?", "Question 2?", "Question 3?", "Question 4?"]
def test_get_current_questions_gets_all_questions_from_file(self):
self.assertEqua... | Update unittest to check get_current_questions | Update unittest to check get_current_questions
| Python | mit | andrewlrogers/srvy |
c4741e3246ca85d621f10530e9d70a85cdff7414 | learn/my_pbkdf2.py | learn/my_pbkdf2.py | import ctypes
__all__ = ["pbkdf2"]
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iterations, outlen):
targetbuf = cBuf("\0" * outlen)
ret = libssl.PKCS5_PBKDF2_HMAC_SHA1(
... | import ctypes
import platform
__all__ = ["pbkdf2"]
name = "libssl.%s" % ("dylib" if platform.system() == "Darwin" else "so")
libssl = ctypes.CDLL("libssl.dylib")
libssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int
def cBuf(data):
return ctypes.create_string_buffer(data, len(data))
def pbkdf2(password, salt, iter... | Load .so if not on Crap OS X | Load .so if not on Crap OS X
| Python | bsd-2-clause | tzwenn/luksfs |
058a0eb16a5a807c137553042f973c907d231cf1 | ndb/operate/__init__.py | ndb/operate/__init__.py | # coding=utf-8
import node_locate
import node_filter
import node_select
import node_update
import node_delete
import node_insert
import node_script
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
return node_update.N... | # coding=utf-8
import node_locate
import node_select
import node_update
import node_delete
import node_insert
import node_script
import node_clean
import node_travel
def select(node, path, action=None):
return node_select.NodeSelect().select(node, path, action)
def update(node, path, value, action=None):
re... | Add clean and travel to operate | Add clean and travel to operate | Python | apache-2.0 | PinaeOS/ndb-py,node-db/ndb-py |
c9eb050771c487aae67e0a1f8c69ad011b6aaa90 | repomgmt/management/commands/process-build-queue.py | repomgmt/management/commands/process-build-queue.py | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | Add tailing / to APT_REPO_BASE_URL | Add tailing / to APT_REPO_BASE_URL
| Python | apache-2.0 | sorenh/python-django-repomgmt,sorenh/python-django-repomgmt |
7f611e99d36089bc6836042ba8aec2df02a56f3a | pymemcache/test/test_serde.py | pymemcache/test/test_serde.py | from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(self, value):
serialized, flags = python_memcache_serializer(b'key', value... | from unittest import TestCase
from pymemcache.serde import (python_memcache_serializer,
python_memcache_deserializer, FLAG_PICKLE,
FLAG_INTEGER, FLAG_LONG, FLAG_TEXT)
import pytest
import six
@pytest.mark.unit()
class TestSerde(TestCase):
def check(sel... | Test for expected flags with serde tests | Test for expected flags with serde tests
| Python | apache-2.0 | bwalks/pymemcache,sontek/pymemcache,pinterest/pymemcache,ewdurbin/pymemcache,pinterest/pymemcache,sontek/pymemcache |
f050c0429beffa13d94ad303c1730fef5b44f544 | pymysql/tests/test_nextset.py | pymysql/tests/test_nextset.py | from pymysql.tests import base
from pymysql import util
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur = self.con.cursor()
cur.execute("SELECT 1; SELECT 2;")
self.as... | from pymysql.tests import base
from pymysql import util
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestNextset(base.PyMySQLTestCase):
def setUp(self):
super(TestNextset, self).setUp()
self.con = self.connections[0]
def test_nextset(self):
cur... | Add multi cursor test currently failed. | Add multi cursor test currently failed.
| Python | mit | Geoion/Tornado-MySQL,PyMySQL/PyMySQL,PyMySQL/Tornado-MySQL,boneyao/PyMySQL,aio-libs/aiomysql,jwjohns/PyMySQL,yeyinzhu3211/PyMySQL,jheld/PyMySQL,eibanez/PyMySQL,pymysql/pymysql,lzedl/PyMySQL,modulexcite/PyMySQL,xjzhou/PyMySQL,xjzhou/PyMySQL,MartinThoma/PyMySQL,wraziens/PyMySQL,mosquito/Tornado-MySQL,pulsar314/Tornado-My... |
c955628b134586491265bc2e6b4045398072cead | allauth/socialaccount/providers/kakao/provider.py | allauth/socialaccount/providers/kakao/provider.py | from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['properties']
... | Handle case where email is not present | fix(kakao): Handle case where email is not present
| Python | mit | pennersr/django-allauth,rsalmaso/django-allauth,rsalmaso/django-allauth,lukeburden/django-allauth,bittner/django-allauth,AltSchool/django-allauth,pennersr/django-allauth,AltSchool/django-allauth,rsalmaso/django-allauth,AltSchool/django-allauth,lukeburden/django-allauth,bittner/django-allauth,lukeburden/django-allauth,b... |
94edf518993860dbff8d845292bfe4ce94d9fe5e | netdumplings/console/__init__.py | netdumplings/console/__init__.py | from .info import main as info
from .printer import main as printer
from .shifty import main as shifty
from .snifty import main as snifty
from .status import main as status
(
info,
printer,
shifty,
snifty,
status,
)
| from .printer import printer
from .shifty import shifty
from .shiftydetails import shiftydetails
from .shiftysummary import shiftysummary
from .snifty import snifty
(
printer,
shifty,
shiftydetails,
shiftysummary,
snifty,
)
| Update console module with new cli names | Update console module with new cli names
| Python | mit | mjoblin/netdumplings,mjoblin/netdumplings,mjoblin/netdumplings |
68e8dfb52aea3a3f6ee99b3ce2a2b479a39c19db | doc/examples/special/plot_errorfill.py | doc/examples/special/plot_errorfill.py | """
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import numpy as np
impor... | """
================
Plot `errorfill`
================
When you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to represent the error values instead of using individual bars.
"""
import numpy as np
impor... | Fix labeling on plots so it matches elements. | DOC: Fix labeling on plots so it matches elements.
| Python | bsd-3-clause | tonysyu/mpltools,matteoicardi/mpltools |
2a2c9e01b51b10594da97c5ce273073931e44c43 | social_auth/backends/pipeline/misc.py | social_auth/backends/pipeline/misc.py | from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def tuple_index(t, e):
for (i, te) in enumerate(t):
if te == e:
return i
return None
def save_status_to_session(request, auth, *arg... | from social_auth.backends import PIPELINE
from social_auth.utils import setting
PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'
def save_status_to_session(request, auth, *args, **kwargs):
"""Saves current social-auth status to session."""
next_entry = setting('SOCIAL_AUTH_PIPELI... | Revert "Add own tuple_index function to stay compatible with python 2.5" | Revert "Add own tuple_index function to stay compatible with python 2.5"
This reverts commit 7e6af723e15a785b403010de4b44b49fce924e91.
| Python | bsd-3-clause | michael-borisov/django-social-auth,qas612820704/django-social-auth,VishvajitP/django-social-auth,beswarm/django-social-auth,lovehhf/django-social-auth,antoviaque/django-social-auth-norel,qas612820704/django-social-auth,MjAbuz/django-social-auth,omab/django-social-auth,caktus/django-social-auth,VishvajitP/django-social-... |
93effb501a50d8265afd37826fbcab4dd4a87611 | qa_app/views.py | qa_app/views.py | # Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Fix user and attempts sqlalchemia request. | Fix user and attempts sqlalchemia request.
| Python | apache-2.0 | molecul/qa_app_flask,molecul/qa_app_flask,molecul/qa_app_flask |
1914bd9a9fc2f1ce7a557dd2134d98796866283d | rootpy/userdata.py | rootpy/userdata.py | """
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
DATA_ROOT = None
if os.getenv('ROOTPY_GRIDMODE') not in ('1', 'true'):
DATA_ROOT = os.getenv('ROOTPY_DATA')
if DATA_ROOT is None:
DATA_ROOT = os.path.expanduser('~/.rootpy')
else:
DATA_ROOT =... | """
This module handles creation of the user-data area
"""
import os
import tempfile
import atexit
from os.path import expanduser, expandvars, exists, isdir
if "XDG_CONFIG_HOME" not in os.environ:
os.environ["XDG_CONFIG_HOME"] = expanduser('~/.config')
if "XDG_CACHE_HOME" not in os.environ:
os.environ["XDG_C... | Use XDG base directory specificiation | Use XDG base directory specificiation
| Python | bsd-3-clause | rootpy/rootpy,rootpy/rootpy,ndawe/rootpy,kreczko/rootpy,ndawe/rootpy,kreczko/rootpy,ndawe/rootpy,kreczko/rootpy,rootpy/rootpy |
98fd04596367f94b7f47056c429ea23b2dd6165b | miller-rabin.py | miller-rabin.py | import sys, math, random
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
s = -1
quotient = modulo
remainder = 0
while remainder == 0:
quotient, remainder = divmod(quotient, 2)
s += 1
d = quotient * 2 + 1
for k in range(10):
witness = random.randint(2, modulo - 1)... | import sys, math, random
# Receive candidate number from arguments, or default to 221 for test purposes.
if len(sys.argv) > 1:
candidate = eval(sys.argv[1])
else:
candidate = 221
modulo = candidate - 1
# Write the modulo (candidate -1) number in the form
# 2^s * d.
s = 0
quotient = modulo
remainder = 0
while rema... | Add comments to Python version | Add comments to Python version
| Python | mit | boppreh/miller-rabin,boppreh/miller-rabin |
0fed2ca675967f1d43d0abacb9110875b30b0d64 | tests/test_input.py | tests/test_input.py | from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_methods.slider("Sli... | from unittest.mock import patch
from rcfc import server, input_methods
from test_helpers import IgnoredArgument
input_value = 0
def set_input_value(val):
global input_value
input_value = val
@patch("bottle.Bottle.route")
def test_slider(mock_route):
server.clear_buttons()
input_methods.slider("Sli... | Add custom rangers to slider | Add custom rangers to slider
| Python | mit | pviafore/rcfc,pviafore/rcfc,pviafore/rcfc |
91bdd47afe409e86bceca71ebb07ae1975e9073a | tests/test_sweep.py | tests/test_sweep.py | import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
res... | import os
import numpy as np
import crepe
def test_sweep():
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
model = crepe.build_and_load_model()
crepe.process_file(model, file)
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
res... | Fix bug in unit test (ignore header row in output csv file) | Fix bug in unit test (ignore header row in output csv file)
| Python | mit | marl/crepe |
fcfe2513fc8532dc2212a254da42d75048e76de7 | form_designer/tests/test_cms_plugin.py | form_designer/tests/test_cms_plugin.py | from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models import FormDefini... | import django
from django.contrib.auth.models import AnonymousUser
from django.utils.crypto import get_random_string
import pytest
from cms import api
from cms.page_rendering import render_page
from form_designer.contrib.cms_plugins.form_designer_form.cms_plugins import FormDesignerPlugin
from form_designer.models imp... | Disable Django-CMS test on Django 1.10+ | Disable Django-CMS test on Django 1.10+
Someone with the time and inclination should set up the test to work with a Django-CMS version compatible with Django 1.10+, then try again
| Python | bsd-3-clause | andersinno/django-form-designer-ai,kcsry/django-form-designer,andersinno/django-form-designer,andersinno/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer-ai |
1d82b988fdd913e291ed73552964c8724934ad32 | tools/build_interface_docs.py | tools/build_interface_docs.py | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
... | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
import sys
# local imports
from interfacedocgen import InterfaceHelpWriter
#*****************************************************************************
if __name__ == '__main__':
nipypepath = os.path.abspath('..')
... | Remove pymvpa from documentation build. | Remove pymvpa from documentation build.
git-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@931 ead46cd0-7350-4e37-8683-fc4c6f79bf00
| Python | bsd-3-clause | arokem/nipype,grlee77/nipype,JohnGriffiths/nipype,wanderine/nipype,fprados/nipype,fprados/nipype,christianbrodbeck/nipype,dgellis90/nipype,wanderine/nipype,sgiavasis/nipype,arokem/nipype,rameshvs/nipype,mick-d/nipype,FredLoney/nipype,mick-d/nipype_source,mick-d/nipype,blakedewey/nipype,sgiavasis/nipype,rameshvs/nipype,... |
0c69c3e25f52ab126886a2a2f1c33d099d0bb5a4 | annfab/distances/matrix_cosine.py | annfab/distances/matrix_cosine.py | import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).distance(x, y)
... | import numpy as np
import nearpy.distances
class MatrixCosineDistance(nearpy.distances.CosineDistance):
"""
A distance measure for calculating the cosine distance between matrices.
"""
def distance(self, x, y):
if len(x.shape) <= 1:
return super(MatrixCosineDistance, self).distan... | Add simple tests for matrix operands for distance measure. | Add simple tests for matrix operands for distance measure.
| Python | mit | elezar/ann-fab,elezar/ann-fab,elezar/ann-fab |
6723dd3e2980d040cef4f7d0f7675933666eb088 | tests/benchmarks/constructs/LocalVariableAssign.py | tests/benchmarks/constructs/LocalVariableAssign.py | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | Enhance construct test to avoid local variable optimization. | Tests: Enhance construct test to avoid local variable optimization.
| Python | apache-2.0 | wfxiang08/Nuitka,kayhayen/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,tempbottle/Nuitka,wfxiang08/Nuitka |
6f939e9c2bd4cf42cb4ad58112375f36abf489bf | terraform/templates/sch_log_parser.py | terraform/templates/sch_log_parser.py | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | Add group/job info to job dashboard | Add group/job info to job dashboard
Signed-off-by: Salim Alam <18ae4dd1e3db1d49a738226169e3b099325c79a0@chef.io>
| Python | apache-2.0 | habitat-sh/habitat,nathenharvey/habitat,nathenharvey/habitat,georgemarshall/habitat,georgemarshall/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,nathenharvey/habitat,rsertelon/habitat,nathenharvey/habitat,habitat-sh/habitat,georg... |
29ecb6f6bac85aeecba6b2602744f178735c0adc | pyautoupdate/_move_glob.py | pyautoupdate/_move_glob.py | import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob(src):
... | import glob
import shutil
import os
if os.name == "nt":
from .ntcommonpath import commonpath
else:
from .posixcommonpath import commonpath
def move_glob(src,dst):
"""Moves files from src to dest.
src may be any glob to recognize files. dst must be a folder."""
for obj in glob.iglob(src):
... | Fix bug in copy_glob when destination directory already has files | Fix bug in copy_glob when destination directory already has files
| Python | lgpl-2.1 | rlee287/pyautoupdate,rlee287/pyautoupdate |
7698ad7a907da5e7b4ad7cfd40255bb9c44b5b87 | scripts/sort-cluster-issue.py | scripts/sort-cluster-issue.py | #!/usr/bin/python
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
from pyspark.sql.functions import asc, desc
if __name__ == "__main__":
sc = SparkContext(appName='resort data')
sqlContext = SQLContext(sc)
df = sqlContext.read.load('hdfs://discovery3:9000/tmp/dasmith/c19-20160919-a50-o... | #!/usr/bin/python
from __future__ import print_function
import sys
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.functions import desc
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: sort-cluster-issue.py <input> <output>", file=sys.stderr)
exit(-1)
sc... | Use command-line arguments for paths. | Use command-line arguments for paths.
| Python | apache-2.0 | ViralTexts/vt-passim,ViralTexts/vt-passim,ViralTexts/vt-passim |
742e5e7a998e8e397a438d4edf9fa3d6234009fc | popit/migrations/0001_initial.py | popit/migrations/0001_initial.py | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['{{ app_name }}']
| # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
complete_apps = ['popit']
| Replace placeholders with actual app name | Replace placeholders with actual app name
| Python | agpl-3.0 | ciudadanointeligente/popit-django,mysociety/popit-django,ciudadanointeligente/popit-django,mysociety/popit-django,mysociety/popit-django,ciudadanointeligente/popit-django |
27e86c661021b1276123b264f00536fc89d203c4 | common/templatetags/lutris.py | common/templatetags/lutris.py | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | import copy
from django import template
from django.conf import settings
from games import models
register = template.Library()
def get_links(user_agent):
systems = ['ubuntu', 'fedora', 'linux']
downloads = copy.copy(settings.DOWNLOADS)
main_download = None
for system in systems:
if system ... | Fix download link , again | Fix download link , again
| Python | agpl-3.0 | Turupawn/website,Turupawn/website,lutris/website,lutris/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website |
a367b1d4bdbb639b4eab862c7ce691eb4a861d26 | wandb/compat/windows.py | wandb/compat/windows.py | """
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
# If we found an unsafe character, escape with doub... | """
Windows-related compatibility helpers.
"""
import re
_find_unsafe = re.compile(r'[\s<>|&^]').search
def quote_arg(s):
"""Based on shlex.quote in the standard library."""
if not s:
return '""'
if _find_unsafe(s) is None:
return s
if s.startswith('"') and s.endswith('"'):
re... | Add check for args which are already quotes | Add check for args which are already quotes
| Python | mit | wandb/client,wandb/client,wandb/client |
508ca596d46c08fdc9295769059f5de974b2d1df | base/components/accounts/admin.py | base/components/accounts/admin.py | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
super(ContributorMixin, self).save_model(request, obj, form, change)
if not change:
obj.... | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Editor
class ContributorMixin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
if not change:
obj.submitted_by = request.user
obj.edited_by.add(request.user)
o... | Move this to the bottom... | Move this to the bottom...
| Python | apache-2.0 | hello-base/web,hello-base/web,hello-base/web,hello-base/web |
1a04c983eb921f47452ea6c013313f90875c400f | pkgconf/__init__.py | pkgconf/__init__.py | import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
if callab... | import sys
from functools import partial, update_wrapper
from django.utils import six
def proxy(attr, default):
def wrapper(self):
# It has to be most recent,
# to override settings in tests
from django.conf import settings
value = getattr(settings, attr, default)
if callab... | Fix "import star" feature support | Fix "import star" feature support
`dict.keys()` returns `dict_keys` object in py3,
which does not support indexing.
| Python | bsd-3-clause | byashimov/django-pkgconf |
d61bc5d2d5dad607332bfe131e537d139011ab57 | main.py | main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
if __name__ == "__main__":
bot = Bot()
bot.start() | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bot import Bot
import os
import signal
def signal_handler(signal, frame):
print "Caught SIGINT, terminating."
os._exit(0)
if __name__ == "__main__":
bot = Bot()
bot.start()
signal.signal(signal.SIGINT, signal_handler)
while Ture:
signa... | Allow program termination using SIGINT | Allow program termination using SIGINT
It's a rather crude method, but it works.
| Python | mit | gehaxelt/python-rss2irc |
c49024439978fddee1cd688524741e8ee482132b | pi_gpio/sockets.py | pi_gpio/sockets.py | from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PIN_MANAGER.read_... | from flask.ext.socketio import emit
from pi_gpio import socketio
from config.pins import PinManager
PIN_MANAGER = PinManager()
@socketio.on('pin:list')
def pin_list():
response = PIN_MANAGER.read_all()
emit('pin:list', response)
@socketio.on('pin:read')
def pin_read(data):
response = PIN_MANAGER.read_... | Fix the usage of dict object | Fix the usage of dict object
Fix this error:
```sh
pi@raspberrypi:~/Pi-GPIO-Server $ !sudo
sudo python pi_gpio_server.py
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run
result = self._run(*self.args, **self.kwargs)
File "/usr/local/... | Python | mit | projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server |
324c61e220fcb66973007cab4b95ca249aef3274 | bvggrabber/api/actualdeparture.py | bvggrabber/api/actualdeparture.py | # -*- coding: utf-8 -*-
| # -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from bvggrabber.api import QueryApi, Departure
ACTUAL_QUERY_API_ENDPOINT = 'http://mobil.bvg.de/IstAbfahrtzeiten/index/mobil'
class ActualDepartureQueryApi(QueryApi):
def __init__(self, station):
super(ActualDepartureQueryApi, se... | Add first attempt of ActualDepartureQueryApi | Add first attempt of ActualDepartureQueryApi
| Python | bsd-3-clause | MarkusH/bvg-grabber |
98bb4305ccdd8a83763bedb1f09c261e9904487c | cla_backend/apps/legalaid/tests/test_views.py | cla_backend/apps/legalaid/tests/test_views.py | import unittest
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from legalaid.tests.views.test_base import CLAProviderAuthBaseApiTestMixin
from legalaid.views import FullCaseViewSet
from... | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from legalaid.views import FullCaseViewSet
from cla_backend.apps.call_centre.permissions impor... | Refactor the test for the method test_filter inside class FullCaseViewSet and create a new test that allows you to test for just ASCII characters | Refactor the test for the method test_filter inside class FullCaseViewSet and create a new test that allows you to test for just ASCII characters
| Python | mit | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend |
e9a5bbd1eba1cdad15626a712bfc7994008c7381 | byceps/blueprints/snippet/init.py | byceps/blueprints/snippet/init.py | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | """
byceps.blueprints.snippet.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import current_app
from ...services.snippet import mountpoint_service
from .views import blueprint as snippet_blueprint, view_current_version_b... | Fix snippet URL rules to use mountpoints' endpoint suffix | Fix snippet URL rules to use mountpoints' endpoint suffix
| Python | bsd-3-clause | m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps |
5611d502c30ee0274fcd523deffcb68c77f31fd8 | basic.py | basic.py |
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
return 'okay.'
@cmd
def make(even... |
from brutal.core.plugin import BotPlugin, cmd, event, match, threaded
@cmd
def ping(event):
"""Responds 'pong' to your 'ping'."""
return 'pong'
@cmd
def echo(event):
"""Echoes back the message it recieves."""
return ' '.join(event.args)
@cmd
def sudo(event):
"""Responds 'okay.' to your 'sudo ... | Add docstrings to 'sudo' and 'make'. | Add docstrings to 'sudo' and 'make'. | Python | apache-2.0 | Adman/brutal-plugins,mrshu/brutal-plugins |
d37cac61f1457609806fba507cf9568188d1664d | button.py | button.py | import RPi.GPIO as GPIO
import time
import os
#sets the Input Pin for your Button
#in this case it is GPIO24 or HardwarePin 19
buttonPin = 19
#sets GPIO Mode to use Hardware Pin Layout
GPIO.setmode(GPIO.BCM)
#sets GPIO Pin to INPUT mode with a Pull Down Resistor
GPIO.setup(buttonPin,GPIO.IN, pull_up_down=GPIO.PUD_DOWN... | import RPi.GPIO as GPIO
import time
import os
import sys
from optparse import OptionParser
# Parse input arguments
parser = OptionParser()
parser.add_option("-t", "--testGPIO", action="store_true", help="Test GPIO connection, does not call the JS script.")
# The option --pin sets the Input Pin for your Button
# It d... | Allow parsing of option arguments and basic GPIO testing. | Allow parsing of option arguments and basic GPIO testing.
| Python | mit | henne-/guest-password-printer,henne-/guest-password-printer |
eb39ec42078994eac9a5d085f35bcb35dea77a64 | salt/states/apt.py | salt/states/apt.py | # Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name}
state = __salt__['pkg.get_... | # Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def held(name):
'''
Set package in 'hold' state, meaning it will not be upgraded.
name
The name of the package, e.g., 'tmux'
'''
ret = {'name': name, 'changes': {}, 'result': False... | Make dict updates more dense | Make dict updates more dense
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt |
d0818c7dcabebe7697444b73b6b8f30ade73958d | openedx/core/djangoapps/appsembler/eventtracking/utils.py | openedx/core/djangoapps/appsembler/eventtracking/utils.py | """
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an event.
Retu... | """
Utility functions for event tracking processing.
"""
from django.core.exceptions import MultipleObjectsReturned
from . import exceptions
def get_site_config_for_event(event_props):
"""
Try multiple strategies to find a SiteConfiguration object to use
for evaluating and processing an event.
Retu... | Return exeption if cannot get the site config in event | Return exeption if cannot get the site config in event
| Python | agpl-3.0 | appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.