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 |
|---|---|---|---|---|---|---|---|---|---|---|
968c73805e5beff502955ad3dbb8aa86ee8bc0b7 | freelancefinder/jobs/forms.py | freelancefinder/jobs/forms.py | """Forms for dealing with jobs/posts."""
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from taggit.models import Tag
class PostFilterForm(forms.Form):
"""Form for filtering the PostListView."""
title = forms.CharField(required=False)
is_job_p... | """Forms for dealing with jobs/posts."""
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from taggit.models import Tag
class PostFilterForm(forms.Form):
"""Form for filtering the PostListView."""
title = forms.CharField(required=False)
is_job_p... | Tag is not required, of course | Tag is not required, of course
| Python | bsd-3-clause | ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder | ---
+++
@@ -26,7 +26,7 @@
"""Form for filtering the JobListView."""
search = forms.CharField(required=False)
- tag = forms.ModelChoiceField(queryset=Tag.objects.all())
+ tag = forms.ModelChoiceField(queryset=Tag.objects.all(), required=False)
def __init__(self, *args, **kwargs):
supe... |
99b96d2c0b82e186b9eaa13d2efe8b617c9cf3aa | registration/__init__.py | registration/__init__.py | VERSION = (0, 9, 0, 'beta', 1)
def get_version():
from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover
| VERSION = (1, 0, 0, 'final', 0)
def get_version():
"Returns a PEP 386-compliant version number from VERSION."
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha releases... | Fix version number reporting so we can be installed before Django. | Fix version number reporting so we can be installed before Django.
| Python | bsd-3-clause | dinie/django-registration,dinie/django-registration,FundedByMe/django-registration,FundedByMe/django-registration,Avenza/django-registration | ---
+++
@@ -1,6 +1,22 @@
-VERSION = (0, 9, 0, 'beta', 1)
+VERSION = (1, 0, 0, 'final', 0)
def get_version():
- from django.utils.version import get_version as django_get_version
- return django_get_version(VERSION) # pragma: no cover
+ "Returns a PEP 386-compliant version number from VERSION."
+ asse... |
7d88c98fcf6984b07a8b085f8272868b1c23b29e | app/status/views.py | app/status/views.py | from flask import jsonify, current_app
from . import status
from . import utils
from ..main.services.search_service import status_for_all_indexes
@status.route('/_status')
def status():
db_status = status_for_all_indexes()
if db_status['status_code'] == 200:
return jsonify(
status="ok",... | from flask import jsonify, current_app
from . import status
from . import utils
from ..main.services.search_service import status_for_all_indexes
@status.route('/_status')
def status():
db_status = status_for_all_indexes()
if db_status['status_code'] == 200:
return jsonify(
status="ok",... | Return correct message if elasticsearch fails to connect. | Return correct message if elasticsearch fails to connect.
| Python | mit | alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api,RichardKnop/digitalmarketplace-search-api,RichardKnop/digitalmarketplace-search-api,RichardKnop/digitalmarketplace-search-api,RichardKnop/digitalmarketplace-search-api | ---
+++
@@ -23,5 +23,8 @@
status="error",
version=utils.get_version_label(),
message="Error connecting to elasticsearch",
- db_status=db_status
+ db_status={
+ 'status_code': 500,
+ 'message': db_status['message'][0]
+ }
), 500 |
155476e8feb584fb802b2aed4266aec32d617f2a | app/status/views.py | app/status/views.py | from flask import jsonify, current_app
from . import status
from . import utils
from .. import api_client
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
api_client.status
)
apis_wot_got_errors = []
if api_response is None or api_response.... | from flask import jsonify, current_app
from . import status
from . import utils
from .. import api_client
@status.route('/_status')
def status():
api_response = utils.return_response_from_api_status_call(
api_client.status
)
apis_with_errors = []
if api_response is None or api_response.sta... | Change variable name & int comparison. | Change variable name & int comparison.
| Python | mit | alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphag... | ---
+++
@@ -12,13 +12,13 @@
api_client.status
)
- apis_wot_got_errors = []
+ apis_with_errors = []
- if api_response is None or api_response.status_code is not 200:
- apis_wot_got_errors.append("(Data) API")
+ if api_response is None or api_response.status_code != 200:
+ ap... |
829cccc630c26f2e9d89007c669308c6b1bb63cf | frigg/worker/fetcher.py | frigg/worker/fetcher.py | # -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if task:
... | # -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if task:
... | Add deletion of result after build | Add deletion of result after build
| Python | mit | frigg/frigg-worker | ---
+++
@@ -32,4 +32,6 @@
def __start_build(task):
build = Build(task['id'], task)
build.run_tests()
+ for result in build.results:
+ del result
del build |
cce8c4b40038a8b8ddccc76f7d13c7f5d0e5e566 | txircd/modules/rfc/cmd_links.py | txircd/modules/rfc/cmd_links.py | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class LinksCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "LinksCommand"
core = True
d... | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class LinksCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "LinksCommand"
core = True
d... | Make the order of LINKS output consistent | Make the order of LINKS output consistent
| Python | bsd-3-clause | ElementalAlchemist/txircd,Heufneutje/txircd | ---
+++
@@ -16,6 +16,7 @@
return {}
def execute(self, user, data):
+ user.sendMessage(irc.RPL_LINKS, self.ircd.name, self.ircd.name, "0 {}".format(self.ircd.config["server_description"]))
for server in self.ircd.servers.itervalues():
hopCount = 1
nextServer = server.nextClosest
@@ -27,7 +28,6 @@
... |
f0e11b0743c2779f61970917da6eef859149f600 | taar/recommenders/utils.py | taar/recommenders/utils.py | import json
import os
from tempfile import gettempdir
import boto3
from botocore.exceptions import ClientError
import requests
def fetch_json(uri):
""" Perform an HTTP GET on the given uri, return the results as json.
Args:
uri: the string URI to fetch.
Returns:
A JSON object with the r... | import json
import os
from tempfile import gettempdir
import boto3
from botocore.exceptions import ClientError
import requests
def fetch_json(uri):
""" Perform an HTTP GET on the given uri, return the results as json.
Args:
uri: the string URI to fetch.
Returns:
A JSON object with the r... | Make sure to load the S3 cache file when available | Make sure to load the S3 cache file when available
| Python | mpl-2.0 | maurodoglio/taar | ---
+++
@@ -39,5 +39,6 @@
s3.download_fileobj(s3_bucket, s3_key, data)
except ClientError:
return None
- with open(local_path, 'r') as data:
- return json.loads(data.read())
+
+ with open(local_path, 'r') as data:
+ return json.loads(data.read... |
60c62cea5d0775ce443280c0973ce323d26eaa28 | app/main/errors.py | app/main/errors.py | # coding=utf-8
from flask import render_template
from . import main
from dmapiclient import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.app_errorhandler... | # coding=utf-8
from flask import render_template
from . import main
from ..api_client.error import APIError
@main.app_errorhandler(APIError)
def api_error_handler(e):
return _render_error_page(e.status_code)
@main.app_errorhandler(404)
def page_not_found(e):
return _render_error_page(404)
@main.app_error... | Change app-level error handler to use api_client.error exceptions | Change app-level error handler to use api_client.error exceptions
| Python | mit | AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend | ---
+++
@@ -2,7 +2,7 @@
from flask import render_template
from . import main
-from dmapiclient import APIError
+from ..api_client.error import APIError
@main.app_errorhandler(APIError) |
0b2cf0a651d27af90a229d85f77ac9ebd2502905 | run_test_BMI_ku_model.py | run_test_BMI_ku_model.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 10 10:56:16 2017
@author: kangwang
"""
import os
import sys
from permamodel.components import bmi_Ku_component
from permamodel.tests import examples_directory
cfg_file = os.path.join(examples_directory, 'Ku_method.cfg')
x = bmi_Ku_component.BmiKu... | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 10 10:56:16 2017
@author: kangwang
"""
import os
import sys
from permamodel.components import bmi_Ku_component
from permamodel.tests import examples_directory
cfg_file = os.path.join(examples_directory, 'Ku_method.cfg')
x = bmi_Ku_component.BmiKu... | Use BMI method to get ALT value | Use BMI method to get ALT value
It looks like it may not give the correct answer, though.
| Python | mit | permamodel/permamodel,permamodel/permamodel | ---
+++
@@ -19,4 +19,5 @@
x.update()
x.finalize()
-print x._values["ALT"][:]
+# print x._values["ALT"][:]
+print x.get_value('soil__active_layer_thickness') |
7f4876b1b220b8c3c26ce1490a76adf9721da4da | sample/pandas-example.py | sample/pandas-example.py | #!/usr/bin/env python
import pandas as pd
import numpy as np
import gtabview
c_arr = [['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux'],
['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two']]
columns = pd.MultiIndex.from_tuples(list(zip(*c_arr)), names=['V1', 'V2'])
i_arr = [['bar', 'bar', 'bar', ... | #!/usr/bin/env python3
import pandas as pd
import numpy as np
import gtabview
c_arr = [['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux'],
['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two']]
columns = pd.MultiIndex.from_tuples(list(zip(*c_arr)), names=['V1', 'V2'])
i_arr = [['bar', 'bar', 'bar',... | Make python3 default also for the samples | Make python3 default also for the samples
| Python | mit | wavexx/gtabview | ---
+++
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import pandas as pd
import numpy as np
import gtabview |
c21318fa5c125e54160f67d410cf4572a2f9a47e | addons/web_calendar/contacts.py | addons/web_calendar/contacts.py | from openerp.osv import fields, osv
class web_calendar_contacts(osv.osv):
_name = 'web_calendar.contacts'
_columns = {
'user_id': fields.many2one('res.users','Me'),
'partner_id': fields.many2one('res.partner','Contact'),
'active':fields.boolean('active'),
}
_defaul... | from openerp.osv import fields, osv
class web_calendar_contacts(osv.osv):
_name = 'web_calendar.contacts'
_columns = {
'user_id': fields.many2one('res.users','Me'),
'partner_id': fields.many2one('res.partner','Contact',required=True),
'active':fields.boolean('active'),
... | Add required on field res.partner from model Contacts to avoid the creation of empty coworkers | [FIX] Add required on field res.partner from model Contacts to avoid the creation of empty coworkers
| Python | agpl-3.0 | havt/openerp-web,havt/openerp-web,havt/openerp-web,havt/openerp-web,havt/openerp-web | ---
+++
@@ -5,7 +5,7 @@
_columns = {
'user_id': fields.many2one('res.users','Me'),
- 'partner_id': fields.many2one('res.partner','Contact'),
+ 'partner_id': fields.many2one('res.partner','Contact',required=True),
'active':fields.boolean('active'),
}
_defaults ... |
31986c4c7d5781f0924289308d99754c81d29710 | pml/units.py | pml/units.py | import numpy as np
from scipy.interpolate import PchipInterpolator
class UcPoly(object):
def __init__(self, coef):
self.p = np.poly1d(coef)
def machine_to_physics(self, machine_value):
return self.p(machine_value)
def physics_to_machine(self, physics_value):
roots = (self.p - phy... | import numpy as np
from scipy.interpolate import PchipInterpolator
class UcPoly(object):
def __init__(self, coef):
self.p = np.poly1d(coef)
def machine_to_physics(self, machine_value):
return self.p(machine_value)
def physics_to_machine(self, physics_value):
roots = (self.p - phy... | Raise error when creating PChip object with not monotonely increasing y list | Raise error when creating PChip object with not monotonely increasing y list
| Python | apache-2.0 | willrogers/pml,willrogers/pml | ---
+++
@@ -24,6 +24,11 @@
self.y = y
self.pp = PchipInterpolator(x, y)
+ diff = np.diff(y)
+ if not (np.all(diff > 0)):
+ raise ValueError('''Given coefficients must be
+ monotonely increasing.''')
+
def machine_to_physics(self, machine... |
95d2036aab2e3d154f4f292ef8624d6d02d48ac0 | cleanpyc.py | cleanpyc.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'xilei'
import os
from os.path import join
import stat
def chmod(targetdir):
"""
remove *.pyc files
"""
for root, dirs, files in os.walk(targetdir):
for file in files:
prefix,ext = os.path.splitext(file)
if e... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'xilei'
import os
from os.path import join
import stat
def rmpyc(targetdir):
"""
remove *.pyc files
"""
for root, dirs, files in os.walk(targetdir):
for file in files:
prefix,ext = os.path.splitext(file)
if e... | Change function name chmod to rmpyc | Change function name chmod to rmpyc
| Python | apache-2.0 | xiilei/pytools,xiilei/pytools | ---
+++
@@ -7,7 +7,7 @@
import stat
-def chmod(targetdir):
+def rmpyc(targetdir):
"""
remove *.pyc files
"""
@@ -21,4 +21,4 @@
if __name__ == '__main__':
- chmod('./')
+ rmpyc('./') |
92d7058347da755ff90621c56b36959521dfc99a | scripts/commandsocket.py | scripts/commandsocket.py | import RPi.GPIO as GPIO
import time
from socketIO_client import SocketIO, LoggingNamespace
socketIO = SocketIO('localhost:3000')
def onCommand(*args):
print("hello")
while (True):
socketIO.on("commands", onCommand)
socketIO.wait(seconds=1)
socketIO.off("sequencePi") | import RPi.GPIO as GPIO
import time
from socketIO_client import SocketIO, LoggingNamespace
socketIO = SocketIO('localhost:3000')
def onCommand(*args):
print(args)
while (True):
socketIO.on("commands", onCommand)
socketIO.wait(seconds=1)
socketIO.off("sequencePi") | Make sockets print actual output | Make sockets print actual output
Make sockets print actual output
| Python | mit | willdavidc/piel,willdavidc/piel,willdavidc/piel,willdavidc/piel,willdavidc/piel | ---
+++
@@ -5,7 +5,7 @@
socketIO = SocketIO('localhost:3000')
def onCommand(*args):
- print("hello")
+ print(args)
while (True):
socketIO.on("commands", onCommand) |
3a44dbeec871aa057c4d5b42c9089a8d2b649063 | django_agpl/urls.py | django_agpl/urls.py | # -*- coding: utf-8 -*-
#
# django-agpl -- tools to aid releasing Django projects under the AGPL
# Copyright (C) 2008, 2009, 2016 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by t... | # -*- coding: utf-8 -*-
#
# django-agpl -- tools to aid releasing Django projects under the AGPL
# Copyright (C) 2008, 2009, 2016 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by t... | Drop patterns import for Django 1.0 compatibility. | Drop patterns import for Django 1.0 compatibility.
| Python | agpl-3.0 | lamby/django-agpl,lamby/django-agpl | ---
+++
@@ -16,12 +16,12 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from . import views
-urlpatterns = patterns('django_ag... |
99d1357c379b2df5219891da7f64e4584060f069 | app/celery/reporting_tasks.py | app/celery/reporting_tasks.py | from datetime import datetime, timedelta
from flask import current_app
from notifications_utils.statsd_decorators import statsd
from app import notify_celery
from app.dao.fact_billing_dao import (
fetch_billing_data_for_day,
update_fact_billing
)
@notify_celery.task(name="create-nightly-billing")
@statsd(na... | from datetime import datetime, timedelta
from flask import current_app
from notifications_utils.statsd_decorators import statsd
from app import notify_celery
from app.dao.fact_billing_dao import (
fetch_billing_data_for_day,
update_fact_billing
)
@notify_celery.task(name="create-nightly-billing")
@statsd(na... | Fix the logging message in the nightly task | Fix the logging message in the nightly task
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | ---
+++
@@ -26,4 +26,5 @@
for data in transit_data:
update_fact_billing(data, process_day)
- current_app.logger.info("create-nightly-billing task complete. {} rows updated".format(len(transit_data)))
+ current_app.logger.info(
+ "create-nightly-billing task complete. {} ro... |
987c54559cb52370fc459a30cdbdfd0e38c5ef62 | plata/context_processors.py | plata/context_processors.py | import plata
def plata_context(request):
"""
Adds a few variables from Plata to the context if they are available:
* ``plata.shop``: The current :class:`plata.shop.views.Shop` instance
* ``plata.order``: The current order
* ``plata.contact``: The current contact instance
"""
shop = plata.... | import plata
def plata_context(request):
"""
Adds a few variables from Plata to the context if they are available:
* ``plata.shop``: The current :class:`plata.shop.views.Shop` instance
* ``plata.order``: The current order
* ``plata.contact``: The current contact instance
* ``plata.price_includ... | Add the variable `plata.price_includes_tax` to the template context | Add the variable `plata.price_includes_tax` to the template context
| Python | bsd-3-clause | armicron/plata,armicron/plata,stefanklug/plata,armicron/plata | ---
+++
@@ -7,6 +7,7 @@
* ``plata.shop``: The current :class:`plata.shop.views.Shop` instance
* ``plata.order``: The current order
* ``plata.contact``: The current contact instance
+ * ``plata.price_includes_tax``: Whether prices include tax or not
"""
shop = plata.shop_instance()
@@ -17... |
ae4b4fe5fb5c5774720dd3a14549aa88bde91043 | tests/Epsilon_tests/ImportTest.py | tests/Epsilon_tests/ImportTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import EPS
from grammpy import EPSILON
class ImportTest(TestCase):
def test_idSame(self):
self.assertEqual(id(EPS),id(EPSILON)... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import EPS
from grammpy import EPSILON
class ImportTest(TestCase):
def test_idSame(self):
self.assertEqual(id(EPS), id(EPSILON))... | Add tests to compare epsilon with another objects | Add tests to compare epsilon with another objects
| Python | mit | PatrikValkovic/grammpy | ---
+++
@@ -13,12 +13,24 @@
class ImportTest(TestCase):
-
def test_idSame(self):
- self.assertEqual(id(EPS),id(EPSILON))
+ self.assertEqual(id(EPS), id(EPSILON))
def test_equal(self):
self.assertEqual(EPS, EPSILON)
+ def test_equalToSelf(self):
+ self.assertEqual(EP... |
86692e6fbbbc6a8db9e4c323eb0688865b81f717 | slot/main.py | slot/main.py | import logging
from flask import Flask
from flask_cache import Cache
from flask_login import LoginManager
# Set up logging
log = logging.getLogger('slot')
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
log.addHandler(ch)
app = Flask(__name__)
app.config.from_object('config')
cach... | import logging
from flask import Flask
from flask_cache import Cache
from flask_login import LoginManager
from flask_sslify import SSLify
# Set up logging
log = logging.getLogger('slot')
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
log.addHandler(ch)
app = Flask(__name__)
app.c... | Add SSLify to force SSL | Add SSLify to force SSL
| Python | mit | nhshd-slot/SLOT,nhshd-slot/SLOT,nhshd-slot/SLOT | ---
+++
@@ -3,6 +3,7 @@
from flask import Flask
from flask_cache import Cache
from flask_login import LoginManager
+from flask_sslify import SSLify
# Set up logging
log = logging.getLogger('slot')
@@ -13,6 +14,7 @@
app = Flask(__name__)
app.config.from_object('config')
+sslify = SSLify(app, age=300)
cache... |
6f8ef313bcf90b7e96d05186eb606ff53d0cea90 | buchner/settings.py | buchner/settings.py | import os
from buchner.helpers import truthiness
def abspath(path):
return os.path.abspath(os.path.relpath(path, os.path.dirname(__file__)))
DEBUG = truthiness(os.environ.get('DEBUG', False))
DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite:///buchner_app.db')
BLUEPRINTS = []
# Flask-Funnel
JAVA_BIN = os... | import os
from buchner.helpers import truthiness
def abspath(path):
return os.path.abspath(os.path.relpath(path, os.path.dirname(__file__)))
DEBUG = truthiness(os.environ.get('DEBUG', False))
DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite:///buchner_app.db')
INSTALLED_APPS = []
# Flask-Funnel
JAVA_BIN ... | Remove last trace of BLUEPRINTS | Remove last trace of BLUEPRINTS
| Python | bsd-3-clause | rehandalal/buchner | ---
+++
@@ -9,7 +9,7 @@
DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite:///buchner_app.db')
-BLUEPRINTS = []
+INSTALLED_APPS = []
# Flask-Funnel
JAVA_BIN = os.environ.get('JAVA_BIN', 'java') |
fc608d8ab5d463c72d5e2e267c14e0c304e39acd | Cauldron/bundled/GUI/__init__.py | Cauldron/bundled/GUI/__init__.py | import version
version.append ('$Revision: 83265 $')
del version
import os, pkg_resources
# Enumerate all the available attributes and functions within this
# module, for the benefit of those that insist upon doing
# 'from module import *'.
__all__ = ('Box', 'Button', 'Color', 'Event', 'Font', 'Icon',
'Image', '... | import version
version.append ('$Revision: 83265 $')
del version
import os, pkg_resources
# Enumerate all the available attributes and functions within this
# module, for the benefit of those that insist upon doing
# 'from module import *'.
__all__ = ('Box', 'Button', 'Color', 'Event', 'Font', 'Icon',
'Image', '... | Fix bug in bundled GUI | Fix bug in bundled GUI
| Python | bsd-3-clause | alexrudy/Cauldron | ---
+++
@@ -30,5 +30,5 @@
import Value
from version import version
-path = pkg_resources.resource_filepath("Cauldron", "data/reldir/data/icons")
+path = pkg_resources.resource_filename("Cauldron", "data/reldir/data/icons")
Images.initialize (path) |
d45fb029dc4bf0119062a07b962dbc7fff1f300a | skimage/measure/__init__.py | skimage/measure/__init__.py | from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon
__all__ = ['find_contours',
'regionprops',
'perimeter',
'structural_similarit... | from .find_contours import find_contours
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon
from .fit import LineModel, CircleModel, EllipseModel, ransac
__all__ = ['find_contours',
'regionp... | Add imports of fit to subpackage | Add imports of fit to subpackage
| Python | bsd-3-clause | ajaybhat/scikit-image,vighneshbirodkar/scikit-image,almarklein/scikit-image,GaZ3ll3/scikit-image,keflavich/scikit-image,ofgulban/scikit-image,paalge/scikit-image,keflavich/scikit-image,chintak/scikit-image,chintak/scikit-image,chintak/scikit-image,Britefury/scikit-image,youprofit/scikit-image,dpshelio/scikit-image,Hiyo... | ---
+++
@@ -2,10 +2,16 @@
from ._regionprops import regionprops, perimeter
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon
+from .fit import LineModel, CircleModel, EllipseModel, ransac
+
__all__ = ['find_contours',
'regionprops'... |
3a6d76201104b928c1b9053317c9e61804814ff5 | pyresticd.py | pyresticd.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import getpass
import time
from twisted.internet import task
from twisted.internet import reactor
# Configuration
timeout = 3600*24*3 # Period
restic_command = "/home/mebus/restic" # your restic command here
# Program
def do_restic_backup():
print "\nStarti... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import getpass
import time
from twisted.internet import task
from twisted.internet import reactor
# Configuration
timeout = 3600*24*3 # Period
restic_command = "/home/mebus/restic" # your restic command here
# Program
def do_restic_backup():
print('Starting... | Use py3-style print and string-formatting | Use py3-style print and string-formatting
| Python | mit | Mebus/pyresticd,Mebus/pyresticd | ---
+++
@@ -8,19 +8,21 @@
from twisted.internet import reactor
-# Configuration
+# Configuration
timeout = 3600*24*3 # Period
restic_command = "/home/mebus/restic" # your restic command here
# Program
+
def do_restic_backup():
- print "\nStarting Backup at " + str(time.ctime())
+ print('Starting... |
2c9d5a8b167f77a69995d55e2b2ef52c90807124 | pytest_vw.py | pytest_vw.py | # -*- coding: utf-8 -*-
import os
import pytest
# You didn't see that.
#
# I hope you don't understand this code.
_config = None
EXAMINATORS = [
'CI',
'CONTINUOUS_INTEGRATION',
'BUILD_ID',
'BUILD_NUMBER',
'TEAMCITY_VERSION',
'TRAVIS',
'CIRCLECI',
'JENKINS_URL',
'HUDSON_URL',
... | # -*- coding: utf-8 -*-
import os
import pytest
# You didn't see that.
#
# I hope you don't understand this code.
EXAMINATORS = [
'CI',
'CONTINUOUS_INTEGRATION',
'BUILD_ID',
'BUILD_NUMBER',
'TEAMCITY_VERSION',
'TRAVIS',
'CIRCLECI',
'JENKINS_URL',
'HUDSON_URL',
'bamboo.build... | Use item.config to access config. | Use item.config to access config.
Fixes #1.
| Python | mit | The-Compiler/pytest-vw | ---
+++
@@ -8,9 +8,6 @@
# You didn't see that.
#
# I hope you don't understand this code.
-
-
-_config = None
EXAMINATORS = [
@@ -35,16 +32,11 @@
rep = outcome.get_result()
examinators = EXAMINATORS
- for examinator in _config.getini('vw_examinators').split('\n'):
+ for examinator in item.co... |
e87490ea157f4882f644329e4b447f51c0a2acb3 | benchmarks/bench_vectorize.py | benchmarks/bench_vectorize.py | """
Benchmarks for ``@vectorize`` ufuncs.
"""
import numpy as np
from numba import vectorize
@vectorize(["float32(float32, float32)",
"float64(float64, float64)",
"complex64(complex64, complex64)",
"complex128(complex128, complex128)"])
def mul(x, y):
return x * y
class Tim... | """
Benchmarks for ``@vectorize`` ufuncs.
"""
import numpy as np
from numba import vectorize
@vectorize(["float32(float32, float32)",
"float64(float64, float64)",
"complex64(complex64, complex64)",
"complex128(complex128, complex128)"])
def mul(x, y):
return x * y
@vectoriz... | Add a relative difference vectorization benchmark | Add a relative difference vectorization benchmark
| Python | bsd-2-clause | gmarkall/numba-benchmark,numba/numba-benchmark | ---
+++
@@ -15,6 +15,14 @@
return x * y
+@vectorize(["float32(float32, float32)",
+ "float64(float64, float64)"])
+def rel_diff(x, y):
+ # XXX for float32 performance, we should write `np.float32(2)`, but
+ # that's not the natural way to write this code...
+ return 2 * (x - y) / (x + y)
... |
f94c946d135aed30f4d9068844b563fa94e39ff1 | test.py | test.py | from unittest import TestCase
import lazydict
class TestLazyDictionary(TestCase):
def test_circular_reference_error(self):
d = lazydict.LazyDictionary()
d['foo'] = lambda s: s['foo']
self.assertRaises(lazydict.CircularReferenceError, d.__getitem__, 'foo')
def test_constant_redefinitio... | from unittest import TestCase
import lazydict
class TestLazyDictionary(TestCase):
def test_circular_reference_error(self):
d = lazydict.LazyDictionary()
d['foo'] = lambda s: s['foo']
self.assertRaises(lazydict.CircularReferenceError, d.__getitem__, 'foo')
def test_constant_redefinitio... | Check recursion in str() and repr() | Check recursion in str() and repr()
| Python | mit | janrain/lazydict | ---
+++
@@ -25,9 +25,9 @@
self.assertEqual(d['sum'], 3)
def test_str(self):
- d = lazydict.LazyDictionary({'a': 1})
- self.assertEqual(str(d), "{'a': 1}")
+ d = lazydict.LazyDictionary({'a': {'b': 1}})
+ self.assertEqual(str(d), "{'a': {'b': 1}}")
def test_repr(s... |
1469da25fec3e3e966d5a0b5fab11dd279bbe05a | blogsite/models.py | blogsite/models.py | """Collection of Models used in blogsite."""
from . import db
class Post(db.Model):
"""Model representing a blog post.
Attributes
----------
id : db.Column
Autogenerated primary key
title : db.Column
body : db.Column
"""
# Columns
id = db.Column(db.Integer, primary_key=Tr... | """Collection of Models used in blogsite."""
from . import db
class Post(db.Model):
"""Model representing a blog post.
Attributes
----------
id : SQLAlchemy.Column
Autogenerated primary key
title : SQLAlchemy.Column
body : SQLAlchemy.Column
"""
# Columns
id = db.Column(db... | Correct type comment for table columns | Correct type comment for table columns
| Python | mit | paulaylingdev/blogsite,paulaylingdev/blogsite | ---
+++
@@ -7,10 +7,10 @@
Attributes
----------
- id : db.Column
+ id : SQLAlchemy.Column
Autogenerated primary key
- title : db.Column
- body : db.Column
+ title : SQLAlchemy.Column
+ body : SQLAlchemy.Column
"""
# Columns |
0cda764617dcbf52c36d4a63e240b6f849b06640 | tests/app/test_application.py | tests/app/test_application.py | from .helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def test_index(self):
response = self.client.get('/')
assert 200 == response.status_code
| from .helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def test_index(self):
response = self.client.get('/')
assert 200 == response.status_code
def test_404(self):
response = self.client.get('/not-found')
assert 404 == response.status_code
| Add test for not found URLs | Add test for not found URLs
| Python | mit | alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace... | ---
+++
@@ -5,3 +5,8 @@
def test_index(self):
response = self.client.get('/')
assert 200 == response.status_code
+
+ def test_404(self):
+ response = self.client.get('/not-found')
+ assert 404 == response.status_code
+ |
18cd9a1db083db1ce0822bab2f502357eeec97b5 | blog/tests/test_templatetags.py | blog/tests/test_templatetags.py | from django.test import TestCase
from django.template import Context, Template
class BlogTemplatetagsTestCase(TestCase):
def test_md_as_html5(self):
body = """# H1 heading
**Paragraph** text
## H2 heading
~~~~{.python}
if True:
print("Some Python code in markdown")
~~~~
1 First
2. Second
* sub
3.... | from django.test import TestCase
from django.template import Context, Template
class BlogTemplatetagsTestCase(TestCase):
def test_md_as_html5(self):
body = """# H1 heading
**Paragraph** text
<strong>html markup works</strong>
## H2 heading
~~~~{.python}
if True:
print("Some <b>Python</b> code in mark... | Test HTML handling in markdown | Test HTML handling in markdown
| Python | agpl-3.0 | node13h/droll,node13h/droll | ---
+++
@@ -8,12 +8,12 @@
body = """# H1 heading
**Paragraph** text
-
+<strong>html markup works</strong>
## H2 heading
~~~~{.python}
if True:
- print("Some Python code in markdown")
+ print("Some <b>Python</b> code in markdown")
~~~~
1 First
@@ -22,10 +22,11 @@
3. Last"""
expected ... |
726370913332fd5e27bb04446b75ef59fb711a9c | broadgauge/main.py | broadgauge/main.py | import os
import sys
import web
import yaml
from . import default_settings
def load_default_config():
# take all vars defined in default_config
config = dict((k, v) for k, v in default_settings.__dict__.items()
if not k.startswith("_"))
web.config.update(config)
def load_config_from_en... | import os
import sys
import web
import yaml
from . import default_settings
def load_default_config():
# take all vars defined in default_config
config = dict((k, v) for k, v in default_settings.__dict__.items()
if not k.startswith("_"))
web.config.update(config)
def load_config_from_en... | Read mail settings from config. | Read mail settings from config.
| Python | bsd-3-clause | fsmk/fsmkschool,anandology/broadgauge | ---
+++
@@ -20,6 +20,11 @@
'SECRET_KEY',
'DATABASE_URL',
'ADMIN_USER',
+ 'MAIL_SERVER',
+ 'MAIL_USERNAME',
+ 'MAIL_PASSWORD',
+ 'MAIL_TLS',
+ 'FROM_ADDRESS',
]
for k in keys: |
4a32838db7cbfa1962f3cd61f46caa308e4ea645 | src/rgrep.py | src/rgrep.py | def display_usage():
return 'Usage: python rgrep [options] pattern files\nThe options are the '\
'same as grep\n'
def rgrep(pattern='', text='', case='', count=False, version=False):
if pattern == '' or text == '':
return display_usage()
elif not count:
if case == 'i':
... | def display_usage():
return 'Usage: python rgrep [options] pattern files\nThe options are the '\
'same as grep\n'
class RGrep(object):
def __init__(self):
self.version = 'RGrep (BSD) 0.0.1'
self.count = False
self.pattern = ''
self.text = ''
self.case = ''
... | Add match and case insensitive methods | Add match and case insensitive methods
| Python | bsd-2-clause | ambidextrousTx/RGrep-Python | ---
+++
@@ -1,17 +1,6 @@
def display_usage():
return 'Usage: python rgrep [options] pattern files\nThe options are the '\
'same as grep\n'
-
-
-def rgrep(pattern='', text='', case='', count=False, version=False):
- if pattern == '' or text == '':
- return display_usage()
- elif not coun... |
bd8c5628a6af96a68f1ed6022a983af7a5495529 | tartpy/rt.py | tartpy/rt.py | import os
import multiprocessing
import threading
class Sponsor(object):
def __init__(self):
print('Sponsor pid: {}'.format(os.getpid()))
def create(self, behavior):
return Actor(behavior, self)
class Actor(object):
def __init__(self, behavior, sponsor):
self.behavior = behavior... | import os
import multiprocessing
import threading
class Sponsor(object):
def __init__(self):
print('Sponsor pid: {}'.format(os.getpid()))
def create(self, behavior):
return Actor(behavior, self)
class Actor(object):
def __init__(self, behavior, sponsor):
self.behavior = behavior... | Allow arg to specify spawning type | Allow arg to specify spawning type | Python | mit | waltermoreira/tartpy | ---
+++
@@ -16,8 +16,8 @@
self.behavior = behavior
self.sponsor = sponsor
- def send(self, message):
- spawn(self.behavior, message, method='process')
+ def send(self, message, method='thread'):
+ spawn(self.behavior, message, method)
def spawn(f, args, method='thread'): |
9f600d66f76d023926d1c1a6c974bd1abba40cfb | breakers/__init__.py | breakers/__init__.py | # -*- coding: utf-8 -*-
"""
breakers
~~~~~
Breakers is a simple python package that implements the circuit breaker
pattern.
:copyright: (c) 2015 by Marcus Martins.
:license: Apache License, Version 2.0, see LICENSE for more details.
"""
from .breaker import Breaker
__all__ = [Breaker, ]
__vers... | # -*- coding: utf-8 -*-
"""
breakers
~~~~~
Breakers is a simple python package that implements the circuit breaker
pattern.
:copyright: (c) 2015 by Marcus Martins.
:license: Apache License, Version 2.0, see LICENSE for more details.
"""
from .breaker import Breaker
__all__ = ['Breaker', ]
__ve... | Fix __all__ on module entry point | Fix __all__ on module entry point
| Python | apache-2.0 | marcusmartins/breakers | ---
+++
@@ -9,6 +9,6 @@
"""
from .breaker import Breaker
-__all__ = [Breaker, ]
+__all__ = ['Breaker', ]
__version__ = '0.1' |
926a7e3f8bc3808160bcab439e62b5848345d6f5 | tests/settings.py | tests/settings.py | # -*- coding: utf-8 -*-
import django
DEBUG = False
USE_TZ = True
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
}
INSTALLED_APPS = [
"easy_pjax",
"tests"
]
MIDDLEWARE_CLASSES = []
ROOT_URLCONF = "tests.urls"
SECRET_KEY = "secret"
if django.VERSION[:2] >= (1, 8):
TE... | # -*- coding: utf-8 -*-
import django
DEBUG = False
USE_TZ = True
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
}
INSTALLED_APPS = [
"easy_pjax",
"tests"
]
MIDDLEWARE_CLASSES = []
ROOT_URLCONF = "tests.urls"
SECRET_KEY = "secret"
if django.VERSION[:2] >= (1, 8):
TE... | Use double quotes for strings | Use double quotes for strings
| Python | bsd-3-clause | nigma/django-easy-pjax,nigma/django-easy-pjax,nigma/django-easy-pjax | ---
+++
@@ -21,11 +21,11 @@
if django.VERSION[:2] >= (1, 8):
TEMPLATES = [
{
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'builtins': ["easy_pjax.templatetags.pjax_tags"],
- 'context_p... |
4df20c02934e431568105467ee44374bedddf4a5 | fabfile/dbengine.py | fabfile/dbengine.py | ###################################################################
#
# Copyright (c) 2013 Miing.org <samuel.miing@gmail.com>
#
# This software is licensed under the GNU Affero General Public
# License version 3 (AGPLv3), as published by the Free Software
# Foundation, and may be copied, distributed, and modified un... | ###################################################################
#
# Copyright (c) 2013 Miing.org <samuel.miing@gmail.com>
#
# This software is licensed under the GNU Affero General Public
# License version 3 (AGPLv3), as published by the Free Software
# Foundation, and may be copied, distributed, and modified un... | Fix 'cant import from .postgresql' | Fix 'cant import from .postgresql'
| Python | agpl-3.0 | miing/mci_migo,miing/mci_migo,miing/mci_migo | ---
+++
@@ -15,7 +15,12 @@
###################################################################
-from .postgresql import pgsql_*
+from .postgresql import (
+ pgsql_createuser,
+ pgsql_dropdb,
+ pgsql_createdb,
+ pgsql_dropuser,
+)
from .django import syncdb grantuser
|
2201aaeffb93713adcdf20f5868b5a90b562efda | pages/models.py | pages/models.py | from django.db import models
class Page(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=64, blank=False)
name.help_text='Internal name of page'
title = models.CharField(max_length=64, blank=True)
title.help_text='Page title to display in titlebar of browser/tab'
body = ... | from django.db import models
class Page(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=64, blank=False)
name.help_text='Internal name of page'
title = models.CharField(max_length=64, blank=True)
title.help_text='Page title to display in titlebar of browser/tab'
body = ... | Increase character limit for pages | Increase character limit for pages
Closes #70. | Python | isc | ashbc/tgrsite,ashbc/tgrsite,ashbc/tgrsite | ---
+++
@@ -10,16 +10,16 @@
title = models.CharField(max_length=64, blank=True)
title.help_text='Page title to display in titlebar of browser/tab'
- body = models.TextField(max_length=8192, blank=True)
+ body = models.TextField(max_length=16384, blank=True)
body.help_text='Page contents'
- head = models.Tex... |
42918ef774625643220c182ca0eb5601841db595 | dvox/app.py | dvox/app.py | config = {
"CREATE_RETRIES": 5,
"CHUNK_LOCK_TIMEOUT_SECONDS": 10,
"WORKER_TIMEOUT_SECONDS": 15
}
| config = {
"CREATE_RETRIES": 5,
"CHUNK_LOCK_TIMEOUT_SECONDS": 10,
"WORKER_TIMEOUT_SECONDS": 15,
"CHUNK_SIZE": 25,
"BLOCK_BYTE_SIZE": 8
}
| Add controls for storage size | Add controls for storage size
| Python | mit | numberoverzero/dvox | ---
+++
@@ -1,5 +1,7 @@
config = {
"CREATE_RETRIES": 5,
"CHUNK_LOCK_TIMEOUT_SECONDS": 10,
- "WORKER_TIMEOUT_SECONDS": 15
+ "WORKER_TIMEOUT_SECONDS": 15,
+ "CHUNK_SIZE": 25,
+ "BLOCK_BYTE_SIZE": 8
} |
510063159145cd3fdc7bdd0c8b93dc46d98a88c8 | obj_sys/models.py | obj_sys/models.py | # Create your models here.
from models_obj_rel import *
from models_ufs_obj import *
try:
# apps.py
from django.apps import AppConfig
try:
import tagging
tagging.register(UfsObj)
except ImportError:
pass
except ImportError:
try:
import tagging
tagging.regi... | # Create your models here.
from models_obj_rel import *
from models_ufs_obj import *
try:
import tagging
tagging.register(UfsObj)
except ImportError:
pass
| Remove not used app config. | Remove not used app config.
| Python | bsd-3-clause | weijia/obj_sys,weijia/obj_sys | ---
+++
@@ -3,21 +3,8 @@
from models_ufs_obj import *
-
try:
- # apps.py
- from django.apps import AppConfig
- try:
- import tagging
-
- tagging.register(UfsObj)
- except ImportError:
- pass
-except ImportError:
- try:
- import tagging
- tagging.register(UfsObj)... |
33a9bd5cf465a56c2eb156dcbc0d4e61a0f590a4 | osmABTS/places.py | osmABTS/places.py | """
Places of interest generation
=============================
"""
| """
Places of interest generation
=============================
This module defines a class for places of interest and the functions for
generating the data structure for all of them from the OSM raw data.
Each place of interest will basically just carry the information about its
location in the **network** as the id... | Implement place class and homes generation | Implement place class and homes generation
The Place class for places of interest has been implemented, as well as
the generation of homes, which is different from the generation of other
places of interest.
| Python | mit | tschijnmo/osmABTS | ---
+++
@@ -2,4 +2,100 @@
Places of interest generation
=============================
+This module defines a class for places of interest and the functions for
+generating the data structure for all of them from the OSM raw data.
+
+Each place of interest will basically just carry the information about its
+locat... |
306cf5987c90d54d72037c19dd02f07be37cbb6f | make_mozilla/base/tests/decorators.py | make_mozilla/base/tests/decorators.py | from functools import wraps
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
__all__ = ['wip']
def fail(message):
raise AssertionError(message)
def wip(f):
@wraps(f)
def run_test(*args, **kwargs):
try:
f(*args, **kwargs)
except Exception as e:
... | from functools import wraps
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
import os
__all__ = ['wip']
def fail(message):
raise AssertionError(message)
def wip(f):
@wraps(f)
def run_test(*args, **kwargs):
try:
f(*args, **kwargs)
except Exception as... | Add integration test decorator to prevent certain tests running unless we really want them to. | Add integration test decorator to prevent certain tests running unless we really want them to.
| Python | bsd-3-clause | mozilla/make.mozilla.org,mozilla/make.mozilla.org,mozilla/make.mozilla.org,mozilla/make.mozilla.org | ---
+++
@@ -1,6 +1,7 @@
from functools import wraps
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
+import os
__all__ = ['wip']
@@ -17,3 +18,13 @@
fail("test passed but marked as work in progress")
return attr('wip')(run_test)
+def integration(f):
+ @wraps(f)
+ ... |
aeae640c34b7f68870304fb2a6a163d852440b7a | test/buildbot/buildbot_config/master/schedulers.py | test/buildbot/buildbot_config/master/schedulers.py | """
This module contains the logic which returns the set of
schedulers to use for the build master.
"""
def get_schedulers():
return []
| """
This module contains the logic which returns the set of
schedulers to use for the build master.
"""
from buildbot.changes.filter import ChangeFilter
from buildbot.schedulers.basic import SingleBranchScheduler
def get_schedulers():
full = SingleBranchScheduler(name="full",
chan... | Add a scheduler for the master branch to run | Buildbot: Add a scheduler for the master branch to run
| Python | mit | mkuzmin/vagrant,zsjohny/vagrant,ferventcoder/vagrant,sni/vagrant,patrys/vagrant,ArloL/vagrant,tomfanning/vagrant,channui/vagrant,wangfakang/vagrant,muhanadra/vagrant,jkburges/vagrant,rivy/vagrant,muhanadra/vagrant,krig/vagrant,Ninir/vagrant,tbarrongh/vagrant,johntron/vagrant,petems/vagrant,signed8bit/vagrant,carlosefr/... | ---
+++
@@ -3,5 +3,12 @@
schedulers to use for the build master.
"""
+from buildbot.changes.filter import ChangeFilter
+from buildbot.schedulers.basic import SingleBranchScheduler
+
def get_schedulers():
- return []
+ full = SingleBranchScheduler(name="full",
+ change_filter... |
9e6621ac7e4f07b9272ddb144aebbb75826d2405 | src/flock.py | src/flock.py | #!/usr/bin/env python
import cherrypy
from jinja2 import Environment, FileSystemLoader
j2_env = Environment(loader = FileSystemLoader('templates'))
class Root(object):
@cherrypy.expose
def index(self):
template = j2_env.get_template('base.html')
return template.render()
cherrypy.config.update('app.config')
ch... | #!/usr/bin/env python
from flask import Flask, redirect, render_template, request, session, url_for
from flask_oauthlib.client import OAuth, OAuthException
app = Flask(__name__)
app.config['FACEBOKK_APP_ID'] = ''
app.config['FACEBOOK_APP_SECRET'] = ''
app.config['GOOGLE_APP_ID'] = ''
app.config['GOOGLE_APP_SECRET'] =... | Switch to Flask, add oauth | Switch to Flask, add oauth
| Python | agpl-3.0 | DavidJFelix/hatchit,DavidJFelix/hatchit,DavidJFelix/hatchit | ---
+++
@@ -1,17 +1,50 @@
#!/usr/bin/env python
-import cherrypy
-from jinja2 import Environment, FileSystemLoader
+from flask import Flask, redirect, render_template, request, session, url_for
+from flask_oauthlib.client import OAuth, OAuthException
-j2_env = Environment(loader = FileSystemLoader('templates'))
... |
5f63a4cddc1157e1b0cb085562ee16e55f1c88b5 | cesium/celery_app.py | cesium/celery_app.py | from celery import Celery
from cesium import _patch_celery
celery_config = {
'CELERY_ACCEPT_CONTENT': ['pickle'],
'CELERY_IMPORTS': ['cesium', 'cesium._patch_celery', 'cesium.celery_tasks'],
'CELERY_RESULT_BACKEND': 'amqp',
'CELERY_RESULT_SERIALIZER': 'pickle',
'CELERY_TASK_SERIALIZER': 'pickle',
... | from celery import Celery
from cesium import _patch_celery
import os
celery_config = {
'CELERY_ACCEPT_CONTENT': ['pickle'],
'CELERY_IMPORTS': ['cesium', 'cesium._patch_celery', 'cesium.celery_tasks'],
'CELERY_RESULT_BACKEND': 'amqp',
'CELERY_RESULT_SERIALIZER': 'pickle',
'CELERY_TASK_SERIALIZER':... | Allow broker to be overridden | Allow broker to be overridden
| Python | bsd-3-clause | mltsp/mltsp,acrellin/mltsp,bnaul/mltsp,bnaul/mltsp,bnaul/mltsp,acrellin/mltsp,mltsp/mltsp,mltsp/mltsp,acrellin/mltsp,acrellin/mltsp,mltsp/mltsp,bnaul/mltsp,mltsp/mltsp,bnaul/mltsp,bnaul/mltsp,acrellin/mltsp,acrellin/mltsp,mltsp/mltsp | ---
+++
@@ -1,5 +1,8 @@
from celery import Celery
from cesium import _patch_celery
+
+import os
+
celery_config = {
'CELERY_ACCEPT_CONTENT': ['pickle'],
@@ -8,7 +11,8 @@
'CELERY_RESULT_SERIALIZER': 'pickle',
'CELERY_TASK_SERIALIZER': 'pickle',
'INSTALLED_APPS': ['cesium'],
- 'CELERY_BROKER... |
a17aade30c5925ba40eacfa2ab2a067a9141aa84 | tests/__init__.py | tests/__init__.py | #
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
# All tests in the test suite.
__all__ = ( "bitfield_tests", "zscii_tests" )
| #
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
# All tests in the test suite.
__all__ = ( "bitfield_tests", "zscii_tests", "lexer_tests", "glk_tests" )
| Make run_tests run all tests if no arguments are provided. | Make run_tests run all tests if no arguments are provided.
| Python | bsd-3-clause | BGCX262/zvm-hg-to-git,BGCX262/zvm-hg-to-git | ---
+++
@@ -4,4 +4,4 @@
#
# All tests in the test suite.
-__all__ = ( "bitfield_tests", "zscii_tests" )
+__all__ = ( "bitfield_tests", "zscii_tests", "lexer_tests", "glk_tests" ) |
84af834a348097f493b1e63034c8d0487354d737 | qanta/reporting/report_generator.py | qanta/reporting/report_generator.py | from jinja2 import Environment, PackageLoader
from qanta import qlogging
log = qlogging.get(__name__)
class ReportGenerator:
def __init__(self, template):
self.template = template
def create(self, variables, md_output, pdf_output):
env = Environment(loader=PackageLoader('qanta', 'reporting/... | from jinja2 import Environment, PackageLoader
from qanta import qlogging
log = qlogging.get(__name__)
class ReportGenerator:
def __init__(self, template):
self.template = template
def create(self, variables, md_output, pdf_output):
env = Environment(loader=PackageLoader('qanta', 'reporting/... | Fix bug where there was an empty report | Fix bug where there was an empty report
| Python | mit | miyyer/qb,miyyer/qb,Pinafore/qb,miyyer/qb,miyyer/qb,Pinafore/qb | ---
+++
@@ -15,7 +15,7 @@
markdown = template.render(variables)
if md_output is not None:
with open(md_output, 'w') as f:
- f.write(md_output)
+ f.write(markdown)
try:
import pypandoc
pypandoc.convert_text( |
5ee94e9a74bc4128ed8e7e10a2106ea422f22757 | sandbox/sandbox/polls/serialiser.py | sandbox/sandbox/polls/serialiser.py |
from nap import models, fields, api, serialiser, publisher
from .models import Choice, Poll
class ChoiceSerialiser(models.ModelSerialiser):
class Meta:
model = Choice
exclude = ('poll,')
class PollSerialiser(serialiser.Serialiser):
api_name = 'poll'
question = fields.Field()
publ... |
from nap import models, fields, api, serialiser, publisher
from .models import Choice, Poll
class ChoiceSerialiser(models.ModelSerialiser):
class Meta:
model = Choice
exclude = ('poll,')
class PollSerialiser(serialiser.Serialiser):
api_name = 'poll'
question = fields.Field()
publ... | Add attribute to choices field declaration | Add attribute to choices field declaration
| Python | bsd-3-clause | MarkusH/django-nap,limbera/django-nap | ---
+++
@@ -16,7 +16,7 @@
question = fields.Field()
published = fields.DateTimeField('pub_date')
- choices = fields.ManySerialiserField(serialiser=ChoiceSerialiser())
+ choices = fields.ManySerialiserField('choices_set.all', serialiser=ChoiceSerialiser())
class PollPublisher(publisher.Publisher... |
a3c49c490ffe103f759b935bae31c37c05d26e81 | tests/settings.py | tests/settings.py | # -*- coding: utf-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'formtools',
'tests.wizard.wizardtests',
]
SECRET_KEY = 'sp... | # -*- coding: utf-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/tmp/django-formtools-tests.db',
}
}
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'formtools',
... | Use a filesystem db and add the sites app to fix a test failure. | Use a filesystem db and add the sites app to fix a test failure.
| Python | bsd-3-clause | gchp/django-formtools,thenewguy/django-formtools,lastfm/django-formtools,barseghyanartur/django-formtools,thenewguy/django-formtools,barseghyanartur/django-formtools,gchp/django-formtools,lastfm/django-formtools | ---
+++
@@ -2,7 +2,7 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': ':memory:',
+ 'NAME': '/tmp/django-formtools-tests.db',
}
}
@@ -10,6 +10,7 @@
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
+ '... |
36b10d57a812b393c73fe3b4117cc133d0f9d110 | templatemailer/mailer.py | templatemailer/mailer.py | import logging
from django.core import mail
from .tasks import task_email_user
logger = logging.getLogger(__name__)
def send_email(user, template, context, attachments=None, delete_attachments_after_send=False,
language_code=None):
'''
Send email to user
:param user: User instance or re... | import logging
from django.core import mail
from .tasks import task_email_user
logger = logging.getLogger(__name__)
def send_email(user, template, context, attachments=None, delete_attachments_after_send=False,
language_code=None):
'''
Send email to user
:param user: User instance or re... | Fix AttributeError when supplying email address as user | Fix AttributeError when supplying email address as user
| Python | mit | tuomasjaanu/django-templatemailer | ---
+++
@@ -29,9 +29,14 @@
### otherwise, defer sending email to celery
send_email_f = task_email_user.delay
+ try:
+ user = user.pk
+ except AttributeError:
+ pass
+
### send email
send_email_f(
- user.pk if user else None,
+ user,
template,
... |
359cab09d0cf7de375b43f82f9a9507f3c84cd34 | distutilazy/__init__.py | distutilazy/__init__.py | """
distutilazy
-----------
Extra distutils command classes.
:license: MIT, see LICENSE for more details.
"""
__version__ = "0.4.0"
__all__ = ("clean", "pyinstaller", "command")
| """
distutilazy
-----------
Extra distutils command classes.
:license: MIT, see LICENSE for more details.
"""
__version__ = "0.4.1"
__all__ = ("clean", "command", "pyinstaller", "test")
| Add test to __all__ in package, bump version to 0.4.1 | Add test to __all__ in package, bump version to 0.4.1
| Python | mit | farzadghanei/distutilazy | ---
+++
@@ -7,5 +7,5 @@
:license: MIT, see LICENSE for more details.
"""
-__version__ = "0.4.0"
-__all__ = ("clean", "pyinstaller", "command")
+__version__ = "0.4.1"
+__all__ = ("clean", "command", "pyinstaller", "test") |
698ab729f60bdb1a4b280bf6f93e9faa0e1b63f9 | run-hooks.py | run-hooks.py | # -*- coding: utf-8 -*-
"""
Eve Demo
~~~~~~~~
A demostration of a simple API powered by Eve REST API.
The live demo is available at eve-demo.herokuapp.com. Please keep in mind
that the it is running on Heroku's free tier using a free MongoHQ
sandbox, which means that the first request to the ... | # -*- coding: utf-8 -*-
"""
Eve Demo
~~~~~~~~
A demostration of a simple API powered by Eve REST API.
The live demo is available at eve-demo.herokuapp.com. Please keep in mind
that the it is running on Heroku's free tier using a free MongoHQ
sandbox, which means that the first request to the ... | Prepare for PyCon Belarus 2018 | Prepare for PyCon Belarus 2018
| Python | bsd-3-clause | nicolaiarocci/eve-demo | ---
+++
@@ -20,7 +20,7 @@
def codemotion(endpoint, response):
for document in response['_items']:
- document['CODEMOTION'] = 'IS SO FREAKING COOL!'
+ document['PYCON BELARUS'] = 'IS SO FREAKING COOL!'
app = Eve()
app.on_fetched_resource += codemotion |
8d56fe74b373efe2dd3bbaffbde9eddd6fae6da7 | piot/sensor/sumppump.py | piot/sensor/sumppump.py | import time
from periphery import GPIO
from piot.sensor.base import BaseAnalogSensor
class SumpPump(BaseAnalogSensor):
def __init__(self):
self.min_normal=30
self.max_normal=200
self.unit='cm'
self.error_sentinel=None
def read_analog_sensor(self):
trig=GPIO(23, 'out... | import time
from periphery import GPIO
from piot.sensor.base import BaseAnalogSensor
class SumpPump(BaseAnalogSensor):
def __init__(self):
self.min_normal=30
self.max_normal=200
self.unit='cm'
self.error_sentinel=None
def read_analog_sensor(self):
trig=GPIO(23, 'out... | Return distance from sump pump sensor | Return distance from sump pump sensor
| Python | mit | tnewman/PIoT,tnewman/PIoT,tnewman/PIoT | ---
+++
@@ -38,3 +38,5 @@
trig.close()
echo.close()
+
+ return distance |
3d439d81766f354de9ab257d5ed690efd4aeb508 | nap/extras/actions.py | nap/extras/actions.py |
from django.http import StreamingHttpResponse
from django.utils.encoding import force_text
from .models import modelserialiser_factory
from .simplecsv import CSV
class ExportCsv(object):
def __init__(self, serialiser=None, label=None, **opts):
self.serialiser = serialiser
self.opts = opts
... |
from django.http import StreamingHttpResponse
from django.utils.encoding import force_text
from .models import modelserialiser_factory
from .simplecsv import Writer
class ExportCsv(object):
def __init__(self, serialiser=None, label=None, **opts):
self.serialiser = serialiser
self.opts = opts
... | Adjust for renamed CSV class | Adjust for renamed CSV class
| Python | bsd-3-clause | limbera/django-nap,MarkusH/django-nap | ---
+++
@@ -3,7 +3,7 @@
from django.utils.encoding import force_text
from .models import modelserialiser_factory
-from .simplecsv import CSV
+from .simplecsv import Writer
class ExportCsv(object):
@@ -24,7 +24,7 @@
ser_class = self.serialiser
def inner(ser):
- csv = CSV(fie... |
dc47a724525186fe99d79e62447efc3dbc9d95b0 | app/groups/utils.py | app/groups/utils.py | from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
from django.contrib.sites.models import Site
def send_group_email(request, to_email, subject, email_text_template, email_html_template):
"""Sends ... | from django.conf import settings
from django.core.mail import EmailMultiAlternatives, get_connection
from django.template.loader import get_template
from django.template import Context
from django.contrib.sites.models import Site
def send_group_email(request, to_email, subject, email_text_template, email_html_template... | Send individual mails, to avoid showing the whole to list, BCC and spamholing from Google | Send individual mails, to avoid showing the whole to list, BCC and spamholing from Google
| Python | bsd-3-clause | nikdoof/test-auth | ---
+++
@@ -1,5 +1,5 @@
from django.conf import settings
-from django.core.mail import EmailMultiAlternatives
+from django.core.mail import EmailMultiAlternatives, get_connection
from django.template.loader import get_template
from django.template import Context
from django.contrib.sites.models import Site
@@ -9,... |
cfcce6d4002657f72afdd780af06b3bfa4d9e10d | neo/test/iotest/test_axonaio.py | neo/test/iotest/test_axonaio.py | """
Tests of neo.io.axonaio
"""
import unittest
from neo.io.axonaio import AxonaIO
from neo.test.iotest.common_io_test import BaseTestIO
from neo.io.proxyobjects import (AnalogSignalProxy,
SpikeTrainProxy, EventProxy, EpochProxy)
from neo import (AnalogSignal, SpikeTrain)
import quantities as pq
impo... | """
Tests of neo.io.axonaio
"""
import unittest
from neo.io.axonaio import AxonaIO
from neo.test.iotest.common_io_test import BaseTestIO
from neo.io.proxyobjects import (AnalogSignalProxy,
SpikeTrainProxy, EventProxy, EpochProxy)
from neo import (AnalogSignal, SpikeTrain)
import quantities as pq
impo... | Add new files to common io tests | Add new files to common io tests
| Python | bsd-3-clause | apdavison/python-neo,NeuralEnsemble/python-neo,JuliaSprenger/python-neo,samuelgarcia/python-neo,INM-6/python-neo | ---
+++
@@ -20,7 +20,8 @@
'axona'
]
entities_to_test = [
- 'axona/axona_raw.set'
+ 'axona/axona_raw.set',
+ 'axona/dataset_unit_spikes/20140815-180secs.set'
]
|
474f213cf2cc4851f9cfcd17652a29ad74ab1f0d | write_csv.py | write_csv.py | import sqlite3
import csv
from datetime import datetime
current_date = datetime.now().strftime('%Y-%m-%d')
destination_file = 'srvy' + current_date + '.csv'
sqlite_file = 'srvy.db'
table_name = 'responses'
date_column = 'date'
time_column = 'time'
score_column = 'score'
question_column = 'question'
conn = sqlite3... | import sqlite3
import csv
from datetime import datetime
current_date = str(datetime.now().strftime('%Y-%m-%d'))
destination_file = 'srvy' + current_date + '.csv'
sqlite_file = 'srvy.db'
table_name = 'responses'
date_column = 'date'
time_column = 'time'
score_column = 'score'
question_column = 'question'
conn = sq... | Change current date in SQLite query to tuple | Change current date in SQLite query to tuple
| Python | mit | andrewlrogers/srvy | ---
+++
@@ -3,7 +3,7 @@
from datetime import datetime
-current_date = datetime.now().strftime('%Y-%m-%d')
+current_date = str(datetime.now().strftime('%Y-%m-%d'))
destination_file = 'srvy' + current_date + '.csv'
sqlite_file = 'srvy.db'
@@ -20,7 +20,7 @@
#c.execute("SELECT * FROM responses WHERE date LIKE... |
1c9540879d8761d9252c3fb3f749ae0b6d5be2b9 | wqflask/utility/elasticsearch_tools.py | wqflask/utility/elasticsearch_tools.py | es = None
try:
from elasticsearch import Elasticsearch, TransportError
from utility.tools import ELASTICSEARCH_HOST, ELASTICSEARCH_PORT
es = Elasticsearch([{
"host": ELASTICSEARCH_HOST
, "port": ELASTICSEARCH_PORT
}]) if (ELASTICSEARCH_HOST and ELASTICSEARCH_PORT) else None
except:
... | es = None
try:
from elasticsearch import Elasticsearch, TransportError
from utility.tools import ELASTICSEARCH_HOST, ELASTICSEARCH_PORT
es = Elasticsearch([{
"host": ELASTICSEARCH_HOST
, "port": ELASTICSEARCH_PORT
}]) if (ELASTICSEARCH_HOST and ELASTICSEARCH_PORT) else None
except:
... | Refactor common items to more generic methods. | Refactor common items to more generic methods.
* Refactor code that can be used in more than one place to a more
generic method/function that's called by other methods
| Python | agpl-3.0 | pjotrp/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,genenetwork/genenetwork2,DannyArends/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,DannyArends/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2,DannyArend... | ---
+++
@@ -11,25 +11,27 @@
es = None
def get_user_by_unique_column(column_name, column_value):
- user_details = None
+ return get_item_by_unique_column(column_name, column_value, index="users", doc_type="local")
+
+def save_user(user, user_id):
+ es_save_data("users", "local", user, user_id)
+
+def ... |
2438efb99b85fbc76cd285792c1511e7e2813a05 | zeus/api/resources/repository_tests.py | zeus/api/resources/repository_tests.py | from datetime import timedelta
from sqlalchemy.sql import func
from zeus.config import db
from zeus.constants import Result, Status
from zeus.models import Repository, TestCase, Job
from zeus.utils import timezone
from .base_repository import BaseRepositoryResource
from ..schemas import TestCaseStatisticsSchema
test... | from datetime import timedelta
from sqlalchemy.sql import func
from zeus.config import db
from zeus.constants import Result, Status
from zeus.models import Repository, TestCase, Job
from zeus.utils import timezone
from .base_repository import BaseRepositoryResource
from ..schemas import TestCaseStatisticsSchema
test... | Simplify query plan for repo tests | ref: Simplify query plan for repo tests
| Python | apache-2.0 | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus | ---
+++
@@ -31,12 +31,16 @@
runs_failed,
func.avg(TestCase.duration).label("avg_duration"),
)
- .join(Job, TestCase.job_id == Job.id)
.filter(
- Job.repository_id == repo.id,
- Job.date_finished >= timezone.now() - ti... |
08c2e38f9c87926476e7ad346001bf2a8271ab47 | wikichatter/TalkPageParser.py | wikichatter/TalkPageParser.py | import mwparserfromhell as mwp
from . import IndentTree
from . import WikiComments as wc
class Page:
def __init__(self):
self.indent = -2
def __str__(self):
return "Talk_Page"
class Section:
def __init__(self, heading):
self.heading = heading
self.indent = -1
def __st... | import mwparserfromhell as mwp
from . import IndentTree
from . import WikiComments as wc
class Page:
def __init__(self):
self.indent = -2
def __str__(self):
return "Talk_Page"
class Section:
def __init__(self, heading):
self.heading = heading
self.indent = -1
def __... | Switch to flat sections to avoid double including subsections | Switch to flat sections to avoid double including subsections
| Python | mit | kjschiroo/WikiChatter | ---
+++
@@ -1,6 +1,7 @@
import mwparserfromhell as mwp
from . import IndentTree
from . import WikiComments as wc
+
class Page:
def __init__(self):
@@ -8,6 +9,7 @@
def __str__(self):
return "Talk_Page"
+
class Section:
def __init__(self, heading):
@@ -17,12 +19,12 @@
def __str__... |
f35c6f989129d6298eb2f419ccb6fe8d4c734fd6 | taskq/run.py | taskq/run.py | import time
import transaction
from taskq import models
from daemon import runner
class TaskRunner():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdout_path = '/dev/tty'
self.stderr_path = '/dev/tty'
self.pidfile_path = '/tmp/task-runner.pid'
self.pidfile_timeo... | import time
import transaction
from daemon import runner
from taskq import models
class TaskDaemonRunner(runner.DaemonRunner):
def _status(self):
pid = self.pidfile.read_pid()
message = []
if pid:
message += ['Daemon started with pid %s' % pid]
else:
messag... | Add status to the daemon | Add status to the daemon
| Python | mit | LeResKP/sqla-taskq | ---
+++
@@ -1,7 +1,30 @@
import time
import transaction
+from daemon import runner
from taskq import models
-from daemon import runner
+
+
+class TaskDaemonRunner(runner.DaemonRunner):
+
+ def _status(self):
+ pid = self.pidfile.read_pid()
+ message = []
+ if pid:
+ message += ['... |
91d6503ebf3188a6e27058efcb10c0855df3542a | falafel/tests/test_api_generator.py | falafel/tests/test_api_generator.py | import unittest
from tools import generate_api_config
class TestAPIGen(unittest.TestCase):
@classmethod
def setUpClass(cls):
from falafel.mappers import * # noqa
pass
def setUp(self):
self.latest = generate_api_config.APIConfigGenerator(plugin_package="falafel").serialize_data_s... | import unittest
from falafel.tools import generate_api_config
class TestAPIGen(unittest.TestCase):
@classmethod
def setUpClass(cls):
from falafel.mappers import * # noqa
pass
def setUp(self):
self.latest = generate_api_config.APIConfigGenerator(plugin_package="falafel").serializ... | Fix failing API gen test | Fix failing API gen test
| Python | apache-2.0 | RedHatInsights/insights-core,RedHatInsights/insights-core | ---
+++
@@ -1,5 +1,5 @@
import unittest
-from tools import generate_api_config
+from falafel.tools import generate_api_config
class TestAPIGen(unittest.TestCase): |
5ed0474407669ebbca1e2a3f5a74ea3260bd3f2b | TimeSeriesTools/__init__.py | TimeSeriesTools/__init__.py |
__author__ = 'To\xc3\xb1o G. Quintela (tgq.spm@gmail.com)'
__version__ = '0.0.0'
#from pyCausality.TimeSeries.TS import *
#from pyCausality.TimeSeries.automatic_thresholding import *
#from pyCausality.TimeSeries.distances import *
#from pyCausality.TimeSeries.measures import *
#from pyCausality.TimeSeries.smoothing... |
__author__ = 'To\xc3\xb1o G. Quintela (tgq.spm@gmail.com)'
__version__ = '0.0.0'
#from pyCausality.TimeSeries.TS import *
#from pyCausality.TimeSeries.automatic_thresholding import *
#from pyCausality.TimeSeries.distances import *
#from pyCausality.TimeSeries.measures import *
#from pyCausality.TimeSeries.smoothing... | Add ts statistics to the tests module. | Add ts statistics to the tests module.
| Python | mit | tgquintela/TimeSeriesTools,tgquintela/TimeSeriesTools | ---
+++
@@ -38,7 +38,7 @@
# test_measures.test()
test_transformations.test()
test_burstdetection.test()
-# test_tsstatistics.test()
+ test_tsstatistics.test()
# test_regimedetection.test()
# test_feature_extraction.test()
# test_similarities.test() |
76abc1d6043a509418027c618d16c5a38502f2f2 | findaconf/tests/test_site_routes.py | findaconf/tests/test_site_routes.py | # coding: utf-8
from findaconf import app, db
from findaconf.tests.config import set_app, unset_app
from unittest import TestCase
class TestSiteRoutes(TestCase):
def setUp(self):
self.app = set_app(app, db)
def tearDown(self):
unset_app(db)
# test routes from blueprint/site.py
def ... | # coding: utf-8
from findaconf import app, db
from findaconf.tests.config import set_app, unset_app
from unittest import TestCase
class TestSiteRoutes(TestCase):
def setUp(self):
self.app = set_app(app, db)
def tearDown(self):
unset_app(db)
# test routes from blueprint/site.py
def ... | Add tests for login oauth links | Add tests for login oauth links
| Python | mit | cuducos/findaconf,cuducos/findaconf,koorukuroo/findaconf,koorukuroo/findaconf,koorukuroo/findaconf,cuducos/findaconf | ---
+++
@@ -27,14 +27,31 @@
'location': 'University of Essex'})
assert resp.status_code == 200
assert resp.mimetype == 'text/html'
-
+
def test_login(self):
-
+
# test if login page exists
resp = self.app.get('/login')
... |
0663793adc99b83d76578f5266e07e2ecbb4bd71 | test/run_tests.py | test/run_tests.py | """This module uses unittest TestLoader to run tests"""
import sys
import unittest
if __name__ == '__main__':
sys.dont_write_bytecode = True
SUITE = unittest.TestLoader().discover(".")
unittest.TextTestRunner(verbosity=2, buffer=True).run(SUITE)
| """This module uses unittest TestLoader to run tests"""
import sys
import unittest
if __name__ == '__main__':
sys.dont_write_bytecode = True
SUITE = unittest.TestLoader().discover(".")
unittest.TextTestRunner(verbosity=1, buffer=True).run(SUITE)
| Make run_test output less verbose | Make run_test output less verbose
| Python | mit | blairck/chess_notation | ---
+++
@@ -5,4 +5,4 @@
if __name__ == '__main__':
sys.dont_write_bytecode = True
SUITE = unittest.TestLoader().discover(".")
- unittest.TextTestRunner(verbosity=2, buffer=True).run(SUITE)
+ unittest.TextTestRunner(verbosity=1, buffer=True).run(SUITE) |
2080c35b6708718a4014fcbb23e1de3c82d42245 | opps/core/__init__.py | opps/core/__init__.py | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
trans_app_label = _('Core')
| # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
trans_app_label = _('Opps')
| Change trans app label core models to CMS name | Change trans app label core models to CMS name
| Python | mit | opps/opps,opps/opps,williamroot/opps,jeanmask/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,williamroot/opps,opps/opps | ---
+++
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
-trans_app_label = _('Core')
+trans_app_label = _('Opps') |
3e2746de9aae541880fe4cf643520a2577a3a0d5 | tof_server/views.py | tof_server/views.py | """This module provides views for application."""
from tof_server import app, versioning, mysql
from flask import jsonify, make_response
import string, random
@app.route('/')
def index():
"""Server information"""
return jsonify({
'server-version' : versioning.SERVER_VERSION,
'client-versions' :... | """This module provides views for application."""
from tof_server import app, versioning, mysql
from flask import jsonify, make_response
import string, random
@app.route('/')
def index():
"""Server information"""
return jsonify({
'server-version' : versioning.SERVER_VERSION,
'client-versions' :... | Add stub methods for map handling | Add stub methods for map handling
| Python | mit | P1X-in/Tanks-of-Freedom-Server | ---
+++
@@ -14,30 +14,40 @@
@app.route('/players', methods=['POST'])
def generate_new_id():
"""Method for generating new unique player ids"""
- try:
- cursor = mysql.connection.cursor()
- new_pin = ''
+ cursor = mysql.connection.cursor()
+ new_pin = ''
- characters_pool = string... |
757f984f37d6b3f989c7d9109a09834c2834197f | pipeline/compute_rpp/compute_rpp.py | pipeline/compute_rpp/compute_rpp.py | import sys
import os
import numpy as np
from skcycling.utils import load_power_from_fit
from skcycling.power_profile import Rpp
# The first input argument corresponding to the data path
data_path = sys.argv[1]
# The second input argument is the storage directory
storage_path = sys.argv[2]
# We can create a list of ... | import sys
import os
import numpy as np
from skcycling.utils import load_power_from_fit
from skcycling.restoration import denoise
from skcycling.power_profile import Rpp
# The first input argument corresponding to the data path
data_path = sys.argv[1]
# The second input argument is the storage directory
storage_path... | Update the pipeline to take into account the outlier rejection method to compute the RPP | Update the pipeline to take into account the outlier rejection method to compute the RPP
| Python | mit | clemaitre58/power-profile,clemaitre58/power-profile,glemaitre/power-profile,glemaitre/power-profile | ---
+++
@@ -3,6 +3,7 @@
import numpy as np
from skcycling.utils import load_power_from_fit
+from skcycling.restoration import denoise
from skcycling.power_profile import Rpp
# The first input argument corresponding to the data path
@@ -26,6 +27,8 @@
print 'Process file #{} over {}'.format(idx_file+1, len... |
d6536696f322beba321384ec58c1576b56d3eec2 | clio/utils.py | clio/utils.py |
import json
from bson import json_util
from flask.wrappers import Request, cached_property
def getBoolean(string):
if string is None:
return False
return {
'1': True, 'yes': True, 'true': True, 'on': True,
'0': False, 'no': False, 'false': False, 'off': False, '': False, None: False
... |
import json
from bson import json_util, BSON
from flask.wrappers import Request, cached_property
def getBoolean(string):
if string is None:
return False
return {
'1': True, 'yes': True, 'true': True, 'on': True,
'0': False, 'no': False, 'false': False, 'off': False, '': False, None: F... | Add support for decoding data serialized as BSON. | Add support for decoding data serialized as BSON.
| Python | apache-2.0 | geodelic/clio,geodelic/clio | ---
+++
@@ -1,6 +1,6 @@
import json
-from bson import json_util
+from bson import json_util, BSON
from flask.wrappers import Request, cached_property
@@ -19,6 +19,9 @@
"""If the mimetype is `application/json` this will contain the
parsed JSON data.
"""
+ if self.mimetype == '... |
aa359661c31df53885e19f5acb2e0171b6f87398 | recipe_scrapers/innit.py | recipe_scrapers/innit.py | from ._abstract import AbstractScraper
"""
Note that innit hosts recipes for several companies. I found it while looking at centralmarket.com
"""
class Innit(AbstractScraper):
@classmethod
def host(self, domain="com"):
return f"innit.{domain}"
| from ._abstract import AbstractScraper
"""
Note that innit hosts recipes for several companies. I found it while looking at centralmarket.com
"""
class Innit(AbstractScraper):
@classmethod
def host(self, domain="com"):
return f"innit.{domain}"
def title(self):
return self.schema.tit... | Add wrapper methods for clarity. | Add wrapper methods for clarity.
| Python | mit | hhursev/recipe-scraper | ---
+++
@@ -9,3 +9,24 @@
@classmethod
def host(self, domain="com"):
return f"innit.{domain}"
+
+ def title(self):
+ return self.schema.title()
+
+ def total_time(self):
+ return self.schema.total_time()
+
+ def yields(self):
+ return self.schema.yields()
+
+ def ima... |
d06ff3fede08430146a03efb7964363fa950b1c9 | pyon/util/int_test.py | pyon/util/int_test.py | #!/usr/bin/env python
"""Integration test base class and utils"""
from contextlib import contextmanager
import unittest
from pyon.container.cc import Container
from pyon.core.bootstrap import bootstrap_pyon
# Make this call more deterministic in time.
bootstrap_pyon()
class IonIntegrationTestCase(unittest.TestCase... | #!/usr/bin/env python
"""Integration test base class and utils"""
from contextlib import contextmanager
import unittest
from pyon.container.cc import Container
from pyon.core.bootstrap import bootstrap_pyon
from mock import patch
# Make this call more deterministic in time.
bootstrap_pyon()
class IonIntegrationTes... | Add option to turn on queue auto delete | Add option to turn on queue auto delete
| Python | bsd-2-clause | mkl-/scioncc,crchemist/scioncc,scionrep/scioncc,mkl-/scioncc,scionrep/scioncc,crchemist/scioncc,scionrep/scioncc,mkl-/scioncc,crchemist/scioncc,ooici/pyon,ooici/pyon | ---
+++
@@ -7,6 +7,7 @@
from pyon.container.cc import Container
from pyon.core.bootstrap import bootstrap_pyon
+from mock import patch
# Make this call more deterministic in time.
bootstrap_pyon()
@@ -45,3 +46,8 @@
if self.container:
self.container.stop()
self.container = No... |
af42088008ec2592885005e1a6e2b0ae52fd15a8 | File.py | File.py | import scipy.io.wavfile as wav
import numpy
import warnings
def wavread(filename):
with warnings.catch_warnings():
warnings.simplefilter("ignore")
fs,x = wav.read(filename)
maxv = numpy.iinfo(x.dtype).max
x = x.astype('float')
x = x / maxv
return (fs,x)
def wavwrite(filename, fs, x):
maxv = numpy.iinfo(nump... | import scipy.io.wavfile as wav
import numpy
import warnings
def wavread(filename):
with warnings.catch_warnings():
warnings.simplefilter("ignore")
fs,x = wav.read(filename)
maxv = numpy.iinfo(x.dtype).max
return (fs,x.astype('float') / maxv)
def wavwrite(filename, fs, x):
maxv = numpy.iinfo(numpy.int16).max
... | Test fuer WAV write und read gleichheit | Test fuer WAV write und read gleichheit
| Python | mit | antiface/dspy,nils-werner/dspy | ---
+++
@@ -7,13 +7,8 @@
warnings.simplefilter("ignore")
fs,x = wav.read(filename)
maxv = numpy.iinfo(x.dtype).max
- x = x.astype('float')
- x = x / maxv
- return (fs,x)
+ return (fs,x.astype('float') / maxv)
def wavwrite(filename, fs, x):
maxv = numpy.iinfo(numpy.int16).max
- x /= numpy.max(numpy.abs(x)... |
93d066f464a048881010a9d468a727a48e78c69d | books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py | books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py | # Vigenère Cipher Dictionary Hacker
# https://www.nostarch.com/crackingcodes/ (BSD Licensed)
from books.CrackingCodesWithPython.pyperclip import copy
from books.CrackingCodesWithPython.Chapter11.detectEnglish import isEnglish
from books.CrackingCodesWithPython.Chapter18.vigenereCipher import decryptMessage
def main(... | # Vigenère Cipher Dictionary Hacker
# https://www.nostarch.com/crackingcodes/ (BSD Licensed)
from books.CrackingCodesWithPython.pyperclip import copy
from books.CrackingCodesWithPython.Chapter11.detectEnglish import isEnglish
from books.CrackingCodesWithPython.Chapter18.vigenereCipher import decryptMessage
DICTIONARY... | Update vigenereDicitonaryHacker: added full path to dictionary file | Update vigenereDicitonaryHacker: added full path to dictionary file
| Python | mit | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | ---
+++
@@ -4,6 +4,8 @@
from books.CrackingCodesWithPython.pyperclip import copy
from books.CrackingCodesWithPython.Chapter11.detectEnglish import isEnglish
from books.CrackingCodesWithPython.Chapter18.vigenereCipher import decryptMessage
+
+DICTIONARY_FILE = "/home/jose/PycharmProjects/python-tutorials/books/Crac... |
4b54a8a038d5f9f2ead224b030f87f393d57d40b | tests/__init__.py | tests/__init__.py | """Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the command classes in... | """Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the command classes in... | Fix test_copyreg when numpy is installed (GH-20935) | bpo-41003: Fix test_copyreg when numpy is installed (GH-20935)
Fix test_copyreg when numpy is installed: test.pickletester now
saves/restores warnings.filters when importing numpy, to ignore
filters installed by numpy.
Add the save_restore_warnings_filters() function to the
test.support.warnings_helper module. | Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | ---
+++
@@ -15,26 +15,25 @@
import os
import sys
import unittest
-import warnings
from test.support import run_unittest
+from test.support.warnings_helper import save_restore_warnings_filters
here = os.path.dirname(__file__) or os.curdir
def test_suite():
- old_filters = warnings.filters[:]
suit... |
19656decb756db364d012cbfb13d0ddf30e15bae | py/tests/test_runner.py | py/tests/test_runner.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Fix running python tests by changing the env directly | [SW-1610][FollowUp] Fix running python tests by changing the env directly
(cherry picked from commit 0d808a100cd14fce9d4fba4f9cde6ad5315fbc12)
| Python | apache-2.0 | h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water | ---
+++
@@ -26,6 +26,10 @@
else:
path = "{}:{}".format(dist, path)
+os.putenv("PYTHONPATH", path)
+os.putenv('PYSPARK_DRIVER_PYTHON', sys.executable)
+os.putenv('PYSPARK_PYTHON', sys.executable)
+
os.environ["PYTHONPATH"] = path
os.environ['PYSPARK_DRIVER_PYTHON'] = sys.executable
os.environ['PYSPARK_PYTHO... |
bc6999e5e587a5e4dfd8b65f168de8ebce8bc93b | webnotes/website/doctype/blog_category/blog_category.py | webnotes/website/doctype/blog_category/blog_category.py | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.webutils import WebsiteGenerator, cleanup_page_name, clear_cache
class DocType(WebsiteGenerator):
def __init__(self, d, dl):
self.doc, self.do... | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.webutils import WebsiteGenerator, cleanup_page_name, clear_cache
class DocType(WebsiteGenerator):
def __init__(self, d, dl):
self.doc, self.do... | Fix in Blog Category Naming | Fix in Blog Category Naming
| Python | mit | aboganas/frappe,RicardoJohann/frappe,gangadharkadam/letzfrappe,mbauskar/omnitech-demo-frappe,mhbu50/frappe,BhupeshGupta/frappe,gangadhar-kadam/laganfrappe,mbauskar/omnitech-frappe,shitolepriya/test-frappe,shitolepriya/test-frappe,mbauskar/tele-frappe,gangadharkadam/letzfrappe,gangadharkadam/frappecontribution,sbktechno... | ---
+++
@@ -8,6 +8,10 @@
class DocType(WebsiteGenerator):
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
+
+ def autoname(self):
+ # to override autoname of WebsiteGenerator
+ self.doc.name = self.doc.category_name
def get_page_title(self):
return self.doc.title |
3ec2cc49a68894572f2eafc9172f4140791b6fc5 | sremailer.py | sremailer.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import bottle
import stoneridge
@bottle.post('/email')
def email():
r = bottle.request.form... | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import bottle
import logging
import stoneridge
@bottle.post('/email')
def email():
logging.... | Add logging to email daemon | Add logging to email daemon
| Python | mpl-2.0 | mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge | ---
+++
@@ -4,16 +4,21 @@
# obtain one at http://mozilla.org/MPL/2.0/.
import bottle
+import logging
import stoneridge
@bottle.post('/email')
def email():
+ logging.debug('handling email')
r = bottle.request.forms
to = r.get('to')
+ logging.debug('to: %s' % (to,))
subject = r.get('su... |
37bedf8495834f0773f8a082c3f358321ebb8f77 | src/utils.py | src/utils.py | import os
vowels = ['a e i o u']
constanents = ['b c d f g h j k l m n p q r s t v w x y z 1 2 3 4 \
5 6 7 8 9 0']
def inInventory(itemClass, player):
for item in player.inventory:
if isinstance(item, itemClass):
return True
break
return False
def getItemFrom... | import os
vowels = ['a e i o u'].split(' ')
consonants = ['b c d f g h j k l m n p q r s t v w x y z 1 2 3 4 \
5 6 7 8 9 0'].split(' ')
def inInventory(itemClass, player):
for item in player.inventory:
if isinstance(item, itemClass):
return True
break
return Fa... | Fix @DaVinci789's crappy spelling >:) | Fix @DaVinci789's crappy spelling >:)
| Python | mit | allanburleson/python-adventure-game,disorientedperson/python-adventure-game | ---
+++
@@ -1,8 +1,8 @@
import os
-vowels = ['a e i o u']
-constanents = ['b c d f g h j k l m n p q r s t v w x y z 1 2 3 4 \
- 5 6 7 8 9 0']
+vowels = ['a e i o u'].split(' ')
+consonants = ['b c d f g h j k l m n p q r s t v w x y z 1 2 3 4 \
+ 5 6 7 8 9 0'].split(' ')
def inI... |
5f73fd983caa758a77f0fd823425057bd8b36204 | devproject/devproject/urls.py | devproject/devproject/urls.py | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^flickr/', include('ditto.flickr.urls', namespace='flickr')),
url(r'^pinboard/', include('ditto.pinboard.urls', namespace='pinboard')),
url(r'^twitter/', include... | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^flickr/', include('ditto.flickr.urls', namespace='flickr')),
url(r'^pinboard/', include('ditto.pinboard.urls', namespace='pinboard')),
url(r'^twitter/', include... | Fix deprecation re url patterns | Fix deprecation re url patterns
| Python | mit | philgyford/django-ditto,philgyford/django-ditto,philgyford/django-ditto | ---
+++
@@ -13,10 +13,9 @@
from django.conf import settings
-from django.conf.urls import include, patterns, url
if settings.DEBUG:
import debug_toolbar
- urlpatterns += patterns('',
+ urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
- )
+ ] |
b57a2e184e3861617c12801529295b0095257cd9 | petition/resources.py | petition/resources.py | from import_export import resources
from .models import Signature
class SignatureResource(resources.ModelResource):
class Meta:
exclude = ('created_on', 'modified_on')
model = Signature
| from import_export import resources
import swapper
Signature = swapper.load_model("petition", "Signature")
class SignatureResource(resources.ModelResource):
class Meta:
model = Signature
| Fix swappable model in signature export | Fix swappable model in signature export
| Python | mit | watchdogpolska/django-one-petition,watchdogpolska/django-one-petition,watchdogpolska/django-one-petition | ---
+++
@@ -1,8 +1,9 @@
from import_export import resources
-from .models import Signature
+import swapper
+
+Signature = swapper.load_model("petition", "Signature")
class SignatureResource(resources.ModelResource):
class Meta:
- exclude = ('created_on', 'modified_on')
model = Signature |
8851223a1576a4e164449b589f68c0420966d622 | PythonScript/GenerateBook.py | PythonScript/GenerateBook.py | #Set Cover=Cover
#Set BookCover=%BookName%%Cover%
#Set BookCoverHTML=%BookCover%%HTMLExt%
#Call pandoc ..\source\%BookCover%%BookExt% -o %BookCoverHTML% --standalone %CSS_%%Cover%%CSSExt% --verbose
def GenerateCover():
pass
if __name__ == '__main__':
GenerateCover()
| import subprocess
def GenerateCover():
Cover = "Cover"
BookName = "BookName"
BookCover = BookName + Cover
BookExt = "BookExt"
HTMLExt = "HTMLExt"
BookCoverHTML = BookCover + HTMLExt
CSS = "CSS_"
CSSExt = "CSSExt"
pandocCommand = "pandoc ..\\source\\" + BookCover + BookExt + " -o "
+ BookCoverHTML + " -standa... | Implement GenerateCover using fake vars | Implement GenerateCover using fake vars
| Python | mit | fan-jiang/Dujing | ---
+++
@@ -1,10 +1,17 @@
-#Set Cover=Cover
-#Set BookCover=%BookName%%Cover%
-#Set BookCoverHTML=%BookCover%%HTMLExt%
-#Call pandoc ..\source\%BookCover%%BookExt% -o %BookCoverHTML% --standalone %CSS_%%Cover%%CSSExt% --verbose
+import subprocess
+def GenerateCover():
+ Cover = "Cover"
+ BookName = "BookName"
+ BookC... |
795d76074b0d8336ebe29b3816186732d29c0cd2 | deployer/__init__.py | deployer/__init__.py | from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.5.0'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
| from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.5.1'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
| Update to next dev version | Update to next dev version | Python | mit | totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer | ---
+++
@@ -3,7 +3,7 @@
from celery.signals import setup_logging
-__version__ = '0.5.0'
+__version__ = '0.5.1'
__author__ = 'sukrit'
deployer.logger.init_logging() |
2b7a703aab3e07cee82a0b1cc494dab71d7c22df | bin/build-scripts/write_build_time.py | bin/build-scripts/write_build_time.py | #!/usr/bin/env python
import time
now = time.time()
formatted = time.strftime("%B %d, %Y %H:%M:%S UTC", time.gmtime())
print 'exports.string = %r' % formatted
# Note Javascript uses milliseconds:
print 'exports.timestamp = %i' % int(now * 1000)
import subprocess
print 'exports.gitrevision = %r' % subprocess.check_ou... | #!/usr/bin/env python
import time
now = time.time()
formatted = time.strftime("%B %d, %Y %H:%M:%S UTC", time.gmtime())
print 'exports.string = %r' % formatted
# Note Javascript uses milliseconds:
print 'exports.timestamp = %i' % int(now * 1000)
import subprocess
print 'exports.gitrevision = %r' % subprocess.check_ou... | Use correct latest commit in __version__ endpoint | Use correct latest commit in __version__ endpoint
| Python | mpl-2.0 | mozilla-services/pageshot,mozilla-services/screenshots,mozilla-services/pageshot,mozilla-services/pageshot,mozilla-services/screenshots,mozilla-services/screenshots,mozilla-services/screenshots,mozilla-services/pageshot | ---
+++
@@ -10,4 +10,4 @@
import subprocess
print 'exports.gitrevision = %r' % subprocess.check_output(
- ["git", "describe", "--always"]).strip()
+ ["git", "describe", "--tags", "--always"]).strip() |
3a57d826a957b864753895d8769dcf747d489e1b | administrator/serializers.py | administrator/serializers.py | from categories.models import Category, Keyword, Subcategory
from rest_framework import serializers
class SubcategoryListSerializer(serializers.ModelSerializer):
class Meta:
model = Subcategory
fields = ('pk', 'name')
class CategorySerializer(serializers.ModelSerializer):
subcategories = Sub... | from categories.models import Category, Keyword, Subcategory
from rest_framework import serializers
class SubcategoryListSerializer(serializers.ModelSerializer):
class Meta:
model = Subcategory
fields = ('pk', 'name')
class CategorySerializer(serializers.ModelSerializer):
subcategories = Sub... | Remove category serializer from subcategory serializer | Remove category serializer from subcategory serializer
| Python | apache-2.0 | belatrix/BackendAllStars | ---
+++
@@ -22,7 +22,6 @@
class SubcategorySerializer(serializers.ModelSerializer):
- category = CategorySerializer(read_only=True, many=True)
-
class Meta:
model = Subcategory
+ fields = ('pk', 'name', 'is_active') |
0960ca60effa80ca52a715d30f9651741c3b9800 | python/sparknlp/annotation.py | python/sparknlp/annotation.py | from pyspark.sql.types import *
class Annotation:
def __init__(self, annotator_type, begin, end, result, metadata, embeddings):
self.annotator_type = annotator_type
self.begin = begin
self.end = end
self.result = result
self.metadata = metadata
self.embeddings = em... | from pyspark.sql.types import *
class Annotation:
def __init__(self, annotator_type, begin, end, result, metadata, embeddings):
self.annotator_type = annotator_type
self.begin = begin
self.end = end
self.result = result
self.metadata = metadata
self.embeddings = em... | Fix Python dataType Annotation [skip travis] | Fix Python dataType Annotation [skip travis]
Fix in python dataType for Annotation [skip travis] | Python | apache-2.0 | JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp | ---
+++
@@ -26,7 +26,7 @@
@staticmethod
def dataType():
return StructType([
- StructField('annotator_type', StringType(), False),
+ StructField('annotatorType', StringType(), False),
StructField('begin', IntegerType(), False),
StructField('end', Integ... |
30cf33413086f558a07638aadf8b38f6e887a7fc | openedx/core/djangoapps/appsembler/settings/settings/devstack_lms.py | openedx/core/djangoapps/appsembler/settings/settings/devstack_lms.py | """
Settings for Appsembler on devstack/LMS.
"""
from os import path
from openedx.core.djangoapps.appsembler.settings.settings import devstack_common
def plugin_settings(settings):
"""
Appsembler LMS overrides for devstack.
"""
devstack_common.plugin_settings(settings)
settings.DEBUG_TOOLBAR_PAT... | """
Settings for Appsembler on devstack/LMS.
"""
from os import path
from openedx.core.djangoapps.appsembler.settings.settings import devstack_common
def plugin_settings(settings):
"""
Appsembler LMS overrides for devstack.
"""
devstack_common.plugin_settings(settings)
settings.DEBUG_TOOLBAR_PAT... | Fix /media/ redirects on devstack | Fix /media/ redirects on devstack
| Python | agpl-3.0 | appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform | ---
+++
@@ -32,3 +32,7 @@
customer_themes_dir = path.join(settings.COMPREHENSIVE_THEME_DIRS[0], 'customer_themes')
if path.isdir(customer_themes_dir):
settings.STATICFILES_DIRS.insert(0, customer_themes_dir)
+
+ # This is used in the appsembler_sites.middleware.RedirectMiddleware to ... |
2ce08224bc87ae34f546211c80d2b89a38acd0ec | chromepass.py | chromepass.py | from os import getenv
import sqlite3
import win32crypt
csv_file = open("chromepass.csv",'wb')
csv_file.write("link,username,password\n".encode('utf-8'))
appdata = getenv("APPDATA")
if appdata[-7:] == "Roaming": #Some WINDOWS Installations point to Roaming.
appdata = appdata[:-8]
connection = sqlite3.connect(appdata +... | from os import getenv
import sqlite3
import win32crypt
import argparse
def args_parser():
parser = argparse.ArgumentParser(description="Retrieve Google Chrome Passwords")
parser.add_argument("--output", help="Output to csv file", action="store_true")
args = parser.parse_args()
if args.output:
... | Complete Overhaul. Argeparse used. Outputs to csv | Complete Overhaul. Argeparse used. Outputs to csv
| Python | mit | hassaanaliw/chromepass | ---
+++
@@ -1,22 +1,54 @@
from os import getenv
import sqlite3
import win32crypt
-csv_file = open("chromepass.csv",'wb')
-csv_file.write("link,username,password\n".encode('utf-8'))
-appdata = getenv("APPDATA")
-if appdata[-7:] == "Roaming": #Some WINDOWS Installations point to Roaming.
- appdata = appdata[:-8]
-c... |
7a2e6723a925626b1d8ee6f70c656a9fd5befd5d | airflow/utils/__init__.py | airflow/utils/__init__.py | # -*- coding: utf-8 -*-
#
# 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
... | # -*- coding: utf-8 -*-
#
# 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
... | Fix airflow.utils deprecation warning code being Python 3 incompatible | Fix airflow.utils deprecation warning code being Python 3 incompatible
See https://docs.python.org/3.0/whatsnew/3.0.html#operators-and-special-methods
| Python | apache-2.0 | wooga/airflow,AllisonWang/incubator-airflow,sid88in/incubator-airflow,nathanielvarona/airflow,gritlogic/incubator-airflow,hgrif/incubator-airflow,gilt/incubator-airflow,sdiazb/airflow,andyxhadji/incubator-airflow,vijaysbhat/incubator-airflow,dmitry-r/incubator-airflow,mtagle/airflow,gritlogic/incubator-airflow,mrares/i... | ---
+++
@@ -29,7 +29,7 @@
from airflow.utils.decorators import apply_defaults
""",
category=PendingDeprecationWarning,
- filename=func.func_code.co_filename,
- lineno=func.func_code.co_firstlineno + 1
+ filename=func.__code__.co_filename,
+ lineno=func.__code__.c... |
b0b57fd69378c3ed6ee35abd0c45c952a1c52dd1 | planet_alignment/test/config/bunch_parser.py | planet_alignment/test/config/bunch_parser.py | """
.. module:: config_parser
:platform: linux
:synopsis: Module to test the bunch YAML configuration parser.
.. moduleauthor:: Paul Fanelli <paul.fanelli@gmail.com>
.. modulecreated:: 6/26/15
"""
from bunch import Bunch
import pytest
from planet_alignment.config.bunch_parser import BunchParser
from planet_ali... | """
.. module:: config_parser
:platform: linux
:synopsis: Module to test the bunch YAML configuration parser.
.. moduleauthor:: Paul Fanelli <paul.fanelli@gmail.com>
.. modulecreated:: 6/26/15
"""
from bunch import Bunch
import pytest
from planet_alignment.config.bunch_parser import BunchParser
from planet_ali... | Remove superfluous 'is True' from the assert. | Remove superfluous 'is True' from the assert.
| Python | mit | paulfanelli/planet_alignment | ---
+++
@@ -37,4 +37,4 @@
def test_parse_config_file(fix_parser):
config_file = constants.TEST_SYSTEM_YAML
b = fix_parser.parse(config_file)
- assert isinstance(b, Bunch) is True
+ assert isinstance(b, Bunch) |
fd03c80eb7b705f6f3e9e6c554950ed15a7ecdd4 | face_it/settings/dev.py | face_it/settings/dev.py | from .base import *
DEBUG = True
try:
from .local import *
except ImportError:
pass
SOCIAL_AUTH_YAMMER_KEY = 'OCnfR7VJNBbcSS8GXMCi3A'
SOCIAL_AUTH_YAMMER_SECRET = 'y1MZSoo0MuX8RJPEjMbZWJDvafR9mZmFWWUfHOcZgxM'
| from .base import *
DEBUG = True
try:
from .local import *
except ImportError:
pass
| Remove yammer api key that was accidentally committed | Remove yammer api key that was accidentally committed
| Python | cc0-1.0 | m3brown/face_it,m3brown/face_it,excellalabs/face-off,m3brown/face_it,kave/Face-Off,m3brown/face_it,madridsoccer5/face-off,excellalabs/face-off,kave/Face-Off,excellalabs/face-off,madridsoccer5/face-off,kave/Face-Off,excellalabs/face-off,kave/Face-Off,madridsoccer5/face-off,madridsoccer5/face-off | ---
+++
@@ -6,6 +6,3 @@
from .local import *
except ImportError:
pass
-
-SOCIAL_AUTH_YAMMER_KEY = 'OCnfR7VJNBbcSS8GXMCi3A'
-SOCIAL_AUTH_YAMMER_SECRET = 'y1MZSoo0MuX8RJPEjMbZWJDvafR9mZmFWWUfHOcZgxM' |
8121924b8d056752a31255646b116e9eb6fbbaa6 | plugins/reversedns.py | plugins/reversedns.py | import logging, interfaces, os, IPy
from StringIO import StringIO
class Shorewall(interfaces.IOpenMesherPlugin):
def __init__(self):
self._files = {}
def process(self, mesh):
logging.debug('Generating DNS config...')
self._files = {}
rdns = StringIO()
for r... | import logging, interfaces, os, IPy
from StringIO import StringIO
class Shorewall(interfaces.IOpenMesherPlugin):
def __init__(self):
self._files = {}
def process(self, mesh):
logging.debug('Generating DNS config...')
self._files = {}
rdns = StringIO()
for r... | Fix bad path for mesh-reverse.db | Fix bad path for mesh-reverse.db
| Python | bsd-3-clause | heyaaron/openmesher,heyaaron/openmesher,darkpixel/openmesher,darkpixel/openmesher | ---
+++
@@ -20,7 +20,7 @@
#BUG: Need to put iface name in rev dns
rdns.write('%s\t\tPTR\t%s.\n' %(ip1.reverseName(), link.server.fqdn))
rdns.write('%s\t\tPTR\t%s.\n' %(ip2.reverseName(), link.client.fqdn))
- self._files[router] = {'/etc/mesh-re... |
fb03522237afdd56059fb0146e1609b85606286f | l10n_ch_import_cresus/__openerp__.py | l10n_ch_import_cresus/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | Add Odoo Community Association (OCA) as author | Add Odoo Community Association (OCA) as author | Python | agpl-3.0 | open-net-sarl/l10n-switzerland,BT-ojossen/l10n-switzerland,cgaspoz/l10n-switzerland,CompassionCH/l10n-switzerland,BT-fgarbely/l10n-switzerland,BT-csanchez/l10n-switzerland,cyp-opennet/ons_cyp_github,BT-fgarbely/l10n-switzerland,ndtran/l10n-switzerland,CompassionCH/l10n-switzerland,cyp-opennet/ons_cyp_github,open-net-sa... | ---
+++
@@ -25,7 +25,7 @@
'depends': [
'account',
],
- 'author': 'Camptocamp',
+ 'author': 'Camptocamp, Odoo Community Association (OCA)',
'website': 'http://www.camptocamp.com',
'data': [
'wizard/l10n_ch_import_cresus_view.xml', |
53ff13fa0822dbabf554360bf000f8b3bfe41f40 | imagersite/imager_profile/models.py | imagersite/imager_profile/models.py | from django.db import models
# Create your models here.
| """Establish models for the imager site's User Profile."""
from django.db import models
from django.contrib.auth.models import User
class ImagerProfile(models.Model):
"""Profile attached to User models by one-to-one relationship."""
user = models.OneToOneField(User, related_name='profile')
is_active = mo... | Set up basic imagerprofile and made first migration | Set up basic imagerprofile and made first migration
| Python | mpl-2.0 | WillWeatherford/django-imager,WillWeatherford/django-imager | ---
+++
@@ -1,3 +1,13 @@
+"""Establish models for the imager site's User Profile."""
from django.db import models
+from django.contrib.auth.models import User
-# Create your models here.
+
+class ImagerProfile(models.Model):
+ """Profile attached to User models by one-to-one relationship."""
+
+ user = model... |
48d0dc98fd859ea1d8cf25370fe0be9ac1350448 | selftest/subdir/proc.py | selftest/subdir/proc.py | # Copyright 2012 Dietrich Epp <depp@zdome.net>
# See LICENSE.txt for details.
@test
def nostdin_1():
check_output(['./nostdin'], 'Test', '')
@test(fail=True)
def nostdin_2_fail():
check_output(['./nostdin'], 'Test', 'Bogus')
@test
def nostdout_1():
check_output(['./nostdout'], 'Test', '')
@test(fail=Tru... | # Copyright 2012 Dietrich Epp <depp@zdome.net>
# See LICENSE.txt for details.
@test(fail=True)
def nostdin_1():
check_output(['./nostdin'], 'Test', '')
fail("The pipe didn't break, but that's okay")
@test(fail=True)
def nostdin_2_fail():
check_output(['./nostdin'], 'Test', 'Bogus')
@test
def nostdout_1()... | Mark broken pipe test with expected failure | Mark broken pipe test with expected failure
| Python | bsd-2-clause | depp/idiotest,depp/idiotest | ---
+++
@@ -1,9 +1,10 @@
# Copyright 2012 Dietrich Epp <depp@zdome.net>
# See LICENSE.txt for details.
-@test
+@test(fail=True)
def nostdin_1():
check_output(['./nostdin'], 'Test', '')
+ fail("The pipe didn't break, but that's okay")
@test(fail=True)
def nostdin_2_fail(): |
39708edfad5698b34771eba941ac822cbf84baa7 | readthedocs/oauth/migrations/0004_drop_github_and_bitbucket_models.py | readthedocs/oauth/migrations/0004_drop_github_and_bitbucket_models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('oauth', '0003_move_github'),
]
operations = [
migrations.RemoveField(
model_name='bitbucketproject',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def forwards_remove_content_types(apps, schema_editor):
db = schema_editor.connection.alias
ContentType = apps.get_model('contenttypes', 'ContentType')
ContentType.objects.using(db).filter(
ap... | Drop content type in migration as well | Drop content type in migration as well
| Python | mit | stevepiercy/readthedocs.org,techtonik/readthedocs.org,pombredanne/readthedocs.org,rtfd/readthedocs.org,stevepiercy/readthedocs.org,istresearch/readthedocs.org,techtonik/readthedocs.org,pombredanne/readthedocs.org,tddv/readthedocs.org,espdev/readthedocs.org,istresearch/readthedocs.org,rtfd/readthedocs.org,davidfischer/r... | ---
+++
@@ -2,6 +2,16 @@
from __future__ import unicode_literals
from django.db import models, migrations
+
+
+def forwards_remove_content_types(apps, schema_editor):
+ db = schema_editor.connection.alias
+ ContentType = apps.get_model('contenttypes', 'ContentType')
+ ContentType.objects.using(db).filter... |
056b4ae938ab1aacf5e3f48a1e17919a79ff29b7 | scripts/sbatch_cancel.py | scripts/sbatch_cancel.py | import subprocess
import sys
import getpass
### Kill a job and its chain of dependents (as created by sbatch_submit).
### Usage: python sbatch_cancel.py [Name of first running job in chain] ... | import subprocess
import sys
import getpass
### Kill a job and its chain of dependents (as created by sbatch_submit).
### Usage: python sbatch_cancel.py [Name of first running job in chain] [Name of fi... | Kill multiple chains at once. | Kill multiple chains at once.
| Python | mit | nyu-mll/spinn,nyu-mll/spinn,nyu-mll/spinn | ---
+++
@@ -3,21 +3,22 @@
import getpass
### Kill a job and its chain of dependents (as created by sbatch_submit).
-### Usage: python sbatch_cancel.py [Name of first running job in chain] ... |
994ef988e966499dbc5c7298a201105517692fc7 | source/views/views.py | source/views/views.py | import json
from django.shortcuts import render
from django.http import HttpResponse
from source.forms.search_form import SearchForm
from source.controllers.cater_controller import CaterController
def index(request):
if request.method == 'GET':
form = SearchForm(request.GET)
if form.is_valid():
... | import json
from django.shortcuts import render
from django.http import HttpResponse
from source.forms.search_form import SearchForm
from source.controllers.cater_controller import CaterController
def index(request):
if request.method == 'GET':
form = SearchForm(request.GET)
if form.is_valid():
... | Add extra line to separate functions | Add extra line to separate functions
| Python | mit | jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu | ---
+++
@@ -26,6 +26,7 @@
return render(request, 'index.html', {'status': 200, 'form': form})
+
def price(request):
if request.method == 'GET':
title = request.GET.__getitem__('title') |
cef6f3cce4a942bea53d6bae639dcd48d680d05a | gpytorch/means/linear_mean.py | gpytorch/means/linear_mean.py | #!/usr/bin/env python3
import torch
from .mean import Mean
class LinearMean(Mean):
def __init__(self, input_size, batch_shape=torch.Size(), bias=True):
super().__init__()
self.register_parameter(name='weights',
parameter=torch.nn.Parameter(torch.randn(*batch_shape,... | #!/usr/bin/env python3
import torch
from .mean import Mean
class LinearMean(Mean):
def __init__(self, input_size, batch_shape=torch.Size(), bias=True):
super().__init__()
self.register_parameter(name='weights',
parameter=torch.nn.Parameter(torch.randn(*batch_shape,... | Fix LinearMean bias when bias=False | Fix LinearMean bias when bias=False
| Python | mit | jrg365/gpytorch,jrg365/gpytorch,jrg365/gpytorch | ---
+++
@@ -11,6 +11,8 @@
parameter=torch.nn.Parameter(torch.randn(*batch_shape, input_size, 1)))
if bias:
self.register_parameter(name='bias', parameter=torch.nn.Parameter(torch.randn(*batch_shape, 1)))
+ else:
+ self.bias = None
def for... |
f00fd0fde81a340cf00030bbe2562b8c878edd41 | src/yawf/signals.py | src/yawf/signals.py | from django.dispatch import Signal
message_handled = Signal(providing_args=['message', 'instance', 'new_revision'])
| from django.dispatch import Signal
message_handled = Signal(
providing_args=['message', 'instance', 'new_revision', 'transition_result']
)
| Add new arg in message_handled signal definition | Add new arg in message_handled signal definition
| Python | mit | freevoid/yawf | ---
+++
@@ -1,3 +1,5 @@
from django.dispatch import Signal
-message_handled = Signal(providing_args=['message', 'instance', 'new_revision'])
+message_handled = Signal(
+ providing_args=['message', 'instance', 'new_revision', 'transition_result']
+ ) |
e1529a2071779dc7f657c3bbb370f3c2c5fb240e | HTTPCloser.py | HTTPCloser.py | import time, gevent
seen = None
def used(url, http_pool):
__patch()
seen[(url, http_pool)] = time.time()
def __patch():
global seen
if seen is None:
seen = {}
gevent.spawn(clean)
def clean():
while True:
for k, last_seen in seen.items:
if time.time... | import time, gevent
seen = None
def used(url, http_pool):
__patch()
seen[(url, http_pool)] = time.time()
def __patch():
global seen
if seen is None:
seen = {}
gevent.spawn(clean)
def clean():
while True:
for k, last_seen in seen.items():
if time.ti... | Fix typoe items vs items() | Fix typoe items vs items()
| Python | mit | c00w/bitHopper,c00w/bitHopper | ---
+++
@@ -14,7 +14,7 @@
def clean():
while True:
- for k, last_seen in seen.items:
+ for k, last_seen in seen.items():
if time.time()-last_seen < 0.3:
continue
|
5a76457e2b9596ad3497b0145410a2f4090a5c54 | tests/mixins.py | tests/mixins.py | class RedisCleanupMixin(object):
client = None
prefix = None
def setUp(self):
super(RedisCleanupMixin, self).setUp()
self.assertIsNotNone(self.client, "Need a redis client to be provided")
def tearDown(self):
root = '*'
if self.prefix is not None:
root = '{}... | class RedisCleanupMixin(object):
client = None
prefix = NotImplemented # type: str
def setUp(self):
super(RedisCleanupMixin, self).setUp()
self.assertIsNotNone(self.client, "Need a redis client to be provided")
def tearDown(self):
root = '*'
if self.prefix is not None:... | Add annotation required for mypy | Add annotation required for mypy
| Python | bsd-3-clause | thread/django-lightweight-queue,thread/django-lightweight-queue | ---
+++
@@ -1,6 +1,6 @@
class RedisCleanupMixin(object):
client = None
- prefix = None
+ prefix = NotImplemented # type: str
def setUp(self):
super(RedisCleanupMixin, self).setUp() |
e281c9ab30acdbc60439a143557efdeaf4757e1b | tests/integration/test_kcm_install.py | tests/integration/test_kcm_install.py | from . import integration
import os
import tempfile
def test_kcm_install():
# Install kcm to a temporary directory.
install_dir = tempfile.mkdtemp()
integration.execute(integration.kcm(),
["install",
"--install-dir={}".format(install_dir)])
installed_kc... | from . import integration
import os
import tempfile
def test_kcm_install():
# Install kcm to a temporary directory.
install_dir = tempfile.mkdtemp()
integration.execute(integration.kcm(),
["install",
"--install-dir={}".format(install_dir)])
installed_kc... | Remove the installed kcm binary after int tests. | Remove the installed kcm binary after int tests.
| Python | apache-2.0 | Intel-Corp/CPU-Manager-for-Kubernetes,Intel-Corp/CPU-Manager-for-Kubernetes,Intel-Corp/CPU-Manager-for-Kubernetes | ---
+++
@@ -16,3 +16,5 @@
integration.execute(integration.kcm(), ["--help"]))
assert (integration.execute(installed_kcm, ["--version"]) ==
integration.execute(integration.kcm(), ["--version"]))
+
+ integration.execute("rm", [installed_kcm]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.