commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
a1de1f26d30a753c7e3ea66a600b04fb130b02ec | hellomama_registration/testsettings.py | hellomama_registration/testsettings.py | from hellomama_registration.settings import * # flake8: noqa
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'TESTSEKRET'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
CELERY_ALWAYS_EAGE... | from hellomama_registration.settings import * # flake8: noqa
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'TESTSEKRET'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
CELERY_ALWAYS_EAGE... | Use MD5 password hasher for test runs | Use MD5 password hasher for test runs
| Python | bsd-3-clause | praekelt/hellomama-registration,praekelt/hellomama-registration | ---
+++
@@ -15,3 +15,5 @@
METRICS_URL = "http://metrics-url"
METRICS_AUTH_TOKEN = "REPLACEME"
+
+PASSWORD_HASHERS = ('django.contrib.auth.hashers.MD5PasswordHasher',) |
f7a9391c22a1b69bcd645a3efbe41f32e91e668c | hb_res/resources/ExplanationStorage.py | hb_res/resources/ExplanationStorage.py | __author__ = 'skird'
class ExplanationStorage:
"""
Interface of abstract readable/writeable resource
Every resource is a map from string to list of strings
It supports random access and provides iterator on its elements
"""
def entries(self):
return NotImplementedError
def add_en... | __author__ = 'skird'
class ExplanationStorage:
"""
Interface of abstract readable/writeable resource
Every resource is a map from string to list of strings
It supports random access and provides iterator on its elements
"""
def entries(self):
raise NotImplementedError
def add_ent... | Fix typo with return instead of raise | Fix typo with return instead of raise
| Python | mit | hatbot-team/hatbot_resources | ---
+++
@@ -9,7 +9,7 @@
"""
def entries(self):
- return NotImplementedError
+ raise NotImplementedError
def add_entry(self, entry) -> None:
raise NotImplementedError |
6629a3a238432522d77f840b465eb99a3745593f | django_base64field/tests/models.py | django_base64field/tests/models.py | from django.db import models
from django.utils.baseconv import base64
from django_base64field.fields import Base64Field
class Planet(models.Model):
ek = Base64Field()
name = models.CharField(
default='Fucker',
max_length=103
)
class Continent(models.Model):
ek = Base64Field()
nam... | from django.db import models
from django.utils.baseconv import base64
from django_base64field.fields import Base64Field
class Planet(models.Model):
# Making `ek` unique just because it will be used as `FK`
# in other models.
ek = Base64Field(unique=True)
name = models.CharField(
default='Fucke... | Add little bit comments for Planet model | Add little bit comments for Planet model
| Python | bsd-3-clause | Alir3z4/django-base64field | ---
+++
@@ -4,7 +4,9 @@
class Planet(models.Model):
- ek = Base64Field()
+ # Making `ek` unique just because it will be used as `FK`
+ # in other models.
+ ek = Base64Field(unique=True)
name = models.CharField(
default='Fucker',
max_length=103 |
084eac5735404edeed62cee4e2b429c8f4f2a7a5 | app/dao/inbound_numbers_dao.py | app/dao/inbound_numbers_dao.py | from app import db
from app.dao.dao_utils import transactional
from app.models import InboundNumber
def dao_get_inbound_numbers():
return InboundNumber.query.all()
def dao_get_available_inbound_numbers():
return InboundNumber.query.filter(InboundNumber.active, InboundNumber.service_id.is_(None)).all()
def... | from app import db
from app.dao.dao_utils import transactional
from app.models import InboundNumber
def dao_get_inbound_numbers():
return InboundNumber.query.order_by(InboundNumber.updated_at, InboundNumber.number).all()
def dao_get_available_inbound_numbers():
return InboundNumber.query.filter(InboundNumbe... | Update dao to order by updated_at, number | Update dao to order by updated_at, number
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | ---
+++
@@ -4,7 +4,7 @@
def dao_get_inbound_numbers():
- return InboundNumber.query.all()
+ return InboundNumber.query.order_by(InboundNumber.updated_at, InboundNumber.number).all()
def dao_get_available_inbound_numbers(): |
e8ebb4e9be78e32bc59b1f03cd4854add1148de3 | extra.py | extra.py | Import('env')
env.Append(CXXFLAGS=["-std=c++11"], CPPPATH=["src/wakaama", "wakaama"])
| Import('env')
env.Append(CFLAGS=["-std=gnu11"], CXXFLAGS=["-std=c++11"], CPPPATH=["src/wakaama", "wakaama"])
| Make C11 default. pio should actually do this. | Make C11 default. pio should actually do this.
Signed-off-by: David Graeff <cddf4d21ffd604ccd3fdffe1267f1f9d72e179ea@web.de>
| Python | mit | Openhab-Nodes/libWakaamaEmb,Openhab-Nodes/libWakaamaEmb,Openhab-Nodes/libWakaamaEmb,Openhab-Nodes/libWakaamaEmb | ---
+++
@@ -1,2 +1,2 @@
Import('env')
-env.Append(CXXFLAGS=["-std=c++11"], CPPPATH=["src/wakaama", "wakaama"])
+env.Append(CFLAGS=["-std=gnu11"], CXXFLAGS=["-std=c++11"], CPPPATH=["src/wakaama", "wakaama"]) |
ec867f87441af657f0138ec723de4a52299284d8 | src/epiweb/apps/survey/urls.py | src/epiweb/apps/survey/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^profile/$', 'epiweb.apps.survey.views.profile_index'),
(r'^thanks/$', 'epiweb.apps.survey.views.thanks'),
url(r'^people/$', 'epiweb.apps.survey.views.people', name='survey_people'),
url(r'^people/add/$', 'epiweb.apps.survey.views.pe... | from django.conf.urls.defaults import *
from . import views
urlpatterns = patterns('',
(r'^profile/$', views.profile_index),
(r'^thanks/$', views.thanks),
url(r'^people/$', views.people, name='survey_people'),
url(r'^people/add/$', views.people_add, name='survey_people_add'),
(r'^$', views.index),... | Use view's function instead of its name | Use view's function instead of its name
| Python | agpl-3.0 | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website | ---
+++
@@ -1,10 +1,12 @@
from django.conf.urls.defaults import *
+from . import views
+
urlpatterns = patterns('',
- (r'^profile/$', 'epiweb.apps.survey.views.profile_index'),
- (r'^thanks/$', 'epiweb.apps.survey.views.thanks'),
- url(r'^people/$', 'epiweb.apps.survey.views.people', name='survey_people'... |
e85e5ea6e2a8b188ff79d114ae0546c8d3ca4c73 | examples/MNIST/mnist.py | examples/MNIST/mnist.py | import os
import gzip
import pickle
import sys
# Python 2/3 compatibility.
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
'''Adapted from theano tutorial'''
def load_mnist(data_file = os.path.join(os.path.dirname(__file__), 'mnist.pkl.gz')):
if not os.pa... | import os
import gzip
import pickle
import sys
# Python 2/3 compatibility.
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
'''Adapted from theano tutorial'''
def load_mnist(data_file = os.path.join(os.path.dirname(__file__), 'mnist.pkl.gz')):
if not os.pa... | Simplify code loading MNIST dataset. | Simplify code loading MNIST dataset.
| Python | mit | VisualComputingInstitute/Beacon8,lucasb-eyer/DeepFried2,elPistolero/DeepFried2,yobibyte/DeepFried2,Pandoro/DeepFried2 | ---
+++
@@ -16,21 +16,14 @@
def load_mnist(data_file = os.path.join(os.path.dirname(__file__), 'mnist.pkl.gz')):
if not os.path.exists(data_file):
- origin = ('http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.pkl.gz')
- print('Downloading data from %s' % origin)
+ origin = 'http://... |
6ce0b5fabd3573ac3c3feb30e8fb48af16d2504f | apps/users/tests/test_profile_admin.py | apps/users/tests/test_profile_admin.py | import fudge
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from users.models import Profile, Link
class ProfileAdmin(TestCase):
def setUp(self):
self.client = Client()
self.User = User.objects.create(
... | from contextlib import contextmanager
import fudge
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from users.models import Profile, Link
@contextmanager
def given_user(fake_auth, user):
"""Context manager to respond to any login... | Fix the profile test to log in as the test user. | Fix the profile test to log in as the test user. | Python | bsd-3-clause | mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/mozilla-ignite | ---
+++
@@ -1,3 +1,5 @@
+from contextlib import contextmanager
+
import fudge
from django.test import TestCase, Client
@@ -5,6 +7,14 @@
from django.contrib.auth.models import User
from users.models import Profile, Link
+
+
+@contextmanager
+def given_user(fake_auth, user):
+ """Context manager to respond t... |
bcfb29272d727ee2775c9f212053725e4a562752 | pip_review/__init__.py | pip_review/__init__.py | from functools import partial
import subprocess
import requests
import multiprocessing
import json
def get_pkg_info(pkg_name, session):
r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
if r.status_code == requests.codes.ok:
return json.loads(r.text)
else:
raise ValueErr... | from functools import partial
import subprocess
import urllib2
import multiprocessing
import json
def get_pkg_info(pkg_name):
req = urllib2.Request('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
handler = urllib2.urlopen(req)
status = handler.getcode()
if status == 200:
content = handler... | Remove the requests dependency altogether. | Remove the requests dependency altogether.
(Makes no sense for such small a tool.)
| Python | bsd-2-clause | suutari-ai/prequ,suutari/prequ,suutari/prequ | ---
+++
@@ -1,21 +1,24 @@
from functools import partial
import subprocess
-import requests
+import urllib2
import multiprocessing
import json
-def get_pkg_info(pkg_name, session):
- r = session.get('http://pypi.python.org/pypi/%s/json' % (pkg_name,))
- if r.status_code == requests.codes.ok:
- ret... |
f9f12e89e526b2645f013fc5856488d105a39d5a | bouncer/sentry.py | bouncer/sentry.py | """Report exceptions to Sentry/Raven."""
from pyramid import tweens
import raven
from bouncer import __version__
def get_raven_client(request):
"""Return the Raven client for reporting crashes to Sentry."""
client = request.registry["raven.client"]
client.http_context({
"url": request.url,
... | """Report exceptions to Sentry/Raven."""
import os
import raven
from bouncer import __version__
def get_raven_client(request):
"""Return the Raven client for reporting crashes to Sentry."""
client = request.registry["raven.client"]
client.http_context({
"url": request.url,
"method": re... | Add environment name to Sentry client | Add environment name to Sentry client
Skyliner provides the ENV environment variable for our application,
which contains either "prod" or "qa" depending on the environment.
Sentry supports partitioning reports based on the environment within a
single application. Adding this metadata to the `Client` allows us to
migr... | Python | bsd-2-clause | hypothesis/bouncer,hypothesis/bouncer,hypothesis/bouncer | ---
+++
@@ -1,5 +1,7 @@
"""Report exceptions to Sentry/Raven."""
-from pyramid import tweens
+
+import os
+
import raven
from bouncer import __version__
@@ -21,8 +23,10 @@
def includeme(config):
- config.registry["raven.client"] = raven.Client(
- release=__version__)
+ environment = os.environ.... |
79cb9edf45ed77cdaa851e45d71f10c69db41221 | benchexec/tools/yogar-cbmc-parallel.py | benchexec/tools/yogar-cbmc-parallel.py | """
BenchExec is a framework for reliable benchmarking.
This file is part of BenchExec.
Copyright (C) 2007-2015 Dirk Beyer
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
ht... | """
BenchExec is a framework for reliable benchmarking.
This file is part of BenchExec.
Copyright (C) 2007-2015 Dirk Beyer
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
ht... | Add forgotten program file for deployment | Add forgotten program file for deployment
| Python | apache-2.0 | ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,dbeyer/benchexec,dbeyer/benchexec,sosy-lab/benchexec | ---
+++
@@ -19,6 +19,10 @@
class Tool(yogar_cbmc.Tool):
+ REQUIRED_PATHS = [
+ "yogar-cbmc"
+ ]
+
def executable(self):
return util.find_executable('yogar-cbmc-parallel')
|
94c943b3dcabb1611a745caef0ecf6da10e807e4 | kiteconnect/__version__.py | kiteconnect/__version__.py | __title__ = "kiteconnect"
__description__ = "The official Python client for the Kite Connect trading API"
__url__ = "https://kite.trade"
__download_url__ = "https://github.com/zerodhatech/pykiteconnect"
__version__ = "3.7.0"
__author__ = "Zerodha Technology Pvt ltd. (India)"
__author_email__ = "talk@zerodha.tech"
__lic... | __title__ = "kiteconnect"
__description__ = "The official Python client for the Kite Connect trading API"
__url__ = "https://kite.trade"
__download_url__ = "https://github.com/zerodhatech/pykiteconnect"
__version__ = "3.7.0.b1"
__author__ = "Zerodha Technology Pvt ltd. (India)"
__author_email__ = "talk@zerodha.tech"
__... | Mark release as beta in setup.py | Mark release as beta in setup.py
| Python | mit | rainmattertech/pykiteconnect | ---
+++
@@ -2,7 +2,7 @@
__description__ = "The official Python client for the Kite Connect trading API"
__url__ = "https://kite.trade"
__download_url__ = "https://github.com/zerodhatech/pykiteconnect"
-__version__ = "3.7.0"
+__version__ = "3.7.0.b1"
__author__ = "Zerodha Technology Pvt ltd. (India)"
__author_ema... |
6b53e14ec1f5c71d2aa1f17a4108f4e1d88e8b89 | pywikibot/families/wikia_family.py | pywikibot/families/wikia_family.py | # -*- coding: utf-8 -*-
__version__ = '$Id$'
import family
# The Wikia Search family
# user-config.py: usernames['wikia']['wikia'] = 'User name'
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = u'wikia'
self.langs = {
u'wikia': None,... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
import family
# The Wikia Search family
# user-config.py: usernames['wikia']['wikia'] = 'User name'
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = u'wikia'
self.langs = {
u'wikia': None,... | Update a version number from trunk r9016 | Update a version number from trunk r9016
git-svn-id: 9a050473c2aca1e14f53d73349e19b938c2cf203@9040 6a7f98fc-eeb0-4dc1-a6e2-c2c589a08aa6
| Python | mit | legoktm/pywikipedia-rewrite | ---
+++
@@ -20,7 +20,7 @@
return u'www.wikia.com'
def version(self, code):
- return "1.15.1"
+ return "1.16.2"
def scriptpath(self, code):
return '' |
98f1df191febd889fcde861f94a9ca126c60ea37 | tests/GIR/runalltests.py | tests/GIR/runalltests.py | # -*- Mode: Python -*-
import os
import glob
import sys
import shutil
import unittest
testLoader = unittest.TestLoader()
names = []
for filename in glob.iglob("test_*.py"):
names.append(filename[:-3])
names.sort()
testSuite = testLoader.loadTestsFromNames(names)
runner = unittest.TextTestRunner(verbosity=2)
resu... | # -*- Mode: Python -*-
import os
import glob
import sys
import shutil
import unittest
if os.path.isfile("./test_data/test_gir.db"):
os.remove("./test_data/test_gir.db")
testLoader = unittest.TestLoader()
names = []
for filename in glob.iglob("test_*.py"):
names.append(filename[:-3])
names.sort()
testSuite = t... | Remove SQLite database before running tests | Remove SQLite database before running tests
| Python | lgpl-2.1 | midgardproject/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core | ---
+++
@@ -6,6 +6,9 @@
import shutil
import unittest
+
+if os.path.isfile("./test_data/test_gir.db"):
+ os.remove("./test_data/test_gir.db")
testLoader = unittest.TestLoader()
@@ -24,8 +27,5 @@
except OSError:
pass
-if os.path.isfile("./test_data/test_gir.db"):
- os.remove("./test_data/test_gir.db")... |
74dcf36c2eecab290c1c76c947b024e51d280ea7 | tests/test_rover_init.py | tests/test_rover_init.py | def test_rover_init_with_default_parameters():
from rover import Rover
rover = Rover()
assert rover.x == 0
assert rover.y == 0
assert rover.direction == 'N'
def test_rover_init_with_custom_parameters():
from rover import Rover
rover = Rover(3, 7, 'W')
assert rover.x == 3
assert rove... | def test_rover_init_with_default_parameters():
from rover import Rover
rover = Rover()
assert rover.x == 0
assert rover.y == 0
assert rover.direction == 'N'
assert rover.grid_x == 50
assert rover.grid_y == 50
def test_rover_init_with_custom_parameters():
from rover import Rover
rov... | Add testing for default grid_* values | Add testing for default grid_* values
| Python | mit | authentik8/rover | ---
+++
@@ -5,12 +5,18 @@
assert rover.y == 0
assert rover.direction == 'N'
+ assert rover.grid_x == 50
+ assert rover.grid_y == 50
+
def test_rover_init_with_custom_parameters():
from rover import Rover
rover = Rover(3, 7, 'W')
assert rover.x == 3
assert rover.y == 7
asser... |
a9a01b2bb07fadb6e9ab07228fc6857f28e4d444 | src/edge/context_processors.py | src/edge/context_processors.py | import os
def export_envs(request):
data = {}
data['FULLSTORY_ORG_ID'] = os.getenv('FULLSTORY_ORG_ID', '')
return data
| import os
def export_envs(request):
data = {}
data['FULLSTORY_ORG_ID'] = os.getenv('FULLSTORY_ORG_ID', '')
return data
| Fix flake8 error by adding extra line | Fix flake8 error by adding extra line
| Python | mit | ginkgobioworks/edge,ginkgobioworks/edge,ginkgobioworks/edge,ginkgobioworks/edge | ---
+++
@@ -1,4 +1,5 @@
import os
+
def export_envs(request):
data = {} |
fa7ffa32f0484c45a665de2766a97ae7a23a0b6d | pyicloud/utils.py | pyicloud/utils.py | import getpass
import keyring
from .exceptions import NoStoredPasswordAvailable
KEYRING_SYSTEM = 'pyicloud://icloud-password'
def get_password(username, interactive=True):
try:
return get_password_from_keyring(username)
except NoStoredPasswordAvailable:
if not interactive:
raise... | import getpass
import keyring
from .exceptions import NoStoredPasswordAvailable
KEYRING_SYSTEM = 'pyicloud://icloud-password'
def get_password(username, interactive=True):
try:
return get_password_from_keyring(username)
except NoStoredPasswordAvailable:
if not interactive:
raise... | Tweak wording of password prompt | Tweak wording of password prompt
iCloud is branded with a lower case 'i' like most other Apple products.
| Python | mit | picklepete/pyicloud,picklepete/pyicloud | ---
+++
@@ -15,7 +15,7 @@
raise
return getpass.getpass(
- 'ICloud Password for {username}: '.format(
+ 'Enter iCloud password for {username}: '.format(
username=username,
)
) |
cd189a5cbf8cbb567efaba0e92b3c31278817a39 | pnrg/filters.py | pnrg/filters.py | from jinja2._compat import text_type
import re
def do_right(value, width=80):
"""Right-justifies the value in a field of a given width."""
return text_type(value).rjust(width)
_LATEX_SUBS = (
(re.compile(r'\\'), r'\\textbackslash'),
(re.compile(r'([{}_#%&$])'), r'\\\1'),
(re.compile(r'~'), r'\~{}'... | from jinja2._compat import text_type
import re
def do_right(value, width=80):
"""Right-justifies the value in a field of a given width."""
return text_type(value).rjust(width)
_LATEX_SUBS = (
(re.compile(r'\\'), r'\\textbackslash'),
(re.compile(r'([{}_#%&$])'), r'\\\1'),
(re.compile(r'~'), r'\~{}'... | Use Computer Modern for \LaTeX macro | Use Computer Modern for \LaTeX macro
Source Sans pro (and most othe sans-serif fonts) render the LaTeX macro
pretty weirdly, so the classic Computer Modern should be okay here. It
may wind up being an odd contrast in an otherwise sans-serif document
though, so this may eventually get reverted!
| Python | mit | sjbarag/poorly-named-resume-generator,sjbarag/poorly-named-resume-generator | ---
+++
@@ -13,7 +13,7 @@
(re.compile(r'"'), r"''"),
(re.compile(r'\.\.\.+'), r'\\ldots'),
(re.compile(r'&'), r'&'),
- (re.compile(r'LaTeX'), r'\\LaTeX')
+ (re.compile(r'LaTeX'), r'\\textrm{\\LaTeX}')
)
def escape_tex(value): |
d1a893514092a2495fcd2b14365b9b014fd39f59 | calaccess_processed/models/__init__.py | calaccess_processed/models/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Import all of the models from submodules and thread them together.
"""
from calaccess_processed.models.campaign.entities import (
Candidate,
CandidateCommittee,
)
from calaccess_processed.models.campaign.filings import (
Form460,
Form460Version,
Sche... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Import all of the models from submodules and thread them together.
"""
from calaccess_processed.models.campaign.entities import (
Candidate,
CandidateCommittee,
)
from calaccess_processed.models.campaign.filings import (
Form460,
Form460Version,
Sche... | Add missing models to __all__ list | Add missing models to __all__ list
| Python | mit | california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data | ---
+++
@@ -41,6 +41,10 @@
'Form460Version',
'Schedule497',
'Schedule497Version',
+ 'MonetaryContribution',
+ 'MonetaryContributionVersion',
+ 'NonMonetaryContribution',
+ 'NonMonetaryContributionVersion',
'LateContributionReceived',
'LateContributionReceivedVersion',
'LateCo... |
64dd3ecb1cf5adbf68d59d231b67e7d30ace715f | scripts/create-hosted-graphite-dashboards.py | scripts/create-hosted-graphite-dashboards.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description:
To add
Usage:
scripts/create-hosted-graphite-dashboards.py <hosted_graphite_api_key>
Example:
scripts/create-hosted-graphite-dashboards.py apikey
"""
import os
import sys
import requests
from docopt import docopt
sys.path.insert(0, '.') # ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description:
This pushes dashboards defined in /grafana directory up to our hosted graphite.
You can get the <hosted_graphite_api_key> from the "Account Home" page of hosted graphite.
To change a dashboard a process you should follow is:
1. Set "editabl... | Update docstring for creating hosted graphite dashboards | Update docstring for creating hosted graphite dashboards
| Python | mit | alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws | ---
+++
@@ -2,7 +2,19 @@
# -*- coding: utf-8 -*-
"""
Description:
- To add
+ This pushes dashboards defined in /grafana directory up to our hosted graphite.
+ You can get the <hosted_graphite_api_key> from the "Account Home" page of hosted graphite.
+
+ To change a dashboard a process you should follow... |
08aa975b100b1dbf8c9594a2e57368ad866f98a4 | api/caching/tasks.py | api/caching/tasks.py | import urlparse
import celery
import requests
from celery.utils.log import get_task_logger
from api.base import settings
from framework.tasks import app as celery_app
logger = get_task_logger(__name__)
class VarnishTask(celery.Task):
abstract = True
max_retries = 5
def get_varnish_servers():
# TODO: t... | import urlparse
import requests
from celery.utils.log import get_task_logger
from api.base import settings
logger = get_task_logger(__name__)
def get_varnish_servers():
# TODO: this should get the varnish servers from HAProxy or a setting
return settings.VARNISH_SERVERS
def ban_url(url):
timeout = 0.5... | Move from celery task to regular-old function | Move from celery task to regular-old function
| Python | apache-2.0 | sloria/osf.io,cwisecarver/osf.io,mattclark/osf.io,emetsger/osf.io,SSJohns/osf.io,erinspace/osf.io,asanfilippo7/osf.io,mluo613/osf.io,mluo613/osf.io,caseyrollins/osf.io,saradbowman/osf.io,cwisecarver/osf.io,icereval/osf.io,doublebits/osf.io,brianjgeiger/osf.io,mluo613/osf.io,adlius/osf.io,adlius/osf.io,aaxelb/osf.io,bin... | ---
+++
@@ -1,24 +1,18 @@
import urlparse
-import celery
import requests
from celery.utils.log import get_task_logger
+
from api.base import settings
-from framework.tasks import app as celery_app
-
logger = get_task_logger(__name__)
-
-class VarnishTask(celery.Task):
- abstract = True
- max_retries = ... |
13d9edb6d643d0955663f78b610fee6106e7128e | KISSmetrics/client.py | KISSmetrics/client.py | # -*- coding: utf-8 -*-
import KISSmetrics
from KISSmetrics import request
from urllib3 import PoolManager
class Client:
def __init__(self, key, trk_host=KISSmetrics.TRACKING_HOSTNAME,
trk_proto=KISSmetrics.TRACKING_PROTOCOL):
self.key = key
if trk_proto not in ['http', 'https']... | # -*- coding: utf-8 -*-
import KISSmetrics
from KISSmetrics import request
from urllib3 import PoolManager
class Client:
def __init__(self, key, trk_host=KISSmetrics.TRACKING_HOSTNAME,
trk_proto=KISSmetrics.TRACKING_PROTOCOL):
self.key = key
if trk_proto not in ('http', 'https')... | Use a tuple instead of a list for protocol membership test | Use a tuple instead of a list for protocol membership test
| Python | mit | kissmetrics/py-KISSmetrics | ---
+++
@@ -10,7 +10,7 @@
def __init__(self, key, trk_host=KISSmetrics.TRACKING_HOSTNAME,
trk_proto=KISSmetrics.TRACKING_PROTOCOL):
self.key = key
- if trk_proto not in ['http', 'https']:
+ if trk_proto not in ('http', 'https'):
raise ValueError('trk_proto mu... |
1bba76808aa5c598f1558cd127d8ed4a006692e1 | tests/conftest.py | tests/conftest.py | import os
def pytest_configure(config):
if 'USE_QT_API' in os.environ:
os.environ['QT_API'] = os.environ['USE_QT_API'].lower()
def pytest_report_header(config):
versions = os.linesep
versions += 'PyQt4: '
try:
from PyQt4 import Qt
versions += "PyQt: {0} - Qt: {1}".format(Qt... | import os
def pytest_configure(config):
if 'USE_QT_API' in os.environ:
os.environ['QT_API'] = os.environ['USE_QT_API'].lower()
# We need to import qtpy here to make sure that the API versions get set
# straight away.
import qtpy
def pytest_report_header(config):
versions = os.linesep
... | Make sure we import qtpy before importing any Qt wrappers directly | Make sure we import qtpy before importing any Qt wrappers directly | Python | mit | spyder-ide/qtpy,goanpeca/qtpy,davvid/qtpy,davvid/qtpy,goanpeca/qtpy | ---
+++
@@ -2,8 +2,13 @@
def pytest_configure(config):
+
if 'USE_QT_API' in os.environ:
os.environ['QT_API'] = os.environ['USE_QT_API'].lower()
+
+ # We need to import qtpy here to make sure that the API versions get set
+ # straight away.
+ import qtpy
def pytest_report_header(config... |
8359d60480371a8f63bdd4ea1b7cf03f231c1350 | djangopress/settings_tinymce.py | djangopress/settings_tinymce.py | # if you want support for tinymce in the admin pages
# add tinymce to the installed apps (after installing if needed)
# and then import these settings, or copy and adjust as needed
TINYMCE_DEFAULT_CONFIG = {
'relative_urls': False,
'plugins': "table code image link colorpicker textcolor wordcount",
'tools'... | # if you want support for tinymce in the admin pages
# add tinymce to the installed apps (after installing if needed)
# and then import these settings, or copy and adjust as needed
TINYMCE_DEFAULT_CONFIG = {
'relative_urls': False,
'plugins': "table code image link colorpicker textcolor wordcount",
'tools'... | Update settings for tinymce to allow show_blog_latest tag | Update settings for tinymce to allow show_blog_latest tag
| Python | mit | codefisher/djangopress,codefisher/djangopress,codefisher/djangopress,codefisher/djangopress | ---
+++
@@ -7,6 +7,6 @@
'plugins': "table code image link colorpicker textcolor wordcount",
'tools': "inserttable",
'toolbar': "undo redo | styleselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | forecolor backcol... |
3ca7c667cbf37499dc959b336b9ff0e88f5d4275 | dbarray/tests/run.py | dbarray/tests/run.py | """From http://stackoverflow.com/a/12260597/400691"""
import sys
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'dbarray',
'HOST': 'localhost'
}
},
INSTALLED_APPS... | """From http://stackoverflow.com/a/12260597/400691"""
import sys
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'dbarray',
'HOST': 'localhost'
}
},
INSTALLED_APPS... | Remove commented code . | Remove commented code [ci skip].
| Python | bsd-3-clause | ecometrica/django-dbarray | ---
+++
@@ -12,14 +12,9 @@
'HOST': 'localhost'
}
},
- INSTALLED_APPS=(
- 'dbarray.tests',
- # 'django.contrib.auth',
- # 'django.contrib.contenttypes',
- # 'django.contrib.sessions',
- # 'django.contrib.admin',
- ),
+ INSTALLED_APPS=('dbarray.test... |
a1bf03f69b9cadddcc7e0015788f23f9bad0f862 | apps/splash/views.py | apps/splash/views.py | import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base.html', {'splas... | import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
splash_year.events = _merge_events(splash_year.sp... | Append event merging on splash_events | Append event merging on splash_events
| Python | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | ---
+++
@@ -6,6 +6,9 @@
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
+
+ splash_year.events = _merge_events(splash_year.splash_events.all())
+
return render(request, 'splash/base.html', {'splash_... |
e722dbc13dcf1c30086fb3aff9afd89d2bddb409 | validator/jschematest.py | validator/jschematest.py | # Testing jsonschema error printing capabilities
import jsonschema
import json
# Custom printing of errors (skip no-information messages)
# TODO: solve repetition of same error (with different paths)
def print_errors(errors, indent=0):
next_indent = indent + 2
for error in errors:
msg = error.message
... | # Testing jsonschema error printing capabilities
import jsonschema
import json
# Custom printing of errors (skip no-information messages)
# TODO: solve repetition of same error (with different paths)
def print_errors(errors, indent=0):
next_indent = indent + 2
for error in errors:
msg = error.message
... | Make chapter validator loop over all chapter files in the knowledge model | Make chapter validator loop over all chapter files in the knowledge model
| Python | apache-2.0 | DataStewardshipPortal/ds-km,CCMi-FIT/ds-km,CCMi-FIT/ds-km-core | ---
+++
@@ -1,7 +1,6 @@
# Testing jsonschema error printing capabilities
import jsonschema
import json
-
# Custom printing of errors (skip no-information messages)
# TODO: solve repetition of same error (with different paths)
@@ -24,10 +23,19 @@
new_errors = sorted(error.context, key=lambda e: e.schem... |
1f4fea5d4bb67f84defa1693e0ea26295de489ff | helios/conf/settings.py | helios/conf/settings.py | # -*- coding: utf-8 -*-
from django.conf import settings
PAGINATE_BY = getattr(settings, 'STORE_PAGINATE_BY', 50)
IS_MULTILINGUAL = getattr(settings, 'STORE_IS_MULTILINGUAL', False)
HAS_CURRENCIES = getattr(settings, 'STORE_HAS_CURRENCIES', False)
USE_PAYPAL = getattr(settings, 'STORE_USE_PAYPAL', False)
PRODUCT_MODE... | # -*- coding: utf-8 -*-
from django.conf import settings
DEBUG = getattr(settings, 'STORE_DEBUG', False)
PAGINATE_BY = getattr(settings, 'STORE_PAGINATE_BY', 50)
IS_MULTILINGUAL = getattr(settings, 'STORE_IS_MULTILINGUAL', False)
HAS_CURRENCIES = getattr(settings, 'STORE_HAS_CURRENCIES', False)
USE_PAYPAL = getattr(s... | Set the DEBUG store setting | Set the DEBUG store setting
| Python | bsd-3-clause | panosl/helios | ---
+++
@@ -2,6 +2,7 @@
from django.conf import settings
+DEBUG = getattr(settings, 'STORE_DEBUG', False)
PAGINATE_BY = getattr(settings, 'STORE_PAGINATE_BY', 50)
IS_MULTILINGUAL = getattr(settings, 'STORE_IS_MULTILINGUAL', False)
HAS_CURRENCIES = getattr(settings, 'STORE_HAS_CURRENCIES', False) |
61b59bfdf9581a280263f4049e7d257fa47cdad0 | teknologr/registration/views.py | teknologr/registration/views.py | from django.shortcuts import render, redirect
from django.conf import settings
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.mailutils import mailApplicantSubmission
class BaseView(View):
context = {'DEBUG': ... | from django.shortcuts import render, redirect
from django.conf import settings
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.mailutils import mailApplicantSubmission
class BaseView(View):
context = {'DEBUG': ... | Fix registration form replay issue | Fix registration form replay issue
| Python | mit | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | ---
+++
@@ -22,6 +22,13 @@
class SubmitView(BaseView):
template = 'submit.html'
+ def get(self, request, **kwargs):
+ previous_context = request.session.pop('context', None)
+ if not previous_context:
+ return redirect('registration.views.home')
+
+ return render(request, se... |
3fad3c64a317956265c14c82c182b66979ba8554 | greatbigcrane/preferences/forms.py | greatbigcrane/preferences/forms.py | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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 agre... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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 agre... | Append a trailing newline to the project directory | Append a trailing newline to the project directory
| Python | apache-2.0 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | ---
+++
@@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
+import os.path
from django import forms
from preferences.models import Preference
@@ -21,3 +22,9 @@
super(PreferencesForm, self).__init__(*args, **kwargs)
for pref... |
62454216b7d0426c23d75ba4aafd761093447e63 | compiler.py | compiler.py | #!/usr/local/bin/python3
import http.client, urllib.parse, sys, argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--js", default='/dev/stdin', help="Input file")
parser.add_argument("--js_output_file", default='/dev/stdout', help="Output file")
parser.add_argument("--compila... | #!/usr/local/bin/python3
import http.client, urllib.parse, sys, argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--js", default='/dev/stdin', help="Input file")
parser.add_argument("--js_output_file", default='/dev/stdout', help="Output file")
parser.add_argument("--compila... | Add js_externs parameter for API | Add js_externs parameter for API
| Python | mit | femtopixel/docker-google-closure-compiler-api,femtopixel/docker-google-closure-compiler-api | ---
+++
@@ -7,6 +7,7 @@
parser.add_argument("--js", default='/dev/stdin', help="Input file")
parser.add_argument("--js_output_file", default='/dev/stdout', help="Output file")
parser.add_argument("--compilation_level", default='WHITESPACE_ONLY', choices=['WHITESPACE_ONLY', 'SIMPLE_OPTIMIZATIONS', 'ADVA... |
d8344f9bea9cfbc8ab22b952f223d2365de907b4 | cli_helpers/tabular_output/terminaltables_adapter.py | cli_helpers/tabular_output/terminaltables_adapter.py | # -*- coding: utf-8 -*-
"""Format adapter for the terminaltables module."""
import terminaltables
from cli_helpers.utils import filter_dict_by_key
from .preprocessors import (bytes_to_string, align_decimals,
override_missing_value)
supported_formats = ('ascii', 'double', 'github')
preproc... | # -*- coding: utf-8 -*-
"""Format adapter for the terminaltables module."""
import terminaltables
from cli_helpers.utils import filter_dict_by_key
from .preprocessors import (bytes_to_string, align_decimals,
override_missing_value)
supported_formats = ('ascii', 'double', 'github')
preproc... | Remove try/except that should never be hit. | Remove try/except that should never be hit.
Increases code coverage.
| Python | bsd-3-clause | dbcli/cli_helpers,dbcli/cli_helpers | ---
+++
@@ -21,10 +21,7 @@
'github': terminaltables.GithubFlavoredMarkdownTable,
}
- try:
- table = table_format_handler[table_format]
- except KeyError:
- raise ValueError('unrecognized table format: {}'.format(table_format))
+ table = table_format_handler[table_format]
... |
9a58d241e61301b9390b17e391e4b65a3ea85071 | squadron/libraries/apt/__init__.py | squadron/libraries/apt/__init__.py | import os
import subprocess
from string import find
def run_command(command):
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
return out,err
def schema():
"""
This returns
"""
return { 'title': 'apt schema',
'type': 'stri... | import os
import subprocess
from string import find
def run_command(command):
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
return out,err
def schema():
"""
This returns
"""
return { 'title': 'apt schema',
'type': 'stri... | Remove extra print in apt | Remove extra print in apt
| Python | mit | gosquadron/squadron,gosquadron/squadron | ---
+++
@@ -33,11 +33,10 @@
for package in inputhashes:
out = run_command(['apt-get', 'install', '-y', package])
if(find(out[1], 'Permission denied') != -1):
- failed.append(package) #Install failed because we're not root
+ failed.append(package) # Install failed because w... |
aae84224b5a2d1689b1739da319d140474702c96 | zuice/bindings.py | zuice/bindings.py | class Bindings(object):
def __init__(self):
self._bindings = {}
def bind(self, key):
if key in self:
raise AlreadyBoundException("Cannot rebind key: %s" % key)
return Binder(key, self._bindings)
def copy(self):
copy = Bindings()
copy._bindings = ... | class Bindings(object):
def __init__(self):
self._bindings = {}
def bind(self, key, provider=None):
if key in self:
raise AlreadyBoundException("Cannot rebind key: %s" % key)
if provider is None:
return Binder(key, self)
else:
... | Simplify detection of keys already bound | Simplify detection of keys already bound
| Python | bsd-2-clause | mwilliamson/zuice | ---
+++
@@ -2,10 +2,14 @@
def __init__(self):
self._bindings = {}
- def bind(self, key):
+ def bind(self, key, provider=None):
if key in self:
raise AlreadyBoundException("Cannot rebind key: %s" % key)
- return Binder(key, self._bindings)
+
+ i... |
66212e51341562f156353a0ae195d15b0d22b21b | scripts/import.py | scripts/import.py | #!/usr/bin/env python
import sys
import os
import requests
import multiprocessing
def list_files(directory):
for root, subdirs, files in os.walk(directory):
print("ROOT: {}".format(root))
for file in files:
yield os.path.abspath(os.path.join(root, file))
for subdir in subdirs:... | #!/usr/bin/env python
import sys
import json
import os
import requests
import multiprocessing
def list_files(directory):
for root, subdirs, files in os.walk(directory):
print("ROOT: {}".format(root))
for file in files:
yield os.path.abspath(os.path.join(root, file))
for subdir... | PUT services rather than POSTing them | PUT services rather than POSTing them
| Python | mit | RichardKnop/digitalmarketplace-api,RichardKnop/digitalmarketplace-api,RichardKnop/digitalmarketplace-api,mtekel/digitalmarketplace-api,mtekel/digitalmarketplace-api,RichardKnop/digitalmarketplace-api,alphagov/digitalmarketplace-api,mtekel/digitalmarketplace-api,alphagov/digitalmarketplace-api,mtekel/digitalmarketplace-... | ---
+++
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import sys
+import json
import os
import requests
import multiprocessing
@@ -24,11 +25,14 @@
print("Access token: {}".format(access_token))
print("Listing dir: {}".format(listing_dir))
- def post_file(file_path):
+ def put_file(file_path):
... |
95b08a7cb2d473c25c1d326b0394336955b47af4 | appy/models.py | appy/models.py | from django.db import models
from django.contrib.auth.models import User
class Tag(models.Model):
description = models.TextField()
class Position(models.Model):
company = models.TextField()
job_title = models.TextField()
description = models.TextField()
tags = models.ManyToManyField(Tag)
class... | from django.db import models
from django.contrib.auth.models import User
class Tag(models.Model):
description = models.TextField()
def __unicode__(self):
return self.description
class Position(models.Model):
company = models.TextField()
job_title = models.TextField()
description = model... | Add unicode representations for tags/positions | Add unicode representations for tags/positions
| Python | mit | merdey/ApPy,merdey/ApPy | ---
+++
@@ -5,12 +5,18 @@
class Tag(models.Model):
description = models.TextField()
+ def __unicode__(self):
+ return self.description
+
class Position(models.Model):
company = models.TextField()
job_title = models.TextField()
description = models.TextField()
tags = models.Man... |
2b43ab4eb41e305c5bdadf5c338e134e5569249d | tests/conftest.py | tests/conftest.py | # pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=False)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
print('In directo... | # pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=False)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
print('In directo... | Add session setup and teardown fixtures. | Add session setup and teardown fixtures. | Python | mit | bilderbuchi/ofStateManager | ---
+++
@@ -16,3 +16,17 @@
os.chdir('MockRepos')
print('In directory ' + os.getcwd())
# does not need teardown, since tmpdir directories get autodeleted
+
+
+def session_teardown():
+ """Tear down testing session"""
+ print('Tearing down testing session')
+ os.chdir(BASEDIR) # so html coverage report lands in ... |
98bded02b1b5116db640f5e58f73920108af0b0c | tests/test_set.py | tests/test_set.py | import matplotlib
import fishbowl
original = []
updated = [r'\usepackage{mathspec}',
r'\setallmainfonts(Digits,Latin,Greek){Arbitrary}']
def test_context_set():
fishbowl.reset_style()
with fishbowl.style(axes='minimal', palette='gourami', font='Arbitrary'):
assert matplotlib.rcParams['pgf... | import matplotlib
import fishbowl
original = True
updated = False
def test_context_set():
fishbowl.reset_style()
with fishbowl.style(axes='minimal', palette='gourami', font='Arbitrary'):
assert matplotlib.rcParams['axes.spines.left'] == updated
def test_context_reset():
fishbowl.reset_style()
... | Update tests to remove pgf.preamble | Update tests to remove pgf.preamble
| Python | mit | baxen/fishbowl | ---
+++
@@ -2,31 +2,30 @@
import fishbowl
-original = []
-updated = [r'\usepackage{mathspec}',
- r'\setallmainfonts(Digits,Latin,Greek){Arbitrary}']
+original = True
+updated = False
def test_context_set():
fishbowl.reset_style()
with fishbowl.style(axes='minimal', palette='gourami', fon... |
e6d965cc36d92ee8f138d487614244c6e3deda69 | run_tests.py | run_tests.py | from __future__ import division
import libtbx.load_env
def discover_pytests(module):
try:
import os
import pytest
except ImportError:
return []
if 'LIBTBX_SKIP_PYTEST' in os.environ:
return []
test_list = []
dist_dir = libtbx.env.dist_path(module)
class TestDiscoveryPlugin:
def pytest_... | from __future__ import division
import libtbx.load_env
def discover_pytests(module):
try:
import os
import pytest
except ImportError:
def pytest_warning():
print "=" * 60
print "WARNING: Skipping some tests\n"
print "To run all available tests you need to install pytest"
print "... | Add warning for skipped tests if pytest not available | Add warning for skipped tests if pytest not available
| Python | bsd-3-clause | xia2/i19 | ---
+++
@@ -6,6 +6,15 @@
import os
import pytest
except ImportError:
+ def pytest_warning():
+ print "=" * 60
+ print "WARNING: Skipping some tests\n"
+ print "To run all available tests you need to install pytest"
+ print "eg. with libtbx.python -m pip install pytest"
+ pri... |
baedff75f2b86f09368e3bd72b72e27bf887cc88 | rotational-cipher/rotational_cipher.py | rotational-cipher/rotational_cipher.py | import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
return "".join(rot_gen(s,n))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
def rot_gen(s, n):
rules = shift_rules(n)
f... | import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
| Use lambda function with method | Use lambda function with method
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | ---
+++
@@ -6,18 +6,10 @@
def rotate(s, n):
- return "".join(rot_gen(s,n))
+ rules = shift_rules(n)
+ return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
-
-
-def ro... |
939ebf2eb4536fd5a6318d6cc4b55a9dc4c8def2 | documentation/compile_documentation.py | documentation/compile_documentation.py | import sys
import os
def find_code(text):
START_TAG = '```lpg'
END_TAG = '```'
first_index = text.find(START_TAG)
if first_index == -1:
return None, None
last_index = text.find(END_TAG, first_index + 1)
return first_index + len(START_TAG), last_index
def process_file(path):
conte... | import sys
import os
def find_code(text):
START_TAG = '```lpg'
END_TAG = '```'
first_index = text.find(START_TAG)
if first_index == -1:
return None, None
last_index = text.find(END_TAG, first_index + 1)
return first_index + len(START_TAG), last_index
def process_file(path):
conte... | Split the documentation compilation into different files | Split the documentation compilation into different files
| Python | mit | TyRoXx/Lpg,TyRoXx/Lpg,TyRoXx/Lpg,mamazu/Lpg,mamazu/Lpg,mamazu/Lpg,TyRoXx/Lpg,mamazu/Lpg,TyRoXx/Lpg | ---
+++
@@ -24,20 +24,24 @@
def write_to_file(file_name, code):
- for i, code_block in enumerate(code):
- print_block = '// %s : %i\n%s\n' % (file_name, i, code_block)
- destination.write(print_block)
+ with open(file_name, 'w') as f:
+ f.write(code)
+
+def write_codeblocks_to_differ... |
c7fd327623dfa84a91931771265932d4da95d766 | 001-xoxoxo-obj/harness.py | 001-xoxoxo-obj/harness.py | from game import Game
from input_con import InputCon
from output_con import OutputCon
class Harness():
def __init__(self, output, inputs):
self._game = Game()
self._output = output
self._inputs = inputs
def Start(self):
self._output.show_welcome()
while True:
self._outpu... | from game import Game
from input_con import InputCon
from output_con import OutputCon
class Harness():
def __init__(self, output, inputs):
self._game = Game()
self._output = output
self._inputs = inputs
def Start(self):
self._output.show_welcome()
while True:
self._outpu... | Fix nierozpoznawania bledu gracza w pierwszym ruchu | Fix nierozpoznawania bledu gracza w pierwszym ruchu
| Python | mit | gynvael/stream,gynvael/stream,gynvael/stream,gynvael/stream,gynvael/stream,gynvael/stream | ---
+++
@@ -22,13 +22,13 @@
while True:
move = self._inputs[player_id].get_move()
- if move is None:
+ if move is False:
self._output.show_move_error(player)
- continue
+ continue
if self._game.make_move(move) is False:
self._output.s... |
9a34e663f9ef65cdac91c42dcf198ae28d4385be | txircd/modbase.py | txircd/modbase.py | # The purpose of this file is to provide base classes with the needed functions
# already defined; this allows us to guarantee that any exceptions raised
# during function calls are a problem with the module and not just that the
# particular function isn't defined.
class Module(object):
def hook(self, base):
self.... | # The purpose of this file is to provide base classes with the needed functions
# already defined; this allows us to guarantee that any exceptions raised
# during function calls are a problem with the module and not just that the
# particular function isn't defined.
class Module(object):
def hook(self, base):
self.... | Add a function for commands to process parameters | Add a function for commands to process parameters
| Python | bsd-3-clause | ElementalAlchemist/txircd,Heufneutje/txircd,DesertBus/txircd | ---
+++
@@ -35,3 +35,8 @@
return self
def onUse(self, user, params):
pass
+ def processParams(self, user, params):
+ return {
+ "user": user,
+ "params": params
+ } |
a1cc1c08e9ff36ff0293f0224ca0acb41f065073 | alg_selection_sort.py | alg_selection_sort.py | def selection_sort(a_list):
"""Selection Sort algortihm.
Concept: Find out the maximun item's original slot first,
then switch it to the max slot. Iterate the procedure.
"""
for max_slot in reversed(range(len(a_list))):
select_slot = 0
for slot in range(1, max_slot + 1):
... | def selection_sort(a_list):
"""Selection Sort algortihm.
Concept:
- Find out the maximun item's original slot first,
- then swap it and the item at the max slot.
- Iterate the procedure.
"""
for max_slot in reversed(range(len(a_list))):
select_slot = 0
for slot in ra... | Revise doc string for selection sort’s concept | Revise doc string for selection sort’s concept
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | ---
+++
@@ -1,8 +1,10 @@
def selection_sort(a_list):
"""Selection Sort algortihm.
- Concept: Find out the maximun item's original slot first,
- then switch it to the max slot. Iterate the procedure.
+ Concept:
+ - Find out the maximun item's original slot first,
+ - then swap it and the it... |
1be7237169f0c0920d4891d7fb20b03327037cdb | osgtest/tests/test_40_proxy.py | osgtest/tests/test_40_proxy.py | import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
import unittest
class TestGridProxyInit(osgunittest.OSGTestCase):
def test_01_grid_proxy_init(self):
core.skip_ok_unless_installed('globus-proxy-utils')
command = ('grid-proxy-init', '-debug')
password = ... | import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
import pprint
import errno
class TestGridProxyInit(osgunittest.OSGTestCase):
def test_00_list_proxies(self):
command = ('ls', '-lF', '/tmp/x509up_u*')
status, stdout, _ = core.system(command, 'List proxies')
... | Add debugging code to proxy generation | Add debugging code to proxy generation
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@18806 4e558342-562e-0410-864c-e07659590f8c
| Python | apache-2.0 | efajardo/osg-test,efajardo/osg-test | ---
+++
@@ -1,12 +1,30 @@
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
-import unittest
+import pprint
+import errno
class TestGridProxyInit(osgunittest.OSGTestCase):
+
+ def test_00_list_proxies(self):
+ command = ('ls', '-lF', '/tmp/x509up_u*')
+ status... |
a30e51ccb74bc55924be6f7f79dc4b6038c9b457 | altair/examples/bar_chart_with_highlighted_segment.py | altair/examples/bar_chart_with_highlighted_segment.py | """
Bar Chart with Highlighted Segment
----------------------------------
This example shows a bar chart that highlights values beyond a threshold.
"""
import altair as alt
import pandas as pd
from vega_datasets import data
source = data.wheat()
threshold = pd.DataFrame([{"threshold": 90}])
bars = alt.Chart(source).m... | """
Bar Chart with Highlighted Segment
----------------------------------
This example shows a bar chart that highlights values beyond a threshold.
"""
# category: bar charts
import altair as alt
import pandas as pd
from vega_datasets import data
source = data.wheat()
threshold = pd.DataFrame([{"threshold": 90}])
bar... | Move bar chart with highlighted segment chart into the bar charts section | Move bar chart with highlighted segment chart into the bar charts section | Python | bsd-3-clause | altair-viz/altair | ---
+++
@@ -3,6 +3,7 @@
----------------------------------
This example shows a bar chart that highlights values beyond a threshold.
"""
+# category: bar charts
import altair as alt
import pandas as pd
from vega_datasets import data |
09340916e7db6ba8ccb5697b9444fbccc0512103 | example/example/views.py | example/example/views.py | from django import forms
from django.forms.formsets import formset_factory
from django.shortcuts import render
from djangoformsetjs.utils import formset_media_js
class MyForm(forms.Form):
foo = forms.CharField()
class Media(object):
# The form must have `formset_media_js` in its Media
js = fo... | from django import forms
from django.forms.formsets import formset_factory
from django.shortcuts import render
from djangoformsetjs.utils import formset_media_js
class MyForm(forms.Form):
foo = forms.CharField()
class Media(object):
# The form must have `formset_media_js` in its Media
js = fo... | Add `can_delete=True` to the example formset | Add `can_delete=True` to the example formset
| Python | bsd-2-clause | pretix/django-formset-js,pretix/django-formset-js,pretix/django-formset-js | ---
+++
@@ -14,7 +14,7 @@
)
-MyFormSet = formset_factory(MyForm)
+MyFormSet = formset_factory(MyForm, can_delete=True)
def formset_view(request): |
de11b473a6134ed1403e91d55d30c23e6683a926 | test/runner/versions.py | test/runner/versions.py | #!/usr/bin/env python
"""Show python and pip versions."""
import os
import sys
try:
import pip
except ImportError:
pip = None
print('.'.join(u'%s' % i for i in sys.version_info))
if pip:
print('pip %s from %s' % (pip.__version__, os.path.dirname(pip.__file__)))
| #!/usr/bin/env python
"""Show python and pip versions."""
import os
import sys
try:
import pip
except ImportError:
pip = None
print(sys.version)
if pip:
print('pip %s from %s' % (pip.__version__, os.path.dirname(pip.__file__)))
| Revert "Relax ansible-test python version checking." | Revert "Relax ansible-test python version checking."
This reverts commit d6cc3c41874b64e346639549fd18d8c41be0db8b.
| Python | mit | thaim/ansible,thaim/ansible | ---
+++
@@ -9,7 +9,7 @@
except ImportError:
pip = None
-print('.'.join(u'%s' % i for i in sys.version_info))
+print(sys.version)
if pip:
print('pip %s from %s' % (pip.__version__, os.path.dirname(pip.__file__))) |
c3ead540e7008ba1a3d01df695620bc952564805 | sphinx/fabfile.py | sphinx/fabfile.py | from fabric.api import run, env, roles
from fabric.contrib.project import rsync_project
import sys
sys.path.append("source")
import conf
env.roledefs = {
'web': ['bokeh.pydata.org']
}
env.user = "bokeh"
@roles('web')
def deploy(v=None):
if v is None:
v = conf.version
# make a backup of the old ... | from fabric.api import run, env, roles
from fabric.contrib.files import exists
from fabric.contrib.project import rsync_project
import sys
sys.path.append("source")
import conf
env.roledefs = {
'web': ['bokeh.pydata.org']
}
env.user = "bokeh"
@roles('web')
def deploy(v=None):
if v is None:
v = conf.... | Add error if latest is passed to deploy. Also check if the path exist before meaking the symlink. | Add error if latest is passed to deploy. Also check if the path exist before meaking the symlink.
| Python | bsd-3-clause | Karel-van-de-Plassche/bokeh,aavanian/bokeh,clairetang6/bokeh,matbra/bokeh,quasiben/bokeh,justacec/bokeh,schoolie/bokeh,rothnic/bokeh,evidation-health/bokeh,ptitjano/bokeh,muku42/bokeh,percyfal/bokeh,daodaoliang/bokeh,KasperPRasmussen/bokeh,aiguofer/bokeh,CrazyGuo/bokeh,draperjames/bokeh,mindriot101/bokeh,percyfal/bokeh... | ---
+++
@@ -1,4 +1,5 @@
from fabric.api import run, env, roles
+from fabric.contrib.files import exists
from fabric.contrib.project import rsync_project
import sys
@@ -15,6 +16,9 @@
if v is None:
v = conf.version
+ elif v == "latest":
+ raise RuntimeError("You can not pass 'latest' as f... |
cb28bba6ee642828df473383ea469a6aa46ca59c | skimage/util/unique.py | skimage/util/unique.py | import numpy as np
def unique_rows(ar):
"""Remove repeated rows from a 2D array.
Parameters
----------
ar : 2D np.ndarray
The input array.
Returns
-------
ar_out : 2D np.ndarray
A copy of the input array with repeated rows removed.
Raises
------
ValueError : ... | import numpy as np
def unique_rows(ar):
"""Remove repeated rows from a 2D array.
Parameters
----------
ar : 2D np.ndarray
The input array.
Returns
-------
ar_out : 2D np.ndarray
A copy of the input array with repeated rows removed.
Raises
------
ValueError : ... | Add note describing array copy if discontiguous | Add note describing array copy if discontiguous
| Python | bsd-3-clause | paalge/scikit-image,Midafi/scikit-image,michaelpacer/scikit-image,Britefury/scikit-image,SamHames/scikit-image,oew1v07/scikit-image,chintak/scikit-image,vighneshbirodkar/scikit-image,jwiggins/scikit-image,warmspringwinds/scikit-image,Britefury/scikit-image,rjeli/scikit-image,ofgulban/scikit-image,emon10005/scikit-image... | ---
+++
@@ -17,6 +17,12 @@
Raises
------
ValueError : if `ar` is not two-dimensional.
+
+ Notes
+ -----
+ The function will generate a copy of `ar` if it is not
+ C-contiguous, which will negatively affect performance for large
+ input arrays.
Examples
-------- |
88ec3066a191f22b1faa3429ae89cbd76d45ac9b | aore/config/dev.py | aore/config/dev.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .common import *
sphinx_conf.listen = "127.0.0.1:9312"
sphinx_conf.var_dir = "C:\\Sphinx"
db_conf.database = "postgres"
db_conf.host = "localhost"
db_conf.port = 5432
db_conf.user = "postgres"
db_conf.password = "intercon"
unrar_config.path = "C:\... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .common import *
sphinx_conf.listen = "192.168.0.37:9312"
sphinx_conf.var_dir = "C:\\Sphinx"
db_conf.database = "postgres"
db_conf.host = "192.168.0.37"
db_conf.port = 5432
db_conf.user = "postgres"
db_conf.password = "intercon"
unrar_config.path ... | Test global ip with Sphinx | Test global ip with Sphinx
| Python | bsd-3-clause | jar3b/py-phias,jar3b/py-phias,jar3b/py-phias,jar3b/py-phias | ---
+++
@@ -4,11 +4,11 @@
from .common import *
-sphinx_conf.listen = "127.0.0.1:9312"
+sphinx_conf.listen = "192.168.0.37:9312"
sphinx_conf.var_dir = "C:\\Sphinx"
db_conf.database = "postgres"
-db_conf.host = "localhost"
+db_conf.host = "192.168.0.37"
db_conf.port = 5432
db_conf.user = "postgres"
db_conf... |
f60b940205a5e1011ce1c9c5672cb262c4649c0b | app/mod_auth/forms.py | app/mod_auth/forms.py | from flask_wtf import FlaskForm
from wtforms import StringField, BooleanField, PasswordField
from wtforms.validators import DataRequired
class LoginForm(FlaskForm):
username = StringField('username', validators=[DataRequired()])
password = PasswordField('password', validators=[DataRequired()])
remember_me... | from flask_wtf import FlaskForm
from wtforms import StringField, BooleanField, PasswordField
from wtforms.validators import DataRequired, ValidationError, EqualTo
from .models import User
class LoginForm(FlaskForm):
username = StringField('username', validators=[DataRequired()])
password = PasswordField('pass... | Validate username and password on signup | Validate username and password on signup
| Python | mit | ziel980/website,ziel980/website | ---
+++
@@ -1,6 +1,7 @@
from flask_wtf import FlaskForm
from wtforms import StringField, BooleanField, PasswordField
-from wtforms.validators import DataRequired
+from wtforms.validators import DataRequired, ValidationError, EqualTo
+from .models import User
class LoginForm(FlaskForm):
@@ -8,7 +9,13 @@
pa... |
3d38af257f55a0252cb41408a404faa66b30d512 | pyconde/speakers/models.py | pyconde/speakers/models.py | from django.db import models
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
class Speaker(models.Model):
"""
The speaker model acts as user-abstraction for various session and proposal
related objects.
"""
user = models.OneToOneField(User, related_name='sp... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_save
from django.dispatch.dispatcher import receiver
class Speaker(models.Model):
"""
... | Create a speaker profile for each user that is registered. | Create a speaker profile for each user that is registered.
| Python | bsd-3-clause | pysv/djep,EuroPython/djep,pysv/djep,EuroPython/djep,pysv/djep,EuroPython/djep,pysv/djep,EuroPython/djep,pysv/djep | ---
+++
@@ -1,6 +1,11 @@
-from django.db import models
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
+from django.db import models
+from django.db.models.signals import post_save
+from django.dispatch.disp... |
579286426cf20c5cd5d4c94d97fd0a55eb571f8f | talks_keeper/templatetags/tk_filters.py | talks_keeper/templatetags/tk_filters.py | from django import template
from django.forms import CheckboxInput
register = template.Library()
@register.filter(name='addclass')
def addclass(value, arg):
return value.as_widget(attrs={'class': arg})
@register.filter(name='is_checkbox')
def is_checkbox(field):
return field.field.widget.__class__.__name_... | from django import template
from django.forms import CheckboxInput
from django.contrib.auth.models import Group
register = template.Library()
@register.filter(name='addclass')
def addclass(value, arg):
return value.as_widget(attrs={'class': arg})
@register.filter(name='is_checkbox')
def is_checkbox(field):
... | Add templatetag to check if user included in group | Add templatetag to check if user included in group
| Python | mit | samitnuk/talks_keeper,samitnuk/talks_keeper,samitnuk/talks_keeper | ---
+++
@@ -1,5 +1,6 @@
from django import template
from django.forms import CheckboxInput
+from django.contrib.auth.models import Group
register = template.Library()
@@ -14,3 +15,9 @@
def is_checkbox(field):
return field.field.widget.__class__.__name__ == \
CheckboxInput().__class__.__name__
+
... |
d52c9731b0c6494e9f4181fc33f00cdf39adb3ca | tests/unit/test_util.py | tests/unit/test_util.py | import pytest
from pmxbot import util
@pytest.has_wordnik
def test_lookup():
assert util.lookup('dachshund') is not None
| import pytest
from pmxbot import util
@pytest.has_wordnik
def test_lookup():
assert util.lookup('dachshund') is not None
@pytest.has_internet
def test_emergency_compliment():
assert util.load_emergency_compliments()
| Add test for emergency compliments | Add test for emergency compliments
| Python | mit | yougov/pmxbot,yougov/pmxbot,yougov/pmxbot | ---
+++
@@ -5,3 +5,7 @@
@pytest.has_wordnik
def test_lookup():
assert util.lookup('dachshund') is not None
+
+@pytest.has_internet
+def test_emergency_compliment():
+ assert util.load_emergency_compliments() |
5b8bcdd802858baae3854fbfb8758dc65bdd8d34 | hardware/unicorn_hat_hd/demo_lights.py | hardware/unicorn_hat_hd/demo_lights.py | #!/usr/bin/env python
import unicornhathd
import os
try:
unicornhathd.set_pixel(0, 0, 255, 255, 255)
unicornhathd.set_pixel(15, 0, 255, 255, 255)
unicornhathd.set_pixel(0, 15, 255, 255, 255)
unicornhathd.set_pixel(15, 15, 255, 255, 255)
unicornhathd.show()
raw_input("Press the <ENTER> key or <C... | #!/usr/bin/env python
import unicornhathd
import os
from time import sleep
class Point:
def __init__(self, x, y, dx, dy):
self.x = x
self.y = y
self.dx = dx
self.dy = dy
def turn_on(self):
unicornhathd.set_pixel(self.x, self.y, 255, 255, 255)
def turn_off(self):
... | Make the 4 lights bounce backwards and forwards along each edge. | Make the 4 lights bounce backwards and forwards along each edge.
| Python | mit | claremacrae/raspi_code,claremacrae/raspi_code,claremacrae/raspi_code | ---
+++
@@ -1,14 +1,57 @@
#!/usr/bin/env python
import unicornhathd
import os
+from time import sleep
+
+class Point:
+ def __init__(self, x, y, dx, dy):
+ self.x = x
+ self.y = y
+ self.dx = dx
+ self.dy = dy
+
+ def turn_on(self):
+ unicornhathd.set_pixel(self.x, self.y, ... |
4aada26d0de09836f3b67b0fce136805cf11fa37 | thinc/extra/load_nlp.py | thinc/extra/load_nlp.py | import numpy
SPACY_MODELS = {}
VECTORS = {}
def get_spacy(lang, **kwargs):
global SPACY_MODELS
import spacy
if lang not in SPACY_MODELS:
SPACY_MODELS[lang] = spacy.load(lang, **kwargs)
return SPACY_MODELS[lang]
def get_vectors(ops, lang):
global VECTORS
key = (ops.device, lang)
... | import numpy
SPACY_MODELS = {}
VECTORS = {}
def get_spacy(lang, **kwargs):
global SPACY_MODELS
import spacy
if lang not in SPACY_MODELS:
SPACY_MODELS[lang] = spacy.load(lang, **kwargs)
return SPACY_MODELS[lang]
def get_vectors(ops, lang):
global VECTORS
key = (ops.device, lang)
... | Fix divide by zero error in vectors loading | Fix divide by zero error in vectors loading
| Python | mit | explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc | ---
+++
@@ -22,6 +22,6 @@
vectors = numpy.zeros((nV, nM), dtype='float32')
for lex in nlp.vocab:
if lex.has_vector:
- vectors[lex.rank] = lex.vector / lex.vector_norm
+ vectors[lex.rank] = lex.vector / (lex.vector_norm+1e-8)
VECTORS[key] = ops.asar... |
59c4dd56e427e29eb26e81512c3066fe3f8b13b8 | tools/gdb/gdb_chrome.py | tools/gdb/gdb_chrome.py | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""GDB support for Chrome types.
Add this to your gdb by amending your ~/.gdbinit as follows:
python
import sys
sys.path.insert(... | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""GDB support for Chrome types.
Add this to your gdb by amending your ~/.gdbinit as follows:
python
import sys
sys.path.insert(... | Add FilePath to the gdb pretty printers. | Add FilePath to the gdb pretty printers.
Review URL: http://codereview.chromium.org/6621017
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@76956 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,rogerwang/chromium,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,hujiajie/pa-chromium,nacl-webkit/chrome_deps,Jonekee/chromium.src,nacl-webk... | ---
+++
@@ -26,12 +26,24 @@
def to_string(self):
return self.val['spec_']
+class FilePathPrinter(object):
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ return self.val['path_']['_M_dataplus']['_M_p']
+
+
def lookup_function(val):
- typ = str(val.type)
-... |
97401a56e59d06acdd455f111dbe993265f2a39d | setup.py | setup.py | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='urbansim',
version='0.2dev',
description='Tool for modeling metropolitan real estate markets',
author='Synthicity',
author_email='ffoti@berkeley.edu',
license='AGPL',
u... | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='urbansim',
version='0.2dev',
description='Tool for modeling metropolitan real estate markets',
author='Synthicity',
author_email='ffoti@berkeley.edu',
license='AGPL',
u... | Remove urbansimd from excluded packages. | Remove urbansimd from excluded packages.
| Python | bsd-3-clause | SANDAG/urbansim,apdjustino/urbansim,synthicity/urbansim,UDST/urbansim,UDST/urbansim,bricegnichols/urbansim,AZMAG/urbansim,ual/urbansim,UDST/urbansim,VladimirTyrin/urbansim,waddell/urbansim,VladimirTyrin/urbansim,bricegnichols/urbansim,SANDAG/urbansim,waddell/urbansim,waddell/urbansim,apdjustino/urbansim,apdjustino/urba... | ---
+++
@@ -16,7 +16,7 @@
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: GNU Affero General Public License v3'
],
- packages=find_packages(exclude=['urbansimd', '*.tests']),
+ packages=find_packages(exclude=['*.tests']),
package_data={'urbansim.urbansim': ['temp... |
267b5392adaf3e3f93a22f95e5f1f161225a7f3a | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-pgallery',
version=__import__('pgallery').__version__,
description='Photo gallery app for PostgreSQL and Django.',
long_description=read('RE... | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-pgallery',
version=__import__('pgallery').__version__,
description='Photo gallery app for PostgreSQL and Django.',
long_description=read('RE... | Add classifier for Python 3.6 | Add classifier for Python 3.6
| Python | mit | zsiciarz/django-pgallery,zsiciarz/django-pgallery | ---
+++
@@ -35,6 +35,7 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
'Topic :: Utilities',
],
) |
ad5cb91fa011e067a96835e59e05581af3ea3a53 | acctwatch/configcheck.py | acctwatch/configcheck.py | import httplib2
import os
import sys
import time
from apiclient import discovery
from oauth2client import file
from oauth2client import client
from oauth2client import tools
from config import Configuration
try:
import geoip2.database as geoipdb
except ImportError:
geoipdb = None
def main():
config = Co... | import httplib2
import os
import sys
import time
from apiclient import discovery
from oauth2client import file
from oauth2client import client
from oauth2client import tools
from config import Configuration
try:
import geoip2.database as geoipdb
except ImportError:
print ("GeoIP is missing, please install de... | Clean up configuration check utility | Clean up configuration check utility
| Python | isc | GuardedRisk/Google-Apps-Auditing | ---
+++
@@ -13,14 +13,10 @@
try:
import geoip2.database as geoipdb
except ImportError:
- geoipdb = None
+ print ("GeoIP is missing, please install dependency")
def main():
config = Configuration()
- if config.WITH_GEOIP and not geoipdb:
- print ("GeoIP is enabled, but unable to import m... |
fae3f6aaba91167c5da2f3d5d9b6b1a66068f9f7 | setup.py | setup.py | from distutils.core import setup
import os, glob, string, shutil
# Packages
packages = ['neuroimaging', 'neuroimaging.statistics', 'neuroimaging.image', 'neuroimaging.reference', 'neuroimaging.data', 'neuroimaging.image.formats', 'neuroimaging.image.formats.analyze', 'neuroimaging.fmri', 'neuroimaging.fmri.fmristat',... | import os, glob, string, shutil
from distutils.core import setup
# Packages
packages = ['neuroimaging', 'neuroimaging.statistics', 'neuroimaging.image', 'neuroimaging.reference', 'neuroimaging.data', 'neuroimaging.image.formats', 'neuroimaging.image.formats.analyze', 'neuroimaging.fmri', 'neuroimaging.fmri.fmristat',... | Test edit - to check svn email hook | Test edit - to check svn email hook | Python | bsd-3-clause | yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD | ---
+++
@@ -1,5 +1,5 @@
+import os, glob, string, shutil
from distutils.core import setup
-import os, glob, string, shutil
# Packages
|
50efc8ccccecc3f48fcf0e82ebc3390da48e0967 | setup.py | setup.py | from setuptools import setup
setup(
name="balrog",
version="1.0",
description="Mozilla's Update Server",
author="Ben Hearsum",
author_email="ben@hearsum.ca",
packages=[
"auslib",
"auslib.admin",
"auslib.admin.views",
"auslib.blobs",
"auslib.migrate",
... | from setuptools import find_packages, setup
setup(
name="balrog",
version="1.0",
description="Mozilla's Update Server",
author="Ben Hearsum",
author_email="ben@hearsum.ca",
packages=find_packages(exclude=["vendor"]),
include_package_data=True,
install_requires=[
"flask==0.10.1"... | Use find_packages instead of an explicit list of packages for easier maintenance. | Use find_packages instead of an explicit list of packages for easier maintenance.
| Python | mpl-2.0 | nurav/balrog,testbhearsum/balrog,nurav/balrog,testbhearsum/balrog,mozbhearsum/balrog,aksareen/balrog,nurav/balrog,testbhearsum/balrog,nurav/balrog,mozbhearsum/balrog,tieu/balrog,mozbhearsum/balrog,tieu/balrog,aksareen/balrog,aksareen/balrog,tieu/balrog,mozbhearsum/balrog,tieu/balrog,aksareen/balrog,testbhearsum/balrog | ---
+++
@@ -1,4 +1,4 @@
-from setuptools import setup
+from setuptools import find_packages, setup
setup(
@@ -7,17 +7,7 @@
description="Mozilla's Update Server",
author="Ben Hearsum",
author_email="ben@hearsum.ca",
- packages=[
- "auslib",
- "auslib.admin",
- "auslib.admin.... |
2a7877c1ed3e1dc9a5bcc27220847a5a75cf65ab | spiff/membership/management/commands/bill_members.py | spiff/membership/management/commands/bill_members.py | from django.core.management import BaseCommand
from spiff.membership.utils import monthRange
from spiff.membership.models import Member, RankLineItem
from spiff.payment.models import Invoice
class Command(BaseCommand):
help = 'Bills active members for the month'
def handle(self, *args, **options):
for member ... | from django.core.management import BaseCommand
from spiff.membership.utils import monthRange
from spiff.membership.models import Member, RankLineItem
from spiff.payment.models import Invoice
class Command(BaseCommand):
help = 'Bills active members for the month'
def handle(self, *args, **options):
for member ... | Fix swapped dates on invoices | Fix swapped dates on invoices
| Python | agpl-3.0 | SYNHAK/spiff,SYNHAK/spiff,SYNHAK/spiff | ---
+++
@@ -11,7 +11,7 @@
if not member.billedForMonth():
if member.highestRank is not None and member.highestRank.monthlyDues > 0:
print "Billing", member, "for the month"
- endOfMonth, startOfMonth = monthRange()
+ startOfMonth, endOfMonth = monthRange()
invoi... |
e3409c94b64deac85deada28f57a30ae08d0083d | api/caching/listeners.py | api/caching/listeners.py | from functools import partial
from api.caching.tasks import ban_url
from framework.postcommit_tasks.handlers import enqueue_postcommit_task
from modularodm import signals
@signals.save.connect
def ban_object_from_cache(sender, instance, fields_changed, cached_data):
abs_url = None
if hasattr(instance, 'absol... | from functools import partial
from api.caching.tasks import ban_url
from framework.postcommit_tasks.handlers import enqueue_postcommit_task
from modularodm import signals
@signals.save.connect
def ban_object_from_cache(sender, instance, fields_changed, cached_data):
abs_url = None
if hasattr(instance, 'absolu... | Fix passing arguments to ban_url | Fix passing arguments to ban_url
h/t @cwisecarver
| Python | apache-2.0 | chrisseto/osf.io,cslzchen/osf.io,Johnetordoff/osf.io,SSJohns/osf.io,alexschiller/osf.io,mluke93/osf.io,rdhyee/osf.io,zachjanicki/osf.io,wearpants/osf.io,leb2dg/osf.io,caneruguz/osf.io,zamattiac/osf.io,TomHeatwole/osf.io,mattclark/osf.io,aaxelb/osf.io,felliott/osf.io,caseyrollins/osf.io,mluke93/osf.io,erinspace/osf.io,R... | ---
+++
@@ -3,7 +3,6 @@
from api.caching.tasks import ban_url
from framework.postcommit_tasks.handlers import enqueue_postcommit_task
from modularodm import signals
-
@signals.save.connect
def ban_object_from_cache(sender, instance, fields_changed, cached_data):
@@ -12,4 +11,4 @@
abs_url = instance.ab... |
dae054de92d6d864f77a337d269ba9b0c5ddeec4 | examples/charts/file/stacked_bar.py | examples/charts/file/stacked_bar.py | from bokeh.charts import Bar, output_file, show
from bokeh.charts.operations import blend
from bokeh.charts._attributes import cat, color
from bokeh.charts.utils import df_from_json
from bokeh.sampledata.olympics2014 import data
df = df_from_json(data)
# filter by countries with at least one medal and sort
df = df[df... | from bokeh.charts import Bar, output_file, show
from bokeh.charts.operations import blend
from bokeh.charts.attributes import cat, color
from bokeh.charts.utils import df_from_json
from bokeh.sampledata.olympics2014 import data
df = df_from_json(data)
# filter by countries with at least one medal and sort
df = df[df[... | Fix import on stacked bar example. | Fix import on stacked bar example.
| Python | bsd-3-clause | percyfal/bokeh,maxalbert/bokeh,phobson/bokeh,ChinaQuants/bokeh,quasiben/bokeh,DuCorey/bokeh,schoolie/bokeh,phobson/bokeh,KasperPRasmussen/bokeh,bokeh/bokeh,Karel-van-de-Plassche/bokeh,rs2/bokeh,DuCorey/bokeh,aavanian/bokeh,gpfreitas/bokeh,aavanian/bokeh,KasperPRasmussen/bokeh,draperjames/bokeh,dennisobrien/bokeh,maxalb... | ---
+++
@@ -1,6 +1,6 @@
from bokeh.charts import Bar, output_file, show
from bokeh.charts.operations import blend
-from bokeh.charts._attributes import cat, color
+from bokeh.charts.attributes import cat, color
from bokeh.charts.utils import df_from_json
from bokeh.sampledata.olympics2014 import data
|
d3e2a11f72f6de811f39ac10aa0abde74b99d269 | hcibench/pipeline/__init__.py | hcibench/pipeline/__init__.py | """
The :mod:`hcibench.pipeline` module provides a flexible infrastructure for
data processing and implements some common types of processing blocks.
"""
from .base import PipelineBlock, Pipeline, PassthroughPipeline
from .common import Windower, Filter, FeatureExtractor
__all__ = ['PipelineBlock',
'Pipeli... | """
The :mod:`hcibench.pipeline` module provides a flexible infrastructure for
data processing and implements some common types of processing blocks.
"""
from .base import PipelineBlock, Pipeline, PassthroughPipeline
from .common import Windower, Filter, FeatureExtractor, Estimator
__all__ = ['PipelineBlock',
... | Make Estimator importable from pipeline. | Make Estimator importable from pipeline.
| Python | mit | ucdrascal/axopy,ucdrascal/hcibench | ---
+++
@@ -4,7 +4,7 @@
"""
from .base import PipelineBlock, Pipeline, PassthroughPipeline
-from .common import Windower, Filter, FeatureExtractor
+from .common import Windower, Filter, FeatureExtractor, Estimator
__all__ = ['PipelineBlock',
'Pipeline', |
dc0f82fb424bce899493be9ba483a1fe16ea4f64 | setup.py | setup.py |
from setuptools import setup, find_packages
setup(
name='jawa',
packages=find_packages(),
version='2.1.1',
python_requires='>=3.6',
description='Doing fun stuff with JVM ClassFiles.',
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
author=... |
from setuptools import setup, find_packages
setup(
name='jawa',
packages=find_packages(),
version='2.1.1',
python_requires='>=3.6',
description='Doing fun stuff with JVM ClassFiles.',
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
author=... | Add bumpversion as a dev requirement. | Add bumpversion as a dev requirement.
| Python | mit | TkTech/Jawa,TkTech/Jawa | ---
+++
@@ -45,7 +45,8 @@
'pyyaml',
'ipython',
'twine',
- 'wheel'
+ 'wheel',
+ 'bumpversion'
]
},
entry_points=''' |
e91b691ba2e9a83d8cc94f42bdc41c9a7350c790 | setup.py | setup.py | #!/usr/bin/env python
"""Distutils installer for extras."""
from setuptools import setup
import os.path
import extras
testtools_cmd = extras.try_import('testtools.TestCommand')
def get_version():
"""Return the version of extras that we are building."""
version = '.'.join(
str(component) for componen... | #!/usr/bin/env python
"""Distutils installer for extras."""
from setuptools import setup
import os.path
import extras
testtools_cmd = extras.try_import('testtools.TestCommand')
def get_version():
"""Return the version of extras that we are building."""
version = '.'.join(
str(component) for componen... | Add trove classifiers specifying Python 3 support. | Add trove classifiers specifying Python 3 support.
| Python | mit | testing-cabal/extras | ---
+++
@@ -35,7 +35,12 @@
'in the standard library'),
long_description=get_long_description(),
version=get_version(),
- classifiers=["License :: OSI Approved :: MIT License"],
+ classifiers=[
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: MIT License... |
0ed714d6982d8d4cec628a7549a0a348526f0cf2 | setup.py | setup.py | import os
import setuptools
setuptools.setup(
name='factory_djoy',
version='0.5',
description='Factories for Django, creating valid instances every time',
url='http://github.com/jamescooke/factory_djoy',
author='James Cooke',
author_email='github@jamescooke.info',
license='MIT',
pac... | import os
import setuptools
setuptools.setup(
name='factory_djoy',
version='0.5.0',
description='Factories for Django, creating valid instances every time',
url='http://github.com/jamescooke/factory_djoy',
author='James Cooke',
author_email='github@jamescooke.info',
license='MIT',
p... | Add z Patch number as per symver.org | Add z Patch number as per symver.org
| Python | mit | jamescooke/factory_djoy | ---
+++
@@ -4,7 +4,7 @@
setuptools.setup(
name='factory_djoy',
- version='0.5',
+ version='0.5.0',
description='Factories for Django, creating valid instances every time',
url='http://github.com/jamescooke/factory_djoy', |
fdb7c400adb777cdc60cf034569d81e95797cc10 | infupy/backends/common.py | infupy/backends/common.py | import sys
from abc import ABCMeta, abstractmethod
def printerr(msg, e=''):
msg = "Backend: " + str(msg)
print(msg.format(e), file=sys.stderr)
class CommandError(Exception):
def __str__(self):
return "Command error: {}".format(self.args)
class Syringe(metaclass=ABCMeta):
_events = set()
... | import sys
from abc import ABCMeta, abstractmethod
def printerr(msg, e=''):
msg = "Backend: " + str(msg)
print(msg.format(e), file=sys.stderr)
class CommandError(Exception):
def __str__(self):
return "Command error: {}".format(self.args)
class Syringe(metaclass=ABCMeta):
_events = set()
... | Make abstract methods raise not implemented | Make abstract methods raise not implemented
| Python | isc | jaj42/infupy | ---
+++
@@ -14,23 +14,20 @@
@abstractmethod
def execCommand(self, msg):
- """
- Send command and read reply.
- """
- pass
+ raise NotImplementedError
# Read Perfusion related values
@abstractmethod
def readRate(self):
- return 0
+ raise Not... |
e635af49a1f72475980ff91406942707a369935d | setup.py | setup.py |
__author__ = 'matth'
from distutils.core import setup
from setuptools import find_packages
setup(
name='py-exe-builder',
version='0.1',
packages = find_packages(),
license='Apache License, Version 2.0',
description='Uses py2exe to create small exe stubs that leverage a full python installation, r... |
__author__ = 'matth'
from distutils.core import setup
from setuptools import find_packages
setup(
name='py-exe-builder',
version='0.2.dev1',
packages = find_packages(),
license='Apache License, Version 2.0',
description='Uses py2exe to create small exe stubs that leverage a full python installati... | Change version to dev version | Change version to dev version
| Python | apache-2.0 | j5int/py-exe-builder | ---
+++
@@ -6,7 +6,7 @@
setup(
name='py-exe-builder',
- version='0.1',
+ version='0.2.dev1',
packages = find_packages(),
license='Apache License, Version 2.0',
description='Uses py2exe to create small exe stubs that leverage a full python installation, rather than packing the required pyc... |
d93b1c1feadb3e8c2dd0643a19b025faec305a7a | setup.py | setup.py | """Setuptools packaging configuration for pyperf."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst') as f:
README = f.read()
setup(
name='py-perf',
version='0.0.1',
url='https://github.com/kevinconway/PyPerf',
license="Apache2",
description='A servi... | """Setuptools packaging configuration for pyperf."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst') as f:
README = f.read()
setup(
name='py-perf',
version='0.0.1',
url='https://github.com/kevinconway/PyPerf',
license="Apache2",
description='A servi... | Add entry_point for profiler implementations | Add entry_point for profiler implementations
| Python | apache-2.0 | kevinconway/PyPerf,kevinconway/PyPerf,kevinconway/PyPerf | ---
+++
@@ -36,6 +36,12 @@
"pyperf_transports": [
"amqp = pyperf.transports.amqp:AmqpTransport",
],
+ "pyperf_profilers": [
+ "runtime = pyperf.profilers.runtime:RuntimeProfiler",
+ "memory_max = pyperf.profilers.memory:MaxMemoryProfiler",
+ "memo... |
c656bca77d13afcfd8d6df0286b632433e08def1 | setup.py | setup.py | import os
from setuptools import setup
from sys import platform
REQUIREMENTS = []
if platform.startswith('darwin'):
REQUIREMENTS.append('pyobjc-core >= 2.5')
with open(os.path.join(os.path.dirname(__file__), 'nativeconfig', 'version.py')) as f:
version = None
code = compile(f.read(), 'version.py', 'exe... | import os
from setuptools import setup
from sys import platform
REQUIREMENTS = []
if platform.startswith('darwin'):
REQUIREMENTS.append('pyobjc-core >= 2.5')
with open(os.path.join(os.path.dirname(__file__), 'nativeconfig', 'version.py')) as f:
version = None
code = compile(f.read(), 'version.py', 'exe... | Add subdirs of nativeconfig package to build. | Add subdirs of nativeconfig package to build.
| Python | mit | GreatFruitOmsk/nativeconfig | ---
+++
@@ -19,7 +19,7 @@
setup(
name='nativeconfig',
version=version,
- packages=['nativeconfig'],
+ packages=['nativeconfig', 'nativeconfig.options', 'nativeconfig.config'],
url='https://github.com/GreatFruitOmsk/nativeconfig',
license='MIT License',
author='Ilya Kulakov', |
ff921ad5b1d85dc9554dfcd9d94d96f9f80b0d2b | setup.py | setup.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017 qsuscs, TobiX
import os
import sys
from glob import glob
os.chdir(os.path.dirname(__file__))
exit = 0
for f in glob('dot.*'):
dst = os.path.expanduser('~/' + f[3:].replace(u'\u2571', '/'))
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017 qsuscs, TobiX
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0
for f in glob('dot.*'):
dst = os.path.expanduser('~/' + f[3:].replace(u'\u2571', ... | Fix compatibility with Python 2 ;) | Fix compatibility with Python 2 ;)
| Python | isc | TobiX/dotfiles,TobiX/dotfiles | ---
+++
@@ -1,12 +1,14 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017 qsuscs, TobiX
+
+from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
-os.chdir(os.path.dirname(__file__))
+os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0
for f ... |
c638dbf619030c8d207e3bfd2e711da7c6c5cdf4 | passman.py | passman.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from splash import showSplash
from functions import quit, getServiceFromUser, getPasswordFromUser, writeToFile
def main():
while True:
service = getServiceFromUser()
pw = getPasswordFromUser()
writeToFile(service, pw)
# run the program
showSp... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import hashlib
from splash import showSplash
from functions import quit, getServiceFromUser, getPasswordFromUser, \
getUserInput, handleLogin, welcomeMessage, showMenu
from database import addUser, getAllServices, checkIfServiceExists, \
addService, removeService,... | Clean up main a bit | Clean up main a bit
| Python | mit | regexpressyourself/passman | ---
+++
@@ -2,19 +2,27 @@
# -*- coding: utf-8 -*-
+import hashlib
+
from splash import showSplash
-from functions import quit, getServiceFromUser, getPasswordFromUser, writeToFile
+from functions import quit, getServiceFromUser, getPasswordFromUser, \
+ getUserInput, handleLogin, welcomeMessage, showMenu
+... |
8111060bae0818a44dc6669bf8ae011a1e612857 | hunter/reviewsapi.py | hunter/reviewsapi.py | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ['UDACITY_AUTH_TOKEN']
self.headers = {'Authorization': token, 'Content-Length': '0'}
def execute(self, request):
try:
... | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ['UDACITY_AUTH_TOKEN']
self.headers = {'Authorization': token, 'Content-Length': '0'}
def execute(self, request):
try:
... | Remove whitespaces from lambda expression | Remove whitespaces from lambda expression
| Python | mit | anapaulagomes/reviews-assigner | ---
+++
@@ -25,11 +25,11 @@
raise UnauthorizedToken('Maybe it\'s time to change your token!')
def certifications(self):
- return self.execute(lambda : requests.get(CERTIFICATIONS_URL, headers=self.headers))
+ return self.execute(lambda:requests.get(CERTIFICATIONS_URL, headers=self.he... |
1dbc30202bddfd4f03bdc9a8005de3c363d2ac1d | blazar/plugins/dummy_vm_plugin.py | blazar/plugins/dummy_vm_plugin.py | # Copyright (c) 2013 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 agreed to in writ... | # Copyright (c) 2013 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 agreed to in writ... | Add update_reservation to dummy plugin | Add update_reservation to dummy plugin
update_reservation is now an abstract method. It needs to be added to
all plugins.
Change-Id: I921878bd5233613b804b17813af1aac5bdfed9e7
| Python | apache-2.0 | ChameleonCloud/blazar,ChameleonCloud/blazar,openstack/blazar,stackforge/blazar,stackforge/blazar,openstack/blazar | ---
+++
@@ -25,6 +25,9 @@
def reserve_resource(self, reservation_id, values):
return None
+ def update_reservation(self, reservation_id, values):
+ return None
+
def on_start(self, resource_id):
"""Dummy VM plugin does nothing."""
return 'VM %s should be waked up this ... |
b7627255c04e51ebb28f31365cff28ee9abcd05c | openspending/ui/test/functional/test_home.py | openspending/ui/test/functional/test_home.py | from .. import ControllerTestCase, url
class TestHomeController(ControllerTestCase):
def test_index(self):
response = self.app.get(url(controller='home', action='index'))
assert 'OpenSpending' in response
def test_locale(self):
response = self.app.get(url(controller='home', action='lo... | from .. import ControllerTestCase, url
class TestHomeController(ControllerTestCase):
def test_index(self):
response = self.app.get(url(controller='home', action='index'))
assert 'OpenSpending' in response
def test_locale(self):
response = self.app.get(url(controller='home', action='se... | Fix test for locale route generation. | Fix test for locale route generation. | Python | agpl-3.0 | CivicVision/datahub,spendb/spendb,johnjohndoe/spendb,pudo/spendb,johnjohndoe/spendb,nathanhilbert/FPA_Core,openspending/spendb,CivicVision/datahub,spendb/spendb,johnjohndoe/spendb,USStateDept/FPA_Core,USStateDept/FPA_Core,openspending/spendb,pudo/spendb,CivicVision/datahub,nathanhilbert/FPA_Core,spendb/spendb,openspend... | ---
+++
@@ -7,4 +7,4 @@
assert 'OpenSpending' in response
def test_locale(self):
- response = self.app.get(url(controller='home', action='locale'))
+ response = self.app.get(url(controller='home', action='set_locale')) |
16d77ff6a8d20773070630e1c7abb23c66345d72 | setup.py | setup.py | from setuptools import setup
setup(name='q', version='2.4', py_modules=['q'],
description='Quick-and-dirty debugging output for tired programmers',
author='Ka-Ping Yee', author_email='ping@zesty.ca',
license='Apache License 2.0',
url='http://github.com/zestyping/q', classifiers=[
'Prog... | from setuptools import setup
setup(name='q', version='2.5', py_modules=['q'],
description='Quick-and-dirty debugging output for tired programmers',
author='Ka-Ping Yee', author_email='ping@zesty.ca',
license='Apache License 2.0',
url='http://github.com/zestyping/q', classifiers=[
'Prog... | Advance PyPI version to 2.5. | Advance PyPI version to 2.5.
| Python | apache-2.0 | zestyping/q | ---
+++
@@ -1,5 +1,5 @@
from setuptools import setup
-setup(name='q', version='2.4', py_modules=['q'],
+setup(name='q', version='2.5', py_modules=['q'],
description='Quick-and-dirty debugging output for tired programmers',
author='Ka-Ping Yee', author_email='ping@zesty.ca',
license='Apache Licen... |
7fa490cb598aca2848ce886dfc45bb8606f07e58 | backend/geonature/core/gn_profiles/models.py | backend/geonature/core/gn_profiles/models.py | from geonature.utils.env import DB
from utils_flask_sqla.serializers import serializable
@serializable
class VmCorTaxonPhenology(DB.Model):
__tablename__ = "vm_cor_taxon_phenology"
__table_args__ = {"schema": "gn_profiles"}
cd_ref = DB.Column(DB.Integer)
period = DB.Column(DB.Integer)
id_nomenclatu... | from flask import current_app
from geoalchemy2 import Geometry
from utils_flask_sqla.serializers import serializable
from utils_flask_sqla_geo.serializers import geoserializable
from geonature.utils.env import DB
@serializable
class VmCorTaxonPhenology(DB.Model):
__tablename__ = "vm_cor_taxon_phenology"
__ta... | Add VM valid profile model | Add VM valid profile model
| Python | bsd-2-clause | PnEcrins/GeoNature,PnEcrins/GeoNature,PnEcrins/GeoNature,PnEcrins/GeoNature | ---
+++
@@ -1,5 +1,10 @@
+from flask import current_app
+from geoalchemy2 import Geometry
+
+from utils_flask_sqla.serializers import serializable
+from utils_flask_sqla_geo.serializers import geoserializable
+
from geonature.utils.env import DB
-from utils_flask_sqla.serializers import serializable
@serializable... |
52864307e692f40ddfe170a4b8607c4b2b96bff5 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.26',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
... | Update the PyPI version to 7.0. | Update the PyPI version to 7.0.
| Python | mit | Doist/todoist-python | ---
+++
@@ -10,7 +10,7 @@
setup(
name='todoist-python',
- version='0.2.26',
+ version='7.0',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com', |
823179066c9a7c101a18e9c2d7ccb2a9ccf7f1cb | setup.py | setup.py | import os
from setuptools import setup, find_packages
from hamcrest import __version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = 'PyHamcrest',
version = __version__,
author = 'Jon Reid',
author_email = 'jon.reid@mac.com',
description = 'H... | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
import re
matched = re.match('__version__.*', read(os.path.join('hamcrest', '__init__.py')))
if matched:
exec(matched.group())
setup(
name = 'PyHamcrest',
version ... | Support python 3 installtion; need distribute | Support python 3 installtion; need distribute
| Python | bsd-3-clause | msabramo/PyHamcrest,nitishr/PyHamcrest,nitishr/PyHamcrest,msabramo/PyHamcrest | ---
+++
@@ -1,9 +1,13 @@
import os
from setuptools import setup, find_packages
-from hamcrest import __version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
+import re
+matched = re.match('__version__.*', read(os.path.join('hamcrest', '__init__.py')))
+if matched:
+... |
c5b73be1bf0f0edd05c4743c2449bee568d01c76 | setup.py | setup.py | from distutils.core import setup
from turbasen import VERSION
name = 'turbasen'
setup(
name=name,
packages=[name],
version=VERSION,
description='Client for Nasjonal Turbase REST API',
author='Ali Kaafarani',
author_email='ali.kaafarani@turistforeningen.no',
url='https://github.com/Turbase... | from distutils.core import setup
from os import path
from turbasen import VERSION
name = 'turbasen'
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name=name,
packages=[name],
version=VERSION,
descript... | Add long description from README | Add long description from README
| Python | mit | Turbasen/turbasen.py | ---
+++
@@ -1,14 +1,20 @@
from distutils.core import setup
+from os import path
from turbasen import VERSION
name = 'turbasen'
+
+here = path.abspath(path.dirname(__file__))
+with open(path.join(here, 'README.md'), encoding='utf-8') as f:
+ long_description = f.read()
setup(
name=name,
packages... |
7a80fd081c6d8ece2b199f4a7915dc59d1805437 | setup.py | setup.py | #!/usr/bin/env python
from os import path
from setuptools import setup
with open(path.join(path.abspath(path.dirname(__file__)), 'README.rst')) as f:
long_description = f.read()
setup(name='django_uncertainty',
version='1.5',
description='A Django middleware to generate predictable errors on sites'... | #!/usr/bin/env python
from os import path
from setuptools import setup
with open(path.join(path.abspath(path.dirname(__file__)), 'README.rst')) as f:
long_description = f.read()
setup(name='django_uncertainty',
version='1.5',
description='A Django middleware to generate predictable errors on sites'... | Remove support for Python 2 | Remove support for Python 2
| Python | bsd-3-clause | abarto/django_uncertainty | ---
+++
@@ -27,7 +27,6 @@
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
], |
89dfdc7ebe2fe483d2b306dac83a666aa7c013d7 | setup.py | setup.py | #!/usr/bin/env python
from os.path import join
from setuptools import setup, find_packages
name = 'geokey-sapelli'
version = __import__(name.replace('-', '_')).__version__
repository = join('https://github.com/ExCiteS', name)
setup(
name=name,
version=version,
description='Read Sapelli project and load ... | #!/usr/bin/env python
from os.path import dirname, join
from setuptools import setup, find_packages
def read(file_name):
with open(join(dirname(__file__), file_name)) as file_object:
return file_object.read()
name = 'geokey-sapelli'
version = __import__(name.replace('-', '_')).__version__
repository = ... | Include README for PyPI release | Include README for PyPI release
| Python | mit | ExCiteS/geokey-sapelli,ExCiteS/geokey-sapelli | ---
+++
@@ -1,7 +1,12 @@
#!/usr/bin/env python
-from os.path import join
+from os.path import dirname, join
from setuptools import setup, find_packages
+
+
+def read(file_name):
+ with open(join(dirname(__file__), file_name)) as file_object:
+ return file_object.read()
name = 'geokey-sapelli'
@@ -1... |
2c7924b879be6536f0a6f0f7f78e5813156734af | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='neomodel',
version='0.4.0',
description='An object mapper for the neo4j graph database.',
long_description=open('README.rst').read(),
author='Robin Edwards',
author_email='robin.ge@gmail.com',
zip_safe=True,
url='http://github.com... | from setuptools import setup, find_packages
setup(
name='neomodel',
version='1.0.0',
description='An object mapper for the neo4j graph database.',
long_description=open('README.rst').read(),
author='Robin Edwards',
author_email='robin.ge@gmail.com',
zip_safe=True,
url='http://github.com... | Remove lucene query builder and bumper version | Remove lucene query builder and bumper version
| Python | mit | bleib1dj/neomodel,fpieper/neomodel,robinedwards/neomodel,cristigociu/neomodel_dh,bleib1dj/neomodel,pombredanne/neomodel,robinedwards/neomodel,andrefsp/neomodel,wcooley/neomodel | ---
+++
@@ -2,7 +2,7 @@
setup(
name='neomodel',
- version='0.4.0',
+ version='1.0.0',
description='An object mapper for the neo4j graph database.',
long_description=open('README.rst').read(),
author='Robin Edwards',
@@ -14,7 +14,7 @@
keywords='graph neo4j py2neo ORM',
tests_requ... |
69281da6f69bbdc5cfb832efa0b0c1b7810eb262 | setup.py | setup.py | # -*- coding: utf-8 -*-
from distutils.core import setup
readme_file = open('README.rst')
setup(
name='django-db-file-storage',
version='0.3.1',
author='Victor Oliveira da Silva',
author_email='victor_o_silva@hotmail.com',
packages=['db_file_storage'],
url='https://github.com/victor-o-silva/d... | # -*- coding: utf-8 -*-
from distutils.core import setup
readme_file = open('README.rst')
setup(
name='django-db-file-storage',
version='0.3.1',
author='Victor Oliveira da Silva',
author_email='victor_o_silva@hotmail.com',
packages=['db_file_storage'],
url='https://github.com/victor-o-silva/d... | Mark as compatible for python 2.7, 3.3 and 3.4 | Mark as compatible for python 2.7, 3.3 and 3.4
Add `classifiers` parameter to `setup` function call in `setup.py` file. | Python | mit | victor-o-silva/db_file_storage,victor-o-silva/db_file_storage | ---
+++
@@ -20,6 +20,16 @@
install_requires=[
"Django",
],
+ classifiers=[
+ 'Framework :: Django',
+ 'Intended Audience :: Developers',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.7',
+ ... |
b04ef68d079bf4ef172c6fa7f84946369b080cb7 | setup.py | setup.py | """setup.py"""
from codecs import open as codecs_open
from setuptools import setup
with codecs_open('README.rst', 'r', 'utf-8') as f:
README = f.read()
with codecs_open('HISTORY.rst', 'r', 'utf-8') as f:
HISTORY = f.read()
setup(
name='jsonrpcserver',
version='3.4.0',
description='Process JSON-R... | """setup.py"""
from codecs import open as codecs_open
from setuptools import setup
with codecs_open('README.rst', 'r', 'utf-8') as f:
README = f.read()
with codecs_open('HISTORY.rst', 'r', 'utf-8') as f:
HISTORY = f.read()
setup(
name='jsonrpcserver',
version='3.4.0',
description='Process JSON-R... | Add to extras_require examples section | Add to extras_require examples section
| Python | mit | bcb/jsonrpcserver | ---
+++
@@ -26,11 +26,13 @@
'tox': ['tox','pylint'],
'examples': [
'aiohttp',
+ 'aiozmq',
'flask',
'flask-socketio',
+ 'pyzmq',
'tornado',
+ 'websockets',
'werkzeug',
- 'pyzmq'
]
... |
ad889be15a374ff07492b549ba454bafd3a76fd7 | setup.py | setup.py | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as readme:
README = readme.read()
setup(
name='django-postgres-extra',
version='1.21a2',
packages=find_packages(),
include_package_data=True,
license='MIT L... | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as readme:
README = readme.read().split('h1>', 2)[1]
setup(
name='django-postgres-extra',
version='1.21a2',
packages=find_packages(),
include_package_data=True,... | Cut out logo in README uploaded to PyPi | Cut out logo in README uploaded to PyPi
| Python | mit | SectorLabs/django-postgres-extra | ---
+++
@@ -3,7 +3,7 @@
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as readme:
- README = readme.read()
+ README = readme.read().split('h1>', 2)[1]
setup(
name='django-postgres-extra', |
3ab6dbf87053634ce48627787151a24b33b546af | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.5',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.6',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | Update the PyPI version to 0.2.6. | Update the PyPI version to 0.2.6.
| Python | mit | Doist/todoist-python,electronick1/todoist-python | ---
+++
@@ -10,7 +10,7 @@
setup(
name='todoist-python',
- version='0.2.5',
+ version='0.2.6',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com', |
b98b804ea83723d476f50a46e9ba4dbe8fc6e4a4 | setup.py | setup.py | from setuptools import find_packages
from setuptools import setup
setup(
name='kms-encryption-toolbox',
version='0.0.5',
url='https://github.com/ApplauseOSS/kms-encryption-toolbox',
license='Applause',
description='Encryption toolbox to be used with the Amazon Key Management Service for securing yo... | from setuptools import find_packages
from setuptools import setup
setup(
name='kms-encryption-toolbox',
version='0.0.6',
url='https://github.com/ApplauseOSS/kms-encryption-toolbox',
license='Applause',
description='Encryption toolbox to be used with the Amazon Key Management Service for securing yo... | Add cffi to the package requirements. | Add cffi to the package requirements.
| Python | mit | ApplauseOSS/kms-encryption-toolbox | ---
+++
@@ -3,7 +3,7 @@
setup(
name='kms-encryption-toolbox',
- version='0.0.5',
+ version='0.0.6',
url='https://github.com/ApplauseOSS/kms-encryption-toolbox',
license='Applause',
description='Encryption toolbox to be used with the Amazon Key Management Service for securing your deployme... |
548d5b46607d1023e7b0a95c6a2995419fa06b50 | fickle/api.py | fickle/api.py | import flask
from flask import request, json
def Response(data, status = 200):
body = json.dumps(data)
return flask.Response(body, status = status, mimetype = 'application/json')
def SuccessResponse(dataset_id = None):
return Response({ 'success': True, 'id': dataset_id })
def ErrorResponse(status = 400)... | import flask
from flask import request, json
def Response(data, status = 200):
body = json.dumps(data)
return flask.Response(body, status = status, mimetype = 'application/json')
def SuccessResponse(dataset_id = None):
return Response({ 'success': True, 'id': dataset_id })
def ErrorResponse(status = 400)... | Change HTTP method for validate endpoint | Change HTTP method for validate endpoint
| Python | mit | norbert/fickle | ---
+++
@@ -31,7 +31,7 @@
backend.fit()
return SuccessResponse(backend.dataset_id)
- @app.route('/validate', methods=['PUT'])
+ @app.route('/validate', methods=['POST'])
def api_validate():
if not backend.loaded():
return ErrorResponse() |
6007c5800ea1f59ac26417b5081323c0b40446ad | almanacbot/almanac-bot.py | almanacbot/almanac-bot.py | import json
import logging
import logging.config
import os
import sys
import config
import constants
def setup_logging(
path='logging.json',
log_level=logging.DEBUG,
env_key='LOG_CFG'
):
env_path = os.getenv(env_key, None)
if env_path:
path = env_path
if os.path.exists(pat... | import json
import logging
import logging.config
import os
import sys
import config
import constants
import twitter
conf = None
twitter_api = None
def setup_logging(
path='logging.json',
log_level=logging.DEBUG,
env_key='LOG_CFG'
):
env_path = os.getenv(env_key, None)
if env_path:
... | Add Twitter API client initialization. | Add Twitter API client initialization.
| Python | mit | logoff/almanac-bot,logoff/almanac-bot | ---
+++
@@ -6,6 +6,10 @@
import config
import constants
+import twitter
+
+conf = None
+twitter_api = None
def setup_logging(
@@ -24,13 +28,34 @@
logging.basicConfig(level=log_level)
+def setup_twitter():
+ logging.info("Setting up Twitter API client...")
+
+ twitter_api = twitter.Api(
+ ... |
ae966a3cb7f99e5604c8302680f125e12087003a | blackhole/state.py | blackhole/state.py |
class MailState():
_reading_data = False
def set_reading(self, val):
self._reading_data = val
def get_reading(self):
return self._reading_data
| class MailState():
_reading_data = False
def set_reading(self, val):
self._reading_data = val
@property
def reading(self):
return self._reading_data
| Change getter in to property | Change getter in to property | Python | mit | kura/blackhole,kura/blackhole | ---
+++
@@ -1,9 +1,9 @@
-
class MailState():
_reading_data = False
def set_reading(self, val):
self._reading_data = val
- def get_reading(self):
+ @property
+ def reading(self):
return self._reading_data |
e50fc12459e6ff77864fe499b512a57e89f7ead2 | pi_control_service/gpio_service.py | pi_control_service/gpio_service.py | from rpc import RPCService
from pi_pin_manager import PinManager
ALLOWED_ACTIONS = ('on', 'off', 'read')
class GPIOService(RPCService):
def __init__(self, rabbit_url, device_key, pin_config):
self.pins = PinManager(config_file=pin_config)
super(GPIOService, self).__init__(
rabbit_ur... | from rpc import RPCService
from pi_pin_manager import PinManager
ALLOWED_ACTIONS = ('on', 'off', 'read')
class GPIOService(RPCService):
def __init__(self, rabbit_url, device_key, pin_config):
self.pins = PinManager(config_file=pin_config)
super(GPIOService, self).__init__(
rabbit_ur... | Send exception message in response | Send exception message in response
| Python | mit | projectweekend/Pi-Control-Service,HydAu/ProjectWeekds_Pi-Control-Service | ---
+++
@@ -27,8 +27,8 @@
result['error'] = 0
except ValueError:
result['response'] = "'pin' value must be an integer"
- except:
- pass
+ except Exception as e:
+ result['response'] = e.message
return result
def stop(self): |
fe4fec66cbf4100752c4b7414090019ab8ddb8ce | ideascube/conf/idb_bdi.py | ideascube/conf/idb_bdi.py | """Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(... | """Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(... | Add cards for Ideasbox in Burundi | Add cards for Ideasbox in Burundi
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | ---
+++
@@ -11,3 +11,33 @@
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
+STAFF_HOME_CARDS = [c for c in STAFF_HOME_CARDS
+ if c['url'] in ['user_list', 'server:power',
+ 'server:backup']]... |
d75a79d10658ad32a9b1d71e472372d8335c7bb6 | ml/test_amaranth_lib.py | ml/test_amaranth_lib.py | # Lint as: python3
"""These tests ensure correctness for the helper functions in amaranth_lib."""
import unittest
class TestAmaranthHelpers(unittest.TestCase):
def test_load_calorie_data(self):
raise NotImplementedError
def test_clean_data(self):
raise NotImplementedError
def test_add_calorie_labels... | # Lint as: python3
"""These tests ensure correctness for the helper functions in amaranth_lib."""
import unittest
class TestAmaranthHelpers(unittest.TestCase):
def test_combine_dataframes(self):
raise NotImplementedError
def test_get_calorie_data(self):
raise NotImplementedError
def test_clean_data(... | Update testing stubs with helper lib changes | Update testing stubs with helper lib changes
| Python | apache-2.0 | googleinterns/amaranth,googleinterns/amaranth | ---
+++
@@ -6,7 +6,10 @@
class TestAmaranthHelpers(unittest.TestCase):
- def test_load_calorie_data(self):
+ def test_combine_dataframes(self):
+ raise NotImplementedError
+
+ def test_get_calorie_data(self):
raise NotImplementedError
def test_clean_data(self): |
3bc52b94479e3b0e147ff6ef4bcc8379a5b57249 | trunk/mobile_portal/mobile_portal/core/middleware.py | trunk/mobile_portal/mobile_portal/core/middleware.py | from django.conf import settings
import geolocation
from mobile_portal.wurfl.wurfl_data import devices
from mobile_portal.wurfl import device_parents
from pywurfl.algorithms import DeviceNotFound
from mobile_portal.wurfl.vsm import VectorSpaceAlgorithm
class LocationMiddleware(object):
vsa = VectorSpaceAlgorithm(... | from django.conf import settings
import geolocation
from mobile_portal.wurfl.wurfl_data import devices
from mobile_portal.wurfl import device_parents
from pywurfl.algorithms import DeviceNotFound
from mobile_portal.wurfl.vsm import VectorSpaceAlgorithm
class LocationMiddleware(object):
vsa = VectorSpaceAlgorithm(... | Fix bug when Opera Mini (and possibly others) present no X-OperaMini-Phone header. | Fix bug when Opera Mini (and possibly others) present no X-OperaMini-Phone header.
| Python | apache-2.0 | mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject | ---
+++
@@ -20,8 +20,8 @@
except (KeyError, DeviceNotFound):
request.browser = devices.select_id('generic_xhtml')
- if 'opera_mini_ver1' in device_parents[request.browser.devid]:
- opera_device = request.META.get('HTTP_X_OPERAMINI_PHONE')
+ if 'HTTP_X_OPERAMINI_PHONE' ... |
ef81886e4ecf08c12783e0cc2b934ed812accb97 | Zika_vdb_upload.py | Zika_vdb_upload.py | import os, re, time, datetime, csv, sys
import rethinkdb as r
from Bio import SeqIO
from vdb_upload import vdb_upload
from vdb_upload import parser
class Zika_vdb_upload(vdb_upload):
def __init__(self, fasta_fields, fasta_fname, database, virus, source, locus=None, vsubtype=None, authors=None, path=None, auth_ke... | import os, re, time, datetime, csv, sys
import rethinkdb as r
from Bio import SeqIO
from vdb_upload import vdb_upload
from vdb_upload import parser
class Zika_vdb_upload(vdb_upload):
def __init__(self, fasta_fields, fasta_fname, database, virus, source, locus=None, vsubtype=None, authors=None, path=None, auth_ke... | Modify Zika fasta fields to match default VIPRBRC ordering. | Modify Zika fasta fields to match default VIPRBRC ordering.
| Python | agpl-3.0 | blab/nextstrain-db,nextstrain/fauna,blab/nextstrain-db,nextstrain/fauna | ---
+++
@@ -14,6 +14,8 @@
if __name__=="__main__":
args = parser.parse_args()
- fasta_fields = {0:'accession', 1:'strain', 2:'date', 4:'country', 5:'division', 6:'location'}
+ fasta_fields = {0:'accession', 2:'strain', 4:'date', 6:'country'}
+ # 0 1 2 3 4 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.