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 |
|---|---|---|---|---|---|---|---|---|---|---|
c89e30d1a33df2d9d8c5ceb03df98d29b3b08724 | spacy/tests/en/test_exceptions.py | spacy/tests/en/test_exceptions.py | # coding: utf-8
"""Test that tokenizer exceptions are handled correctly."""
from __future__ import unicode_literals
import pytest
@pytest.mark.parametrize('text', ["e.g.", "p.m.", "Jan.", "Dec.", "Inc."])
def test_tokenizer_handles_abbr(en_tokenizer, text):
tokens = en_tokenizer(text)
assert len(tokens) ==... | # coding: utf-8
"""Test that tokenizer exceptions are handled correctly."""
from __future__ import unicode_literals
import pytest
@pytest.mark.parametrize('text', ["e.g.", "p.m.", "Jan.", "Dec.", "Inc."])
def test_tokenizer_handles_abbr(en_tokenizer, text):
tokens = en_tokenizer(text)
assert len(tokens) ==... | Add test for English time exceptions ("1a.m." etc.) | Add test for English time exceptions ("1a.m." etc.)
| Python | mit | honnibal/spaCy,spacy-io/spaCy,Gregory-Howard/spaCy,recognai/spaCy,raphael0202/spaCy,aikramer2/spaCy,explosion/spaCy,aikramer2/spaCy,Gregory-Howard/spaCy,raphael0202/spaCy,honnibal/spaCy,explosion/spaCy,raphael0202/spaCy,spacy-io/spaCy,honnibal/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,Gregory-Howard/spaCy,spacy-io/spaCy,r... | ---
+++
@@ -18,3 +18,10 @@
tokens = en_tokenizer(text)
assert len(tokens) == 6
assert tokens[3].text == "i.e."
+
+
+@pytest.mark.parametrize('text', ["1am", "12a.m.", "11p.m.", "4pm"])
+def test_tokenizer_handles_times(en_tokenizer, text):
+ tokens = en_tokenizer(text)
+ assert len(tokens) == 2
+... |
99b1610fad7224d2efe03547c5114d2f046f50ca | bin/cgroup-limits.py | bin/cgroup-limits.py | #!/usr/bin/python
env_vars = {}
def read_file(path):
try:
with open(path, 'r') as f:
return f.read().strip()
except IOError:
return None
def get_memory_limit():
limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes')
if limit:
env_vars['MEMORY_LIMIT_IN_B... | #!/usr/bin/python
from __future__ import print_function
import sys
env_vars = {}
def read_file(path):
try:
with open(path, 'r') as f:
return f.read().strip()
except IOError:
return None
def get_memory_limit():
limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes')... | Print warnings to standard error | Print warnings to standard error
| Python | apache-2.0 | soltysh/sti-base,mfojtik/sti-base,hhorak/sti-base,bparees/sti-base,openshift/sti-base,sclorg/s2i-base-container,openshift/sti-base,mfojtik/sti-base,bparees/sti-base | ---
+++
@@ -1,4 +1,7 @@
#!/usr/bin/python
+
+from __future__ import print_function
+import sys
env_vars = {}
@@ -13,8 +16,11 @@
def get_memory_limit():
limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes')
- if limit:
- env_vars['MEMORY_LIMIT_IN_BYTES'] = limit
+ if limit is None... |
e93dadc8215f3946e4e7b64ca8ab3481fcf3c197 | froide/foirequestfollower/apps.py | froide/foirequestfollower/apps.py | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class FoiRequestFollowerConfig(AppConfig):
name = 'froide.foirequestfollower'
verbose_name = _('FOI Request Follower')
def ready(self):
from froide.account import account_canceled
import froide.foire... | import json
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class FoiRequestFollowerConfig(AppConfig):
name = 'froide.foirequestfollower'
verbose_name = _('FOI Request Follower')
def ready(self):
from froide.account import account_canceled
import... | Add user data export for foirequest follower | Add user data export for foirequest follower | Python | mit | fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide | ---
+++
@@ -1,3 +1,5 @@
+import json
+
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
@@ -9,8 +11,10 @@
def ready(self):
from froide.account import account_canceled
import froide.foirequestfollower.signals # noqa
+ from froide.account.expor... |
482205f4235f5a741e55fd560bab4a4d75cb5303 | versailes2geojson.py | versailes2geojson.py | import pandas as pd
import geojson
from geojson import FeatureCollection, Feature, Point
# read in original data
csv = pd.read_csv("versaille_stock.csv", sep="\t")
# fetch properties, remove Long and Lat
props = list(csv.columns.values)
props = [p for p in props if p not in ["Longitude",
... | import pandas as pd
import geojson
from geojson import FeatureCollection, Feature, Point
# read in original data
csv = pd.read_csv("versaille_stock.csv", sep="\t")
# fetch properties, remove Long and Lat
props = list(csv.columns.values)
props = [p for p in props if p not in ["Longitude",
... | Correct the order of coordinates. | Correct the order of coordinates.
Geojson expects lon, lat.
| Python | apache-2.0 | mkuzak/atmap | ---
+++
@@ -19,7 +19,7 @@
feature_props = {p: accession[p] for p in props}
f = Feature(
- geometry = Point((lat,lon))
+ geometry = Point((lon,lat))
)
features.append(f) |
29ffe1df88927aa568d3e86b07e372e5ba589310 | indra/sources/eidos/server.py | indra/sources/eidos/server.py | """This is a Python-based web server that can be run to
read with Eidos. To run the server, do
python -m indra.sources.eidos.server
and then submit POST requests to the `localhost:5000/process_text` endpoint
with JSON content as `{'text': 'text to read'}`. The response will be the
Eidos JSON-LD output.
"""
impor... | """This is a Python-based web server that can be run to
read with Eidos. To run the server, do
python -m indra.sources.eidos.server
and then submit POST requests to the `localhost:5000/process_text` endpoint
with JSON content as `{'text': 'text to read'}`. The response will be the
Eidos JSON-LD output.
"""
impor... | Allow one or multiple texts to reground | Allow one or multiple texts to reground
| Python | bsd-2-clause | sorgerlab/belpy,johnbachman/indra,bgyori/indra,johnbachman/belpy,bgyori/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy,johnbachman/belpy,bgyori/indra,sorgerlab/belpy,sorgerlab/indra | ---
+++
@@ -34,7 +34,10 @@
text = request.json.get('text')
if not text:
return []
- res = er.reground_texts([text], wm_yml)
+ if isinstance(text, str):
+ res = er.reground_texts([text], wm_yml)
+ elif isinstance(text, list):
+ res = er.reground_texts(text, wm_yml)
return... |
46b60e3bb2b84685e27035a270e8ae81551f3f72 | silver/management/commands/generate_docs.py | silver/management/commands/generate_docs.py | from optparse import make_option
from datetime import datetime as dt
from django.core.management.base import BaseCommand
from django.utils import translation
from django.conf import settings
from dateutil.relativedelta import *
from silver.documents_generator import DocumentsGenerator
from silver.models import Subscr... | from optparse import make_option
from datetime import datetime as dt
from django.core.management.base import BaseCommand
from django.utils import translation
from django.conf import settings
from dateutil.relativedelta import *
from silver.documents_generator import DocumentsGenerator
from silver.models import Subscr... | Add language code in the command | Add language code in the command
| Python | apache-2.0 | PressLabs/silver,PressLabs/silver,PressLabs/silver | ---
+++
@@ -24,7 +24,7 @@
)
def handle(self, *args, **options):
- translation.activate(settings.LANGUAGE_CODE)
+ translation.activate('en-us')
date = None
if options['billing_date']: |
13be198c8aec08f5738eecbb7da2bfdcafd57a48 | pygraphc/clustering/MaxCliquesPercolationSA.py | pygraphc/clustering/MaxCliquesPercolationSA.py | from MaxCliquesPercolation import MaxCliquesPercolationWeighted
class MaxCliquesPercolationSA(MaxCliquesPercolationWeighted):
def __init__(self, graph, edges_weight, nodes_id, k, threshold):
super(MaxCliquesPercolationSA, self).__init__(graph, edges_weight, nodes_id, k, threshold)
def get_maxcliques_... | from MaxCliquesPercolation import MaxCliquesPercolationWeighted
from pygraphc.optimization.SimulatedAnnealing import SimulatedAnnealing
from numpy import linspace
class MaxCliquesPercolationSA(MaxCliquesPercolationWeighted):
def __init__(self, graph, edges_weight, nodes_id, k, threshold, tmin, tmax, alpha, energy... | Add constructor and get method with SA | Add constructor and get method with SA
| Python | mit | studiawan/pygraphc | ---
+++
@@ -1,9 +1,34 @@
from MaxCliquesPercolation import MaxCliquesPercolationWeighted
+from pygraphc.optimization.SimulatedAnnealing import SimulatedAnnealing
+from numpy import linspace
class MaxCliquesPercolationSA(MaxCliquesPercolationWeighted):
- def __init__(self, graph, edges_weight, nodes_id, k, th... |
33309df85823bde19fcdd2b21b73db9f1da131ab | requests_oauthlib/compliance_fixes/facebook.py | requests_oauthlib/compliance_fixes/facebook.py | from json import dumps
from oauthlib.common import urldecode
from urlparse import parse_qsl
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if 'application/json' in r.headers['content-type']:
return r
... | from json import dumps
try:
from urlparse import parse_qsl
except ImportError:
from urllib.parse import parse_qsl
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if 'application/json' in r.headers['content-type']:... | Remove unused import. Facebook compliance support python3 | Remove unused import. Facebook compliance support python3
| Python | isc | abhi931375/requests-oauthlib,gras100/asks-oauthlib,requests/requests-oauthlib,singingwolfboy/requests-oauthlib,jayvdb/requests-oauthlib,lucidbard/requests-oauthlib,dongguangming/requests-oauthlib,jsfan/requests-oauthlib,jayvdb/requests-oauthlib,sigmavirus24/requests-oauthlib,elafarge/requests-oauthlib | ---
+++
@@ -1,6 +1,8 @@
from json import dumps
-from oauthlib.common import urldecode
-from urlparse import parse_qsl
+try:
+ from urlparse import parse_qsl
+except ImportError:
+ from urllib.parse import parse_qsl
def facebook_compliance_fix(session): |
60a9ace22f219f7b125b3a618090c4dd36cded4c | api/base/exceptions.py | api/base/exceptions.py |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
... | Add additional error detail to cover other circumstances that intend to throw 401 | Add additional error detail to cover other circumstances that intend to throw 401
| Python | apache-2.0 | abought/osf.io,mfraezz/osf.io,rdhyee/osf.io,GageGaskins/osf.io,TomHeatwole/osf.io,Ghalko/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,billyhunt/osf.io,brianjgeiger/osf.io,cosenal/osf.io,danielneis/osf.io,caseyrygt/osf.io,haoyuchen1992/osf.io,cslzchen/osf.io,acshi/osf.io,emetsger/osf.io,Nesiehr/osf.io,samanehsan/osf.io,... | ---
+++
@@ -31,7 +31,10 @@
response.data = {'errors': errors}
# Return 401 instead of 403 during unauthorized requests without having user log in with Basic Auth
- if response is not None and response.data['errors'][0].get('detail') == "Authentication credentials were not provided.":
+ error_message... |
18d06379a2dd89ef3d8db0d045f563b8f38f57db | badgekit_webhooks/urls.py | badgekit_webhooks/urls.py | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | Mark instance list as staff-only, and give it a view name | Mark instance list as staff-only, and give it a view name
| Python | mit | tgs/django-badgekit-webhooks | ---
+++
@@ -9,7 +9,8 @@
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "badgekit_webhooks.views.badge_issued_hook",
name="badge_issued_hook"),
- url(r"^instances/$", views.InstanceListView.as_view()),
+ url(r"^instances/$", staff_member_re... |
fb15b0735a8d2710baa33ac4e74d1dc88de209bc | suplemon/lexer.py | suplemon/lexer.py | # -*- encoding: utf-8
import pygments
import pygments.lexers
class Lexer:
def __init__(self, app):
self.app = app
def lex(self, code, lex):
"""Return tokenified code.
Return a list of tuples (scope, word) where word is the word to be
printed and scope the scope name represen... | # -*- encoding: utf-8
import pygments
import pygments.lexers
class Lexer:
def __init__(self, app):
self.app = app
def lex(self, code, lex):
"""Return tokenified code.
Return a list of tuples (scope, word) where word is the word to be
printed and scope the scope name represen... | Make sure that Lexer.lex() returns str instead of bytes | Make sure that Lexer.lex() returns str instead of bytes
| Python | mit | twolfson/suplemon,richrd/suplemon,richrd/suplemon,severin31/suplemon,twolfson/suplemon,trylle/suplemon | ---
+++
@@ -19,6 +19,9 @@
:return:
"""
if lex is None:
+ if not type(code) is str:
+ # if not suitable lexer is found, return decoded code
+ code = code.decode("utf-8")
return (("global", code),)
words = pygments.lex(code, lex... |
85d6a10891e8c8c3f800a28db28a8d6a1c5684be | src/texas_choropleth/settings/production.py | src/texas_choropleth/settings/production.py | from .base import *
# Debug Settings
DEBUG = False
TEMPLATE_DEBUG = False
# Media Settings
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Staticfile Setttings
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
STATIC_ROOT = os.path.join(BASE_DIR, 'static_final')
# TMP Dir for Choropleth Screenshots
IMA... | from .base import *
# Debug Settings
DEBUG = False
TEMPLATE_DEBUG = False
# Media Settings
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Staticfile Setttings
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
STATIC_ROOT = os.path.join(BASE_DIR, 'static_final')
# TMP Dir for Choropleth Screenshots
IMA... | Use the get_secret function to grab the database configuration. | Use the get_secret function to grab the database configuration.
git-svn-id: d73fdb991549f9d1a0affa567d55bb0fdbd453f3@8412 f04a3889-0f81-4131-97fb-bc517d1f583d
| Python | bsd-3-clause | unt-libraries/texas-choropleth,unt-libraries/texas-choropleth,damonkelley/texas-choropleth,damonkelley/texas-choropleth,unt-libraries/texas-choropleth,damonkelley/texas-choropleth,damonkelley/texas-choropleth,unt-libraries/texas-choropleth | ---
+++
@@ -26,11 +26,11 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
- 'NAME': '',
- 'USER': '',
- 'PASSWORD': '',
- 'HOST': '',
- 'PORT': '',
+ 'NAME': get_secret('DB_NAME'),
+ 'USER': get_secret('DB_USER'),
+ 'PASSWORD': ... |
d8247d43c8026a8de39b09856a3f7beb235dc4f6 | antxetamedia/multimedia/handlers.py | antxetamedia/multimedia/handlers.py | from boto.s3.connection import S3Connection
from boto.exception import S3ResponseError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=False)
while bucket.endswith('-'):
bucket = bucket[:-1]
t... | from boto.s3.connection import S3Connection
from boto.s3.bucket import Bucket
from boto.exception import S3ResponseError, S3CreateError
from django.conf import settings
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Connection(user, passwd, host=settings.S3_HOST, is_secure=False)
while bucket... | Handle the case where the bucket already exists | Handle the case where the bucket already exists
| Python | agpl-3.0 | GISAElkartea/antxetamedia,GISAElkartea/antxetamedia,GISAElkartea/antxetamedia | ---
+++
@@ -1,7 +1,9 @@
from boto.s3.connection import S3Connection
-from boto.exception import S3ResponseError
+from boto.s3.bucket import Bucket
+from boto.exception import S3ResponseError, S3CreateError
from django.conf import settings
+
def upload(user, passwd, bucket, metadata, key, fd):
conn = S3Con... |
2da190d0a6b6f8b6acc70b7e2b6e903283a1e735 | taggit_bootstrap/widgets.py | taggit_bootstrap/widgets.py | from django import forms
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.forms.util import flatatt
from django.utils.encoding import force_text
from taggit.utils import parse_tags, edit_string_for_tags
from django.utils import six
class TagsInput(forms.Tex... | from django import forms
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.forms.utils import flatatt
from django.utils.encoding import force_text
from taggit.utils import parse_tags, edit_string_for_tags
from django.utils import six
class TagsInput(forms.Te... | Update the django path to flatatt module | Update the django path to flatatt module | Python | mit | mi6gan/django-taggit-bootstrap,mi6gan/django-taggit-bootstrap | ---
+++
@@ -1,7 +1,7 @@
from django import forms
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
-from django.forms.util import flatatt
+from django.forms.utils import flatatt
from django.utils.encoding import force_text
from taggit.utils import parse_tags, edi... |
e61bd9a56b31dde461ad0cb82e3140bd0dbfa958 | ckanext/tayside/logic/action/update.py | ckanext/tayside/logic/action/update.py | from ckan.logic.action import update as update_core
import ckan.lib.uploader as uploader
def config_option_update(context, data_dict):
upload = uploader.get_uploader('admin')
upload.update_data_dict(data_dict, 'hero_image_url', 'hero_image_upload',
'clear_hero_image_upload')
up... | from ckan.logic.action import update as update_core
import ckan.lib.uploader as uploader
def config_option_update(context, data_dict):
upload = uploader.get_uploader('admin')
upload.update_data_dict(data_dict, 'hero_image_url', 'hero_image_upload',
'clear_hero_image_upload')
... | Fix bug for saving images in config | Fix bug for saving images in config
| Python | agpl-3.0 | ViderumGlobal/ckanext-tayside,ViderumGlobal/ckanext-tayside,ViderumGlobal/ckanext-tayside,ViderumGlobal/ckanext-tayside | ---
+++
@@ -4,8 +4,12 @@
def config_option_update(context, data_dict):
upload = uploader.get_uploader('admin')
+
upload.update_data_dict(data_dict, 'hero_image_url', 'hero_image_upload',
'clear_hero_image_upload')
+
+ upload.upload(uploader.get_max_image_size())
+
upl... |
b0fd983269fca4c514a8a21d0bb17d47d46780c3 | system_maintenance/tests/functional/base.py | system_maintenance/tests/functional/base.py | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from system_maintenance.tests.utilities import populate_test_db
class FunctionalTest(StaticLiveServerTestCase):
def setUp(self):
populate_test_db()
... | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from system_maintenance.tests.utilities import populate_test_db
class FunctionalTest(StaticLiveServerTestCase):
def setUp(self):
populate_test_db()
... | Make functional testing compatible with selenium 3.141.0 | Make functional testing compatible with selenium 3.141.0
| Python | bsd-3-clause | mfcovington/django-system-maintenance,mfcovington/django-system-maintenance,mfcovington/django-system-maintenance | ---
+++
@@ -30,7 +30,7 @@
self.find_authentication_elements()
self.username_inputbox.send_keys(username)
self.password_inputbox.send_keys(username)
- self.password_inputbox.send_keys(Keys.ENTER)
+ self.login_button.click()
def system_maintenance_url(self, url_stem=''):
... |
1ec98e066eda1faa212816abf1de99c4ed87f8a0 | mysite/multitenancy/models.py | mysite/multitenancy/models.py | import os
from django.conf import settings
from django.db import models
from . import tenant
if 'DJANGO_TENANT' in os.environ:
tenant._set_for_tenant(os.environ['DJANGO_TENANT'])
else:
tenant._set_default()
tenant._patch_table_names()
class Tenant(models.Model):
user = models.OneToOneField(setting... | import os
from django.conf import settings
from django.db import models
from . import tenant
if 'DJANGO_TENANT' in os.environ:
tenant._set_for_tenant(os.environ['DJANGO_TENANT'])
else:
tenant._set_default()
tenant._patch_table_names()
class Tenant(models.Model):
user = models.OneToOneField(setting... | Make network name and slug unique | Make network name and slug unique
| Python | bsd-3-clause | Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto | ---
+++
@@ -15,8 +15,8 @@
class Tenant(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL)
- network_name = models.CharField(max_length=20)
- slug = models.SlugField()
+ network_name = models.CharField(max_length=20, unique=True)
+ slug = models.SlugField(unique=True)
@prop... |
7408862af1a6dc618e9dd78ece2120533466ab75 | test/settings/gyptest-settings.py | test/settings/gyptest-settings.py | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Smoke-tests 'settings' blocks.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('settings.gyp')
test.build('test.gyp', test.AL... | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Smoke-tests 'settings' blocks.
"""
import TestGyp
# 'settings' is only supported for make and scons (and will be removed there as
# we... | Make new settings test not run for xcode generator. | Make new settings test not run for xcode generator.
TBR=evan
Review URL: http://codereview.chromium.org/7472006
| Python | bsd-3-clause | csulmone/gyp,csulmone/gyp,csulmone/gyp,csulmone/gyp | ---
+++
@@ -10,7 +10,9 @@
import TestGyp
-test = TestGyp.TestGyp()
+# 'settings' is only supported for make and scons (and will be removed there as
+# well eventually).
+test = TestGyp.TestGyp(formats=['make', 'scons'])
test.run_gyp('settings.gyp')
test.build('test.gyp', test.ALL)
test.pass_test() |
ff2def37816fbf1a8cf726914368036c0081e869 | tests/integration/shared.py | tests/integration/shared.py |
class ServiceTests(object):
def test_bash(self):
return self.check(
input='bc -q\n1+1\nquit()',
type='org.tyrion.service.bash',
output='2',
error='',
code='0',
)
def test_python(self):
return self.check(
input='pr... |
class ServiceTests(object):
def test_bash(self):
return self.check(
input='bc -q\n1+1\nquit()',
type='org.tyrion.service.bash',
output='2',
error='',
code='0',
)
def test_python(self):
return self.check(
input='pr... | Tweak integration timeout test to match gtest | Tweak integration timeout test to match gtest
| Python | mit | silas/tyrion,silas/tyrion,silas/tyrion,silas/tyrion,silas/tyrion | ---
+++
@@ -30,10 +30,10 @@
def test_timeout_error(self):
return self.check(
- input='sleep 10',
+ input='echo test\nsleep 10',
type='org.tyrion.service.bash',
- output='',
+ output='test',
error=None,
code='15',
- ... |
9aaf3bd6c376f608911b232d5f811e0b7964022f | tests/django_mysql_tests/tests.py | tests/django_mysql_tests/tests.py | # -*- coding:utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from django.test import TestCase
from django_mysql_tests.models import MyModel
class SimpleTests(TestCase):
def test_simple(self):
MyModel.objects.create()
| # -*- coding:utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from django.test import TestCase
from django_mysql_tests.models import MyModel
class SimpleTests(TestCase):
def test_simple(self):
MyModel.objects.create()
def test_t... | Add second test, trying to trigger travis | Add second test, trying to trigger travis
| Python | mit | nickmeharry/django-mysql,nickmeharry/django-mysql,arnau126/django-mysql,adamchainz/django-mysql,arnau126/django-mysql,graingert/django-mysql,graingert/django-mysql | ---
+++
@@ -11,3 +11,7 @@
def test_simple(self):
MyModel.objects.create()
+
+ def test_two(self):
+ MyModel.objects.create()
+ MyModel.objects.create() |
b0dd95950058d174e50589ceeb18c6a0e2a16ec8 | docs/source/_static/export_all_data.py | docs/source/_static/export_all_data.py | #!/usr/bin/env python
"""export_all_data.py - script for exporting all available data"""
import os
from collectionbatchtool import *
def export_all_data(output_dir=None):
"""
Export table data to CSV files.
Parameters
----------
output_dir : str
Path to the output directory.
"""
... | #!/usr/bin/env python
"""export_all_data.py - script for exporting all available data"""
import os
from collectionbatchtool import *
def export_all_data(output_dir=None, quiet=True):
"""
Export table data to CSV files.
Parameters
----------
output_dir : str
Path to the output directory.... | Add parameter "quiet" to export function | Add parameter "quiet" to export function
| Python | mit | jmenglund/CollectionBatchTool | ---
+++
@@ -6,7 +6,7 @@
from collectionbatchtool import *
-def export_all_data(output_dir=None):
+def export_all_data(output_dir=None, quiet=True):
"""
Export table data to CSV files.
@@ -19,12 +19,13 @@
for tabledataset_subclass in TableDataset.__subclasses__():
instance = tabledataset... |
1a575129299985471c69cef083224f939c68052f | tests/test-empty-results.py | tests/test-empty-results.py | #!/usr/bin/env python
import unittest
import waybackpack
import sys, os
# via https://github.com/jsvine/waybackpack/issues/39
URL = "https://indianexpress.com/section/lifestyle/health/feed/"
class Test(unittest.TestCase):
def test_empty_result(self):
timestamps = waybackpack.search(URL, from_date = "2020... | #!/usr/bin/env python
import unittest
import waybackpack
import sys, os
# via https://github.com/jsvine/waybackpack/issues/39
URL = "https://indianexpress.com/section/lifestyle/health/feed/"
class Test(unittest.TestCase):
def test_empty_result(self):
timestamps = waybackpack.search(URL, from_date = "2080... | Update test (endpoint was no longer result-less) | Update test (endpoint was no longer result-less)
| Python | mit | jsvine/waybackpack | ---
+++
@@ -9,7 +9,8 @@
class Test(unittest.TestCase):
def test_empty_result(self):
- timestamps = waybackpack.search(URL, from_date = "2020")
+ timestamps = waybackpack.search(URL, from_date = "2080")
+
assert(len(timestamps) == 0)
pack = waybackpack.Pack( |
3d027b8d4d39fcdbc839bd0e186ea225e1c7b976 | tests/__init__.py | tests/__init__.py | from .test_great_expectations import *
from .test_util import *
from .test_dataset import *
from .test_pandas_dataset import *
from tests.pandas.test_pandas_dataset_distributional_expectations import *
from .test_expectation_decorators import *
from .test_cli import *
| # from .test_great_expectations import *
# from .test_util import *
# from .test_dataset import *
# from .test_pandas_dataset import *
# from tests.pandas.test_pandas_dataset_distributional_expectations import *
# from .test_expectation_decorators import *
# from .test_cli import *
| Remove explicit import in tests module. | Remove explicit import in tests module.
| Python | apache-2.0 | great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations | ---
+++
@@ -1,7 +1,7 @@
-from .test_great_expectations import *
-from .test_util import *
-from .test_dataset import *
-from .test_pandas_dataset import *
-from tests.pandas.test_pandas_dataset_distributional_expectations import *
-from .test_expectation_decorators import *
-from .test_cli import *
+# from .test_grea... |
fa1b111e63ebd069c027a3b969f679b2de54949f | tests/conftest.py | tests/conftest.py | import pytest
from sanic import Sanic
from sanic_openapi import swagger_blueprint
@pytest.fixture()
def app():
app = Sanic('test')
app.blueprint(swagger_blueprint)
return app
| import pytest
from sanic import Sanic
import sanic_openapi
@pytest.fixture()
def app():
app = Sanic("test")
app.blueprint(sanic_openapi.swagger_blueprint)
yield app
# Clean up
sanic_openapi.swagger.definitions = {}
sanic_openapi.swagger._spec = {}
| Add clean up in app fixture | Test: Add clean up in app fixture
| Python | mit | channelcat/sanic-openapi,channelcat/sanic-openapi | ---
+++
@@ -1,10 +1,15 @@
import pytest
from sanic import Sanic
-from sanic_openapi import swagger_blueprint
+
+import sanic_openapi
@pytest.fixture()
def app():
- app = Sanic('test')
- app.blueprint(swagger_blueprint)
- return app
+ app = Sanic("test")
+ app.blueprint(sanic_openapi.swagger_blu... |
04e5083006ee1faffbbdc73bd71b4601ff1db3ae | tests/workers/test_merge.py | tests/workers/test_merge.py | import pytest
from mock import patch, MagicMock
from gitfs.worker.merge import MergeWorker
class TestMergeWorker(object):
def test_run(self):
mocked_queue = MagicMock()
mocked_idle = MagicMock(side_effect=ValueError)
mocked_queue.get.side_effect = ValueError()
worker = MergeWork... | import pytest
from mock import patch, MagicMock
from gitfs.worker.merge import MergeWorker
class TestMergeWorker(object):
def test_run(self):
mocked_queue = MagicMock()
mocked_idle = MagicMock(side_effect=ValueError)
mocked_queue.get.side_effect = ValueError()
worker = MergeWork... | Test merge worker with commits and merges | test: Test merge worker with commits and merges
| Python | apache-2.0 | rowhit/gitfs,bussiere/gitfs,PressLabs/gitfs,PressLabs/gitfs,ksmaheshkumar/gitfs | ---
+++
@@ -21,3 +21,19 @@
mocked_queue.get.assert_called_once_with(timeout=1, block=True)
mocked_idle.assert_called_once_with([], [])
+
+ def test_on_idle_with_commits_and_merges(self):
+ mocked_want_to_merge = MagicMock()
+ mocked_commit = MagicMock()
+
+ worker = MergeWo... |
3a2936bf55019dfd9203031ebe73966846b6f041 | tests/test_dpp.py | tests/test_dpp.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from agents.dpp import DPP
import replay_buffer
from test_dqn_like import _TestDQNLike
from chainer ... | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from agents.dpp import DPP
from agents.dpp import DPPL
from agents.dpp import DPPGreedy
import repl... | Add tests for DPPL and DPPGreedy. | Add tests for DPPL and DPPGreedy.
| Python | mit | toslunar/chainerrl,toslunar/chainerrl | ---
+++
@@ -4,22 +4,46 @@
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
+
from agents.dpp import DPP
+from agents.dpp import DPPL
+from agents.dpp import DPPGreedy
import replay_buffer
from test_dqn_like import _TestDQNLike
-from chainer import tes... |
7c1b539436b1f27896bc0e193b52838e2323519b | tutorials/urls.py | tutorials/urls.py | from django.conf.urls import include, url
from tutorials import views
urlpatterns = [
url(r'^$', views.ListTutorials.as_view()),
url(r'add/', views.NewTutorial.as_view(), name='add_tutorial'),
url(r'(?P<tutorial_id>[\w\-]+)/edit/', views.EditTutorials.as_view(), name='edit_tutorial'),
# This must be ... | from django.conf.urls import include, url
from tutorials import views
urlpatterns = [
url(r'^$', views.ListTutorials.as_view(), name='list_tutorials'),
url(r'add/', views.CreateNewTutorial.as_view(), name='add_tutorial'),
url(r'(?P<tutorial_id>[\w\-]+)/edit/', views.EditTutorials.as_view(), name='edit_tut... | Add url name to ListView, New url for delete view, Refactor ViewClass name for NewTutorials to CreateNewTutorials | Add url name to ListView, New url for delete view, Refactor ViewClass name for NewTutorials to CreateNewTutorials
| Python | agpl-3.0 | openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform | ---
+++
@@ -3,9 +3,10 @@
from tutorials import views
urlpatterns = [
- url(r'^$', views.ListTutorials.as_view()),
- url(r'add/', views.NewTutorial.as_view(), name='add_tutorial'),
+ url(r'^$', views.ListTutorials.as_view(), name='list_tutorials'),
+ url(r'add/', views.CreateNewTutorial.as_view(), name... |
835b8adfb610cdac0233840497f3a1cf9860f946 | cerebro/tests/core/test_usecases.py | cerebro/tests/core/test_usecases.py | import unittest
import cerebro.core.entities as en
import cerebro.core.usecases as uc
class TestUseCases(unittest.TestCase):
def setUp(self):
self.neurons_path = ["./cerebro/neurons"]
self.neuron_test = ("system check")
self.neuron_test_response = "All working properly."
self.com... | import unittest
import cerebro.core.entities as en
import cerebro.core.usecases as uc
class TestUseCases(unittest.TestCase):
def setUp(self):
self.neurons_path = ["./cerebro/neurons"]
self.neuron_test = ("system check")
self.neuron_test_response = "All working properly."
self.com... | Test cases changed and minor optimization | Test cases changed and minor optimization
| Python | mit | Le-Bot/cerebro | ---
+++
@@ -13,10 +13,6 @@
self.command_args = ("arg1", "arg2")
self.test_command = en.Command(self.neuron_test, self.command_args)
- self.error_test = ("asd asdasd ")
- self.error_test_response = "Sorry, I could not process that."
- self.error_command = en.Command(self.error_... |
8aabbacd06e0b634b40a77270e6bf20257289f56 | bin/combine_results.py | bin/combine_results.py | #!/usr/bin/env python
"""
Simple script to combine JUnit test results into a single XML file.
Useful for Jenkins.
TODO: Pretty indentation
"""
import os
from xml.etree import cElementTree as ET
def find_all(name, path):
result = []
for root, dirs, files in os.walk(path):
if name in files:
... | #!/usr/bin/env python
"""
Simple script to combine JUnit test results into a single XML file.
Useful for Jenkins.
TODO: Pretty indentation
"""
import os
from xml.etree import cElementTree as ET
def find_all(name, path):
result = []
for root, dirs, files in os.walk(path):
if name in files:
... | Change output filename for combined results to avoid recursive accumulation | Change output filename for combined results to avoid recursive accumulation
| Python | bsd-3-clause | stuarthodgson/cocotb,mkreider/cocotb2,stuarthodgson/cocotb,mkreider/cocotb2,mkreider/cocotb2,stuarthodgson/cocotb | ---
+++
@@ -31,5 +31,5 @@
ET.ElementTree(result).write(output, encoding="UTF-8")
if __name__ == "__main__":
- main(".", "results.xml")
+ main(".", "combined_results.xml")
|
a0775510c81494777ab1adf7c822c4ca9a0227b2 | tensorbayes/distributions.py | tensorbayes/distributions.py | """ Assumes softplus activations for gaussian
"""
import tensorflow as tf
import numpy as np
def log_bernoulli_with_logits(x, logits):
return -tf.reduce_sum(tf.nn.sigmoid_cross_entropy_with_logits(logits, x), 1)
def log_normal(x, mu, var):
return -0.5 * tf.reduce_sum(tf.log(2 * np.pi) + tf.log(var) + tf.squar... | """ Assumes softplus activations for gaussian
"""
import tensorflow as tf
import numpy as np
def log_bernoulli_with_logits(x, logits, eps=0.0):
if eps > 0.0:
max_val = np.log(1.0 - eps) - np.log(eps)
logits = tf.clip_by_value(logits, -max_val, max_val, name='clipped_logit')
return -tf.reduce_su... | Add eps factor for numerical stability | Add eps factor for numerical stability
| Python | mit | RuiShu/tensorbayes | ---
+++
@@ -3,8 +3,13 @@
import tensorflow as tf
import numpy as np
-def log_bernoulli_with_logits(x, logits):
+def log_bernoulli_with_logits(x, logits, eps=0.0):
+ if eps > 0.0:
+ max_val = np.log(1.0 - eps) - np.log(eps)
+ logits = tf.clip_by_value(logits, -max_val, max_val, name='clipped_logit... |
477822717759df88624644df8b4e64aa81463c42 | kippt_reader/settings/production.py | kippt_reader/settings/production.py | from os import environ
import dj_database_url
from .base import *
INSTALLED_APPS += (
'djangosecure',
)
PRODUCTION_MIDDLEWARE_CLASSES = (
'djangosecure.middleware.SecurityMiddleware',
)
MIDDLEWARE_CLASSES = PRODUCTION_MIDDLEWARE_CLASSES + MIDDLEWARE_CLASSES
DATABASES = {'default': dj_database_url.config(... | from os import environ
import dj_database_url
from .base import *
INSTALLED_APPS += (
'djangosecure',
)
PRODUCTION_MIDDLEWARE_CLASSES = (
'djangosecure.middleware.SecurityMiddleware',
)
MIDDLEWARE_CLASSES = PRODUCTION_MIDDLEWARE_CLASSES + MIDDLEWARE_CLASSES
DATABASES = {'default': dj_database_url.config(... | Remove exempt for hub url | Remove exempt for hub url
| Python | mit | jpadilla/feedleap,jpadilla/feedleap | ---
+++
@@ -34,7 +34,3 @@
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
-
-SECURE_REDIRECT_EXEMPT = [
- '^(?!hub/).*'
-] |
f603d382ab8b93677713d6c9c26f9b6a2616ba13 | src/utils/indices.py | src/utils/indices.py | import json
import os
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Index
from model import APIDoc
_dirname = os.path.dirname(__file__)
with open(os.path.join(_dirname, 'mapping.json'), 'r') as file:
SMARTAPI_MAPPING = json.load(file)
def setup():
"""
Setup Elasticsearch Index.
... | import json
import os
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Index
from model import APIDoc
_dirname = os.path.dirname(__file__)
with open(os.path.join(_dirname, 'mapping.json'), 'r') as file:
SMARTAPI_MAPPING = json.load(file)
def exists():
return Index(APIDoc.Index.name).exi... | Add a few methods used in admin.py | Add a few methods used in admin.py
| Python | mit | Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI,Network-of-BioThings/smartAPI | ---
+++
@@ -10,6 +10,10 @@
SMARTAPI_MAPPING = json.load(file)
+def exists():
+ return Index(APIDoc.Index.name).exists()
+
+
def setup():
"""
Setup Elasticsearch Index.
@@ -17,7 +21,7 @@
Secondary index with static mappings.
"""
- if not Index(APIDoc.Index.name).exists():
+ if ... |
2cee4fbfee7d922dfb83d154c2fa023cb647c4b3 | sslify/middleware.py | sslify/middleware.py | from django.conf import settings
from django.http import HttpResponsePermanentRedirect
class SSLifyMiddleware(object):
"""Force all requests to use HTTPs. If we get an HTTP request, we'll just
force a redirect to HTTPs.
.. note::
This will only take effect if ``settings.DEBUG`` is False.
.. ... | from django.conf import settings
from django.http import HttpResponsePermanentRedirect
class SSLifyMiddleware(object):
"""Force all requests to use HTTPs. If we get an HTTP request, we'll just
force a redirect to HTTPs.
.. note::
This will only take effect if ``settings.DEBUG`` is False.
.. ... | Allow using sslify even in DEBUG mode. | Allow using sslify even in DEBUG mode.
| Python | unlicense | rdegges/django-sslify | ---
+++
@@ -15,11 +15,11 @@
"""
def process_request(self, request):
# If the user has explicitly disabled SSLify, do nothing.
- if getattr(settings, 'SSLIFY_DISABLE', False):
+ if getattr(settings, 'SSLIFY_DISABLE', settings.DEBUG):
return None
# If we get here... |
e28c9da712574618eb28b6ff82631462fee67c16 | changes/utils/times.py | changes/utils/times.py | def duration(value):
ONE_SECOND = 1000
ONE_MINUTE = ONE_SECOND * 60
if not value:
return '0 s'
if value < 3 * ONE_SECOND:
return '%d ms' % (value,)
elif value < 5 * ONE_MINUTE:
return '%d s' % (value / ONE_SECOND,)
else:
return '%d m' % (value / ONE_MINUTE,)
| def duration(value):
ONE_SECOND = 1000
ONE_MINUTE = ONE_SECOND * 60
if not value:
return '0 s'
abs_value = abs(value)
if abs_value < 3 * ONE_SECOND:
return '%d ms' % (value,)
elif abs_value < 5 * ONE_MINUTE:
return '%d s' % (value / ONE_SECOND,)
else:
retur... | Fix for negative values in duration | Fix for negative values in duration
| Python | apache-2.0 | bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes | ---
+++
@@ -5,9 +5,11 @@
if not value:
return '0 s'
- if value < 3 * ONE_SECOND:
+ abs_value = abs(value)
+
+ if abs_value < 3 * ONE_SECOND:
return '%d ms' % (value,)
- elif value < 5 * ONE_MINUTE:
+ elif abs_value < 5 * ONE_MINUTE:
return '%d s' % (value / ONE_SECOND,... |
d3d88d628c61a87b1a36f9a25bdea807dd2d12a2 | saleor/dashboard/settings/forms.py | saleor/dashboard/settings/forms.py | from django import forms
from django.utils.translation import ugettext_lazy as _
from ...setting.models import Setting
class SettingForm(forms.ModelForm):
class Meta:
model = Setting
exclude = []
def clean_name(self):
name = self.cleaned_data['name']
if len(name.split()) > 1:
... | from django import forms
from django.utils.translation import ugettext_lazy as _
from ...setting.models import Setting
class SettingForm(forms.ModelForm):
class Meta:
model = Setting
exclude = []
def clean_name(self):
name = self.cleaned_data['name']
if len(name.split()) > 1:... | Add missing newline between imports | Add missing newline between imports
| Python | bsd-3-clause | tfroehlich82/saleor,KenMutemi/saleor,itbabu/saleor,maferelo/saleor,KenMutemi/saleor,jreigel/saleor,tfroehlich82/saleor,HyperManTT/ECommerceSaleor,mociepka/saleor,KenMutemi/saleor,itbabu/saleor,mociepka/saleor,car3oon/saleor,HyperManTT/ECommerceSaleor,car3oon/saleor,car3oon/saleor,mociepka/saleor,UITools/saleor,UITools/... | ---
+++
@@ -1,5 +1,6 @@
from django import forms
from django.utils.translation import ugettext_lazy as _
+
from ...setting.models import Setting
|
876d414f85297d45dca4f2c9158f9257dfd6cf5f | wagtailgeowidget/edit_handlers.py | wagtailgeowidget/edit_handlers.py | import warnings
import wagtail
if wagtail.VERSION < (2, 0):
warnings.warn("GeoPanel only works in Wagtail 2+", Warning) # NOQA
warnings.warn("Please import GeoPanel from wagtailgeowidget.legacy_edit_handlers instead", Warning) # NOQA
warnings.warn("All support for Wagtail 1.13 and below will be droppen ... | from wagtail.admin.edit_handlers import FieldPanel
from wagtailgeowidget.widgets import (
GeoField,
)
from wagtailgeowidget.app_settings import (
GEO_WIDGET_ZOOM
)
class GeoPanel(FieldPanel):
def __init__(self, *args, **kwargs):
self.classname = kwargs.pop('classname', "")
self.address_f... | Remove no-longer needed wagtail 2.0 warning | Remove no-longer needed wagtail 2.0 warning
| Python | mit | Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget | ---
+++
@@ -1,12 +1,3 @@
-import warnings
-
-import wagtail
-
-if wagtail.VERSION < (2, 0):
- warnings.warn("GeoPanel only works in Wagtail 2+", Warning) # NOQA
- warnings.warn("Please import GeoPanel from wagtailgeowidget.legacy_edit_handlers instead", Warning) # NOQA
- warnings.warn("All support for Wagt... |
d466785a4faaf1c01519935317ededf336f9dd14 | contentstore/management/commands/tests/test_sync_schedules.py | contentstore/management/commands/tests/test_sync_schedules.py | from six import BytesIO
from django.core.management import call_command
from django.test import TestCase
from mock import patch
from contentstore.models import Schedule
from seed_stage_based_messaging import test_utils as utils
class SyncSchedulesTests(TestCase):
@patch('contentstore.management.commands.sync_sch... | from six import StringIO
from django.core.management import call_command
from django.test import TestCase
from mock import patch
from contentstore.models import Schedule
from seed_stage_based_messaging import test_utils as utils
class SyncSchedulesTests(TestCase):
@patch('contentstore.management.commands.sync_sc... | Use StringIO instead of BytesIO | Use StringIO instead of BytesIO
| Python | bsd-3-clause | praekelt/seed-staged-based-messaging,praekelt/seed-stage-based-messaging,praekelt/seed-stage-based-messaging | ---
+++
@@ -1,4 +1,4 @@
-from six import BytesIO
+from six import StringIO
from django.core.management import call_command
from django.test import TestCase
from mock import patch
@@ -18,7 +18,7 @@
schedule = Schedule.objects.create()
utils.enable_signals()
- out = BytesIO()
+ out ... |
fcd523105e9f158f423018d45b05527435a41fb0 | geotrek/altimetry/tests/test_models.py | geotrek/altimetry/tests/test_models.py | import os
from django.test import TestCase
from django.conf import settings
from geotrek.trekking.factories import TrekFactory
from geotrek.trekking.models import Trek
class AltimetryMixinTest(TestCase):
def test_get_elevation_chart_none(self):
trek = TrekFactory.create(no_path=True)
trek.get_el... | import os
from django.test import TestCase
from django.conf import settings
from django.utils.translation import get_language
from geotrek.trekking.factories import TrekFactory
from geotrek.trekking.models import Trek
class AltimetryMixinTest(TestCase):
def test_get_elevation_chart_none(self):
trek = Tr... | Change test model elevation chart | Change test model elevation chart
| Python | bsd-2-clause | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek | ---
+++
@@ -2,6 +2,7 @@
from django.test import TestCase
from django.conf import settings
+from django.utils.translation import get_language
from geotrek.trekking.factories import TrekFactory
from geotrek.trekking.models import Trek
@@ -9,9 +10,12 @@
class AltimetryMixinTest(TestCase):
def test_get_el... |
68452ffc8490d976b043f660a0e3e1f19c4ed98e | great_expectations/actions/__init__.py | great_expectations/actions/__init__.py | from .actions import (
BasicValidationAction,
NamespacedValidationAction,
NoOpAction,
SummarizeAndStoreAction,
)
from .validation_operators import (
DefaultActionAwareValidationOperator
) | from .actions import (
BasicValidationAction,
NamespacedValidationAction,
NoOpAction,
SummarizeAndStoreAction,
SlackNotificationAction
)
from .validation_operators import (
DefaultActionAwareValidationOperator
) | Add Slack action to init | Add Slack action to init
| Python | apache-2.0 | great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations,great-expectations/great_expectations | ---
+++
@@ -3,6 +3,7 @@
NamespacedValidationAction,
NoOpAction,
SummarizeAndStoreAction,
+ SlackNotificationAction
)
from .validation_operators import ( |
dabd787a647e345bdd9f3fd2fee1474b04347512 | website/addons/base/utils.py | website/addons/base/utils.py | from os.path import basename
from website import settings
def serialize_addon_config(config):
lookup = config.template_lookup
return {
'addon_short_name': config.short_name,
'addon_full_name': config.full_name,
'node_settings_template': lookup.get_template(basename(config.node_setting... | from os.path import basename
from website import settings
def serialize_addon_config(config):
lookup = config.template_lookup
return {
'addon_short_name': config.short_name,
'addon_full_name': config.full_name,
'node_settings_template': lookup.get_template(basename(config.node_setting... | Use default settings if no user settings | Use default settings if no user settings
| Python | apache-2.0 | aaxelb/osf.io,DanielSBrown/osf.io,bdyetton/prettychart,HalcyonChimera/osf.io,rdhyee/osf.io,caseyrygt/osf.io,dplorimer/osf,icereval/osf.io,alexschiller/osf.io,pattisdr/osf.io,zachjanicki/osf.io,petermalcolm/osf.io,jmcarp/osf.io,KAsante95/osf.io,acshi/osf.io,cwisecarver/osf.io,adlius/osf.io,cldershem/osf.io,kch8qx/osf.io... | ---
+++
@@ -22,7 +22,7 @@
if user_settings:
user_settings = user_settings.to_json(user)
config.update({
- 'user_settings': user_settings,
+ 'user_settiongs': user_settings or addon_config.DEFAULT_SETTINGS,
})
addon_settings.append(config)
ret... |
45046857f688d4f640dc0b920a42d5b92faa4d9c | jax/_src/lib/mlir/dialects/__init__.py | jax/_src/lib/mlir/dialects/__init__.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Fix ModuleNotFoundError for phawkins only with version | Fix ModuleNotFoundError for phawkins only with version
| Python | apache-2.0 | google/jax,google/jax,google/jax,google/jax | ---
+++
@@ -21,7 +21,7 @@
try:
import jaxlib.mlir.dialects.ml_program as ml_program
except (ModuleNotFoundError, ImportError):
- # TODO(ajcbik,phawkins): make this unconditional when jaxlib > 0.3.7
+ # TODO(phawkins): make this unconditional when jaxlib > 0.3.14
# is the minimum versi... |
b45c0cc0e9f2964ad442115f7a83292fb83611ec | test/vim_autopep8.py | test/vim_autopep8.py | """Run autopep8 on the selected buffer in Vim.
map <C-I> :pyfile <path_to>/vim_autopep8.py<CR>
Replace ":pyfile" with ":py3file" if Vim is built with Python 3 support.
"""
from __future__ import unicode_literals
import sys
import vim
ENCODING = vim.eval('&fileencoding')
def encode(text):
if sys.version_in... | """Run autopep8 on the selected buffer in Vim.
map <C-I> :pyfile <path_to>/vim_autopep8.py<CR>
Replace ":pyfile" with ":py3file" if Vim is built with Python 3 support.
"""
from __future__ import unicode_literals
import sys
import vim
ENCODING = vim.eval('&fileencoding')
def encode(text):
if sys.version_in... | Put code in main function | Put code in main function
| Python | mit | SG345/autopep8,MeteorAdminz/autopep8,Vauxoo/autopep8,hhatto/autopep8,Vauxoo/autopep8,MeteorAdminz/autopep8,SG345/autopep8,vauxoo-dev/autopep8,vauxoo-dev/autopep8,hhatto/autopep8 | ---
+++
@@ -30,7 +30,10 @@
return text.decode(ENCODING)
-if vim.eval('&syntax') == 'python':
+def main():
+ if vim.eval('&syntax') != 'python':
+ return
+
source = '\n'.join(decode(line)
for line in vim.current.buffer) + '\n'
@@ -48,3 +51,7 @@
vim.curre... |
222935ffc347f9787f08b50cccb1981151db5cec | test_jeni_python3.py | test_jeni_python3.py | import unittest
import jeni
from test_jeni import BasicInjector
class Python3AnnotationTestCase(unittest.TestCase):
def test_annotate_without_annotations(self):
def fn(hello):
"unused"
jeni.annotate(fn)
self.assertTrue(jeni.annotate.has_annotations(fn))
@jeni.annotate
def a... | import unittest
import jeni
from test_jeni import BasicInjector
class Python3AnnotationTestCase(unittest.TestCase):
def test_annotate_without_annotations(self):
def fn(hello):
"unused"
jeni.annotate(fn)
self.assertTrue(jeni.annotate.has_annotations(fn))
def test_annotate... | Test for missing __annotations__ in Python 3. | Test for missing __annotations__ in Python 3.
| Python | bsd-2-clause | groner/jeni-python,rduplain/jeni-python | ---
+++
@@ -11,6 +11,24 @@
"unused"
jeni.annotate(fn)
self.assertTrue(jeni.annotate.has_annotations(fn))
+
+ def test_annotate_without_dunder_annotations(self):
+ # Unclear when this would come up; testing it given Python 2 support.
+ class NoDunderAnnotations(object):
... |
1fc2e747f1c02d5b8559f03187464eecda008190 | fernet_fields/test/testmigrate/migrations/0004_copy_values.py | fernet_fields/test/testmigrate/migrations/0004_copy_values.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forwards(apps, schema_editor):
DualText = apps.get_model('testmigrate', 'DualText')
for obj in DualText.objects.all():
obj.value_dual = obj.value
def backwards(apps, schema_editor):
DualText = a... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forwards(apps, schema_editor):
DualText = apps.get_model('testmigrate', 'DualText')
for obj in DualText.objects.all():
obj.value_dual = obj.value
obj.save(force_update=True)
def backwards(ap... | Fix test migration to actually save updates. | Fix test migration to actually save updates.
| Python | bsd-3-clause | orcasgit/django-fernet-fields | ---
+++
@@ -8,12 +8,14 @@
DualText = apps.get_model('testmigrate', 'DualText')
for obj in DualText.objects.all():
obj.value_dual = obj.value
+ obj.save(force_update=True)
def backwards(apps, schema_editor):
DualText = apps.get_model('testmigrate', 'DualText')
for obj in DualTe... |
e9941e34253768e33cbfa54ff2bb9cf2e8267e1d | workflow-diagnosetargets.py | workflow-diagnosetargets.py | #!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import gatk
from ddb_ngsflow import pipeline
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argumen... | #!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import gatk
from ddb_ngsflow import pipeline
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argumen... | Tweak to bam file name calling | Tweak to bam file name calling
| Python | mit | dgaston/ddb-scripts,GastonLab/ddb-scripts,dgaston/ddb-ngsflow-scripts | ---
+++
@@ -30,7 +30,8 @@
root_job = Job.wrapJobFn(pipeline.spawn_batch_jobs)
for sample in samples:
- diagnose_targets_job = Job.wrapJobFn(gatk.diagnosetargets, config, sample, samples, samples[sample]['bam'],
+ diagnose_targets_job = Job.wrapJobFn(gatk.diagnosetargets, config, sample, samp... |
dc6d9ec75ffb2ac776d10a924395d05284bc031e | tests/test_compat.py | tests/test_compat.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_compat
------------
Tests for `cookiecutter.compat` module.
"""
from cookiecutter.compat import unittest, which
def test_existing_command():
assert which('cookiecutter')
def test_non_existing_command():
assert not which('stringthatisntashellcommand')... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_compat
------------
Tests for `cookiecutter.compat` module.
"""
from cookiecutter.compat import which
def test_existing_command():
assert which('cookiecutter')
def test_non_existing_command():
assert not which('stringthatisntashellcommand')
| Remove unused import of compat unittest | Remove unused import of compat unittest
| Python | bsd-3-clause | luzfcb/cookiecutter,jhermann/cookiecutter,christabor/cookiecutter,terryjbates/cookiecutter,audreyr/cookiecutter,agconti/cookiecutter,vincentbernat/cookiecutter,kkujawinski/cookiecutter,atlassian/cookiecutter,foodszhang/cookiecutter,lucius-feng/cookiecutter,nhomar/cookiecutter,benthomasson/cookiecutter,ionelmc/cookiecut... | ---
+++
@@ -8,7 +8,7 @@
Tests for `cookiecutter.compat` module.
"""
-from cookiecutter.compat import unittest, which
+from cookiecutter.compat import which
def test_existing_command(): |
55af2016102ec16a4ec3878f45306e3ac4d520e6 | qingcloud/cli/iaas_client/actions/instance/reset_instances.py | qingcloud/cli/iaas_client/actions/instance/reset_instances.py | # coding: utf-8
from qingcloud.cli.misc.utils import explode_array
from qingcloud.cli.iaas_client.actions.base import BaseAction
class ResetInstancesAction(BaseAction):
action = 'ResetInstances'
command = 'reset-instances'
usage = '%(prog)s -i "instance_id, ..." [-f <conf_file>]'
@classmethod
d... | # coding: utf-8
from qingcloud.cli.misc.utils import explode_array
from qingcloud.cli.iaas_client.actions.base import BaseAction
class ResetInstancesAction(BaseAction):
action = 'ResetInstances'
command = 'reset-instances'
usage = '%(prog)s -i "instance_id, ..." [-f <conf_file> -m <login_mode> -p <login... | Add login mode to reset-instances | Add login mode to reset-instances
| Python | apache-2.0 | yunify/qingcloud-cli | ---
+++
@@ -8,7 +8,7 @@
action = 'ResetInstances'
command = 'reset-instances'
- usage = '%(prog)s -i "instance_id, ..." [-f <conf_file>]'
+ usage = '%(prog)s -i "instance_id, ..." [-f <conf_file> -m <login_mode> -p <login_passwd> -k <login_keypair>]'
@classmethod
def add_ext_arguments(cl... |
270d06c880fe72987b82fe00f234852e8d49eca0 | icekit/plugins/image_gallery/content_plugins.py | icekit/plugins/image_gallery/content_plugins.py | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from . import models
@plugin_pool.register
class ImageGalleryPlugin(ContentPlugin):
model = models.ImageGalleryShowItem
category = _('Assets')
render... | """
Definition of the plugin.
"""
from django.utils.translation import ugettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool
from . import models
@plugin_pool.register
class ImageGalleryPlugin(ContentPlugin):
model = models.ImageGalleryShowItem
category = _('Assets')
render... | Remove invalid reference to unnecessary JS for image gallery plugin | Remove invalid reference to unnecessary JS for image gallery plugin
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | ---
+++
@@ -13,8 +13,3 @@
category = _('Assets')
render_template = 'icekit/plugins/image_gallery/default.html'
raw_id_fields = ['slide_show', ]
-
- class FrontendMedia:
- js = (
- 'plugins/image_gallery/init.js',
- ) |
6e02ea0b94b237dbd8da63b77806530a904deef9 | alignak_backend_import/__init__.py | alignak_backend_import/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak backend import
This module contains utility tools to import Nagios-like flat files configuration into
an Alignak REST backend.
"""
# Application version and manifest
VERSION = (0, 8,0 )
__application__ = u"Alignak backend import"
__short_version_... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak backend import
This module contains utility tools to import Nagios-like flat files configuration into
an Alignak REST backend.
"""
# Application version and manifest
VERSION = (0, 8, 0, 1)
__application__ = u"Alignak backend import"
__short_versi... | Fix pep8 Set version as 0.8.0.1 | Fix pep8
Set version as 0.8.0.1
| Python | agpl-3.0 | Alignak-monitoring-contrib/alignak-backend-import,Alignak-monitoring-contrib/alignak-backend-import | ---
+++
@@ -9,7 +9,7 @@
an Alignak REST backend.
"""
# Application version and manifest
-VERSION = (0, 8,0 )
+VERSION = (0, 8, 0, 1)
__application__ = u"Alignak backend import"
__short_version__ = '.'.join((str(each) for each in VERSION[:2])) |
8f4d0247b56ae157e8486c37e38992015e55ac3e | skimage/io/_plugins/matplotlib_plugin.py | skimage/io/_plugins/matplotlib_plugin.py | import matplotlib.pyplot as plt
def imshow(*args, **kwargs):
if plt.gca().has_data():
plt.figure()
kwargs.setdefault('interpolation', 'nearest')
kwargs.setdefault('cmap', 'gray')
plt.imshow(*args, **kwargs)
imread = plt.imread
show = plt.show
def _app_show():
show()
| import matplotlib.pyplot as plt
def imshow(im, *args, **kwargs):
"""Show the input image and return the current axes.
Parameters
----------
im : array, shape (M, N[, 3])
The image to display.
*args, **kwargs : positional and keyword arguments
These are passed directly to `matplot... | Add docstring to matplotlib imshow plugin | Add docstring to matplotlib imshow plugin
The image is now named as an argument, and the axes are returned, in
keeping with matplotlib convention.
| Python | bsd-3-clause | emon10005/scikit-image,vighneshbirodkar/scikit-image,ofgulban/scikit-image,Midafi/scikit-image,bennlich/scikit-image,chriscrosscutler/scikit-image,dpshelio/scikit-image,emon10005/scikit-image,ofgulban/scikit-image,newville/scikit-image,WarrenWeckesser/scikits-image,Britefury/scikit-image,juliusbierk/scikit-image,GaZ3ll... | ---
+++
@@ -1,12 +1,27 @@
import matplotlib.pyplot as plt
-def imshow(*args, **kwargs):
+def imshow(im, *args, **kwargs):
+ """Show the input image and return the current axes.
+
+ Parameters
+ ----------
+ im : array, shape (M, N[, 3])
+ The image to display.
+
+ *args, **kwargs : position... |
1c3d4488566576e3181f7acbf902f0adab3876dd | api/spawner/templates/constants.py | api/spawner/templates/constants.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
from polyaxon_schemas.polyaxonfile import constants
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | Update naming for spawner jobs | Update naming for spawner jobs
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | ---
+++
@@ -2,7 +2,6 @@
from __future__ import absolute_import, division, print_function
from django.conf import settings
-from polyaxon_schemas.polyaxonfile import constants
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
@@ -15,7 +14,7 @@
DEPLOYMENT_NAME = 'plxproject-{proje... |
3607309193c5d8b2b5ce0fd98d976b6e6aa49644 | test/test_client.py | test/test_client.py | import pytest
from numpy import random, ceil
from lightning import Lightning, Visualization
class TestLightningAPIClient(object):
@pytest.fixture(scope="module")
def lgn(self, host):
lgn = Lightning(host)
lgn.create_session("test-session")
return lgn
def test_create_generic(self,... | import pytest
from numpy import random, ceil
from lightning import Lightning, Visualization, VisualizationLocal
class TestLightningAPIClient(object):
@pytest.fixture(scope="module")
def lgn(self, host):
lgn = Lightning(host)
lgn.create_session("test-session")
return lgn
def test_... | Add test for local visualization | Add test for local visualization
| Python | mit | garretstuber/lightning-python,garretstuber/lightning-python,peterkshultz/lightning-python,lightning-viz/lightning-python,garretstuber/lightning-python,lightning-viz/lightning-python,peterkshultz/lightning-python,peterkshultz/lightning-python | ---
+++
@@ -1,6 +1,6 @@
import pytest
from numpy import random, ceil
-from lightning import Lightning, Visualization
+from lightning import Lightning, Visualization, VisualizationLocal
class TestLightningAPIClient(object):
@@ -19,7 +19,6 @@
assert isinstance(viz, Visualization)
assert hasattr... |
427931c5c8847d01e4ce563a9c605a78eceb39f3 | amplpy/amplpython/__init__.py | amplpy/amplpython/__init__.py | # -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system() == 'Windows':
libbase = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib')
lib32 = os.path.join(libbase, 'intel32')
lib64 = os.path.join(libbase, 'amd64')
from glob import glob
try:
i... | # -*- coding: utf-8 -*-
import os
import sys
import ctypes
import platform
if platform.system().startswith(('Windows', 'MSYS', 'CYGWIN', 'MINGW')):
libbase = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib')
lib32 = os.path.join(libbase, 'intel32')
lib64 = os.path.join(libbase, 'amd64')
fr... | Add basic support for MSYS, CYGWIN, and MINGW | Add basic support for MSYS, CYGWIN, and MINGW
| Python | bsd-3-clause | ampl/amplpy,ampl/amplpy,ampl/amplpy | ---
+++
@@ -4,7 +4,7 @@
import ctypes
import platform
-if platform.system() == 'Windows':
+if platform.system().startswith(('Windows', 'MSYS', 'CYGWIN', 'MINGW')):
libbase = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib')
lib32 = os.path.join(libbase, 'intel32')
lib64 = os.path.join(... |
0673df239d14edb8d65c17eaa8291ac26fd0b976 | test_skewstudent.py | test_skewstudent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Testing suite for ARG class.
"""
from __future__ import print_function, division
import unittest as ut
import numpy as np
from skewstudent import SkewStudent
__author__ = "Stanislav Khrapov"
__email__ = "khrapovs@gmail.com"
class ARGTestCase(ut.TestCase):
"""T... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Testing suite for SkewStudent class.
"""
from __future__ import print_function, division
import unittest as ut
import numpy as np
from skewstudent import SkewStudent
__author__ = "Stanislav Khrapov"
__email__ = "khrapovs@gmail.com"
class ARGTestCase(ut.TestCase):
... | Fix title in the test | Fix title in the test
| Python | mit | khrapovs/skewstudent | ---
+++
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-"""Testing suite for ARG class.
+"""Testing suite for SkewStudent class.
"""
from __future__ import print_function, division |
3d5de4b69be9d99fec4a8ffb46338f0684ffac26 | api/base/waffle_decorators.py | api/base/waffle_decorators.py | import waffle
from rest_framework.exceptions import NotFound
def require_flag(flag_name):
"""
Decorator to check whether flag is active.
If inactive, raise NotFound.
"""
def wrapper(fn):
def check_flag(*args,**kwargs):
if waffle.flag_is_active(args[0].request, flag_name):
... | import waffle
from rest_framework.exceptions import NotFound
def require_flag(flag_name):
"""
Decorator to check whether waffle flag is active.
If inactive, raise NotFound.
"""
def wrapper(fn):
def check_flag(*args,**kwargs):
if waffle.flag_is_active(args[0].request, flag_name)... | Add switch and sample decorators. | Add switch and sample decorators.
| Python | apache-2.0 | brianjgeiger/osf.io,HalcyonChimera/osf.io,chennan47/osf.io,laurenrevere/osf.io,adlius/osf.io,mfraezz/osf.io,binoculars/osf.io,pattisdr/osf.io,binoculars/osf.io,brianjgeiger/osf.io,felliott/osf.io,laurenrevere/osf.io,aaxelb/osf.io,cslzchen/osf.io,aaxelb/osf.io,caseyrollins/osf.io,pattisdr/osf.io,erinspace/osf.io,mfraezz... | ---
+++
@@ -3,7 +3,7 @@
def require_flag(flag_name):
"""
- Decorator to check whether flag is active.
+ Decorator to check whether waffle flag is active.
If inactive, raise NotFound.
"""
@@ -15,3 +15,33 @@
raise NotFound('Endpoint is disabled.')
return check_flag
... |
66e16d6e3d80ab81967232d5d154c64c8e277def | robotpy_ext/misc/periodic_filter.py | robotpy_ext/misc/periodic_filter.py | import logging
import wpilib
class PeriodicFilter:
"""
Periodic Filter to help keep down clutter in the console.
Simply add this filter to your logger and the logger will
only print periodically.
The logger will always print logging levels of WARNING or higher
"""
def __i... | import logging
import wpilib
class PeriodicFilter:
"""
Periodic Filter to help keep down clutter in the console.
Simply add this filter to your logger and the logger will
only print periodically.
The logger will always print logging levels of WARNING or higher
"""
def __i... | Allow user to select bypass level | Allow user to select bypass level
| Python | bsd-3-clause | Twinters007/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities,Twinters007/robotpy-wpilib-utilities | ---
+++
@@ -11,7 +11,7 @@
The logger will always print logging levels of WARNING or higher
"""
- def __init__(self, period):
+ def __init__(self, period, bypassLevel=logging.WARN):
'''
:param period: Wait period (in seconds) between logs
'''
@@ -19,11 +19,12 @@
... |
56a89d57824d3bd25ac235a8e360d528edd9a7cf | test/factories/blogpost_factory.py | test/factories/blogpost_factory.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | Fix for nullable author in blogpost factory | Fix for nullable author in blogpost factory
| Python | agpl-3.0 | OpenNewsLabs/pybossa,proyectos-analizo-info/pybossa-analizo-info,proyectos-analizo-info/pybossa-analizo-info,geotagx/pybossa,inteligencia-coletiva-lsd/pybossa,jean/pybossa,proyectos-analizo-info/pybossa-analizo-info,harihpr/tweetclickers,stefanhahmann/pybossa,OpenNewsLabs/pybossa,Scifabric/pybossa,inteligencia-coletiva... | ---
+++
@@ -30,4 +30,5 @@
app = factory.SubFactory('factories.AppFactory')
app_id = factory.LazyAttribute(lambda blogpost: blogpost.app.id)
owner = factory.SelfAttribute('app.owner')
- user_id = factory.LazyAttribute(lambda blogpost: blogpost.owner.id)
+ user_id = factory.LazyAttribute(
+ ... |
4831c45b53d53d31a6514d5c3e2d0465283b4076 | topological_sort.py | topological_sort.py | def topological_sort():
pass
def main():
pass
if __name__ == '__main__':
main()
| def topological_sort_recur():
"""Topological Sorting by Recursion."""
pass
def topological_sort():
"""Topological Sorting for Directed Acyclic Graph (DAG)."""
pass
def main():
# DAG.
adjacency_dict = {
'0': {},
'1': {},
'2': {'3'},
'3': {'1'},
'4': {'0', '1'},
'5': {'0', '2'}
}
... | Add topolofical_sort_recur(), 2 functions’s doc strings and DAG | Add topolofical_sort_recur(), 2 functions’s doc strings and DAG
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | ---
+++
@@ -1,9 +1,22 @@
+def topological_sort_recur():
+ """Topological Sorting by Recursion."""
+ pass
+
def topological_sort():
+ """Topological Sorting for Directed Acyclic Graph (DAG)."""
pass
def main():
- pass
+ # DAG.
+ adjacency_dict = {
+ '0': {},
+ '1': {},
+ '2': {'3'},
+ '3': {'1'... |
7c69d30de5aa58d330a183a0e5015e67c36ca7bc | spacy/tests/regression/test_issue4674.py | spacy/tests/regression/test_issue4674.py | # coding: utf-8
from __future__ import unicode_literals
from spacy.kb import KnowledgeBase
from spacy.util import ensure_path
from spacy.lang.en import English
from spacy.tests.util import make_tempdir
def test_issue4674():
"""Test that setting entities with overlapping identifiers does not mess up IO"""
nl... | # coding: utf-8
from __future__ import unicode_literals
import pytest
from spacy.kb import KnowledgeBase
from spacy.util import ensure_path
from spacy.lang.en import English
from ..tests.util import make_tempdir
def test_issue4674():
"""Test that setting entities with overlapping identifiers does not mess up IO... | Tidy up and expect warning | Tidy up and expect warning
| Python | mit | honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy | ---
+++
@@ -1,11 +1,12 @@
# coding: utf-8
from __future__ import unicode_literals
+import pytest
from spacy.kb import KnowledgeBase
from spacy.util import ensure_path
+from spacy.lang.en import English
-from spacy.lang.en import English
-from spacy.tests.util import make_tempdir
+from ..tests.util import make... |
455cf39de018762d22b5d212f3a2c08491840bbf | tests/integration/cli/sync_test.py | tests/integration/cli/sync_test.py | from ...testcases import DustyIntegrationTestCase
from ...fixtures import busybox_single_app_bundle_fixture
class TestSyncCLI(DustyIntegrationTestCase):
def setUp(self):
super(TestSyncCLI, self).setUp()
busybox_single_app_bundle_fixture()
self.run_command('bundles activate busyboxa')
... | from ...testcases import DustyIntegrationTestCase
from ...fixtures import busybox_single_app_bundle_fixture
class TestSyncCLI(DustyIntegrationTestCase):
def setUp(self):
super(TestSyncCLI, self).setUp()
busybox_single_app_bundle_fixture()
self.run_command('bundles activate busyboxa')
... | Fix ordering problem in tearDown | Fix ordering problem in tearDown
| Python | mit | gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty | ---
+++
@@ -9,12 +9,12 @@
self.run_command('up')
def tearDown(self):
- super(TestSyncCLI, self).tearDown()
self.run_command('bundles deactivate busyboxa')
try:
self.run_command('stop')
except Exception:
pass
+ super(TestSyncCLI, self).... |
6a330523ad683b7883cefa3878c7690fcb5dbd75 | TalkingToYouBot.py | TalkingToYouBot.py | from telegram import Updater
import json
import os
def getToken():
token = []
if not os.path.exists(file_path):
token.append(input('Insert Token here: '))
with open('token.json', 'w') as f:
json.dump(token, f)
else:
with open("token.json") as f:
token = json... | from telegram import Updater
import json
import os
def getToken():
token = []
if not os.path.exists(file_path):
token.append(input('Insert Token here: '))
with open('token.json', 'w') as f:
json.dump(token, f)
else:
with open("token.json") as f:
token = json... | Add simple Echo function and Bot initialisation | Add simple Echo function and Bot initialisation
| Python | mit | h4llow3En/IAmTalkingToYouBot | ---
+++
@@ -15,9 +15,27 @@
return token[0]
+def echo(bot, update):
+ '''
+ Simple function that echos every received message back to the user.
+ '''
+ bot.sendMessage(chat_id=update.message.chat_id, text=update.message.text)
+
+
def main():
token = getToken()
- print(token)
+ print("S... |
64c967eff68163754ed9b9593030e70c26d65f50 | pygfunction/examples/unequal_segment_lengths.py | pygfunction/examples/unequal_segment_lengths.py | # -*- coding: utf-8 -*-
""" Example of calculation of g-functions with unequal segment lengths using
uniform and equal borehole wall temperatures.
The g-functions of a field of 6x4 boreholes is calculated with unequal
segment lengths.
"""
import matplotlib.pyplot as plt
import numpy as np
import pygfunct... | Add code to unequal segment length example | Add code to unequal segment length example
| Python | bsd-3-clause | MassimoCimmino/pygfunction | ---
+++
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+""" Example of calculation of g-functions with unequal segment lengths using
+ uniform and equal borehole wall temperatures.
+
+ The g-functions of a field of 6x4 boreholes is calculated with unequal
+ segment lengths.
+
+"""
+import matplotlib.pyplot as plt... | |
86a7b0e989e983063a1ff5afd098600bf34da401 | ixwsauth_server/api.py | ixwsauth_server/api.py | """
Tastypie API Authorization handlers
"""
from tastypie.authentication import Authentication
from tastypie.authorization import Authorization
class ApplicationAuthentication(Authentication):
"""
Authenticate the API request by checking the application key.
"""
def is_authenticated(self, request, **... | """
Tastypie API Authorization handlers
"""
from tastypie.authentication import Authentication
from tastypie.authorization import Authorization
class ApplicationAuthentication(Authentication):
"""
Authenticate the API request by checking the application key.
"""
def is_authenticated(self, request, **... | Add the consumer key to the identifier | Add the consumer key to the identifier
Used for rate limiting by API key.
Refs #17338
| Python | mit | infoxchange/ixwsauth | ---
+++
@@ -16,6 +16,16 @@
"""
consumer = getattr(request, 'consumer', None)
return consumer is not None
+
+ def get_identifier(self, request):
+ """
+ Return a combination of the consumer, the IP address and the host
+ """
+
+ consumer = getattr(request, 'con... |
e3b5e23566830ab20a7e0358e1040e7a6a889b22 | podoc/conftest.py | podoc/conftest.py | # -*- coding: utf-8 -*-
"""py.test utilities."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import logging
from tempfile import TemporaryDirectory
from pytest import yield_fixture
from pod... | # -*- coding: utf-8 -*-
"""py.test utilities."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import logging
from tempfile import TemporaryDirectory
from pytest import yield_fixture
from pod... | Set the name of the dynamic plugin conversion tests | Set the name of the dynamic plugin conversion tests
| Python | bsd-3-clause | rossant/podoc,podoc/podoc,rossant/podoc,podoc/podoc | ---
+++
@@ -57,4 +57,9 @@
def pytest_generate_tests(metafunc):
"""Generate the test_file_tuple fixture to test all plugin test files."""
if 'test_file_tuple' in metafunc.fixturenames:
- metafunc.parametrize('test_file_tuple', iter_test_files())
+
+ def _name(tuple):
+ """Name of th... |
07d62f1e9525719be48d862a86f3623368c02d9d | kuryr/lib/constants.py | kuryr/lib/constants.py | # 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 writing, software
# distributed under t... | # 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 writing, software
# distributed under t... | Change DEVICE_OWNER to make it more Neutron compliant | Change DEVICE_OWNER to make it more Neutron compliant
Change-Id: Id7a2973928c6df9e134e7b91000e90f244066703
| Python | apache-2.0 | openstack/kuryr,openstack/kuryr | ---
+++
@@ -14,7 +14,7 @@
PORT_STATUS_ACTIVE = 'ACTIVE'
PORT_STATUS_DOWN = 'DOWN'
-DEVICE_OWNER = 'kuryr:container'
+DEVICE_OWNER = 'compute:kuryr'
NIC_NAME_LEN = 14
VETH_PREFIX = 'tap'
CONTAINER_VETH_PREFIX = 't_c' |
eb63b0979763375522bc71ce2f06fb625151ea08 | MoMMI/Modules/wyci.py | MoMMI/Modules/wyci.py | import random
import re
from typing import Match
from discord import Message
from MoMMI import master, always_command, MChannel
@always_command("wyci")
async def wyci(channel: MChannel, _match: Match, message: Message) -> None:
match = re.search(r"\S\s+when[\s*?.!)]*$", message.content, re.IGNORECASE)
if match... | import random
import re
from typing import Match
from discord import Message
from MoMMI import master, always_command, MChannel
@always_command("wyci")
async def wyci(channel: MChannel, _match: Match, message: Message) -> None:
if not channel.server_config("wyci.enabled", True):
return
match = re.... | Add config to disable WYCI. | Add config to disable WYCI.
| Python | mit | PJB3005/MoMMI,PJB3005/MoMMI,PJB3005/MoMMI | ---
+++
@@ -6,6 +6,9 @@
@always_command("wyci")
async def wyci(channel: MChannel, _match: Match, message: Message) -> None:
+ if not channel.server_config("wyci.enabled", True):
+ return
+
match = re.search(r"\S\s+when[\s*?.!)]*$", message.content, re.IGNORECASE)
if match is None:
... |
a0fb20f910f59737be725a1fc3d49d17cafa9107 | ella/articles/newman_admin.py | ella/articles/newman_admin.py | from django.utils.translation import ugettext_lazy as _
from ella.core.newman_admin import ListingInlineAdmin, PublishableAdmin,\
RelatedInlineAdmin
from ella.articles.models import Article
import ella_newman
class ArticleAdmin(PublishableAdmin):
fieldsets = (
(_("Article heading"), {'fields': ('titl... | from django.utils.translation import ugettext_lazy as _
from ella.core.newman_admin import ListingInlineAdmin, PublishableAdmin,\
RelatedInlineAdmin
from ella.articles.models import Article
import ella_newman
class ArticleAdmin(PublishableAdmin):
fieldsets = (
(_("Article heading"), {'fields': ('titl... | Fix pep8 on articles new man admin: E302 expected 2 blank lines | Fix pep8 on articles new man admin: E302 expected 2 blank lines
| Python | bsd-3-clause | WhiskeyMedia/ella,MichalMaM/ella,petrlosa/ella,whalerock/ella,petrlosa/ella,whalerock/ella,WhiskeyMedia/ella,ella/ella,whalerock/ella,MichalMaM/ella | ---
+++
@@ -20,4 +20,3 @@
ella_newman.site.register(Article, ArticleAdmin)
- |
da9058064e2a94f717abe2f97af80d2daa4fa292 | likert_field/models.py | likert_field/models.py | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
import likert_field.forms as forms
class LikertField(models.IntegerField):
"""A Likert field is simply stored as an IntegerField"""
description = _('Likert item... | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
from six import string_types
from django.db import models
from django.utils.translation import ugettext_lazy as _
import likert_field.forms as forms
class LikertField(models.IntegerField):
"""A Likert field is simply stored as an IntegerField"""
... | Handle empty strings from unanswered items | Handle empty strings from unanswered items
| Python | bsd-3-clause | kelvinwong-ca/django-likert-field,kelvinwong-ca/django-likert-field | ---
+++
@@ -1,5 +1,7 @@
#-*- coding: utf-8 -*-
from __future__ import unicode_literals
+
+from six import string_types
from django.db import models
from django.utils.translation import ugettext_lazy as _
@@ -16,6 +18,16 @@
kwargs['null'] = True
super(LikertField, self).__init__(*args, **kw... |
049287c2ec73d46bbc4ad0c4b4778719d6fd4505 | src/dicomweb_client/__init__.py | src/dicomweb_client/__init__.py | __version__ = '0.9.4'
from dicomweb_client.api import DICOMwebClient
| __version__ = '0.10.0'
from dicomweb_client.api import DICOMwebClient
| Increase package version to 0.10.0 | Increase package version to 0.10.0
| Python | mit | MGHComputationalPathology/dicomweb-client | ---
+++
@@ -1,3 +1,3 @@
-__version__ = '0.9.4'
+__version__ = '0.10.0'
from dicomweb_client.api import DICOMwebClient |
22855458c7c683353f2ed7b577289b63da8bc9c6 | src/scikit-cycling/skcycling/utils/io_fit.py | src/scikit-cycling/skcycling/utils/io_fit.py | import numpy as np
from fitparse import FitFile
def load_power_from_fit(filename):
""" Method to open the power data from FIT file into a numpy array.
Parameters
----------
filename: str,
Path to the FIT file.
"""
# Check that the filename has the good extension
if filename.endsw... | import numpy as np
from fitparse import FitFile
def load_power_from_fit(filename):
""" Method to open the power data from FIT file into a numpy array.
Parameters
----------
filename: str,
Path to the FIT file.
"""
# Check that the filename has the good extension
if filename.endsw... | Solve the issue of the power got disconnected during the ride | Solve the issue of the power got disconnected during the ride
| Python | mit | glemaitre/power-profile,glemaitre/power-profile,clemaitre58/power-profile,clemaitre58/power-profile | ---
+++
@@ -32,6 +32,9 @@
if p is not None:
power_rec[idx_rec] = float(p)
else:
- raise ValueError('There record without power values. Check what is happening.')
+ # raise ValueError('There record without power values. Check what is happening.')
+ # We p... |
844e3635aeb0144f7e4cc0d9de3bfc219312bbe5 | ocradmin/plugins/views.py | ocradmin/plugins/views.py | """
RESTful interface to interacting with OCR plugins.
"""
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from ocradmin.ocrtasks.models import OcrTask
from ocradmin.plugins.manager import ModuleManager
import logging
logger = logging.getLogger(__na... | """
RESTful interface to interacting with OCR plugins.
"""
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from ocradmin.ocrtasks.models import OcrTask
from ocradmin.plugins.manager import ModuleManager
import logging
logger = logging.getLogger(__na... | Include the eval'd node type in the async return | Include the eval'd node type in the async return
| Python | apache-2.0 | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | ---
+++
@@ -35,6 +35,10 @@
async = OcrTask.run_celery_task("run.script", evalnode, script,
untracked=True, asyncronous=True, queue="interactive")
- out = dict(task_id=async.task_id, status=async.status,
- results=async.result)
+ out = dict(
+ node=evalnode,
+ task_id... |
b052c2fd93cd578723c93dbe7357f1f3c82273eb | src/poliastro/patched_conics.py | src/poliastro/patched_conics.py | # coding: utf-8
"""Patched Conics Computations
Contains methods to compute interplanetary trajectories approximating the three
body problem with Patched Conics.
"""
from astropy import units as u
from poliastro.twobody import Orbit
from poliastro.constants import J2000
@u.quantity_input(a=u.m)
def compute_soi(body,... | # coding: utf-8
"""Patched Conics Computations
Contains methods to compute interplanetary trajectories approximating the three
body problem with Patched Conics.
"""
from astropy import units as u
from poliastro.twobody import Orbit
from poliastro.constants import J2000
@u.quantity_input(a=u.m)
def compute_soi(body,... | Replace prints by an exception | Replace prints by an exception
| Python | mit | anhiga/poliastro,Juanlu001/poliastro,anhiga/poliastro,poliastro/poliastro,newlawrence/poliastro,newlawrence/poliastro,Juanlu001/poliastro,newlawrence/poliastro,anhiga/poliastro,Juanlu001/poliastro | ---
+++
@@ -39,8 +39,8 @@
return r_SOI.decompose()
except KeyError:
- print("To compute the semimajor axis for Moon",
- " and Pluto use the JPL ephemeris: ")
- print(">>> from astropy.coordinates import solar_system_ephemeris")
- print('>>> sol... |
d156beeaf0638e585c616d697e1ecd76a98d8a3f | axelrod/tests/test_reflex.py | axelrod/tests/test_reflex.py | """
Test suite for Reflex Axelrod PD player.
"""
import axelrod
from test_player import TestPlayer
class Reflex_test(TestPlayer):
def test_initial_nice_strategy(self):
""" First response should always be cooperation. """
p1 = axelrod.Reflex()
p2 = axelrod.Player()
self.assertEqual... | """
Test suite for Reflex Axelrod PD player.
"""
import axelrod
from test_player import TestPlayer
class Reflex_test(TestPlayer):
name = "Reflex"
player = axelrod.Reflex
stochastic = False
def test_strategy(self):
""" First response should always be cooperation. """
p1 = axelrod.Ref... | Simplify tests to new format. | Simplify tests to new format.
| Python | mit | marcharper/Axelrod,ranjinidas/Axelrod,marcharper/Axelrod,ranjinidas/Axelrod | ---
+++
@@ -7,17 +7,16 @@
class Reflex_test(TestPlayer):
- def test_initial_nice_strategy(self):
+ name = "Reflex"
+ player = axelrod.Reflex
+ stochastic = False
+
+
+ def test_strategy(self):
""" First response should always be cooperation. """
p1 = axelrod.Reflex()
p2 ... |
9f208fd476c8864a1b4c294b80d5d8191c400fb5 | admin_sso/admin.py | admin_sso/admin.py | from django.conf.urls import url
from django.contrib import admin
from admin_sso import settings
from admin_sso.models import Assignment
class AssignmentAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'username', 'username_mode', 'domain',
'user', 'weight')
list_editable = ('usern... | from django.conf.urls import url
from django.contrib import admin
from admin_sso import settings
from admin_sso.models import Assignment
class AssignmentAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'username', 'username_mode', 'domain',
'user', 'weight')
list_editable = ('usern... | Add user to raw_id_fields, drastically improves UX on sites with many users | Add user to raw_id_fields, drastically improves UX on sites with many users
| Python | bsd-3-clause | matthiask/django-admin-sso,diegobz/django-admin-sso,diegobz/django-admin-sso,matthiask/django-admin-sso | ---
+++
@@ -9,6 +9,7 @@
list_display = ('__unicode__', 'username', 'username_mode', 'domain',
'user', 'weight')
list_editable = ('username', 'username_mode', 'domain', 'user', 'weight')
+ raw_id_fields = ('user',)
def get_urls(self):
from admin_sso.views import start,... |
4b18a9fe5454055131202c60f057ffa3372dadbb | parsec/commands/cmd_config_init.py | parsec/commands/cmd_config_init.py | import os
import click
from parsec.cli import pass_context
from parsec import options
from parsec import config
from parsec.io import warn, info
CONFIG_TEMPLATE = """## Parsec Global Configuration File.
# Each stanza should contian a single galaxy server to control.
local:
key: "<TODO>"
email: "<TODO>"
... | import os
import click
from parsec.cli import pass_context
from parsec import options
from parsec import config
from parsec.io import warn, info
CONFIG_TEMPLATE = """## Parsec Global Configuration File.
# Each stanza should contian a single galaxy server to control.
local:
key: "%(key)s"
email: "<TODO>"
... | Allow bootstrapping config with values | Allow bootstrapping config with values
| Python | apache-2.0 | galaxy-iuc/parsec | ---
+++
@@ -11,11 +11,11 @@
# Each stanza should contian a single galaxy server to control.
local:
- key: "<TODO>"
+ key: "%(key)s"
email: "<TODO>"
password: "<TODO>"
- host: "127.0.0.1"
- port: "8080"
+ url: "%(url)s"
+ admin: %(admin)s
"""
SUCCESS_MESSAGE = (
@@ -25,8 +25,22 @@
... |
c87b5a51bc0fd69ed3ec1eddeedd3111820d3252 | biblio/__init__.py | biblio/__init__.py | """
Connect to the UGent Biblio API
"""
from .biblio import search, BASE_URL, publications_by_person
__author__ = 'Stef Bastiaansen'
__email__ = 'stef.bastiaansen@ugent.be'
__copyright__ = 'Copyright (c) 2016 LT3 - UGent'
__license__ = 'Apache License 2.0'
__version__ = '0.1'
__url__ = 'https://github.com/megasnort/py... | """
Connect to the UGent Biblio API
"""
from biblio import search, BASE_URL, publications_by_person
__author__ = 'Stef Bastiaansen'
__email__ = 'stef.bastiaansen@ugent.be'
__copyright__ = 'Copyright (c) 2016 LT3 - UGent'
__license__ = 'Apache License 2.0'
__version__ = '0.1'
__url__ = 'https://github.com/megasnort/pyt... | Fix import location of biblio package | Fix import location of biblio package
| Python | apache-2.0 | megasnort/python-ugent-biblio | ---
+++
@@ -1,7 +1,7 @@
"""
Connect to the UGent Biblio API
"""
-from .biblio import search, BASE_URL, publications_by_person
+from biblio import search, BASE_URL, publications_by_person
__author__ = 'Stef Bastiaansen'
__email__ = 'stef.bastiaansen@ugent.be' |
e255b92589000c2d485d35f9008b78e0313b4374 | pystache/template_spec.py | pystache/template_spec.py | # coding: utf-8
"""
Provides a class to customize template information on a per-view basis.
To customize template properties for a particular view, create that view
from a class that subclasses TemplateSpec. The "Spec" in TemplateSpec
stands for template information that is "special" or "specified".
"""
# TODO: fi... | # coding: utf-8
"""
Provides a class to customize template information on a per-view basis.
To customize template properties for a particular view, create that view
from a class that subclasses TemplateSpec. The "spec" in TemplateSpec
stands for "special" or "specified" template information.
"""
class TemplateSpec... | Reorder TemplateSpec attributes and add to docstring. | Reorder TemplateSpec attributes and add to docstring.
| Python | mit | nitish116/pystache,rismalrv/pystache,charbeljc/pystache,rismalrv/pystache,harsh00008/pystache,arlenesr28/pystache,defunkt/pystache,beni55/pystache,nitish116/pystache,nitish116/pystache,rismalrv/pystache,jrnold/pystache,jrnold/pystache,harsh00008/pystache,harsh00008/pystache,charbeljc/pystache,arlenesr28/pystache,beni55... | ---
+++
@@ -4,12 +4,11 @@
Provides a class to customize template information on a per-view basis.
To customize template properties for a particular view, create that view
-from a class that subclasses TemplateSpec. The "Spec" in TemplateSpec
-stands for template information that is "special" or "specified".
+fro... |
ecb3a296b379f4abdc03ce5de447b30ada5f124e | txircd/modules/rfc/cmode_l.py | txircd/modules/rfc/cmode_l.py | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class LimitMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "Lim... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class LimitMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "Lim... | Return the parameter for channel mode +l as a list | Return the parameter for channel mode +l as a list
This fixes a bug where every digit was handled as a separate parameter, causing
"MODE #channel +l 10" to turn into "MODE #channel +ll 1 0"
| Python | bsd-3-clause | Heufneutje/txircd,ElementalAlchemist/txircd | ---
+++
@@ -27,7 +27,7 @@
def checkSet(self, channel, param):
if param.isdigit():
- return param
+ return [param]
return None
def apply(self, actionType, channel, param, alsoChannel, user): |
a3ca99ab519401df8f2418ce877065dc3aa63146 | app/parsers/models.py | app/parsers/models.py | #
# 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 writing, software
# distributed under t... | #
# 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 writing, software
# distributed under t... | Add message_age property to ParsedMessage | Add message_age property to ParsedMessage
| Python | apache-2.0 | forseti-security/real-time-enforcer | ---
+++
@@ -44,3 +44,7 @@
class Config:
arbitrary_types_allowed = True
extra = 'forbid'
+
+ @property
+ def age(self):
+ return int(time.time()) - self.timestamp |
9cf29c769e3902c44914d3e216ae9457aa7e5fef | api/api/config_settings/redis_settings.py | api/api/config_settings/redis_settings.py | import redis
from api.utils import config
class RedisPools(object):
EXPERIMENTS_STATUS = redis.ConnectionPool.from_url(
config.get_string('POLYAXON_REDIS_EXPERIMENTS_STATUS_URL'))
JOBS_STATUS = redis.ConnectionPool.from_url(
config.get_string('POLYAXON_REDIS_JOBS_STATUS_URL'))
JOB_CONTAIN... | import redis
from api.utils import config
class RedisPools(object):
EXPERIMENTS_STATUS = redis.ConnectionPool.from_url(
config.get_string('POLYAXON_REDIS_EXPERIMENTS_STATUS_URL'))
JOBS_STATUS = redis.ConnectionPool.from_url(
config.get_string('POLYAXON_REDIS_JOBS_STATUS_URL'))
JOB_CONTAIN... | Add to stream redis db | Add to stream redis db
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | ---
+++
@@ -10,3 +10,5 @@
config.get_string('POLYAXON_REDIS_JOBS_STATUS_URL'))
JOB_CONTAINERS = redis.ConnectionPool.from_url(
config.get_string('POLYAXON_REDIS_JOB_CONTAINERS_URL'))
+ TO_STREAM = redis.ConnectionPool.from_url(
+ config.get_string('POLYAXON_REDIS_TO_STREAM_URL')) |
66b49f913513545e5ae0484963412e965c8f9aa1 | saleor/dashboard/category/forms.py | saleor/dashboard/category/forms.py | from django import forms
from django.utils.translation import ugettext_lazy as _
from mptt.forms import TreeNodeChoiceField
from ...product.models import Category
class CategoryForm(forms.ModelForm):
class Meta:
model = Category
exclude = []
def __init__(self, *args, **kwargs):
super... | from django import forms
from django.utils.translation import ugettext_lazy as _
from mptt.forms import TreeNodeChoiceField
from ...product.models import Category
class CategoryForm(forms.ModelForm):
class Meta:
model = Category
exclude = []
def __init__(self, *args, **kwargs):
super... | Check if new parent is not a descendant of current category | Check if new parent is not a descendant of current category
| Python | bsd-3-clause | rchav/vinerack,HyperManTT/ECommerceSaleor,rchav/vinerack,taedori81/saleor,jreigel/saleor,tfroehlich82/saleor,avorio/saleor,paweltin/saleor,laosunhust/saleor,UITools/saleor,spartonia/saleor,arth-co/saleor,spartonia/saleor,taedori81/saleor,arth-co/saleor,rchav/vinerack,tfroehlich82/saleor,avorio/saleor,josesanch/saleor,U... | ---
+++
@@ -18,4 +18,6 @@
parent = self.cleaned_data['parent']
if parent == self.instance:
raise forms.ValidationError(_('A category may not be made a child of itself'))
+ if self.instance in parent.get_ancestors():
+ raise forms.ValidationError(_('A category may not b... |
c7d9287b770a0033cb54f9c1f9ac5f8beb25d528 | scripts/cronRefreshEdxQualtrics.py | scripts/cronRefreshEdxQualtrics.py | from surveyextractor import QualtricsExtractor
import getopt
import sys
### Script for scheduling regular EdxQualtrics updates
### Usage for cron should be "cronRefreshEdxQualtrics.py -m -s -r"
# Append directory for dependencies to PYTHONPATH
sys.path.append("/home/dataman/Code/qualtrics_etl/src/qualtrics_etl/")
qe... | from surveyextractor import QualtricsExtractor
import getopt, sys
# Script for scheduling regular EdxQualtrics updates
# Usage for cron should be "cronRefreshEdxQualtrics.py -m -s -r"
qe = QualtricsExtractor()
opts, args = getopt.getopt(sys.argv[1:], 'amsr', ['--reset', '--loadmeta', '--loadsurveys', '--loadresponses... | Revert "Added script for cron job to load surveys to database." | Revert "Added script for cron job to load surveys to database."
This reverts commit 34e5560437348e5cfeab589b783c9cc524aa2abf.
| Python | bsd-3-clause | paepcke/json_to_relation,paepcke/json_to_relation,paepcke/json_to_relation,paepcke/json_to_relation | ---
+++
@@ -1,12 +1,8 @@
from surveyextractor import QualtricsExtractor
-import getopt
-import sys
+import getopt, sys
-### Script for scheduling regular EdxQualtrics updates
-### Usage for cron should be "cronRefreshEdxQualtrics.py -m -s -r"
-
-# Append directory for dependencies to PYTHONPATH
-sys.path.append("/... |
250458aeb6619587443d6896c46a49c9754951e4 | byceps/services/tourney/models/tourney.py | byceps/services/tourney/models/tourney.py | """
byceps.services.tourney.models.tourney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import NewType
from uuid import UUID
from ....database import db, generate_uuid
from ....util.instances import ReprBuilder
fr... | """
byceps.services.tourney.models.tourney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import NewType
from uuid import UUID
from ....database import db, generate_uuid
from ....util.instances import ReprBuilder
fr... | Fix `Tourney` model's database table name | Fix `Tourney` model's database table name
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps | ---
+++
@@ -21,7 +21,7 @@
class Tourney(db.Model):
"""A tournament."""
- __tablename__ = 'tourney_teams'
+ __tablename__ = 'tourneys'
__table_args__ = (
db.UniqueConstraint('group_id', 'title'),
) |
d5049edc8567cebf936bb07847906c5400f9a6d9 | ceph_deploy/tests/unit/hosts/test_suse.py | ceph_deploy/tests/unit/hosts/test_suse.py | from ceph_deploy.hosts import suse
class TestSuseInit(object):
def setup(self):
self.host = suse
def test_choose_init_default(self):
self.host.release = None
init_type = self.host.choose_init()
assert init_type == "sysvinit"
def test_choose_init_SLE_11(self):
... | from ceph_deploy.hosts import suse
from ceph_deploy.hosts.suse.install import map_components
class TestSuseInit(object):
def setup(self):
self.host = suse
def test_choose_init_default(self):
self.host.release = None
init_type = self.host.choose_init()
assert init_type == "sysv... | Add tests for component to SUSE package mapping | Add tests for component to SUSE package mapping
Signed-off-by: David Disseldorp <589a549dc9f982d9f46aeeb82a09ab6d87ccf1d8@suse.de>
| Python | mit | zhouyuan/ceph-deploy,shenhequnying/ceph-deploy,ceph/ceph-deploy,ghxandsky/ceph-deploy,zhouyuan/ceph-deploy,imzhulei/ceph-deploy,SUSE/ceph-deploy,Vicente-Cheng/ceph-deploy,ceph/ceph-deploy,branto1/ceph-deploy,trhoden/ceph-deploy,trhoden/ceph-deploy,osynge/ceph-deploy,ghxandsky/ceph-deploy,SUSE/ceph-deploy,branto1/ceph-d... | ---
+++
@@ -1,4 +1,5 @@
from ceph_deploy.hosts import suse
+from ceph_deploy.hosts.suse.install import map_components
class TestSuseInit(object):
def setup(self):
@@ -23,3 +24,16 @@
self.host.release = '13.1'
init_type = self.host.choose_init()
assert init_type == "systemd"
+
+cla... |
d8f33c46b6462788ef6e38dc5aefcdda2144eb66 | camoco/__init__.py | camoco/__init__.py | """
Camoco Library - CoAnalysis of Molecular Components
CacheMoneyCorn
"""
__license__ = """
Creative Commons Non-Commercial 4.0 Generic
http://creativecommons.org/licenses/by-nc/4.0/
"""
import pyximport; pyximport.install()
from camoco.Camoco import Camoco
from camoco.Expr import Expr
from camoco.CO... | """
Camoco Library - CoAnalysis of Molecular Components
CacheMoneyCorn
"""
__license__ = """
Creative Commons Non-Commercial 4.0 Generic
http://creativecommons.org/licenses/by-nc/4.0/
"""
import pyximport; pyximport.install()
from camoco.Camoco import Camoco
Camoco.create()
from camoco.Expr import Exp... | Fix initial create for camoco class | Fix initial create for camoco class
| Python | mit | schae234/Camoco,schae234/Camoco | ---
+++
@@ -14,6 +14,7 @@
import pyximport; pyximport.install()
from camoco.Camoco import Camoco
+Camoco.create()
from camoco.Expr import Expr
from camoco.COB import COB
from camoco.RefGen import RefGen |
a1bcb99691f5a0238f6a34a5579df3e89e8d6823 | child_sync_gp/model/project_compassion.py | child_sync_gp/model/project_compassion.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file _... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file _... | Fix bug in write project. | Fix bug in write project.
| Python | agpl-3.0 | CompassionCH/compassion-switzerland,ndtran/compassion-switzerland,MickSandoz/compassion-switzerland,eicher31/compassion-switzerland,Secheron/compassion-switzerland,CompassionCH/compassion-switzerland,Secheron/compassion-switzerland,CompassionCH/compassion-switzerland,MickSandoz/compassion-switzerland,ecino/compassion-s... | ---
+++
@@ -21,6 +21,8 @@
"""Update Project in GP."""
res = super(project_compassion, self).write(cr, uid, ids, vals,
context)
+ if not isinstance(ids, list):
+ ids = [ids]
gp_connect = gp_connector.GPConnect()
... |
4ad92bfcbfd2145b008cd18e934ebd6dc3be53e9 | pytest/test_prefork.py | pytest/test_prefork.py | from tectonic import prefork
def test_WorkerMetadata():
"""
This is a simple test, as WorkerMetadata only holds data
"""
pid = 'pid'
health_check_read = 100
last_seen = 'now'
metadata = prefork.WorkerMetadata(pid=pid,
health_check_read=health_check_re... | import os
import shutil
import os.path
import tempfile
from tectonic import prefork
def test_WorkerMetadata():
"""
This is a simple test, as WorkerMetadata only holds data
"""
pid = 'pid'
health_check_read = 100
last_seen = 'now'
metadata = prefork.WorkerMetadata(pid=pid,
... | Add a test for the file object | Add a test for the file object
| Python | bsd-3-clause | markrwilliams/tectonic | ---
+++
@@ -1,3 +1,7 @@
+import os
+import shutil
+import os.path
+import tempfile
from tectonic import prefork
@@ -16,3 +20,37 @@
assert metadata.pid == pid
assert metadata.health_check_read == health_check_read
assert metadata.last_seen == last_seen
+
+
+def test_WriteAndFlushFile():
+ """
+ ... |
cb8bf92ab2f71767de8b471992d79131e4dde9a1 | quicksort/quicksort.py | quicksort/quicksort.py | def sort(arr):
return arr;
if __name__ == '__main__':
unsorted = list(reversed(range(1000)));
print sort(unsorted); | def sort(arr, length):
if length == 1:
return
return (arr, length)
if __name__ == '__main__':
unsorted = list(reversed(range(1000)))
initial_len = len(unsorted)
print sort(unsorted, initial_len) | Add length parameter to sort and remove semicolons | Add length parameter to sort and remove semicolons
The sort function requires a length parameter, so the function
declaration and the initial call were modified to reflect that.
A length of just 1 element represents the base case of the
recursion, so the function simply returns in this case.
Also I forgot how python ... | Python | mit | timpel/stanford-algs,timpel/stanford-algs | ---
+++
@@ -1,6 +1,9 @@
-def sort(arr):
- return arr;
+def sort(arr, length):
+ if length == 1:
+ return
+ return (arr, length)
if __name__ == '__main__':
- unsorted = list(reversed(range(1000)));
- print sort(unsorted);
+ unsorted = list(reversed(range(1000)))
+ initial_len = len(unsorted)
+ print sort(unsorted,... |
9256844b08edaff1b9755a6ffc25acc0df76934d | MoodJournal/entries/serializers.py | MoodJournal/entries/serializers.py | from django.contrib.auth.models import User
from rest_framework import serializers
from .models import UserDefinedCategory
from .models import EntryInstance
class UserDefinedCategorySerializer(serializers.HyperlinkedModelSerializer):
url = serializers.HyperlinkedIdentityField(
view_name='category-detail... | from rest_framework import serializers
from .models import UserDefinedCategory
from .models import EntryInstance
class UserDefinedCategorySerializer(serializers.ModelSerializer):
class Meta:
model = UserDefinedCategory
fields = ('user', 'category', 'pk',)
class EntryInstanceSerializer(serialize... | Revert "beginning hyperlink model serialization" | Revert "beginning hyperlink model serialization"
This reverts commit 6d41c54397512da69604f7e730757f4aff96374f.
| Python | mit | swpease/MoodJournal,swpease/MoodJournal,swpease/MoodJournal | ---
+++
@@ -1,21 +1,13 @@
-from django.contrib.auth.models import User
-
from rest_framework import serializers
from .models import UserDefinedCategory
from .models import EntryInstance
-class UserDefinedCategorySerializer(serializers.HyperlinkedModelSerializer):
- url = serializers.HyperlinkedIdentityFie... |
5a12f027079d109228456c6f3e4912317721246a | setup.py | setup.py | from distutils.core import setup
setup(
name='cyrtranslit',
packages=['cyrtranslit'],
version='0.4',
description='Bi-directional Cyrillic transliteration. Transliterate Cyrillic script text to Roman alphabet text and vice versa.',
author='Open Data Kosovo',
author_email='dev@opendatakosovo.org',
url='http... | from distutils.core import setup
setup(
name='cyrtranslit',
packages=['cyrtranslit'],
version='0.4',
description='Bi-directional Cyrillic transliteration. Transliterate Cyrillic script text to Roman alphabet text and vice versa.',
author='Open Data Kosovo',
author_email='dev@opendatakosovo.org',
url='http... | Declare that cyrtranslit supports Python 3.7 | Declare that cyrtranslit supports Python 3.7
| Python | mit | opendatakosovo/cyrillic-transliteration | ---
+++
@@ -21,5 +21,6 @@
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6'],
+ 'Programming Language :: Python :: 3.6',
+ ... |
26730c073e183249a8eb7c0d0333fdd32e307e4a | setup.py | setup.py | from setuptools import setup, find_packages
deps = [
'ijson==2.2',
'mozci==0.15.1',
'MozillaPulse==1.2.1',
'requests==2.7.0', # Maximum version taskcluster will work with
'taskcluster==0.0.27',
'treeherder-client==1.7.0',
]
setup(name='pulse-actions',
version='0.2.0',
description='... | from setuptools import setup, find_packages
deps = [
'ijson==2.2',
'mozci==0.15.1',
'MozillaPulse==1.2.2',
'requests==2.7.0', # Maximum version taskcluster will work with
'taskcluster==0.0.27',
'treeherder-client==1.7.0',
]
setup(name='pulse-actions',
version='0.2.0',
description='... | Upgrade to working MozillaPulse version | Upgrade to working MozillaPulse version
| Python | mpl-2.0 | armenzg/pulse_actions,adusca/pulse_actions,mozilla/pulse_actions | ---
+++
@@ -3,7 +3,7 @@
deps = [
'ijson==2.2',
'mozci==0.15.1',
- 'MozillaPulse==1.2.1',
+ 'MozillaPulse==1.2.2',
'requests==2.7.0', # Maximum version taskcluster will work with
'taskcluster==0.0.27',
'treeherder-client==1.7.0', |
45369df80923fdd42f7d5c079f6131c0ace43130 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# Package requirements here
"Jinja2==2.9.5"
]
test_requirements = [... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# Package requirements here
"Jinja2==2.9.5"
]
test_requirements = [... | Update development status and keywords | Update development status and keywords
| Python | mit | oldani/HtmlTestRunner,oldani/HtmlTestRunner | ---
+++
@@ -35,9 +35,9 @@
install_requires=requirements,
license="MIT license",
zip_safe=False,
- keywords='HtmlTestRunner, TestRunner, Html Reports',
+ keywords='HtmlTestRunner TestRunner Html Reports',
classifiers=[
- 'Development Status :: 2 - Pre-Alpha',
+ 'Development Stat... |
5fb92c2cf19fc7990db9945c89db31ca32930696 | 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().split('h1>', 2)[1]
setup(
name='django-postgres-extra',
version='1.21a3',
packages=find_packages(),
include_package_data=True,... | 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>\n\n', 2)[1]
setup(
name='django-postgres-extra',
version='1.21a4',
packages=find_packages(),
include_package_data=T... | Cut out blank lines at the start of PyPi README | Cut out blank lines at the start of PyPi README
| Python | mit | SectorLabs/django-postgres-extra | ---
+++
@@ -3,11 +3,11 @@
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]
+ README = readme.read().split('h1>\n\n', 2)[1]
setup(
name='django-postgres-extra',
- ve... |
19a47d8390ed1db3f91568375bb2726ee56d24f3 | setup.py | setup.py | from setuptools import setup
PACKAGE_VERSION = '1.0'
deps = []
setup(name='wptserve',
version=PACKAGE_VERSION,
description="Python webserver intended for in web browser testing",
long_description=open("README.md").read(),
# Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifier... | from setuptools import setup
PACKAGE_VERSION = '1.0.1'
deps = []
setup(name='wptserve',
version=PACKAGE_VERSION,
description="Python webserver intended for in web browser testing",
long_description=open("README.md").read(),
# Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifi... | Update the version for manifest update | Update the version for manifest update
| Python | bsd-3-clause | youennf/wptserve | ---
+++
@@ -1,6 +1,6 @@
from setuptools import setup
-PACKAGE_VERSION = '1.0'
+PACKAGE_VERSION = '1.0.1'
deps = []
setup(name='wptserve', |
363dbc3dac71b9ce2d5ab7d9178253fc9b5bf483 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README')) as f:
README = f.read()
requires = []
setup(name='python-bitcoinlib',
version='0.2.0',
description='This python library provides an easy i... | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README')) as f:
README = f.read()
requires = []
setup(name='python-bitcoinlib',
version='0.2.1-SNAPSHOT',
description='This python library provides ... | Reset version for future development | Reset version for future development
| Python | mit | petertodd/dust-b-gone | ---
+++
@@ -10,7 +10,7 @@
requires = []
setup(name='python-bitcoinlib',
- version='0.2.0',
+ version='0.2.1-SNAPSHOT',
description='This python library provides an easy interface to the bitcoin data structures and protocol.',
long_description=README,
classifiers=[ |
1e117182e6169645940a7d7acc3eba9181e5715e | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="pysolr",
version="3.0.3",
description="Lightweight python wrapper for Apache Solr.",
author='Daniel Lindsley',
author_email='daniel@toastdriven.com',
long_description=open('README.rst', ... | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="pysolr",
version="3.0.4",
description="Lightweight python wrapper for Apache Solr.",
author='Daniel Lindsley',
author_email='daniel@toastdriven.com',
long_description=open('README.rst', ... | Tag version 3.0.4 for PyPI | Tag version 3.0.4 for PyPI
3.x had a minor bug (see SHA:74b0a36) but it broke logging for Solr
errors which seems worth an easily deployed fix
| Python | bsd-3-clause | rokaka/pysolr,toastdriven/pysolr,mbeacom/pysolr,CANTUS-Project/pysolr-tornado,mylanium/pysolr,swistakm/pysolr,toastdriven/pysolr,mbeacom/pysolr,django-searchstack/skisolr,10clouds/pysolr,django-haystack/pysolr,mylanium/pysolr,CANTUS-Project/pysolr-tornado,django-searchstack/skisolr,swistakm/pysolr,upayavira/pysolr,shas... | ---
+++
@@ -6,7 +6,7 @@
setup(
name="pysolr",
- version="3.0.3",
+ version="3.0.4",
description="Lightweight python wrapper for Apache Solr.",
author='Daniel Lindsley',
author_email='daniel@toastdriven.com', |
ed8b46542c831b5e3692368c15619a46fbe338e1 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="PyRundeck",
version="0.3.4",
description="A thin, pure Python wrapper for the Rundeck API",
author="Panagiotis Koutsourakis",
author_email="kutsurak@ekt.gr",
license='BSD',
url='https://github.com/EKT/pyrundeck',
classifiers=[
... | from setuptools import setup, find_packages
setup(
name="PyRundeck",
version="0.3.4",
description="A thin, pure Python wrapper for the Rundeck API",
author="Panagiotis Koutsourakis",
author_email="kutsurak@ekt.gr",
license='BSD',
url='https://github.com/EKT/pyrundeck',
classifiers=[
... | Add PyYAML as a dependency | Add PyYAML as a dependency
| Python | bsd-3-clause | EKT/pyrundeck | ---
+++
@@ -28,6 +28,7 @@
'requests>=2.7.0',
'pyopenssl>=0.15.1',
'ndg-httpsclient>=0.4.0',
- 'pyasn1>=0.1.8'
+ 'pyasn1>=0.1.8',
+ 'pyyaml>=3.11'
]
) |
dcf4d88b6562cafb7a365e14d66a3a1967365210 | setup.py | setup.py | from setuptools import find_packages, setup
setup(
name="redshift-etl",
version="0.27b.1",
author="Harry's Data Engineering and Contributors",
description="ETL code to ferry data from PostgreSQL databases (or S3 files) to Redshift cluster",
license="MIT",
keywords="redshift postgresql etl extr... | from setuptools import find_packages, setup
setup(
name="redshift-etl",
version="0.27.0",
author="Harry's Data Engineering and Contributors",
description="ETL code to ferry data from PostgreSQL databases (or S3 files) to Redshift cluster",
license="MIT",
keywords="redshift postgresql etl extra... | Change version to match RC (v0.27.0) | Change version to match RC (v0.27.0)
| Python | mit | harrystech/arthur-redshift-etl,harrystech/arthur-redshift-etl,harrystech/arthur-redshift-etl,harrystech/arthur-redshift-etl,harrystech/arthur-redshift-etl | ---
+++
@@ -3,7 +3,7 @@
setup(
name="redshift-etl",
- version="0.27b.1",
+ version="0.27.0",
author="Harry's Data Engineering and Contributors",
description="ETL code to ferry data from PostgreSQL databases (or S3 files) to Redshift cluster",
license="MIT", |
c0a8ead2092f6479621bed030bac5f3ee1c5872a | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(name="hal-json",
version="0.1",
description="Parse and encode links according to RFC 5988 or HAL specs",
author="Michael Burrows, Carlos Martín",
author_email="inean.es@gmail.com",
url="https:... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(name="hal-json",
version="0.1",
description="Parse and encode links according to RFC 5988 or HAL specs",
author="Michael Burrows, Carlos Martín",
author_email="inean.es@gmail.com",
url="https:... | Use public github URL for package homepage | Use public github URL for package homepage
| Python | mit | inean/LinkHeader | ---
+++
@@ -8,7 +8,7 @@
description="Parse and encode links according to RFC 5988 or HAL specs",
author="Michael Burrows, Carlos Martín",
author_email="inean.es@gmail.com",
- url="https://inean@github.com/inean/LinkHeader.git",
+ url="https://github.com/inean/LinkHeader.git",
pac... |
17d2bde78fb195536bd57b5b92aa8ba557d4314b | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name = "clrsvsim",
version = "0.0.2",
description = "Color Genomics Structural Variant Simulator",
author = "Color Genomics",
author_email = "dev@color.com",
url = "https://github.com/Col... | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name = "clrsvsim",
version = "0.1.0",
description = "Color Genomics Structural Variant Simulator",
author = "Color Genomics",
author_email = "dev@color.com",
url = "https://github.com/Col... | Stop pinning to specific patch versions | Stop pinning to specific patch versions
This package should not require specific patch versions. Rather, it
should express the broadest range of possible versions that it supports.
In the current `setup.py`, we are very particular about which versions
must be used. Because of the specificity, installing `clrsvsim` ma... | Python | apache-2.0 | color/clrsvsim | ---
+++
@@ -5,22 +5,24 @@
setup(name = "clrsvsim",
- version = "0.0.2",
+ version = "0.1.0",
description = "Color Genomics Structural Variant Simulator",
author = "Color Genomics",
author_email = "dev@color.com",
url = "https://github.com/ColorGenomics/clrsvsim",
pack... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.