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
0e5b3bdd05ba0621c25db4cb4117bd7b93a67725
only_one.py
only_one.py
#!/usr/bin/env python2.7 from __future__ import absolute_import import redis import json #POOL = redis.ConnectionPool(max_connections=4, host='localhost', db=5, port=6379) #REDIS_CLIENT = redis.Redis(connection_pool=POOL) data = json.load(open('config.json')) REDIS_CLIENT = redis.Redis(host=data['oohost'], db=data['o...
#!/usr/bin/env python2.7 from __future__ import absolute_import import redis import json import os #POOL = redis.ConnectionPool(max_connections=4, host='localhost', db=5, port=6379) #REDIS_CLIENT = redis.Redis(connection_pool=POOL) configfile = "%s/config.json" % (os.path.dirname(os.path.realpath(__file__))) data = j...
Set full static path for config.json file. Necessary for launching manually
Set full static path for config.json file. Necessary for launching manually
Python
mit
viable-hartman/mage_scheduler,viable-hartman/mage_scheduler
--- +++ @@ -3,10 +3,12 @@ from __future__ import absolute_import import redis import json +import os #POOL = redis.ConnectionPool(max_connections=4, host='localhost', db=5, port=6379) #REDIS_CLIENT = redis.Redis(connection_pool=POOL) -data = json.load(open('config.json')) +configfile = "%s/config.json" % (os.p...
305892bc4e6c12fb24d42e16b35621ad90553c7c
testdoc/formatter.py
testdoc/formatter.py
"""Formatters for creating documents. A formatter is an object which accepts an output stream (usually a file or standard output) and then provides a structured way for writing to that stream. All formatters should provide 'title', 'section', 'subsection' and 'paragraph' methods which write to the stream. """ class ...
"""Formatters for creating documents. A formatter is an object which accepts an output stream (usually a file or standard output) and then provides a structured way for writing to that stream. All formatters should provide 'title', 'section', 'subsection' and 'paragraph' methods which write to the stream. """ class ...
Put a blank line before section headings.
Put a blank line before section headings.
Python
mit
testing-cabal/testdoc
--- +++ @@ -20,6 +20,7 @@ self.writeln('= %s =\n' % (name,)) def section(self, name): + self.writeln('') self.writeln('== %s ==\n' % (name,)) def subsection(self, name):
bd29eb1eb1d265af33900d62e52430d62eef4144
pylanguagetool/api.py
pylanguagetool/api.py
# -*- coding: utf-8 -*- import requests def get_languages(api_url): r = requests.get(api_url + "languages") return r.json() def check(input_text, api_url, lang, mother_tongue=None, preferred_variants=None, enabled_rules=None, disabled_rules=None, enabled_categories=None, disabled_categor...
# -*- coding: utf-8 -*- import requests def get_languages(api_url): r = requests.get(api_url + "languages") return r.json() def check(input_text, api_url, lang, mother_tongue=None, preferred_variants=None, enabled_rules=None, disabled_rules=None, enabled_categories=None, disabled_categor...
Fix name of parameter `disabledCategories`
Fix name of parameter `disabledCategories`
Python
mit
Findus23/pyLanguagetool
--- +++ @@ -27,7 +27,7 @@ if enabled_categories: post_parameters["enabledCategories"] = enabled_categories if disabled_categories: - post_parameters["enabledCategories"] = disabled_categories + post_parameters["disabledCategories"] = disabled_categories if enabled_only: ...
29e6e77b03569d39e484b47efd3b8230f30ee195
eduid_signup/db.py
eduid_signup/db.py
import pymongo from eduid_signup.compat import urlparse DEFAULT_MONGODB_HOST = 'localhost' DEFAULT_MONGODB_PORT = 27017 DEFAULT_MONGODB_NAME = 'eduid' DEFAULT_MONGODB_URI = 'mongodb://%s:%d/%s' % (DEFAULT_MONGODB_HOST, DEFAULT_MONGODB_PORT, ...
import pymongo DEFAULT_MONGODB_HOST = 'localhost' DEFAULT_MONGODB_PORT = 27017 DEFAULT_MONGODB_NAME = 'eduid' DEFAULT_MONGODB_URI = 'mongodb://%s:%d/%s' % (DEFAULT_MONGODB_HOST, DEFAULT_MONGODB_PORT, DEFAULT_MONGODB_NAME) cla...
Allow Mongo connections to Mongo Replicaset Cluster
Allow Mongo connections to Mongo Replicaset Cluster
Python
bsd-3-clause
SUNET/eduid-signup,SUNET/eduid-signup,SUNET/eduid-signup
--- +++ @@ -1,6 +1,4 @@ import pymongo - -from eduid_signup.compat import urlparse DEFAULT_MONGODB_HOST = 'localhost' DEFAULT_MONGODB_PORT = 27017 @@ -14,11 +12,10 @@ """Simple wrapper to get pymongo real objects from the settings uri""" def __init__(self, db_uri=DEFAULT_MONGODB_URI, - ...
51dcc5fddeb649ec582c435d6244ea4d2e4f8991
zproject/jinja2/__init__.py
zproject/jinja2/__init__.py
from typing import Any from django.contrib.staticfiles.storage import staticfiles_storage from django.template.defaultfilters import slugify, pluralize from django.urls import reverse from django.utils import translation from jinja2 import Environment from two_factor.templatetags.two_factor import device_action from...
from typing import Any from django.contrib.staticfiles.storage import staticfiles_storage from django.template.defaultfilters import slugify, pluralize from django.urls import reverse from django.utils import translation from django.utils.timesince import timesince from jinja2 import Environment from two_factor.templ...
Add django timesince filter to jinja2 filters.
templates: Add django timesince filter to jinja2 filters.
Python
apache-2.0
eeshangarg/zulip,brainwane/zulip,rht/zulip,brainwane/zulip,rishig/zulip,brainwane/zulip,brainwane/zulip,eeshangarg/zulip,synicalsyntax/zulip,punchagan/zulip,eeshangarg/zulip,synicalsyntax/zulip,zulip/zulip,punchagan/zulip,andersk/zulip,kou/zulip,zulip/zulip,punchagan/zulip,kou/zulip,rishig/zulip,showell/zulip,punchagan...
--- +++ @@ -5,6 +5,7 @@ from django.template.defaultfilters import slugify, pluralize from django.urls import reverse from django.utils import translation +from django.utils.timesince import timesince from jinja2 import Environment from two_factor.templatetags.two_factor import device_action @@ -27,5 +28,6 @@ ...
bd9f64c43567135903f2b980c26f9369ba0df649
dsub/_dsub_version.py
dsub/_dsub_version.py
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Update dsub version to 0.4.4.dev0
Update dsub version to 0.4.4.dev0 PiperOrigin-RevId: 344150311
Python
apache-2.0
DataBiosphere/dsub,DataBiosphere/dsub
--- +++ @@ -26,4 +26,4 @@ 0.1.3.dev0 -> 0.1.3 -> 0.1.4.dev0 -> ... """ -DSUB_VERSION = '0.4.3' +DSUB_VERSION = '0.4.4.dev0'
56ad144e447afe961905c67221d961e84aa3e41e
dsub/_dsub_version.py
dsub/_dsub_version.py
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Update dsub version to 0.3.8
Update dsub version to 0.3.8 PiperOrigin-RevId: 313423046
Python
apache-2.0
DataBiosphere/dsub,DataBiosphere/dsub
--- +++ @@ -26,4 +26,4 @@ 0.1.3.dev0 -> 0.1.3 -> 0.1.4.dev0 -> ... """ -DSUB_VERSION = '0.3.8.dev0' +DSUB_VERSION = '0.3.8'
824b2de018ff41bc17c93c3e0e7135137438159c
crits/standards/forms.py
crits/standards/forms.py
from django import forms from crits.core.handlers import get_source_names from crits.core.user_tools import get_user_organization class UploadStandardsForm(forms.Form): """ Django form for uploading a standards document. """ error_css_class = 'error' required_css_class = 'required' filedata =...
from django import forms from crits.core.handlers import get_source_names from crits.core.user_tools import get_user_organization class UploadStandardsForm(forms.Form): """ Django form for uploading a standards document. """ error_css_class = 'error' required_css_class = 'required' filedata =...
Fix error in field type.
Fix error in field type. Should be a Char field, not a choice fie.d
Python
mit
davidhdz/crits,ckane/crits,ckane/crits,kaoscoach/crits,lakiw/cripts,blaquee/crits,ckane/crits,HardlyHaki/crits,korrosivesec/crits,dreardon/crits,0x3a/crits,Magicked/crits,cfossace/crits,davidhdz/crits,blaquee/crits,lakiw/cripts,seanthegeek/crits,jinverar/crits,lakiw/cripts,dreardon/crits,jhuapl-marti/marti,0x3a/crits,c...
--- +++ @@ -12,7 +12,7 @@ required_css_class = 'required' filedata = forms.FileField() source = forms.ChoiceField(required=True) - reference = forms.ChoiceField(required=False) + reference = forms.CharField(required=False) make_event = forms.BooleanField(required=False, label="Create event",...
446fe01898a89c4d6beea6ac85b2fbe642b87265
cross_platform_codecs.py
cross_platform_codecs.py
import sublime import sys class CrossPlaformCodecs(): @classmethod def decode_line(self, line): line = line.rstrip() decoded_line = self.force_decode(line) if sys.version_info >= (3, 0) else line return str(decoded_line) + "\n" @classmethod def force_decode(self, text): ...
import sublime import sys import re class CrossPlaformCodecs(): @classmethod def decode_line(self, line): line = line.rstrip() decoded_line = self.force_decode(line) if sys.version_info >= (3, 0) else line decoded_line = re.sub(r'\033\[(\d{1,2}m|\d\w)', '', str(decoded_line)) re...
Remove terminal Unicode Escape codes
Remove terminal Unicode Escape codes
Python
mit
nickgzzjr/sublime-gulp,NicoSantangelo/sublime-gulp,nickgzzjr/sublime-gulp,NicoSantangelo/sublime-gulp
--- +++ @@ -1,12 +1,14 @@ import sublime import sys +import re class CrossPlaformCodecs(): @classmethod def decode_line(self, line): line = line.rstrip() decoded_line = self.force_decode(line) if sys.version_info >= (3, 0) else line - return str(decoded_line) + "\n" + de...
312c386cda37b8d39c82c30739cdc7162a5035c7
util/versioncheck.py
util/versioncheck.py
#!/usr/bin/python from subprocess import check_output as co from sys import exit # Actually run bin/mn rather than importing via python path version = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True ) version = version.strip() # Find all Mininet path references lines = co( "grep -or 'Mininet \w\.\w\.\w[...
#!/usr/bin/python from subprocess import check_output as co from sys import exit # Actually run bin/mn rather than importing via python path version = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True ) version = version.strip() # Find all Mininet path references lines = co( "grep -or 'Mininet \w\+\.\w\+\...
Fix regex to support Mininet 20.30.40+++
Fix regex to support Mininet 20.30.40+++
Python
bsd-3-clause
mininet/mininet,mininet/mininet,mininet/mininet
--- +++ @@ -8,7 +8,7 @@ version = version.strip() # Find all Mininet path references -lines = co( "grep -or 'Mininet \w\.\w\.\w[\w\+]*' *", shell=True ) +lines = co( "grep -or 'Mininet \w\+\.\w\+\.\w\+[+]*' *", shell=True ) error = False
d2967110a2025c255dd496b85313c5c948b4150a
debuild/models/package.py
debuild/models/package.py
# Copyright (c) 2012 Paul Tagliamonte <paultag@debian.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modif...
# Copyright (c) 2012 Paul Tagliamonte <paultag@debian.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modif...
Move to a generator thinger.
Move to a generator thinger.
Python
mit
opencollab/debile-web,opencollab/debile-web,paultag/debuild.me,opencollab/debile-web,paultag/debuild.me
--- +++ @@ -19,6 +19,7 @@ # DEALINGS IN THE SOFTWARE. from debuild.models import DebuildDatabaseObject, db, strtype +from debuild.models.report import Report class Package(DebuildDatabaseObject): @@ -33,4 +34,5 @@ self._record = thing def reports(self): - return db.reports.find({"p...
788a8a203225756bd16084f32090bf825453dfa8
jupyter_nbconvert_config.py
jupyter_nbconvert_config.py
from jupyter_core.paths import jupyter_config_dir, jupyter_data_dir import os import sys sys.path.append(os.path.join(jupyter_data_dir(), 'extensions')) c = get_config() c.Exporter.template_path = [os.path.join(jupyter_data_dir(), 'templates') ]
from jupyter_core.paths import jupyter_config_dir, jupyter_data_dir import os import sys sys.path.append(os.path.join(jupyter_data_dir(), 'extensions')) c = get_config() c.Exporter.template_path = [ '.', os.path.join(jupyter_data_dir(), 'templates') ]
Add local path to exporter template path
Add local path to exporter template path
Python
bsd-3-clause
benvarkey/IPython-notebook-extensions,jbn/IPython-notebook-extensions,juhasch/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,andyneff/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,juhasch/IPython-notebook-extensions,ipython-contrib/IPython-noteb...
--- +++ @@ -5,5 +5,4 @@ sys.path.append(os.path.join(jupyter_data_dir(), 'extensions')) c = get_config() -c.Exporter.template_path = [os.path.join(jupyter_data_dir(), 'templates') ] - +c.Exporter.template_path = [ '.', os.path.join(jupyter_data_dir(), 'templates') ]
b91a7df56119c14c0d38f8c3654453d7e8e317d2
elm_format.py
elm_format.py
from __future__ import print_function import subprocess import re import sublime, sublime_plugin class ElmFormatCommand(sublime_plugin.TextCommand): def run(self, edit): command = "elm-format {} --yes".format(self.view.file_name()) p = subprocess.Popen(command, stdout=subprocess.PIPE, sterr=subprocess.PIPE, she...
from __future__ import print_function import subprocess import re import sublime, sublime_plugin class ElmFormatCommand(sublime_plugin.TextCommand): def run(self, edit): command = "elm-format {} --yes".format(self.view.file_name()) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, sh...
Fix decoding bug on log
Fix decoding bug on log
Python
mit
deadfoxygrandpa/Elm.tmLanguage,sekjun9878/Elm.tmLanguage,sekjun9878/Elm.tmLanguage,deadfoxygrandpa/Elm.tmLanguage
--- +++ @@ -8,12 +8,12 @@ class ElmFormatCommand(sublime_plugin.TextCommand): def run(self, edit): command = "elm-format {} --yes".format(self.view.file_name()) - p = subprocess.Popen(command, stdout=subprocess.PIPE, sterr=subprocess.PIPE, shell=True) + p = subprocess.Popen(command, stdout=subprocess.PIPE, st...
e1fc18a3b342023e4bb05dc2ffc77a5fc8cc9969
scipy/spatial/setupscons.py
scipy/spatial/setupscons.py
#!/usr/bin/env python from os.path import join def configuration(parent_package = '', top_path = None): from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs config = Configuration('cluster', parent_package, top_path) config.add_data_dir('tests') #config.add_extension('_vq', ...
#!/usr/bin/env python from os.path import join def configuration(parent_package = '', top_path = None): from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs config = Configuration('spatial', parent_package, top_path) config.add_data_dir('tests') #config.add_extension('_vq', ...
Update setup.py file for numscons build.
Update setup.py file for numscons build.
Python
bsd-3-clause
larsmans/scipy,zerothi/scipy,aman-iitj/scipy,rgommers/scipy,niknow/scipy,gertingold/scipy,sonnyhu/scipy,WillieMaddox/scipy,giorgiop/scipy,sriki18/scipy,vigna/scipy,bkendzior/scipy,sargas/scipy,gef756/scipy,Kamp9/scipy,FRidh/scipy,njwilson23/scipy,mortada/scipy,FRidh/scipy,maciejkula/scipy,aman-iitj/scipy,vanpact/scipy,...
--- +++ @@ -4,7 +4,7 @@ def configuration(parent_package = '', top_path = None): from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs - config = Configuration('cluster', parent_package, top_path) + config = Configuration('spatial', parent_package, top_path) config.add_data_...
fb7766a4155a229f31af0e33d1b2aedc1d2ff380
myip/views.py
myip/views.py
from flask import Blueprint, request, jsonify, render_template bp = Blueprint('views', __name__, url_prefix='') @bp.route('/ip', methods=['GET']) def get_ip(): return jsonify(ip=request.remote_addr) @bp.route('/', methods=['GET']) def index(): return render_template('index.html')
from flask import Blueprint, request, render_template bp = Blueprint('views', __name__, url_prefix='') @bp.route('/', methods=['GET']) def index(): return render_template('index.html', ip=request.remote_addr)
Remove json route for retrieving the ip.
Remove json route for retrieving the ip.
Python
mit
brotatos/myip,brotatos/myip
--- +++ @@ -1,14 +1,9 @@ -from flask import Blueprint, request, jsonify, render_template +from flask import Blueprint, request, render_template bp = Blueprint('views', __name__, url_prefix='') -@bp.route('/ip', methods=['GET']) -def get_ip(): - return jsonify(ip=request.remote_addr) - - @bp.route('/', me...
273f9842bbe407e2e4548c712fed8c709c29dd0a
examples/cassandra_db.py
examples/cassandra_db.py
"""Cassandra database example This example demonstrates connecting to a Cassandra database and executing a query. Note that using the database driver remains exactly the same. The only difference is that we're monkey-patching everything (including the Cassandra driver), making it guv-friendly. Adjust this example to...
"""Cassandra database example This example demonstrates connecting to a Cassandra database and executing a query. Note that using the database driver remains exactly the same. The only difference is that we're monkey-patching everything (including the Cassandra driver), making it guv-friendly. Adjust this example to...
Remove warning message (now fixed)
Remove warning message (now fixed)
Python
mit
veegee/guv,veegee/guv
--- +++ @@ -6,11 +6,13 @@ Adjust this example to your database address, keyspace, and query that you would like to run. """ +import guv + +guv.monkey_patch() + import logger + logger.configure() - -import guv -guv.monkey_patch() import logging @@ -30,7 +32,6 @@ for row in rows: log.info(row) ...
8aab29ad2a9f4d4b89ca3e1e54894ccc7a9a6c68
django_jinja/cache.py
django_jinja/cache.py
# -*- coding: utf-8 -*- import django from django.utils.functional import cached_property from jinja2 import BytecodeCache as _BytecodeCache class BytecodeCache(_BytecodeCache): """ A bytecode cache for Jinja2 that uses Django's caching framework. """ def __init__(self, cache_name): self._cac...
# -*- coding: utf-8 -*- import django from django.utils.functional import cached_property from jinja2 import BytecodeCache as _BytecodeCache class BytecodeCache(_BytecodeCache): """ A bytecode cache for Jinja2 that uses Django's caching framework. """ def __init__(self, cache_name): self._cac...
Remove unnecessary Django < 1.8 check
Remove unnecessary Django < 1.8 check Support for old Djangos was dropped in 4f9df0f7b764eda520b2f0428da798db02f66d97
Python
bsd-3-clause
akx/django-jinja,niwinz/django-jinja,akx/django-jinja,akx/django-jinja,niwinz/django-jinja,akx/django-jinja,niwinz/django-jinja
--- +++ @@ -14,12 +14,8 @@ @cached_property def backend(self): - if django.VERSION[:2] < (1, 8): - from django.core.cache import get_cache - return get_cache(self._cache_name) - else: - from django.core.cache import caches - return caches[self._cac...
61381417ff796bbb90ab3b17c366b700e8de1f7b
conjureup/controllers/credentials/tui.py
conjureup/controllers/credentials/tui.py
from conjureup import events, utils from conjureup.app_config import app from . import common class CredentialsController(common.BaseCredentialsController): def render(self): if app.provider.cloud_type == 'localhost': # no credentials required for localhost self.finish() e...
from conjureup import events, utils from conjureup.app_config import app from . import common class CredentialsController(common.BaseCredentialsController): def render(self): if app.provider.cloud_type == 'lxd': # no credentials required for localhost self.finish() elif no...
Correct cloud type checker in TUI for localhost
Correct cloud type checker in TUI for localhost Signed-off-by: Adam Stokes <49c255c1d074742f60d19fdba5e2aa5a34add567@users.noreply.github.com>
Python
mit
ubuntu/conjure-up,conjure-up/conjure-up,conjure-up/conjure-up,ubuntu/conjure-up,Ubuntu-Solutions-Engineering/conjure,Ubuntu-Solutions-Engineering/conjure
--- +++ @@ -6,7 +6,7 @@ class CredentialsController(common.BaseCredentialsController): def render(self): - if app.provider.cloud_type == 'localhost': + if app.provider.cloud_type == 'lxd': # no credentials required for localhost self.finish() elif not self.cred...
81a5997227cb9c8086b3cebf305e539eb2bf1990
daas.py
daas.py
from death_extractor import youtube as yt from death_extractor import set_interval from death_extractor import extract_and_upload def death_as_a_service(vid_path = 'vids', post_interval=3600*2, search_interval=3600*12, dl_interval=3600*6, max_downloads=5, to_imgur=True, to_tumblr=True): """Run periodic search/do...
import os from death_extractor import youtube as yt from death_extractor import set_interval from death_extractor import extract_and_upload def death_as_a_service(vid_path = 'vids', post_interval=3600*2, search_interval=3600*6, dl_interval=3600*3, max_downloads=4, to_imgur=True, to_tumblr=True): """Run periodic ...
Stop getting videos every time script starts
Stop getting videos every time script starts
Python
mit
BooDoo/death_extractor
--- +++ @@ -1,13 +1,15 @@ +import os from death_extractor import youtube as yt from death_extractor import set_interval from death_extractor import extract_and_upload -def death_as_a_service(vid_path = 'vids', post_interval=3600*2, search_interval=3600*12, dl_interval=3600*6, max_downloads=5, to_imgur=True, ...
31a15a6a1d698a9db403b106edb5023b8b1ad0b3
collector/classes/service.py
collector/classes/service.py
import string def sanitise_string(messy_str): """Whitelist characters in a string""" valid_chars = ' {0}{1}'.format(string.ascii_letters, string.digits) return u''.join(char for char in messy_str if char in valid_chars).strip() class Service(object): def __init__(self, numeric_id, detailed_data): ...
# -*- coding: utf-8 -*- import string def sanitise_string(messy_str): """Whitelist characters in a string""" valid_chars = ' {0}{1}'.format(string.ascii_letters, string.digits) return u''.join(char for char in messy_str if char in valid_chars).strip() class Service(object): def __init__(self, numeri...
Add a method to test whether an attribute exists
Add a method to test whether an attribute exists
Python
mit
alphagov/backdrop-transactions-explorer-collector,alphagov/backdrop-transactions-explorer-collector
--- +++ @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import string @@ -19,6 +20,9 @@ dept = self.abbreviated_department() return sanitise_string(u'{0} {1} {2}'.format(self.numeric_id, dept, service_title)) + def attribute_exists(self, key): + return key in self.detailed_data + def ...
cb97436aa76ffc65d4c6488ddac854eeca0dbd36
fullcalendar/admin.py
fullcalendar/admin.py
from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from mezzanine.core.admin import TabularDynamicInlineAdmin, DisplayableAdmin from fullcalendar.models import * class EventCategoryAdmin(admin.ModelAdmin): list_display = ('name',) class OccurrenceInline(TabularDynamicInlineA...
from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from mezzanine.core.admin import TabularDynamicInlineAdmin, DisplayableAdmin from fullcalendar.models import * class EventCategoryAdmin(admin.ModelAdmin): list_display = ('name',) class OccurrenceInline(TabularDynamicInlineA...
Reorder fields for occurence inline
Reorder fields for occurence inline
Python
mit
jonge-democraten/mezzanine-fullcalendar
--- +++ @@ -10,6 +10,8 @@ class OccurrenceInline(TabularDynamicInlineAdmin): model = Occurrence extra = 1 + + fields = ('start_time', 'end_time', 'description') class EventAdmin(DisplayableAdmin): list_display = ('title', 'event_category')
9d05f18dcb4b52c1d4e68f53f24e5ccebab10a58
bot/models.py
bot/models.py
from sqlalchemy import create_engine, Column, String from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() def db_connect(): """ Performs database connection Returns sqlalchemy engine instance """ return create_engine('postgres://avvcurseaphtxf:X0466JySVtLq6nyq_5pb7BQ...
from sqlalchemy import create_engine, Column, String from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() def db_connect(): """ Performs database connection Returns sqlalchemy engine instance """ return create_engine('postgres://fbcmeskynsvati:aURfAdENt6-kumO0j224GuX...
Change database url for create_engine()
Change database url for create_engine()
Python
mit
alexbotello/BastionBot
--- +++ @@ -10,9 +10,9 @@ Performs database connection Returns sqlalchemy engine instance """ - return create_engine('postgres://avvcurseaphtxf:X0466JySVtLq6nyq_5pb7BQNjR@' - 'ec2-54-227-250-80.compute-1.amazonaws.com' - ':5432/d7do67r1b7t1nn', echo=Fa...
80e4caad24bceabd8e15133a96a6aaddd9a97c07
code/type_null_true_false.py
code/type_null_true_false.py
def if_value(values): print('"if value":') for k, v in values: print("%s - %s" % (k, 'true' if v else 'false')) print() def nil_value(values): print('"if value is None":') for k, v in values: print("%s - %s" % (k, 'true' if v is None else 'false')) print() def empty_value(values): print('"if len...
def check(label, fn, values): print(label) for value in values: try: result = 'true' if fn(value) else 'false' except TypeError as e: result = 'error: %s' % e print(" %-9r - %s" % (value, result)) print() values = ['string', '', [1, 2, 3], [], 5, 0, True, Fa...
Refactor Null/True/False to look more pythonic
Refactor Null/True/False to look more pythonic
Python
mit
evmorov/lang-compare,Evmorov/ruby-coffeescript,evmorov/lang-compare,evmorov/lang-compare,Evmorov/ruby-coffeescript,evmorov/lang-compare,Evmorov/ruby-coffeescript,evmorov/lang-compare,evmorov/lang-compare
--- +++ @@ -1,35 +1,15 @@ -def if_value(values): - print('"if value":') - for k, v in values: - print("%s - %s" % (k, 'true' if v else 'false')) - print() +def check(label, fn, values): + print(label) + for value in values: + try: + result = 'true' if fn(value) else 'false' + exce...
927015af4717ffdb52f30f5b931dbba241e1c540
pixiv_hack.py
pixiv_hack.py
from lib.cls_crawl import PixivHackLib if __name__ == '__main__': print('Enter PHPSESSID:') PHPSESSID = raw_input() print('Enter keyword:') key_word = raw_input() print('Enter minimum ratings:') min_ratings = raw_input() print('Enter maximum number of illustrations to download:') max_pics = raw_input() print(...
from lib.cls_crawl import PixivHackLib if __name__ == '__main__': print('Enter PHPSESSID:') PHPSESSID = raw_input() print('Enter keyword:') key_word = raw_input() print('Enter minimum ratings:') min_ratings = raw_input() print('Enter maximum number of illustrations to download:') max_pics = raw_input() print(...
Fix bug: key_word not passed
Fix bug: key_word not passed
Python
mit
Chion82/PixivHack
--- +++ @@ -19,5 +19,5 @@ download_manga = False lib = PixivHackLib() lib.session_id = PHPSESSID - lib.config('kancolle', int(min_ratings), int(max_pics), download_manga) + lib.config(key_word, int(min_ratings), int(max_pics), download_manga) lib.crawl()
645cbd9a4445898f69b1ecd9f3db7d5e7b7b9dbd
libqtile/layout/__init__.py
libqtile/layout/__init__.py
from stack import Stack from max import Max from tile import Tile from floating import Floating from ratiotile import RatioTile from tree import TreeTab from slice import Slice
from stack import Stack from max import Max from tile import Tile from floating import Floating from ratiotile import RatioTile from tree import TreeTab from slice import Slice from xmonad import MonadTall
Add MonadTall to layout module proper.
Add MonadTall to layout module proper. Fixes #126
Python
mit
nxnfufunezn/qtile,qtile/qtile,de-vri-es/qtile,jdowner/qtile,tych0/qtile,w1ndy/qtile,soulchainer/qtile,rxcomm/qtile,flacjacket/qtile,w1ndy/qtile,ramnes/qtile,andrewyoung1991/qtile,frostidaho/qtile,himaaaatti/qtile,cortesi/qtile,encukou/qtile,himaaaatti/qtile,de-vri-es/qtile,kopchik/qtile,qtile/qtile,zordsdavini/qtile,St...
--- +++ @@ -5,3 +5,4 @@ from ratiotile import RatioTile from tree import TreeTab from slice import Slice +from xmonad import MonadTall
57c6c4108c949afb1e2ef682f980488a0d9610f4
project_fish/whats_fresh/tests/test_preparation_model.py
project_fish/whats_fresh/tests/test_preparation_model.py
from django.test import TestCase from django.conf import settings from phonenumber_field.modelfields import PhoneNumberField from whats_fresh.models import * from django.contrib.gis.db import models import os import time import sys import datetime class PreparationsTestCase(TestCase): def setUp(self): s...
from django.test import TestCase from django.conf import settings from phonenumber_field.modelfields import PhoneNumberField from whats_fresh.models import * from django.contrib.gis.db import models import os import time import sys import datetime class PreparationsTestCase(TestCase): def setUp(self): s...
Change unicode test string to ascii
Change unicode test string to ascii
Python
apache-2.0
osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api
--- +++ @@ -17,7 +17,7 @@ 'name': models.TextField, 'description': models.TextField, 'additional_info': models.TextField, - u'id': models.AutoField + 'id': models.AutoField } def test_fields_exist(self):
e99697b18c7ec6052ed161467197b0e86ed3603d
nbgrader/preprocessors/execute.py
nbgrader/preprocessors/execute.py
from nbconvert.preprocessors import ExecutePreprocessor from traitlets import Bool, List from . import NbGraderPreprocessor class Execute(NbGraderPreprocessor, ExecutePreprocessor): interrupt_on_timeout = Bool(True) allow_errors = Bool(True) extra_arguments = List(["--HistoryManager.hist_file=:memory:"])...
from nbconvert.preprocessors import ExecutePreprocessor from traitlets import Bool, List from textwrap import dedent from . import NbGraderPreprocessor class Execute(NbGraderPreprocessor, ExecutePreprocessor): interrupt_on_timeout = Bool(True) allow_errors = Bool(True) extra_arguments = List([], config=T...
Change options so other kernels work with nbgrader
Change options so other kernels work with nbgrader
Python
bsd-3-clause
ellisonbg/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader,jhamrick/nbgrader
--- +++ @@ -1,5 +1,6 @@ from nbconvert.preprocessors import ExecutePreprocessor from traitlets import Bool, List +from textwrap import dedent from . import NbGraderPreprocessor @@ -7,4 +8,16 @@ interrupt_on_timeout = Bool(True) allow_errors = Bool(True) - extra_arguments = List(["--HistoryManage...
9454bfa12e36cdab9bf803cf169c1d979bb27381
cmus_notify/notifications.py
cmus_notify/notifications.py
"""Contains code related to notifications.""" import notify2 from .constants import (DEFAULT_ICON_PATH, DEFAULT_TIMEOUT, ICONS_BY_STATUS) from .formatters import format_notification_message def send_notification(arguments, information): """Send the notification to...
"""Contains code related to notifications.""" from .constants import (DEFAULT_ICON_PATH, DEFAULT_TIMEOUT, ICONS_BY_STATUS) from .formatters import format_notification_message def send_notification(arguments, information): """Send the notification to the OS with a P...
Fix notify2 being imported with the module
Fix notify2 being imported with the module
Python
mit
AntoineGagne/cmus-notify
--- +++ @@ -1,6 +1,4 @@ """Contains code related to notifications.""" - -import notify2 from .constants import (DEFAULT_ICON_PATH, DEFAULT_TIMEOUT, @@ -14,6 +12,8 @@ :param arguments: The parsed arguments :param information: The various song informations """ + import not...
67733d8093980035ae4d212c8bf74fde9a59d983
manoseimas/settings/testing.py
manoseimas/settings/testing.py
from manoseimas.settings.base import * # noqa TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } WEBPACK_LOADER.update({ 'DEFAULT': { 'BUNDLE_DIR_NAME': 'bundles/', 'STATS_FILE': os.path.join(BUILD...
from manoseimas.settings.base import * # noqa TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } WEBPACK_LOADER.update({ 'DEFAULT': { 'BUNDLE_DIR_NAME': 'bundles/', 'STATS_FILE': os.path.join(BUILD...
Fix annoying database issue when running tests
Fix annoying database issue when running tests Now database name is taken from 'read_default_file' parameter which points to a my.cnf configuration, where database name should be defined. But this does not work when running tests for a single file, database name is set to 'test_', but when running all tests, then dat...
Python
agpl-3.0
ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt
--- +++ @@ -16,3 +16,8 @@ }) WEBPACK_COMMAND = ['npm', 'run', 'build:hot-reload'] + +# Database name should be taken from read_default_file, but that does not work +# with tests. Without database name running a single test gets 'test_' as +# database name. +DATABASES['default']['NAME'] = 'manoseimas'
cc93d6b9ade1d15236904978f012f91b0a9d567d
examples/manage.py
examples/manage.py
import logging from aio_manager import Manager from aioapp.app import build_application logging.basicConfig(level=logging.WARNING) app = build_application() manager = Manager(app) # To support SQLAlchemy commands, use this # # from aio_manager.commands.ext import sqlalchemy # sqlalchemy.configure_manager(manager, ap...
import logging from aio_manager import Manager from aioapp.app import build_application logging.basicConfig(level=logging.WARNING) app = build_application() manager = Manager(app) # To support SQLAlchemy commands, use this # # from aio_manager.commands.ext import sqlalchemy # [from aiopg.sa import create_engine] # s...
Update sqlalchemy command configuration example
Update sqlalchemy command configuration example
Python
bsd-3-clause
rrader/aio_manager
--- +++ @@ -10,11 +10,14 @@ # To support SQLAlchemy commands, use this # # from aio_manager.commands.ext import sqlalchemy +# [from aiopg.sa import create_engine] # sqlalchemy.configure_manager(manager, app, Base, # settings.DATABASE_USERNAME, +# settings...
e6b3d51d44d834f434cea5a688f636eb912c067d
infernoshout/utils.py
infernoshout/utils.py
import collections import http.cookies import logging class UniqueBuffer: """A simple deduplicating buffer. To add new items, manipulate self.items. The actual buffer is not limited in length, the `buflen` argument is used to specify the amount of items guaranteed to be unique.""" def __init__(self, b...
import collections import http.cookies import logging class UniqueBuffer: """A simple deduplicating buffer. To add new items, manipulate self.items. The actual buffer is not limited in length, the `buflen` argument is used to specify the amount of items guaranteed to be unique.""" def __init__(self, b...
Remove default buflen value in UniqueBuffer.__init__()
Remove default buflen value in UniqueBuffer.__init__()
Python
unlicense
tsudoko/infernoshout-py
--- +++ @@ -7,7 +7,7 @@ The actual buffer is not limited in length, the `buflen` argument is used to specify the amount of items guaranteed to be unique.""" - def __init__(self, buflen=21): + def __init__(self, buflen): self.items = [] self.old = collections.deque(maxlen=buflen)
0e8a17868731f459d15b754ac0d9cda5a4321a4a
tasks/check_einstein.py
tasks/check_einstein.py
import json from cumulusci.tasks.salesforce import BaseSalesforceApiTask class CheckPermSetLicenses(BaseSalesforceApiTask): task_options = { "permission_sets": { "description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)", "required": True, } ...
import json from cumulusci.tasks.salesforce import BaseSalesforceApiTask class CheckPermSetLicenses(BaseSalesforceApiTask): task_options = { "permission_sets": { "description": "List of permission set names to check for, (ex: EinsteinAnalyticsUser)", "required": True, } ...
Fix analytics template preflight check
Fix analytics template preflight check Returning from _run_task didn't work, and using ```python self.return_values = True ``` results in `return_values` being coerced to an empty dictionary that evaluates as False.
Python
bsd-3-clause
SalesforceFoundation/HEDAP,SalesforceFoundation/HEDAP,SalesforceFoundation/HEDAP
--- +++ @@ -13,7 +13,8 @@ def _run_task(self): query = self._get_query() result = self.tooling.query(query) - return result["size"] > 0 + if result["size"] > 0: + self.return_values["has_einstein_perms"] = True def _get_query(self): where_targets = [f"'{...
d3dbe3e9788c312c79d78d4292b0d2792605a3c4
setup.py
setup.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2010-2018 OneLogin, Inc. # MIT License from setuptools import setup setup( name='python-saml', version='2.4.1', description='Onelogin Python Toolkit. Add SAML support to your Python software using this library', classifiers=[ 'De...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2010-2018 OneLogin, Inc. # MIT License from setuptools import setup setup( name='python-saml', version='2.4.1', description='Onelogin Python Toolkit. Add SAML support to your Python software using this library', classifiers=[ 'De...
Update dm.xmlsec.binding dependency to 1.3.7
Update dm.xmlsec.binding dependency to 1.3.7
Python
mit
onelogin/python-saml,onelogin/python-saml
--- +++ @@ -32,7 +32,7 @@ }, test_suite='tests', install_requires=[ - 'dm.xmlsec.binding==1.3.3', + 'dm.xmlsec.binding==1.3.7', 'isodate>=0.5.0', 'defusedxml>=0.4.1', ],
4af38a7f96199e31b3e37a04bb630d307399aed7
setup.py
setup.py
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.1.1', packages=find_packages(), include_package_data=True, install_requires=[ ...
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.1.1', packages=find_packages(), include_package_data=True, install_requires=[ ...
Update future requirement from <0.18,>=0.16 to >=0.16,<0.19
Update future requirement from <0.18,>=0.16 to >=0.16,<0.19 Updates the requirements on [future](https://github.com/PythonCharmers/python-future) to permit the latest version. - [Release notes](https://github.com/PythonCharmers/python-future/releases) - [Changelog](https://github.com/PythonCharmers/python-future/blob/...
Python
apache-2.0
zooniverse/panoptes-python-client
--- +++ @@ -10,7 +10,7 @@ include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.23', - 'future>=0.16,<0.18', + 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9',
5ed65dbf5541fafbe2dca389a1fdda1c01c229d8
setup.py
setup.py
import os import sys import setuptools if sys.version_info[0] < 3: from codecs import open def local_file(name): return os.path.relpath(os.path.join(os.path.dirname(__file__), name)) README = local_file("README.rst") with open(local_file("src/stratis_cli/_version.py")) as o: exec(o.read()) setuptool...
import os import sys import setuptools if sys.version_info[0] < 3: from codecs import open def local_file(name): return os.path.relpath(os.path.join(os.path.dirname(__file__), name)) README = local_file("README.rst") with open(local_file("src/stratis_cli/_version.py")) as o: exec(o.read()) setuptool...
Update stratisd-client-dbus requirement to 0.07
Update stratisd-client-dbus requirement to 0.07 Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>
Python
apache-2.0
stratis-storage/stratis-cli,stratis-storage/stratis-cli
--- +++ @@ -37,7 +37,7 @@ 'Topic :: Systems Administration' ], install_requires = [ - 'stratisd-client-dbus>=0.06' + 'stratisd-client-dbus>=0.07' ], package_dir={"": "src"}, packages=setuptools.find_packages("src"),
04229ec331c0259a07f5d22a636b65aac60407f8
setup.py
setup.py
from distutils.core import setup def main(): setup( name = 'logging_levels', packages=['logging_levels'], package_dir = {'logging_levels':'logging_levels'}, version = open('VERSION.txt').read().strip(), author='Mike Thornton', author_email='six8@devdetails.com', ...
from distutils.core import setup def main(): setup( name = 'logging_levels', packages=['logging_levels'], package_dir = {'logging_levels':'logging_levels'}, version = open('VERSION.txt').read().strip(), author='Mike Thornton', author_email='six8@devdetails.com', ...
Add Trove classifiers for 2.x and 3.x
Add Trove classifiers for 2.x and 3.x
Python
mit
six8/logging-levels
--- +++ @@ -16,6 +16,12 @@ classifiers = [ "Programming Language :: Python", "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + ...
fdf68c774244c86d061bb095fdbddb943c4c653d
setup.py
setup.py
from setuptools import setup with open('requirements.txt') as f: required = f.read().splitlines() setup( name = 'heatmappy', packages = ['heatmappy'], version = '0.1', description = 'Draw image heatmaps in python', author = 'Lumen Research', author_email = 'development@lumen-research.com', url = 'h...
from setuptools import setup with open('requirements.txt') as f: required = f.read().splitlines() setup( name = 'heatmappy', packages = ['heatmappy'], version = '0.1.0', description = 'Draw image heatmaps in python', author = 'Lumen Research', author_email = 'development@lumen-research.com', url = ...
Make version compliant with pip
Make version compliant with pip
Python
mit
LumenResearch/heatmappy
--- +++ @@ -7,12 +7,12 @@ setup( name = 'heatmappy', packages = ['heatmappy'], - version = '0.1', + version = '0.1.0', description = 'Draw image heatmaps in python', author = 'Lumen Research', author_email = 'development@lumen-research.com', url = 'https://github.com/LumenResearch/heatmappy', - ...
447beba3ab1907c68514cb9a79f99fbf5568e9bf
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup(name='l1', version='0.1', description='L1', author='Bugra Akyildiz', author_email='vbugra@gmail.com', url='bugra.github.io', packages=['l1'], install_requires=['pandas==1.1.3', 'cvxopt==1.2.5.pos...
#!/usr/bin/env python from setuptools import setup setup(name='l1', version='0.1', description='L1', author='Bugra Akyildiz', author_email='vbugra@gmail.com', url='bugra.github.io', packages=['l1'], install_requires=['pandas==1.1.4', 'cvxopt==1.2.5.pos...
Bump pandas from 1.1.3 to 1.1.4
Bump pandas from 1.1.3 to 1.1.4 Bumps [pandas](https://github.com/pandas-dev/pandas) from 1.1.3 to 1.1.4. - [Release notes](https://github.com/pandas-dev/pandas/releases) - [Changelog](https://github.com/pandas-dev/pandas/blob/master/RELEASE.md) - [Commits](https://github.com/pandas-dev/pandas/compare/v1.1.3...v1.1.4)...
Python
apache-2.0
bugra/l1
--- +++ @@ -9,7 +9,7 @@ author_email='vbugra@gmail.com', url='bugra.github.io', packages=['l1'], - install_requires=['pandas==1.1.3', + install_requires=['pandas==1.1.4', 'cvxopt==1.2.5.post1', 'statsmodels==0.12.1', ...
3c8099a8fd577f825462ff4b23e47700af26f3d1
setup.py
setup.py
import os import shutil import sys from setuptools import setup from setuptools.command.install import install import bzt class InstallWithHook(install, object): """ Command adding post-install hook to setup """ def run(self): """ Do the command's job! """ install.run...
import os import shutil import sys from setuptools import setup from setuptools.command.install import install import bzt class InstallWithHook(install, object): """ Command adding post-install hook to setup """ def run(self): """ Do the command's job! """ install.run...
Update meta-info, first public package exposed
Update meta-info, first public package exposed
Python
apache-2.0
Nefry/taurus,arthurlogilab/taurus,greyfenrir/taurus,Blazemeter/taurus,Blazemeter/taurus,Blazemeter/taurus,Nefry/taurus,Nefry/taurus,arthurlogilab/taurus,Blazemeter/taurus,greyfenrir/taurus,greyfenrir/taurus,arthurlogilab/taurus,itaymendel/taurus,Nefry/taurus,itaymendel/taurus,arthurlogilab/taurus,greyfenrir/taurus,Blaz...
--- +++ @@ -1,9 +1,9 @@ import os import shutil import sys - from setuptools import setup from setuptools.command.install import install + import bzt @@ -33,6 +33,11 @@ setup( name="bzt", version=bzt.version, + description='Taurus Tool for Continuous Testing', + author='Andrey Pokhilko', + ...
c681b423dfbad1a7ef2f1a85f98f3ea278424f56
setup.py
setup.py
from setuptools import setup config = { 'name': 'timew-report', 'version': '0.0.0', 'description': 'An interface for TimeWarrior report data', 'author': 'Thomas Lauf', 'author_email': 'Thomas.Lauf@tngtech.com', 'license': 'MIT License', 'classifiers': [ 'Development Status :: 3 - Al...
from setuptools import setup config = { 'name': 'timew-report', 'version': '0.0.0', 'description': 'An interface for TimeWarrior report data', 'long_description': '\n' + open('README.md').read(), 'url': 'https://github.com/lauft/timew-report.git', 'author': 'Thomas Lauf', 'author_email': 'T...
Update long description and url
Update long description and url
Python
mit
lauft/timew-report
--- +++ @@ -4,6 +4,8 @@ 'name': 'timew-report', 'version': '0.0.0', 'description': 'An interface for TimeWarrior report data', + 'long_description': '\n' + open('README.md').read(), + 'url': 'https://github.com/lauft/timew-report.git', 'author': 'Thomas Lauf', 'author_email': 'Thomas.La...
d11e752bc6b3c573600ca916f4737e80a5a18bea
setup.py
setup.py
#! /usr/bin/env python import os from setuptools import setup, find_packages def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except IOError: return '' setup( name='djpl-emailing', version='0.1', description='a django-productline feature to i...
#! /usr/bin/env python import os from setuptools import setup, find_packages def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except IOError: return '' setup( name='djpl-emailing', version='0.1', description='a django-productline feature to i...
Set premailer version to 3.1.1
Set premailer version to 3.1.1
Python
mit
schnapptack/djpl-emailing,schnapptack/djpl-emailing
--- +++ @@ -32,7 +32,7 @@ 'Operating System :: OS Independent' ], install_requires=[ - 'django-productline', 'premailer==3.0.1' + 'django-productline', 'premailer==3.1.1' ] )
9e03ae0a7db5e98c8ee95e930c983d37442581c3
setup.py
setup.py
from setuptools import setup setup( name='feature-extraction', author='Liam Marshall', author_email='limarshall@wisc.edu', version='0.1', license='Apache', packages=['feature_extraction'], install_requires=['numpy', 'Pillow', 'Click'], entry_points=''' [console_scripts] extract_features=feature_extraction....
from setuptools import setup setup( name='feature-extraction', author='Liam Marshall', author_email='limarshall@wisc.edu', version='0.1', license='Apache', packages=['feature_extraction'], install_requires=['numpy', 'Pillow', 'Click', 'scikit-image'], entry_points=''' [console_scripts] extract_features=fea...
Add scikit-image as a dep
Add scikit-image as a dep
Python
apache-2.0
widoptimization-willett/feature-extraction
--- +++ @@ -8,7 +8,7 @@ license='Apache', packages=['feature_extraction'], - install_requires=['numpy', 'Pillow', 'Click'], + install_requires=['numpy', 'Pillow', 'Click', 'scikit-image'], entry_points=''' [console_scripts]
517742cbf787ad7ac09a518c34307ac3c2e561ba
setup.py
setup.py
from setuptools import setup, find_packages setup( name='rawdisk', author='D. Bakunas', version='0.1dev', description='Experimental python code to learn different disk formats', packages=find_packages(), license='LICENSE.txt', long_description=open('README.md').read(), install_requires=...
from setuptools import setup, find_packages setup( name='rawdisk', author='D. Bakunas', version='0.2dev', description='Experimental python code to learn different disk formats', packages=find_packages(), package_data = {'rawdisk.plugins.filesystems' : ['*.yapsy-plugin']}, license='LICENSE.t...
Make sure plugin configuration files are included
Make sure plugin configuration files are included
Python
bsd-3-clause
dariusbakunas/rawdisk
--- +++ @@ -3,9 +3,10 @@ setup( name='rawdisk', author='D. Bakunas', - version='0.1dev', + version='0.2dev', description='Experimental python code to learn different disk formats', packages=find_packages(), + package_data = {'rawdisk.plugins.filesystems' : ['*.yapsy-plugin']}, licen...
5f35af0e5ee1d0082978f2a3ae2ccd78a0ee33e3
setup.py
setup.py
from setuptools import setup, find_packages # pylint: disable=no-name-in-module,import-error def dependencies(file): with open(file) as f: return f.read().splitlines() with open("README.md", encoding='utf-8') as infile: long_description = infile.read() setup( name='halo', packages=find_pac...
import io from setuptools import setup, find_packages # pylint: disable=no-name-in-module,import-error def dependencies(file): with open(file) as f: return f.read().splitlines() with io.open("README.md", encoding='utf-8') as infile: long_description = infile.read() setup( name='halo', pack...
Use io.open to support Python 2
Use io.open to support Python 2
Python
mit
manrajgrover/halo,ManrajGrover/halo
--- +++ @@ -1,3 +1,4 @@ +import io from setuptools import setup, find_packages # pylint: disable=no-name-in-module,import-error @@ -6,7 +7,7 @@ return f.read().splitlines() -with open("README.md", encoding='utf-8') as infile: +with io.open("README.md", encoding='utf-8') as infile: long_descrip...
8b9b25dcc0b906d70dd632898146ffaad0bc57fb
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' The setup script for napalm-logs ''' import uuid from setuptools import setup, find_packages from pip.req import parse_requirements __author__ = 'Mircea Ulinic <mircea.ulinic@gmail.com>' install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' The setup script for napalm-logs ''' import uuid from setuptools import setup, find_packages from pip.req import parse_requirements __author__ = 'Mircea Ulinic <mircea.ulinic@gmail.com>' install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs...
Set dev version and link CLI script
Set dev version and link CLI script
Python
apache-2.0
napalm-automation/napalm-logs,napalm-automation/napalm-logs
--- +++ @@ -15,7 +15,7 @@ setup( name='napalm-logs', - version='0.1.0', + version='0.0.1a0.dev5', packages=find_packages(), author='Mircea Ulinic', author_email='mircea.ulinic@gmail.com', @@ -36,6 +36,7 @@ install_requires=reqs, entry_points={ 'console_scripts': [ + ...
d3c59843fad8671b8e262b29b83d4f2a66bfe493
setup.py
setup.py
from setuptools import setup setup( name='kibana', packages=['kibana'], version='0.6', description='Kibana configuration index (.kibana) command line interface and python API (visualization import/export and mappings refresh)', author='Ryan Farley', author_email='rfarley@mitre.org', url='ht...
from setuptools import setup setup( name='kibana', packages=['kibana'], version='0.7', description='Kibana configuration index (.kibana) command line interface and python API (visualization import/export and mappings refresh)', author='Ryan Farley', author_email='rfarley@mitre.org', url='ht...
Fix download_url, ver bump to coordinate
Fix download_url, ver bump to coordinate
Python
mit
rfarley3/Kibana
--- +++ @@ -3,12 +3,12 @@ setup( name='kibana', packages=['kibana'], - version='0.6', + version='0.7', description='Kibana configuration index (.kibana) command line interface and python API (visualization import/export and mappings refresh)', author='Ryan Farley', author_email='rfarle...
e45f056e92c7e5b2956072f7f2985ce1f7d213ed
setup.py
setup.py
from setuptools import setup def readme(): with open('README.md') as f: return f.read() setup(name='riboutils', version='0.1', description="This package contains utilities for other ribosome profiling projects.", long_description=readme(), keywords="ribosome profiling utili...
from setuptools import setup console_scripts = [ 'extract-metagene-profiles=riboutils.extract_metagene_profiles:main', 'estimate-metagene-profile-bayes-factors=riboutils.estimate_metagene_profile_bayes_factors:main', 'select-periodic-offsets=riboutils.select_periodic_offsets:main' ] def readme(): with...
FIX moved bio script to misc.bio_utils
FIX moved bio script to misc.bio_utils
Python
mit
dieterich-lab/riboseq-utils
--- +++ @@ -1,4 +1,10 @@ from setuptools import setup + +console_scripts = [ + 'extract-metagene-profiles=riboutils.extract_metagene_profiles:main', + 'estimate-metagene-profile-bayes-factors=riboutils.estimate_metagene_profile_bayes_factors:main', + 'select-periodic-offsets=riboutils.select_periodic_offset...
01d2d7abbb0ba949760af6eb70a7b101df09a50a
setup.py
setup.py
# import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215) import multiprocessing assert multiprocessing import re from setuptools import setup, find_packages def get_version(): """ Extracts the version number from the version.py file. """ VERSION_FILE = 'entity_emailer/v...
# import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215) import multiprocessing assert multiprocessing import re from setuptools import setup, find_packages def get_version(): """ Extracts the version number from the version.py file. """ VERSION_FILE = 'entity_emailer/v...
Add freezegun requirement for tests.
Add freezegun requirement for tests.
Python
mit
ambitioninc/django-entity-emailer,ambitioninc/django-entity-emailer,wesleykendall/django-entity-emailer,wesleykendall/django-entity-emailer
--- +++ @@ -41,10 +41,11 @@ 'celery>=3.1', ], tests_require=[ + 'django-dynamic-fixture', 'django-nose', + 'freezegun', + 'mock', 'south', - 'mock', - 'django-dynamic-fixture' ], test_suite='run_tests.run_tests', include_package_da...
e99aa7ecb281675134efd0ff8a0cd9dfb53731b0
setup.py
setup.py
from setuptools import setup from setuptools import find_packages from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #im...
from setuptools import setup from setuptools import find_packages from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #im...
Increment rc version to rc3
Increment rc version to rc3
Python
bsd-3-clause
Eugeny/gevent-socketio,gutomaia/gevent-socketio,smurfix/gevent-socketio,bobvandevijver/gevent-socketio,arnuschky/gevent-socketio,kazmiruk/gevent-socketio,gutomaia/gevent-socketio,arnuschky/gevent-socketio,abourget/gevent-socketio,smurfix/gevent-socketio,gutomaia/gevent-socketio,theskumar-archive/gevent-socketio,yacneya...
--- +++ @@ -14,7 +14,7 @@ setup( name="gevent-socketio", - version="0.3.5-rc2", + version="0.3.5-rc3", description=( "SocketIO server based on the Gevent pywsgi server, " "a Python network library"),
0c76289835e31b6f92e550745002730e1e7efaf2
setup.py
setup.py
from setuptools import setup setup( name = 'PyFVCOM', packages = ['PyFVCOM'], version = '2.1.0', description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."), author = 'Pierre Cazenave', author_email =...
from setuptools import setup setup( name = 'PyFVCOM', packages = ['PyFVCOM'], version = '2.1.0', description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."), author = 'Pierre Cazenave', author_email =...
Update the numpy requirement since we use numpy.isin, which is only available in numpy 1.13.0 onwards.
Update the numpy requirement since we use numpy.isin, which is only available in numpy 1.13.0 onwards.
Python
mit
pwcazenave/PyFVCOM
--- +++ @@ -12,7 +12,7 @@ keywords = ['fvcom', 'unstructured grid', 'mesh'], license = 'MIT', platforms = 'any', - install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy>=1.10.0', 'matplotlib', 'netCDF4', 'lxml', 'pyproj', 'pytz', 'networkx', 'UTide', 'pandas', 'cmocean'], + install_requires = ['p...
ccccb43aafd87bf77961dfe1fb25e00c63255cd1
setup.py
setup.py
#!/usr/bin/env python from codecs import open from setuptools import find_packages, setup with open('README.rst', 'r', 'utf-8') as f: readme = f.read() setup( name='blanc-contentfiles', version='0.2.4', description='Blanc Content Files', long_description=readme, url='https://github.com/deve...
#!/usr/bin/env python from codecs import open from setuptools import find_packages, setup with open('README.rst', 'r', 'utf-8') as f: readme = f.read() setup( name='blanc-contentfiles', version='0.2.4', description='Blanc Content Files', long_description=readme, url='https://github.com/deve...
Update supported Python and Django versions
Update supported Python and Django versions
Python
bsd-3-clause
blancltd/blanc-contentfiles
--- +++ @@ -21,16 +21,18 @@ classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', + 'Framework :: Django :: 1.8', + 'Framework :: Django :: 1.11', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programmi...
0ce6ea2ca75c3839b0a1e41f0fa32e5a9816f653
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup def read(name): from os import path return open(path.join(path.dirname(__file__), name)).read() setup( name='django-facebook-auth', version='3.3.3', description="Authorisation app for Facebook API.", long_description=read("README.rst"), ...
#!/usr/bin/env python from distutils.core import setup def read(name): from os import path return open(path.join(path.dirname(__file__), name)).read() setup( name='django-facebook-auth', version='3.3.4', description="Authorisation app for Facebook API.", long_description=read("README.rst"), ...
Add management commands to package.
Add management commands to package. Change-Id: I6c35981fbe47639e72066ddd802eb4d4d4d2d4a0 Reviewed-on: http://review.pozytywnie.pl:8080/19737 Reviewed-by: Jan <14e793d896ddc8ca6911747228e86464cf420065@pozytywnie.pl> Tested-by: Jenkins
Python
mit
jgoclawski/django-facebook-auth,jgoclawski/django-facebook-auth,pozytywnie/django-facebook-auth,pozytywnie/django-facebook-auth
--- +++ @@ -8,7 +8,7 @@ setup( name='django-facebook-auth', - version='3.3.3', + version='3.3.4', description="Authorisation app for Facebook API.", long_description=read("README.rst"), maintainer="Tomasz Wysocki", @@ -23,5 +23,7 @@ packages=[ 'facebook_auth', 'face...
b7a9e79a80d1be827c803308c0abd651920c0b83
setup.py
setup.py
import os.path try: from setuptools import setup except ImportError: from distutils.core import setup ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) README_FILE = os.path.join(ROOT_DIR, "README.rst") with open(README_FILE) as f: long_description = f.read() setup( name="xutils", version="1...
import os.path try: from setuptools import setup except ImportError: from distutils.core import setup ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) README_FILE = os.path.join(ROOT_DIR, "README.rst") with open(README_FILE) as f: long_description = f.read() setup( name="xutils", version="1...
Set the version to 1.2.0
Set the version to 1.2.0
Python
mit
xgfone/xutils,xgfone/pycom
--- +++ @@ -13,7 +13,7 @@ setup( name="xutils", - version="1.1.0", + version="1.2.0", description="A Fragmentary Python Library, no any third-part dependencies.", long_description=long_description, author="xgfone",
b6c743d9b3d94b9875b5475f7f567fe15c5cb024
setup.py
setup.py
from reviewboard.extensions.packaging import setup GITHUB_URL = 'https://github.com/joshguffin/rboard_bugzilla' VERSION = "0.1" PACKAGE = 'rboard_bugzilla' EXTENSION = '{0} = {0}.extension:BugzillaExtension'.format(PACKAGE), setup( name=PACKAGE, version=VERSION, description='Post to BZs', url=GITHUB_U...
from reviewboard.extensions.packaging import setup GITHUB_URL = 'https://github.com/joshguffin/rboard_bugzilla' VERSION = "0.1" PACKAGE = 'rboard_bugzilla' EXTENSION = '{0} = {0}.extension:BugzillaExtension'.format(PACKAGE), setup( name=PACKAGE, version=VERSION, description='Post to BZs', url=GITHUB_U...
Remove reviewboard requirement; can cause unexpected updates
Remove reviewboard requirement; can cause unexpected updates
Python
mit
joshguffin/rboard_bugzilla
--- +++ @@ -13,6 +13,6 @@ author='Josh Guffin', author_email='josh.guffin@gmail.com', packages=[PACKAGE], - install_requires=['bugzillatools>=0.4', 'ReviewBoard>=2.0.3'], + install_requires=['bugzillatools>=0.4'], entry_points={'reviewboard.extensions': [EXTENSION]} )
bec98cca8a765743cf990f5807f5d52b95dd5d9e
setup.py
setup.py
#!/usr/bin/env python3 # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('glooey/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('REA...
#!/usr/bin/env python3 # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('glooey/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('REA...
Add debugtools as a dependency.
Add debugtools as a dependency.
Python
mit
kxgames/glooey,kxgames/glooey
--- +++ @@ -31,6 +31,7 @@ 'more_itertools', 'vecrec', 'autoprop', + 'debugtools', ], license='MIT', zip_safe=False,
ae6911c3be172d2d163ddbfb27e90e97b7c61684
setup.py
setup.py
from distutils.core import setup setup(name='jupyter_c_kernel', version='1.0', description='Minimalistic C kernel for Jupyter', author='Brendan Rius', author_email='ping@brendan-rius.com', packages=['jupyter_c_kernel'], keywords=['jupyter', 'kernel', 'c'] )
from distutils.core import setup setup(name='jupyter_c_kernel', version='1.0.0', description='Minimalistic C kernel for Jupyter', author='Brendan Rius', author_email='ping@brendan-rius.com', packages=['jupyter_c_kernel'], keywords=['jupyter', 'kernel', 'c'] )
Change version from 1.0 to 1.0.0
Change version from 1.0 to 1.0.0
Python
mit
ZedThree/jupyter-fortran-kernel
--- +++ @@ -1,7 +1,7 @@ from distutils.core import setup setup(name='jupyter_c_kernel', - version='1.0', + version='1.0.0', description='Minimalistic C kernel for Jupyter', author='Brendan Rius', author_email='ping@brendan-rius.com',
7947136954606b91ebf18872b24c50fef6d0c975
setup.py
setup.py
import re from setuptools import setup # get version without importing with open("extra_views/__init__.py", "rb") as f: VERSION = str(re.search('__version__ = "(.+?)"', f.read().decode("utf-8")).group(1)) setup( name="django-extra-views", version=VERSION, url="https://github.com/AndrewIngram/django-e...
import re from setuptools import setup # get version without importing with open("extra_views/__init__.py", "rb") as f: VERSION = str(re.search('__version__ = "(.+?)"', f.read().decode("utf-8")).group(1)) setup( name="django-extra-views", version=VERSION, url="https://github.com/AndrewIngram/django-e...
Add license to trove classifiers.
Add license to trove classifiers.
Python
mit
AndrewIngram/django-extra-views,AndrewIngram/django-extra-views
--- +++ @@ -22,6 +22,7 @@ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language ...
1c0302c7137af550314b05f6e3cc87134c9bdc65
flaskrst/modules/staticpages/__init__.py
flaskrst/modules/staticpages/__init__.py
# -*- coding: utf-8 -*- """ flask-rst.modules.staticfiles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by Christoph Heer. :license: BSD, see LICENSE for more details. """ import os from flask import Blueprint, current_app, render_template from flaskrst.parsers import rstDocument static_pages =...
# -*- coding: utf-8 -*- """ flask-rst.modules.staticfiles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by Christoph Heer. :license: BSD, see LICENSE for more details. """ from flask import Blueprint, current_app, render_template, safe_join from flaskrst.parsers import rstDocument staticpages = ...
Rename blueprint static_pages to staticpages and rename staticpages.show to staticpages.page
Rename blueprint static_pages to staticpages and rename staticpages.show to staticpages.page
Python
bsd-3-clause
jarus/flask-rst
--- +++ @@ -7,22 +7,19 @@ :license: BSD, see LICENSE for more details. """ -import os - -from flask import Blueprint, current_app, render_template +from flask import Blueprint, current_app, render_template, safe_join from flaskrst.parsers import rstDocument -static_pages = Blueprint('static_pages', __name_...
eea0f026a8fed261283c081d7bc447ec480ff6e5
tasks.py
tasks.py
#!/usr/bin/env python3 import subprocess from invoke import task @task def test(): # invoke.run() does not color output, unfortunately nosetests = subprocess.Popen(['nosetests', '--rednose']) nosetests.wait() @task def cover(): nosetests = subprocess.Popen(['nosetests', '--with-coverage', ...
#!/usr/bin/env python3 import os import subprocess from invoke import task @task def test(): # invoke.run() does not respect colored output, unfortunately nosetests = subprocess.Popen(['nosetests', '--rednose']) nosetests.wait() @task def cover(): try: os.mkdir('cover') except OSError: ...
Fix bug that raised error when generating coverage
Fix bug that raised error when generating coverage
Python
mit
caleb531/ssh-wp-backup,caleb531/ssh-wp-backup
--- +++ @@ -1,18 +1,23 @@ #!/usr/bin/env python3 +import os import subprocess from invoke import task @task def test(): - # invoke.run() does not color output, unfortunately + # invoke.run() does not respect colored output, unfortunately nosetests = subprocess.Popen(['nosetests', '--rednose']) ...
ba115c2087b7fc5b07073ee42af6e2548d462245
scripts/scripts/current_track.py
scripts/scripts/current_track.py
import subprocess def main(): st = subprocess.getoutput("mpc") lin = st.split("\n") if len(lin) > 1: sn_status = lin[1] duration = lin[1].split() if "paused" in sn_status: print(lin[0].split("-")[-1] + " [paused]") elif "playing" in sn_status: print(...
import subprocess def text_split(text): new_text = text.split() new_text_len = len(new_text) if new_text_len < 2: return new_text[0] elif new_text_len == 2: return text else: return " ".join(new_text[0:2]) + "..." def main(): st = subprocess.getoutput("mpc") lin = ...
Use `spotify-now` to get current song info in i3blocks
[track] Use `spotify-now` to get current song info in i3blocks
Python
mit
iAmMrinal0/dotfiles,iAmMrinal0/dotfiles
--- +++ @@ -1,5 +1,15 @@ import subprocess + +def text_split(text): + new_text = text.split() + new_text_len = len(new_text) + if new_text_len < 2: + return new_text[0] + elif new_text_len == 2: + return text + else: + return " ".join(new_text[0:2]) + "..." def main(): s...
5ebd910a5665402b68e50f540d8480d8c3bd4e64
pyflation/analysis/deltaprel.py
pyflation/analysis/deltaprel.py
''' pyflation.analysis.deltaprel - Module to calculate relative pressure perturbations. Author: Ian Huston For license and copyright information see LICENSE.txt which was distributed with this file. '''
''' pyflation.analysis.deltaprel - Module to calculate relative pressure perturbations. Author: Ian Huston For license and copyright information see LICENSE.txt which was distributed with this file. ''' def soundspeeds(Vphi, phidot, H): """Sound speeds of the background fields Arguments --------- ...
Add outlines of functions and code for soundspeeds.
Add outlines of functions and code for soundspeeds.
Python
bsd-3-clause
ihuston/pyflation,ihuston/pyflation
--- +++ @@ -5,3 +5,50 @@ For license and copyright information see LICENSE.txt which was distributed with this file. ''' + +def soundspeeds(Vphi, phidot, H): + """Sound speeds of the background fields + + Arguments + --------- + Vphi: array_like + First derivative of the potential with re...
ce9d547af419ec46c1e659a0ca630a752e59e01c
pombola/south_africa/views/constants.py
pombola/south_africa/views/constants.py
# For requests to external APIs, timeout after 3 seconds: API_REQUESTS_TIMEOUT = 3.05
# For requests to external APIs, timeout after 3 seconds: API_REQUESTS_TIMEOUT = 6.05
Increase the PMG API timeout, since it's slow at the moment
Increase the PMG API timeout, since it's slow at the moment
Python
agpl-3.0
mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola
--- +++ @@ -1,2 +1,2 @@ # For requests to external APIs, timeout after 3 seconds: -API_REQUESTS_TIMEOUT = 3.05 +API_REQUESTS_TIMEOUT = 6.05
b612d7a6d67e999f96917de642230946ccf02106
qnd/experiment.py
qnd/experiment.py
import tensorflow as tf from .flag import FLAGS, FlagAdder from .estimator import def_estimator from .inputs import def_def_train_input_fn, def_def_eval_input_fn def def_def_experiment_fn(batch_inputs=True, prepare_filename_queues=True, distributed=False): adde...
import tensorflow as tf from .flag import FLAGS, FlagAdder from .estimator import def_estimator from .inputs import def_def_train_input_fn, def_def_eval_input_fn def def_def_experiment_fn(batch_inputs=True, prepare_filename_queues=True, distributed=False): adde...
Fix help message of --min_eval_frequency flag
Fix help message of --min_eval_frequency flag
Python
unlicense
raviqqe/tensorflow-qnd,raviqqe/tensorflow-qnd
--- +++ @@ -16,8 +16,7 @@ help="Maximum number of {} steps".format(mode)) adder.add_flag("min_eval_frequency", type=int, default=1, - help="Minimum evaluation frequency in number of model " - "savings") + help="Minimum evaluatio...
2a8816e07eec2cfc4680c76c1c5e080a78f149b4
etc/bin/xcode_bot_script.py
etc/bin/xcode_bot_script.py
# This script should be copied into the Run Script trigger of an Xcode Bot # `Xcode Bot > Edit Bot > Triggers > After Integration > Run Script`
# This script should be copied into the Run Script trigger of an Xcode Bot # `Xcode Bot > Edit Bot > Triggers > After Integration > Run Script` # Utilizes `cavejohnson` for various integrations # https://github.com/drewcrawford/CaveJohnson #!/bin/bash PATH=/Library/Frameworks/Python.framework/Versions/3.4/bin:$PATH ...
Add displaying integration status on GitHub
Add displaying integration status on GitHub
Python
bsd-3-clause
apptentive/apptentive-ios,sahara108/apptentive-ios,Jawbone/apptentive-ios,hibu/apptentive-ios,ALHariPrasad/apptentive-ios,apptentive/apptentive-ios,hibu/apptentive-ios,apptentive/apptentive-ios,hibu/apptentive-ios,sahara108/apptentive-ios,Jawbone/apptentive-ios,ALHariPrasad/apptentive-ios
--- +++ @@ -1,2 +1,18 @@ # This script should be copied into the Run Script trigger of an Xcode Bot # `Xcode Bot > Edit Bot > Triggers > After Integration > Run Script` + +# Utilizes `cavejohnson` for various integrations +# https://github.com/drewcrawford/CaveJohnson + +#!/bin/bash +PATH=/Library/Frameworks/Python...
e2aa41bb84984fea4c6b8ea475caf7f7af051dd9
gaphor/codegen/codegen.py
gaphor/codegen/codegen.py
#!/usr/bin/env python """The Gaphor code generator CLI. Provides the CLI for the code generator which transforms a Gaphor models (with .gaphor file extension) in to a data model in Python. """ import argparse from distutils.util import byte_compile from pathlib import Path from gaphor.codegen import profile_coder, u...
#!/usr/bin/env python """The Gaphor code generator CLI. Provides the CLI for the code generator which transforms a Gaphor models (with .gaphor file extension) in to a data model in Python. """ import argparse from distutils.util import byte_compile from pathlib import Path from gaphor.codegen import profile_coder, u...
Use positional argument to improve clarity
Use positional argument to improve clarity Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
Python
lgpl-2.1
amolenaar/gaphor,amolenaar/gaphor
--- +++ @@ -29,7 +29,9 @@ if args.uml_profile: profile_coder.generate(args.modelfile, args.outfile, args.overrides) elif args.sysml_profile: - profile_coder.generate(args.modelfile, args.outfile, args.overrides, True) + profile_coder.generate( + args.modelfile, args.outfile...
f5d00ed283da255b8cd2c82b36e19ab9504a7dd4
webmanager/management/commands/create_default_super_user.py
webmanager/management/commands/create_default_super_user.py
from django.core.management.base import BaseCommand from djangoautoconf.local_key_manager import get_local_key, ConfigurableAttributeGetter from web_manage_tools.user_creator import create_admin def create_default_admin(): super_username = get_local_key("admin_account.admin_username", "webmanager.keys_default") ...
from django.contrib.auth.models import User from django.core.management.base import BaseCommand from djangoautoconf.local_key_manager import get_local_key, ConfigurableAttributeGetter from web_manage_tools.user_creator import create_admin def create_default_admin(): super_username = get_local_key("admin_account....
Check before creating default super user.
Check before creating default super user.
Python
bsd-3-clause
weijia/webmanager,weijia/webmanager,weijia/webmanager
--- +++ @@ -1,3 +1,4 @@ +from django.contrib.auth.models import User from django.core.management.base import BaseCommand from djangoautoconf.local_key_manager import get_local_key, ConfigurableAttributeGetter @@ -7,9 +8,11 @@ def create_default_admin(): super_username = get_local_key("admin_account.admin_us...
106d56e734140d006a083965e55560a55e21e428
NGrams.py
NGrams.py
def generate_ngrams(text, n): ''' Generates all possible n-grams of a piece of text >>> text = 'this is a random piece' >>> n = 2 >>> generate_ngrams(text, n) this is is a a random random piece ''' text_array = text.split(' ') for i in range(0, len(text_array) - n + 1): ...
def generate_ngrams(text, n): ''' Generates all possible n-grams of a piece of text >>> text = 'this is a random piece' >>> n = 2 >>> generate_ngrams(text, n) this is is a a random random piece ''' text_array = text.split(' ') ngram_list = [] for i in range(0, len(te...
Return a list of lists
Return a list of lists
Python
bsd-2-clause
ambidextrousTx/RNLTK
--- +++ @@ -11,8 +11,11 @@ random piece ''' text_array = text.split(' ') + ngram_list = [] for i in range(0, len(text_array) - n + 1): - print text_array[i:i + n] + ngram_list.append(text_array[i:i + n]) + return ngram_list -generate_ngrams('this is a random piece', 2) -gener...
1157fb15f938aae8cfc10392fe816d691c3b41e7
todoist/managers/generic.py
todoist/managers/generic.py
# -*- coding: utf-8 -*- class Manager(object): # should be re-defined in a subclass state_name = None object_type = None def __init__(self, api): self.api = api # shortcuts @property def state(self): return self.api.state @property def queue(self): return...
# -*- coding: utf-8 -*- class Manager(object): # should be re-defined in a subclass state_name = None object_type = None def __init__(self, api): self.api = api # shortcuts @property def state(self): return self.api.state @property def queue(self): return...
Use the remote getter call only on objects with an object_type.
Use the remote getter call only on objects with an object_type.
Python
mit
Doist/todoist-python
--- +++ @@ -34,7 +34,7 @@ if obj['id'] == obj_id or obj.temp_id == str(obj_id): return obj - if not only_local: + if not only_local and self.object_type is not None: getter = getattr(self.api, 'get_%s' % self.object_type) return getter(obj_id)
aaaa20be61e96daf61e397fdf54dfaf6bec461e8
falcom/api/worldcat/data.py
falcom/api/worldcat/data.py
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from ..common import ReadOnlyDataStructure class WorldcatData (ReadOnlyDataStructure): @property def title (self): return s...
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from ..common import ReadOnlyDataStructure class WorldcatData (ReadOnlyDataStructure): auto_properties = ("title",) def __iter__ (...
Use new property format for WorldcatData
Use new property format for WorldcatData
Python
bsd-3-clause
mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation
--- +++ @@ -6,9 +6,7 @@ class WorldcatData (ReadOnlyDataStructure): - @property - def title (self): - return self.get("title") + auto_properties = ("title",) def __iter__ (self): return iter(self.get("libraries", ()))
0ff547915fc9de3d5edb80cc31a0f561453f3687
salt/returners/syslog_return.py
salt/returners/syslog_return.py
''' Return data to the host operating system's syslog facility Required python modules: syslog, json The syslog returner simply reuses the operating system's syslog facility to log return data ''' # Import python libs import syslog import json def __virtual__(): return 'syslog' def returner(ret): ''' ...
''' Return data to the host operating system's syslog facility Required python modules: syslog, json The syslog returner simply reuses the operating system's syslog facility to log return data ''' # Import python libs import syslog import json try: import syslog HAS_SYSLOG = True except ImportError: HAS_...
Check for syslog. Doesn't exist on Windows
Check for syslog. Doesn't exist on Windows
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
--- +++ @@ -10,9 +10,16 @@ # Import python libs import syslog import json +try: + import syslog + HAS_SYSLOG = True +except ImportError: + HAS_SYSLOG = False def __virtual__(): + if not HAS_SYSLOG: + return False return 'syslog'
791d378d1c5cb2e9729877bc70261b9354bdb590
testsuite/cases/pillow_rotate_right.py
testsuite/cases/pillow_rotate_right.py
# coding: utf-8 from __future__ import print_function, unicode_literals, absolute_import from PIL import Image from .base import rpartial from .pillow import PillowTestCase class RotateRightCase(PillowTestCase): def handle_args(self, name, transposition): self.name = name self.transposition = t...
# coding: utf-8 from __future__ import print_function, unicode_literals, absolute_import from PIL import Image from .base import rpartial from .pillow import PillowTestCase class RotateRightCase(PillowTestCase): def handle_args(self, name, transposition): self.name = name self.transposition = t...
Transpose and Transpose180 for all Pillow versions
Transpose and Transpose180 for all Pillow versions
Python
mit
python-pillow/pillow-perf,python-pillow/pillow-perf
--- +++ @@ -14,19 +14,25 @@ self.transposition = transposition def runner(self, im): - im.transpose(self.transposition) + for trans in self.transposition: + im = im.transpose(trans) def readable_args(self): return [self.name] cases = [ - rpartial(Rotate...
20df58bb9e605ecc53848ade31a3acb98118f00b
scripts/extract_clips_from_hdf5_file.py
scripts/extract_clips_from_hdf5_file.py
from pathlib import Path import wave import h5py DIR_PATH = Path('/Users/harold/Desktop/Clips') INPUT_FILE_PATH = DIR_PATH / 'Clips.h5' CLIP_COUNT = 5 def main(): with h5py.File(INPUT_FILE_PATH, 'r') as file_: clip_group = file_['clips'] for i, clip_id in enumerate(clip_group): ...
from pathlib import Path import wave import h5py DIR_PATH = Path('/Users/harold/Desktop/Clips') INPUT_FILE_PATH = DIR_PATH / 'Clips.h5' CLIP_COUNT = 5 def main(): with h5py.File(INPUT_FILE_PATH, 'r') as file_: clip_group = file_['clips'] for i, clip_id in enumerate(clip_group): ...
Add attribute display to clip extraction script.
Add attribute display to clip extraction script.
Python
mit
HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper
--- +++ @@ -20,19 +20,29 @@ if i == CLIP_COUNT: break - samples, sample_rate = read_clip(clip_group, clip_id) + samples, attributes = read_clip(clip_group, clip_id) - print(clip_id, len(samples), samples.dtype, sample_rate) + show_clip(clip...
73856ac73abd9dc68909a67077c016d003888cdd
credentials/apps/records/migrations/0006_auto_20180718_1256.py
credentials/apps/records/migrations/0006_auto_20180718_1256.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-07-17 20:02 from __future__ import unicode_literals from django.db import migrations from credentials.apps.catalog.models import Program from credentials.apps.records.models import ProgramCertRecord def seed_program_cert_records(apps, schema_editor): ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-07-17 20:02 from __future__ import unicode_literals from django.db import migrations from credentials.apps.catalog.models import Program from credentials.apps.records.models import ProgramCertRecord def seed_program_cert_records(apps, schema_editor): ...
Add site guarding for ProgramCertRecord data migration
Add site guarding for ProgramCertRecord data migration
Python
agpl-3.0
edx/credentials,edx/credentials,edx/credentials,edx/credentials
--- +++ @@ -10,7 +10,9 @@ def seed_program_cert_records(apps, schema_editor): for pcr in ProgramCertRecord.objects.all(): - pcr.program = Program.objects.get(uuid=pcr.certificate.program_uuid) + program_uuid = pcr.certificate.program_uuid + site = pcr.certificate.site + pcr.program...
b50c72ad6200cc9f96e1b9eda03fba5d2d4999b9
vesper/external_urls.py
vesper/external_urls.py
""" Functions that return external URLs, for example for the Vesper documentation. """ import vesper.version as vesper_version _USE_LATEST_DOCUMENTATION_VERSION = True """Set this `True` during development, `False` for release.""" def _create_documentation_url(): if _USE_LATEST_DOCUMENTATION_VERSION: ...
""" Functions that return external URLs, for example for the Vesper documentation. """ import vesper.version as vesper_version _USE_LATEST_DOCUMENTATION_VERSION = False """Set this `True` during development, `False` for release.""" def _create_documentation_url(): if _USE_LATEST_DOCUMENTATION_VERSION: ...
Change doc setting for release.
Change doc setting for release.
Python
mit
HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper
--- +++ @@ -6,7 +6,7 @@ import vesper.version as vesper_version -_USE_LATEST_DOCUMENTATION_VERSION = True +_USE_LATEST_DOCUMENTATION_VERSION = False """Set this `True` during development, `False` for release."""
b0e101f523fd853392e65b1b30204a56e3ec34ec
tests/test_twitter.py
tests/test_twitter.py
# -*- coding: utf-8 -*- import pytest import tweepy import vcr from secrets import TWITTER_ACCESS, TWITTER_SECRET from secrets import CONSUMER_KEY, CONSUMER_SECRET class TestTweepyIntegration(): """Test class to ensure tweepy functionality works as expected""" # Class level client to use across tests aut...
# -*- coding: utf-8 -*- import pytest import tweepy import vcr from secrets import TWITTER_ACCESS, TWITTER_SECRET from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET class TestTweepyIntegration(): """Test class to ensure tweepy functionality works as expected""" # Class level client to use a...
Update access token variable names
Update access token variable names
Python
mit
nestauk/inet
--- +++ @@ -4,13 +4,13 @@ import vcr from secrets import TWITTER_ACCESS, TWITTER_SECRET -from secrets import CONSUMER_KEY, CONSUMER_SECRET +from secrets import TWITTER_CONSUMER_ACCESS, TWITTER_CONSUMER_SECRET class TestTweepyIntegration(): """Test class to ensure tweepy functionality works as expected""...
d192bbc2f4e0d9d34c10b559a1007ebefd0ae7bc
kevin/playground/read.py
kevin/playground/read.py
"""Quick script to read inputs. """ if __name__ == '__main__': # Read the number of inputs num_inputs = int(input("How many inputs? ")) assert num_inputs > 3, "At least 3 please." print("Enter your {} inputs in the following form: inp1 inp2 ... inp{}".format( num_inputs, num_inputs)) a = li...
"""Quick script to read inputs. """ if __name__ == '__main__': # Read the number of inputs num_inputs = int(input("How many inputs? ")) assert num_inputs >= 3, "At least 3 please." print("Enter your {} inputs in the following form: inp1 inp2 ... inp{}".format( num_inputs, num_inputs)) a = l...
Fix bug with input number validation
Fix bug with input number validation - Want at least 3 inputs - Was forcing at least 4 - Change greater than to greater than or equal to
Python
mit
kalyons11/kevin,kalyons11/kevin
--- +++ @@ -4,7 +4,7 @@ if __name__ == '__main__': # Read the number of inputs num_inputs = int(input("How many inputs? ")) - assert num_inputs > 3, "At least 3 please." + assert num_inputs >= 3, "At least 3 please." print("Enter your {} inputs in the following form: inp1 inp2 ... inp{}".format(...
6cb215211bff754f531126ac44df03e761b3d7fc
pagerduty_events_api/tests/test_pagerduty_incident.py
pagerduty_events_api/tests/test_pagerduty_incident.py
from unittest import TestCase from unittest.mock import patch from pagerduty_events_api import PagerdutyIncident class TestPagerdutyIncident(TestCase): def setUp(self): super().setUp() self.__subject = PagerdutyIncident('my_service_key', 'my_incident_key') def test_get_service_key_should_ret...
from ddt import ddt, data, unpack from unittest import TestCase from unittest.mock import patch from pagerduty_events_api import PagerdutyIncident @ddt class TestPagerdutyIncident(TestCase): def setUp(self): super().setUp() self.__subject = PagerdutyIncident('my_service_key', 'my_incident_key') ...
Use data provider in PD incident tests.
Use data provider in PD incident tests.
Python
mit
BlasiusVonSzerencsi/pagerduty-events-api
--- +++ @@ -1,9 +1,12 @@ +from ddt import ddt, data, unpack + from unittest import TestCase from unittest.mock import patch from pagerduty_events_api import PagerdutyIncident +@ddt class TestPagerdutyIncident(TestCase): def setUp(self): super().setUp() @@ -15,22 +18,13 @@ def test_get_inc...
8bdf971c3ddbe6f106e788b5a2effebad6c30ec5
geotrek/settings/env_dev.py
geotrek/settings/env_dev.py
# # Django Development # .......................... DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # # Developper additions # .......................... INSTALLED_APPS = ( 'django_extensions', 'debug_toolbar', ) + INSTALLED_APPS INTERNAL_IPS = type(str('c'), (), {'__contains_...
# # Django Development # .......................... DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # # Developper additions # .......................... INSTALLED_APPS = ( 'django_extensions', 'debug_toolbar', 'drf_yasg', ) + INSTALLED_APPS INTERNAL_IPS = type(str('c'), (...
Add drf_yasg module for dev env
Add drf_yasg module for dev env
Python
bsd-2-clause
makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin
--- +++ @@ -13,6 +13,7 @@ INSTALLED_APPS = ( 'django_extensions', 'debug_toolbar', + 'drf_yasg', ) + INSTALLED_APPS INTERNAL_IPS = type(str('c'), (), {'__contains__': lambda *a: True})()
dbfe5fcb87762d68580756d6466bc61fa8ab4a56
histomicstk/preprocessing/color_deconvolution/utils.py
histomicstk/preprocessing/color_deconvolution/utils.py
import numpy from .stain_color_map import stain_color_map def get_stain_vector(args, index): """Get the stain corresponding to args.stain_$index and args.stain_$index_vector. If the former is not "custom", the latter must be None. """ args = vars(args) stain = args['stain_' + str(index)] ...
import numpy from .stain_color_map import stain_color_map def get_stain_vector(args, index): """Get the stain corresponding to args.stain_$index and args.stain_$index_vector. If the former is not "custom", the latter must be None. """ args = vars(args) stain = args['stain_' + str(index)] ...
Enhance get_stain_matrix to take any desired number of vectors
Enhance get_stain_matrix to take any desired number of vectors
Python
apache-2.0
DigitalSlideArchive/HistomicsTK,DigitalSlideArchive/HistomicsTK
--- +++ @@ -22,13 +22,13 @@ raise ValueError('Unless "custom" is chosen for a stain, ' 'no stain vector may be provided.') -def get_stain_matrix(args): +def get_stain_matrix(args, count=3): """Get the stain matrix corresponding to the args.stain_$index and - args.stain_$in...
05094307c2f49b7a6207ddaa049ac79e759c03da
lily/users/authentication/social_auth/providers/google.py
lily/users/authentication/social_auth/providers/google.py
from django.conf import settings from ..exceptions import InvalidProfileError from .base import BaseAuthProvider class GoogleAuthProvider(BaseAuthProvider): client_id = settings.SOCIAL_AUTH_GOOGLE_CLIENT_ID client_secret = settings.SOCIAL_AUTH_GOOGLE_SECRET scope = [ 'https://www.googleapis.com/a...
from django.conf import settings from ..exceptions import InvalidProfileError from .base import BaseAuthProvider class GoogleAuthProvider(BaseAuthProvider): client_id = settings.SOCIAL_AUTH_GOOGLE_CLIENT_ID client_secret = settings.SOCIAL_AUTH_GOOGLE_SECRET scope = [ 'openid', 'email', ...
Fix deprecation of social OAuth scopes
LILY-3349: Fix deprecation of social OAuth scopes
Python
agpl-3.0
HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily
--- +++ @@ -8,9 +8,9 @@ client_id = settings.SOCIAL_AUTH_GOOGLE_CLIENT_ID client_secret = settings.SOCIAL_AUTH_GOOGLE_SECRET scope = [ - 'https://www.googleapis.com/auth/plus.me', - 'https://www.googleapis.com/auth/userinfo.email', - 'https://www.googleapis.com/auth/userinfo.profil...
6ec656a4ab0a255bad85c3157a045849da001352
ggplot/utils/date_breaks.py
ggplot/utils/date_breaks.py
from matplotlib.dates import DayLocator, WeekdayLocator, MonthLocator, YearLocator def parse_break_str(txt): "parses '10 weeks' into tuple (10, week)." txt = txt.strip() if len(txt.split()) == 2: n, units = txt.split() else: n,units = 1, txt units = units.rstrip('s') # e.g. weeks =>...
from matplotlib.dates import MinuteLocator, HourLocator, DayLocator from matplotlib.dates import WeekdayLocator, MonthLocator, YearLocator def parse_break_str(txt): "parses '10 weeks' into tuple (10, week)." txt = txt.strip() if len(txt.split()) == 2: n, units = txt.split() else: n,unit...
Add more granular date locators
Add more granular date locators
Python
mit
has2k1/plotnine,has2k1/plotnine
--- +++ @@ -1,4 +1,5 @@ -from matplotlib.dates import DayLocator, WeekdayLocator, MonthLocator, YearLocator +from matplotlib.dates import MinuteLocator, HourLocator, DayLocator +from matplotlib.dates import WeekdayLocator, MonthLocator, YearLocator def parse_break_str(txt): "parses '10 weeks' into tuple (10, ...
ef62cec8673f255dd9ce909d23a877ba93bd6bf5
voidpp_tools/json_config.py
voidpp_tools/json_config.py
import os import json class JSONConfigLoader(): def __init__(self): self.sources = [ os.path.dirname(os.getcwd()), os.path.dirname(os.path.abspath(__file__)), os.path.expanduser('~'), '/etc', ] def load(self, filename): for source in sel...
import os import json class JSONConfigLoader(): def __init__(self, base_path): self.sources = [ os.path.dirname(os.getcwd()), os.path.dirname(os.path.abspath(base_path)), os.path.expanduser('~'), '/etc', ] def load(self, filename): tries...
Raise exception in case of config load error
Raise exception in case of config load error
Python
mit
voidpp/python-tools
--- +++ @@ -3,20 +3,22 @@ import json class JSONConfigLoader(): - def __init__(self): + def __init__(self, base_path): self.sources = [ os.path.dirname(os.getcwd()), - os.path.dirname(os.path.abspath(__file__)), + os.path.dirname(os.path.abspath(base_path)), ...
a48ae09ce927622e8a5931dbcb843523d8f4bd23
wagtail/tests/test_utils.py
wagtail/tests/test_utils.py
# -*- coding: utf-8 -* from __future__ import absolute_import, unicode_literals import warnings from django.test import SimpleTestCase from wagtail.utils.deprecation import RemovedInWagtail17Warning, SearchFieldsShouldBeAList class TestThisShouldBeAList(SimpleTestCase): def test_add_a_list(self): with ...
# -*- coding: utf-8 -* from __future__ import absolute_import, unicode_literals import warnings from django.test import SimpleTestCase from wagtail.utils.deprecation import RemovedInWagtail17Warning, SearchFieldsShouldBeAList class TestThisShouldBeAList(SimpleTestCase): def test_add_a_list(self): with ...
Reset warnings before testing warnings
Reset warnings before testing warnings
Python
bsd-3-clause
nimasmi/wagtail,torchbox/wagtail,mikedingjan/wagtail,kaedroho/wagtail,zerolab/wagtail,zerolab/wagtail,wagtail/wagtail,chrxr/wagtail,hamsterbacke23/wagtail,rsalmaso/wagtail,kurtrwall/wagtail,quru/wagtail,chrxr/wagtail,kaedroho/wagtail,Toshakins/wagtail,zerolab/wagtail,nealtodd/wagtail,nutztherookie/wagtail,Toshakins/wag...
--- +++ @@ -11,6 +11,8 @@ class TestThisShouldBeAList(SimpleTestCase): def test_add_a_list(self): with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always') + base = SearchFieldsShouldBeAList(['hello']) result = base + ['world'] @@ -23,6 +25...
a436470f00dddcb1764da6b6dc244e86bc71d473
gscripts/ipython_imports.py
gscripts/ipython_imports.py
import numpy as np import pandas as pd import matplotlib_venn import matplotlib.pyplot as plt import brewer2mpl import itertools set1 = brewer2mpl.get_map('Set1', 'qualitative', 9).mpl_colors red = set1[0] blue = set1[1] green = set1[2] purple = set1[3] orange = set1[4] yellow = set1[5] brown = set1[6] pink = set1[7] ...
import numpy as np import pandas as pd import matplotlib_venn import matplotlib.pyplot as plt import brewer2mpl import itertools import seaborn as sns import collections import itertools set1 = brewer2mpl.get_map('Set1', 'qualitative', 9).mpl_colors red = set1[0] blue = set1[1] green = set1[2] purple = set1[3] orange ...
Add seaborn, collections, itertools to IPython imports
Add seaborn, collections, itertools to IPython imports
Python
mit
YeoLab/gscripts,YeoLab/gscripts,YeoLab/gscripts,YeoLab/gscripts
--- +++ @@ -3,6 +3,9 @@ import matplotlib_venn import matplotlib.pyplot as plt import brewer2mpl +import itertools +import seaborn as sns +import collections import itertools set1 = brewer2mpl.get_map('Set1', 'qualitative', 9).mpl_colors
5f56b2094180eb1b6922b58aece611e26ce5d1df
packages/reward-root-submitter/reward_root_submitter/lambda.py
packages/reward-root-submitter/reward_root_submitter/lambda.py
import logging import urllib import sentry_sdk from cloudpathlib import AnyPath from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration from .config import Config from .main import get_all_unsubmitted_roots, process_file, setup_logging config = Config() setup_logging(config) sentry_sdk.init( dsn=con...
import logging import urllib import sentry_sdk from cloudpathlib import AnyPath from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration from .config import Config from .main import get_all_unsubmitted_roots, process_file, setup_logging config = Config() setup_logging(config) sentry_sdk.init( dsn=con...
Fix event source for S3 put events
Fix event source for S3 put events
Python
mit
cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack
--- +++ @@ -27,7 +27,7 @@ unsubmitted_roots = get_all_unsubmitted_roots(config) for index, row in unsubmitted_roots.iterrows(): process_file(row["file"], config) - elif event["Records"][0]["eventSource"] == "aws.s3": + elif event["Records"][0]["eventSource"] == "aws:s3": ...
7fb1212ab97bca6301d9826258a594f8935bba28
mopidy_ttsgpio/tts.py
mopidy_ttsgpio/tts.py
import urllib import gst music_level = 30 class TTS(): def __init__(self, frontend, config): self.frontend = frontend self.player = gst.element_factory_make("playbin", "tts") output = gst.parse_bin_from_description(config['audio']['output'], ...
import os from threading import Thread music_level = 30 class TTS(): def __init__(self, frontend, config): self.frontend = frontend def speak_text(self, text): t = Thread(target=self.speak_text_thread, args=(text,)) t.start() def speak_text_thread(self, text): os.system...
Change from Google TTS to Festival
Change from Google TTS to Festival
Python
apache-2.0
9and3r/mopidy-ttsgpio
--- +++ @@ -1,6 +1,5 @@ -import urllib - -import gst +import os +from threading import Thread music_level = 30 @@ -9,24 +8,10 @@ def __init__(self, frontend, config): self.frontend = frontend - self.player = gst.element_factory_make("playbin", "tts") - output = gst.parse_bin_from_de...
6da0aaf77fe221286981b94eaf7d304568f55957
examples/stories/movie_lister/movies/__init__.py
examples/stories/movie_lister/movies/__init__.py
"""Movies package. Top-level package of movies library. This package contains catalog of movies module components - ``MoviesModule``. It is recommended to use movies library functionality by fetching required instances from ``MoviesModule`` providers. Each of ``MoviesModule`` providers could be overridden. """ from ...
"""Movies package. Top-level package of movies library. This package contains catalog of movies module components - ``MoviesModule``. It is recommended to use movies library functionality by fetching required instances from ``MoviesModule`` providers. Each of ``MoviesModule`` providers could be overridden. """ from ...
Update imports for MovieLister standrard module
Update imports for MovieLister standrard module
Python
bsd-3-clause
rmk135/objects,ets-labs/python-dependency-injector,ets-labs/dependency_injector,rmk135/dependency_injector
--- +++ @@ -7,12 +7,12 @@ Each of ``MoviesModule`` providers could be overridden. """ +from dependency_injector import catalogs +from dependency_injector import providers + from . import finders from . import listers from . import models - -from dependency_injector import catalogs -from dependency_injector imp...
9167d5e85d618d1786c8c72eb1eb0cb2f23a8043
backdrop/write/config/development_environment_sample.py
backdrop/write/config/development_environment_sample.py
# Copy this file to development_environment.py # and replace OAuth credentials your dev credentials TOKENS = { '_foo_bucket': '_foo_bucket-bearer-token', 'bucket': 'bucket-bearer-token', 'foo': 'foo-bearer-token', 'foo_bucket': 'foo_bucket-bearer-token', 'licensing': 'licensing-bearer-token', 'l...
# Copy this file to development_environment.py # and replace OAuth credentials your dev credentials TOKENS = { '_foo_bucket': '_foo_bucket-bearer-token', 'bucket': 'bucket-bearer-token', 'foo': 'foo-bearer-token', 'foo_bucket': 'foo_bucket-bearer-token', 'licensing': 'licensing-bearer-token', 'l...
Fix typo in bucket name
Fix typo in bucket name
Python
mit
alphagov/backdrop,alphagov/backdrop,alphagov/backdrop
--- +++ @@ -7,7 +7,7 @@ 'foo_bucket': 'foo_bucket-bearer-token', 'licensing': 'licensing-bearer-token', 'licensing_journey': 'licensing_journey-bearer-token', - 'licensing__monitoring': 'licensing_monitoring_bearer_token', + 'licensing_monitoring': 'licensing_monitoring_bearer_token', 'licen...
91bd7690c1e48b52a270bc45626e771663828c28
pact/group.py
pact/group.py
from .base import PactBase from .utils import GroupWaitPredicate class PactGroup(PactBase): def __init__(self, pacts): super(PactGroup, self).__init__() self._pacts = list(pacts) def __iadd__(self, other): self._pacts.append(other) return self def _is_finished(self): ...
from .base import PactBase from .utils import GroupWaitPredicate class PactGroup(PactBase): def __init__(self, pacts): self._pacts = list(pacts) super(PactGroup, self).__init__() def __iadd__(self, other): self._pacts.append(other) return self def _is_finished(self): ...
Fix PactGroup created log message
Fix PactGroup created log message
Python
bsd-3-clause
vmalloc/pact
--- +++ @@ -5,8 +5,8 @@ class PactGroup(PactBase): def __init__(self, pacts): + self._pacts = list(pacts) super(PactGroup, self).__init__() - self._pacts = list(pacts) def __iadd__(self, other): self._pacts.append(other)
6db1ddd9c7776cf07222ae58dc9b2c44135ac59a
spacy/__init__.py
spacy/__init__.py
# coding: utf8 from __future__ import unicode_literals import warnings warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.ufunc size changed") # These are imported as part of the API from thinc.neural.util import prefer_gpu, require_gpu from .cli.in...
# coding: utf8 from __future__ import unicode_literals import warnings import sys warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.ufunc size changed") # These are imported as part of the API from thinc.neural.util import prefer_gpu, require_gpu f...
Raise ValueError for narrow unicode build
Raise ValueError for narrow unicode build
Python
mit
explosion/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy
--- +++ @@ -1,6 +1,7 @@ # coding: utf8 from __future__ import unicode_literals import warnings +import sys warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.ufunc size changed") @@ -13,6 +14,12 @@ from .about import __version__ from .errors...
ad4b6663a2de08fddc0ebef8a08e1f405c0cb80a
pkgcmp/cli.py
pkgcmp/cli.py
''' Parse CLI options ''' # Import python libs import os import copy import argparse # Import pkgcmp libs import pkgcmp.scan # Import third party libs import yaml DEFAULTS = {'cachedir': '/var/cache/pkgcmp'} def parse(): ''' Parse!! ''' parser = argparse.ArgumentParser(description='The pkgcmp map gen...
''' Parse CLI options ''' # Import python libs import os import copy import argparse # Import pkgcmp libs import pkgcmp.scan # Import third party libs import yaml DEFAULTS = {'cachedir': '/var/cache/pkgcmp', 'extension_modules': ''} def parse(): ''' Parse!! ''' parser = argparse.ArgumentP...
Add extension_modueles to the default configuration
Add extension_modueles to the default configuration
Python
apache-2.0
SS-RD/pkgcmp
--- +++ @@ -10,7 +10,8 @@ # Import third party libs import yaml -DEFAULTS = {'cachedir': '/var/cache/pkgcmp'} +DEFAULTS = {'cachedir': '/var/cache/pkgcmp', + 'extension_modules': ''} def parse():
88773c6757540c9f1d4dfca2a287512e74bdbc24
python_scripts/mc_config.py
python_scripts/mc_config.py
#!/usr/bin/python import yaml import os.path _config_file_base_name = 'mediawords.yml' _config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml')) def read_config(): yml_file = open(_config_file_name, 'rb') config_file = yaml.load( yml_file ) return config_file
#!/usr/bin/python import yaml import os.path _config_file_base_name = 'mediawords.yml' _config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml')) _defaults_config_file_base_name = 'defaults.yml' _defaults_config_file_name = os.path.abspath(os.path.join(os.path.dirname(__fil...
Read the defaults config file and merge it with mediawords.yml
Read the defaults config file and merge it with mediawords.yml
Python
agpl-3.0
berkmancenter/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT...
--- +++ @@ -6,8 +6,39 @@ _config_file_base_name = 'mediawords.yml' _config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml')) -def read_config(): - yml_file = open(_config_file_name, 'rb') +_defaults_config_file_base_name = 'defaults.yml' +_defaults_config_file_name = ...
b790d32260a08f61be59ee5783bdbf07ed3e1c66
python/labs/quick-banking-app/starter-code/banking.py
python/labs/quick-banking-app/starter-code/banking.py
#!/usr/bin/python # # Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
#!/usr/bin/python # # Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Use new-style classes, following the same fix in the curriculum.
Use new-style classes, following the same fix in the curriculum.
Python
apache-2.0
google/cssi-labs,google/cssi-labs
--- +++ @@ -16,5 +16,5 @@ # Replace "pass" with your code -class BankAccount(): +class BankAccount(object): pass
f51162070c61fe9d3906c7d741432356a08a4ce6
openstack/__init__.py
openstack/__init__.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...
Make end-user modules accessible from top level
Make end-user modules accessible from top level There are several modules that end-users are expected to be using--connection, profile, exceptions, and utils--which could be made slightly more accessible by having them available in the top level `openstack` namespace. This change proposes importing `from openstack imp...
Python
apache-2.0
dtroyer/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-openstacksdk,openstack/python-openstacksdk,briancurtin/python-openstacksdk,dtroyer/python-openstacksdk,stackforge/python-openstacksdk,briancurtin/python-openstacksdk
--- +++ @@ -0,0 +1,16 @@ +# 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 writi...
25ba4aea17d869022682fd70d4c3ccbade19955f
openfisca_country_template/situation_examples/__init__.py
openfisca_country_template/situation_examples/__init__.py
"""This file provides a function to load json example situations.""" import json import os DIR_PATH = os.path.dirname(os.path.abspath(__file__)) def parse(file_name): """Load json example situations.""" file_path = os.path.join(DIR_PATH, file_name) with open(file_path, "r") as file: return json...
"""This file provides a function to load json example situations.""" import json import os DIR_PATH = os.path.dirname(os.path.abspath(__file__)) def parse(file_name): """Load json example situations.""" file_path = os.path.join(DIR_PATH, file_name) with open(file_path, "r", encoding="utf8") as file: ...
Add encoding to open file
Add encoding to open file
Python
agpl-3.0
openfisca/country-template,openfisca/country-template
--- +++ @@ -10,7 +10,7 @@ def parse(file_name): """Load json example situations.""" file_path = os.path.join(DIR_PATH, file_name) - with open(file_path, "r") as file: + with open(file_path, "r", encoding="utf8") as file: return json.loads(file.read())
eb1921615cd9070564d09c934d2c687897619c3a
froide/campaign/listeners.py
froide/campaign/listeners.py
from .models import Campaign def connect_campaign(sender, **kwargs): reference = kwargs.get('reference') if not reference: return parts = reference.split(':', 1) if len(parts) != 2: return namespace = parts[0] try: campaign = Campaign.objects.get(ident=namespace) ex...
from .models import Campaign def connect_campaign(sender, **kwargs): reference = kwargs.get('reference') if not reference: return parts = reference.split(':', 1) if len(parts) != 2: return namespace = parts[0] try: campaign = Campaign.objects.get(ident=namespace) ex...
Add tags of campaign to user
Add tags of campaign to user
Python
mit
stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide
--- +++ @@ -15,3 +15,8 @@ return sender.campaign = campaign sender.save() + + sender.user.tags.add(campaign.ident) + if not sender.user.is_active: + # First-time requester + sender.user.tags.add('%s-first' % campaign.ident)
b8a5655520449148e5f71790f85dfafd84faebec
python/peacock/tests/postprocessor_tab/gold/TestPostprocessorPluginManager_test_script.py
python/peacock/tests/postprocessor_tab/gold/TestPostprocessorPluginManager_test_script.py
#* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgpl-2.1.html """ python ...
""" python TestPostprocessorPluginManager_test_script.py """ import matplotlib.pyplot as plt import mooseutils # Create Figure and Axes figure = plt.figure(facecolor='white') axes0 = figure.add_subplot(111) axes1 = axes0.twinx() # Read Postprocessor Data data = mooseutils.PostprocessorReader('../input/white_elephant_...
Remove header added to gold file
Remove header added to gold file
Python
lgpl-2.1
nuclear-wizard/moose,YaqiWang/moose,harterj/moose,milljm/moose,sapitts/moose,dschwen/moose,jessecarterMOOSE/moose,sapitts/moose,andrsd/moose,sapitts/moose,lindsayad/moose,andrsd/moose,harterj/moose,jessecarterMOOSE/moose,idaholab/moose,jessecarterMOOSE/moose,dschwen/moose,lindsayad/moose,dschwen/moose,SudiptaBiswas/moo...
--- +++ @@ -1,12 +1,3 @@ -#* This file is part of the MOOSE framework -#* https://www.mooseframework.org -#* -#* All rights reserved, see COPYRIGHT for full restrictions -#* https://github.com/idaholab/moose/blob/master/COPYRIGHT -#* -#* Licensed under LGPL 2.1, please see LICENSE for details -#* https://www.gnu.org/...
2a31c4542cec4c46d22ec6cd905bb60813810cef
web/geosearch/tests/test_bag_dataset.py
web/geosearch/tests/test_bag_dataset.py
import unittest from datapunt_geosearch import config from datapunt_geosearch import datasource class TestBAGDataset(unittest.TestCase): def test_query(self): x = 120993 y = 485919 ds = datasource.BagDataSource(dsn=config.DSN_BAG) results = ds.query(x, y) self.assertEqua...
import unittest from datapunt_geosearch import config from datapunt_geosearch import datasource class TestBAGDataset(unittest.TestCase): def test_query(self): x = 120993 y = 485919 ds = datasource.BagDataSource(dsn=config.DSN_BAG) results = ds.query(x, y) self.assertEqua...
Remove WKPB from geosearch - also change test
Remove WKPB from geosearch - also change test
Python
mpl-2.0
DatapuntAmsterdam/datapunt_geosearch,DatapuntAmsterdam/datapunt_geosearch
--- +++ @@ -22,7 +22,7 @@ ds = datasource.BagDataSource(dsn=config.DSN_BAG) results = ds.query(x, y, rd=False) - self.assertEqual(len(results['features']), 7) + self.assertEqual(len(results['features']), 6) if __name__ == '__main__':
e53c66f9ab12fe0c90c447176b083513cd3a4cf5
store/urls.py
store/urls.py
from django.conf.urls import url from .views import ProductCatalogue, ProductDetail, product_review urlpatterns = [ url(r'^catalogue/$', ProductCatalogue.as_view(), name='catalogue'), url(r'^(?P<slug>[\w\-]+)/$', ProductDetail.as_view(), name='detail'), url(r'^review/$', product_review, name='review') ]
from django.conf.urls import url from .views import ProductCatalogue, ProductDetail, product_review urlpatterns = [ url(r'^catalogue/$', ProductCatalogue.as_view(), name='catalogue'), url(r'^review/$', product_review, name='review'), url(r'^(?P<slug>[\w\-]+)/$', ProductDetail.as_view(), name='detail'), ]...
Move products:review URLConf above product:detail
Move products:review URLConf above product:detail The product:detail view is greedy and previously caused the review URLConf never to be resolved by the correct view
Python
bsd-3-clause
kevgathuku/compshop,andela-kndungu/compshop,kevgathuku/compshop,kevgathuku/compshop,andela-kndungu/compshop,andela-kndungu/compshop,kevgathuku/compshop,andela-kndungu/compshop
--- +++ @@ -5,6 +5,6 @@ urlpatterns = [ url(r'^catalogue/$', ProductCatalogue.as_view(), name='catalogue'), + url(r'^review/$', product_review, name='review'), url(r'^(?P<slug>[\w\-]+)/$', ProductDetail.as_view(), name='detail'), - url(r'^review/$', product_review, name='review') ]
b68bf4c1b2ff2e152311adeb0b88e1192d5c4093
Pyblosxom/_version.py
Pyblosxom/_version.py
####################################################################### # This file is part of Pyblosxom. # # Copyright (C) 2003-2011 by the Pyblosxom team. See AUTHORS. # # Pyblosxom is distributed under the MIT license. See the file # LICENSE for distribution details. ###############################################...
####################################################################### # This file is part of Pyblosxom. # # Copyright (C) 2003-2011 by the Pyblosxom team. See AUTHORS. # # Pyblosxom is distributed under the MIT license. See the file # LICENSE for distribution details. ###############################################...
Update version for local development
Update version for local development Conflicts: Pyblosxom/_version.py
Python
mit
willkg/douglas,willkg/douglas
--- +++ @@ -16,5 +16,5 @@ # see http://www.python.org/dev/peps/pep-0386/ -__version__ = "1.5.3" +__version__ = "1.5.3.wgkg"