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 |
|---|---|---|---|---|---|---|---|---|---|---|
3166d48bed0bd7663a3332736a236d8f424b6cd3 | room/views.py | room/views.py | from .models import Room
from rest_framework import viewsets
from .serializers import RoomDetailSerializer, RoomListSerializer
from rest_framework.decorators import detail_route
from django.core.exceptions import PermissionDenied
from rest_framework.exceptions import ParseError
from rest_framework.response import Respo... | from .models import Room
from rest_framework import viewsets
from .serializers import RoomDetailSerializer, RoomListSerializer
from rest_framework.decorators import detail_route
from django.core.exceptions import PermissionDenied
from rest_framework.exceptions import ParseError
from rest_framework.response import Respo... | Check hub permission @ report_availability | Check hub permission @ report_availability
| Python | mit | iver56/useat-api | ---
+++
@@ -6,6 +6,7 @@
from rest_framework.exceptions import ParseError
from rest_framework.response import Response
from django.utils import timezone
+from hub.models import Hub
class RoomViewSet(viewsets.ModelViewSet):
@@ -19,6 +20,20 @@
@detail_route(methods=['post'])
def report_availability(sel... |
6df54729954d5f9bd25549c482b3bc170a338ff0 | tests/completion.py | tests/completion.py | import sys
from nose.tools import ok_
from _utils import _output_eq, IntegrationSpec, _dispatch, trap, expect_exit
class ShellCompletion(IntegrationSpec):
"""
Shell tab-completion behavior
"""
def no_input_means_just_task_names(self):
_output_eq('-c simple_ns_list --complete', "z_toplevel\n... | import sys
from nose.tools import ok_
from _utils import (
_output_eq, IntegrationSpec, _dispatch, trap, expect_exit, assert_contains
)
class ShellCompletion(IntegrationSpec):
"""
Shell tab-completion behavior
"""
def no_input_means_just_task_names(self):
_output_eq('-c simple_ns_list -... | Make new test use contains assertion | Make new test use contains assertion
| Python | bsd-2-clause | mattrobenolt/invoke,frol/invoke,pfmoore/invoke,singingwolfboy/invoke,pyinvoke/invoke,kejbaly2/invoke,tyewang/invoke,pyinvoke/invoke,mkusz/invoke,frol/invoke,pfmoore/invoke,mkusz/invoke,mattrobenolt/invoke,kejbaly2/invoke | ---
+++
@@ -2,7 +2,9 @@
from nose.tools import ok_
-from _utils import _output_eq, IntegrationSpec, _dispatch, trap, expect_exit
+from _utils import (
+ _output_eq, IntegrationSpec, _dispatch, trap, expect_exit, assert_contains
+)
class ShellCompletion(IntegrationSpec):
@@ -23,4 +25,4 @@
output ... |
71fd42a92b41529d9f5c784840ab4c190946adef | social_auth/backends/pipeline/associate.py | social_auth/backends/pipeline/associate.py | from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from social_auth.utils import setting
from social_auth.models import UserSocialAuth
from social_auth.backends.pipeline import warn_setting
from social_auth.backends.exceptions import AuthException
def associate_by_email(details, user=None... | from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from social_auth.utils import setting
from social_auth.models import UserSocialAuth
from social_auth.backends.pipeline import warn_setting
from social_auth.backends.exceptions import AuthException
def associate_by_email(details, user=None... | Remove spammy warning which doesn't apply when stores check emails | Remove spammy warning which doesn't apply when stores check emails
| Python | bsd-3-clause | antoviaque/django-social-auth-norel | ---
+++
@@ -13,7 +13,8 @@
email = details.get('email')
- warn_setting('SOCIAL_AUTH_ASSOCIATE_BY_MAIL', 'associate_by_email')
+ # Don't spam with a warning, this doesn't apply when providers check emails
+ #warn_setting('SOCIAL_AUTH_ASSOCIATE_BY_MAIL', 'associate_by_email')
if email and settin... |
7e4c38c482bc908e85d8121c8e9d70b07ad9cd0d | salt/returners/mongo_return.py | salt/returners/mongo_return.py | '''
Return data to a mongodb server
This is the default interface for returning data for the butter statd subsytem
Required python modules: pymongo
'''
import logging
try:
import pymongo
has_pymongo = True
except ImportError:
has_pymongo = False
log = logging.getLogger(__name__)
__opts__ = {'mongo.db... | '''
Return data to a mongodb server
Required python modules: pymongo
'''
import logging
try:
import pymongo
has_pymongo = True
except ImportError:
has_pymongo = False
log = logging.getLogger(__name__)
__opts__ = {'mongo.db': 'salt',
'mongo.host': 'salt',
'mongo.password': '',
... | Remove reference to butter since butter is deprecated | Remove reference to butter since butter is deprecated
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -1,7 +1,5 @@
'''
Return data to a mongodb server
-
-This is the default interface for returning data for the butter statd subsytem
Required python modules: pymongo
''' |
6811b04a0a2e311fc2d014cd601da61a2f17a451 | sell/views.py | sell/views.py | from django.core.urlresolvers import reverse
from django.forms import model_to_dict
from django.http.response import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from common.models import Student
from sell.forms import PersonalDataForm
def index(request):
return HttpResponseRedirect(re... | from django.core.urlresolvers import reverse
from django.forms import model_to_dict
from django.http.response import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from common.models import Student
from sell.forms import PersonalDataForm
def index(request):
return HttpResponseRedirect(re... | Fix KeyError in Provide personal data form | Fix KeyError in Provide personal data form
| Python | agpl-3.0 | m4tx/egielda,m4tx/egielda,m4tx/egielda | ---
+++
@@ -19,7 +19,7 @@
request.session['personal_data'] = model_to_dict(form.save(commit=False))
return HttpResponseRedirect(reverse('sell.views.books'))
else:
- if request.session['personal_data']:
+ if 'personal_data' in request.session:
form = PersonalDa... |
7e76ced5a75a1d89be384fb4d748c3c0599bfaea | bugimporters/items.py | bugimporters/items.py | import scrapy.item
class ParsedBug(scrapy.item.Item):
# Fields beginning with an underscore are not really part of a
# bug, but extra information that can be exported.
_project_name = scrapy.item.Field()
_tracker_name = scrapy.item.Field()
# These fields correspond to bug data
title = scrapy.i... | import scrapy.item
class ParsedBug(scrapy.item.Item):
# Fields beginning with an underscore are not really part of a
# bug, but extra information that can be exported.
_project_name = scrapy.item.Field()
_tracker_name = scrapy.item.Field()
_deleted = scrapy.item.Field()
# These fields correspo... | Create _deleted field in ParsedBug | Create _deleted field in ParsedBug
We are migrating toward using a special ParsedBug flag to
indicate a bug is remotely deleted, rather than calling a
callback.
| Python | agpl-3.0 | openhatch/oh-bugimporters,openhatch/oh-bugimporters,openhatch/oh-bugimporters | ---
+++
@@ -5,6 +5,7 @@
# bug, but extra information that can be exported.
_project_name = scrapy.item.Field()
_tracker_name = scrapy.item.Field()
+ _deleted = scrapy.item.Field()
# These fields correspond to bug data
title = scrapy.item.Field() |
9a5d2a6f9efefb5b1647de5e467a9dfb74b86c9b | buffpy/tests/test_link.py | buffpy/tests/test_link.py | from nose.tools import eq_
from mock import MagicMock
from buffpy.models.link import Link
def test_links_shares():
'''
Test link's shares retrieving from constructor
'''
mocked_api = MagicMock()
mocked_api.get.return_value = {'shares': 123}
link = Link(api=mocked_api, url='www.google.com')
eq_(link... | from unittest.mock import MagicMock
from buffpy.models.link import Link
def test_links_shares():
""" Test link"s shares retrieving from constructor. """
mocked_api = MagicMock()
mocked_api.get.return_value = {"shares": 123}
link = Link(api=mocked_api, url="www.google.com")
assert link["shares"... | Migrate link tests to pytest | Migrate link tests to pytest
| Python | mit | vtemian/buffpy | ---
+++
@@ -1,32 +1,32 @@
-from nose.tools import eq_
-from mock import MagicMock
+from unittest.mock import MagicMock
from buffpy.models.link import Link
+
def test_links_shares():
- '''
- Test link's shares retrieving from constructor
- '''
+ """ Test link"s shares retrieving from constructor. """
-... |
7989252dd687dfaa1fd12ed8900c947190bfe4f7 | ichnaea/cache.py | ichnaea/cache.py | import redis
import urlparse
def redis_client(redis_url):
r_url = urlparse.urlparse(redis_url)
r_host = r_url.netloc.split(":")[0]
r_port = int(r_url.netloc.split(":")[1])
r_db = int(r_url.path[1:])
pool = redis.ConnectionPool(
max_connections=100,
socket_timeout=10.0,
sock... | import redis
import urlparse
def redis_client(redis_url):
r_url = urlparse.urlparse(redis_url)
r_host = r_url.netloc.split(":")[0]
r_port = int(r_url.netloc.split(":")[1])
r_db = int(r_url.path[1:])
pool = redis.ConnectionPool(
max_connections=100,
host=r_host,
port=r_port,... | Set redis connection info on the right class (the pool). | Set redis connection info on the right class (the pool).
| Python | apache-2.0 | therewillbecode/ichnaea,mozilla/ichnaea,mozilla/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea | ---
+++
@@ -9,11 +9,11 @@
r_db = int(r_url.path[1:])
pool = redis.ConnectionPool(
max_connections=100,
+ host=r_host,
+ port=r_port,
+ db=r_db,
socket_timeout=10.0,
socket_connect_timeout=30.0,
socket_keepalive=True,
)
- return redis.StrictRed... |
a29d712b69f64ec248fb7f6829da9996dc5b217a | tests/integration/test_with_activemq.py | tests/integration/test_with_activemq.py | from . import base
class ActiveMQTestCase(base.IntegrationTestCase):
'''RabbitMQ integration test case.'''
CTXT = {
'plugin.activemq.pool.1.port': 61614,
'plugin.activemq.pool.1.password': 'marionette',
}
class TestWithActiveMQMCo20x(base.MCollective20x, ActiveMQTestCase):
'''MCollec... | import os
from pymco.test import ctxt
from . import base
class ActiveMQTestCase(base.IntegrationTestCase):
'''RabbitMQ integration test case.'''
CTXT = {
'plugin.activemq.pool.1.port': 61614,
'plugin.activemq.pool.1.password': 'marionette',
}
class TestWithActiveMQMCo20x(base.MCollecti... | Test ActiveMQ under SSL connection | Test ActiveMQ under SSL connection
| Python | bsd-3-clause | rafaduran/python-mcollective,rafaduran/python-mcollective,rafaduran/python-mcollective,rafaduran/python-mcollective | ---
+++
@@ -1,3 +1,7 @@
+import os
+
+from pymco.test import ctxt
+
from . import base
@@ -19,3 +23,21 @@
class TestWithActiveMQMCo23x(base.MCollective23x, ActiveMQTestCase):
'''MCollective integration test case.'''
+
+
+class TestWithActiveMQSSLMCo23x(base.MCollective23x, ActiveMQTestCase):
+ '''MCol... |
8c0af29e7b6ec3a5e76fdb1efc56068bf276ad39 | helenae/flask_app.py | helenae/flask_app.py | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from db import tables as dbTables
app = Flask(__name__, template_folder='./web/templates/')
app.config['SECRET_KEY'] = 'some_secret_key'
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://user:password@localhost/csan'
db_connection = SQLAlchemy(app)
i... | from flask import Flask, request, session
from flask_sqlalchemy import SQLAlchemy
from flask.ext.babelex import Babel
from db import tables as dbTables
app = Flask(__name__, template_folder='./web/templates/', static_folder='./web/static/', static_url_path='')
app.config['SECRET_KEY'] = 'some_secret_key'
app.config['S... | Add babel plugin for Flask | Add babel plugin for Flask
| Python | mit | Relrin/Helenae,Relrin/Helenae,Relrin/Helenae | ---
+++
@@ -1,11 +1,21 @@
-from flask import Flask
+from flask import Flask, request, session
from flask_sqlalchemy import SQLAlchemy
+from flask.ext.babelex import Babel
from db import tables as dbTables
-app = Flask(__name__, template_folder='./web/templates/')
+app = Flask(__name__, template_folder='./web/temp... |
747af88d56dc274638f515825405f58b0e59b8d7 | invoice/views.py | invoice/views.py | from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
def pdf_user_view(reque... | from django.shortcuts import get_object_or_404
from django.contrib.auth.decorators import login_required
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pd... | Make sure user in logged in for showing invoice | Make sure user in logged in for showing invoice
| Python | bsd-3-clause | Chris7/django-invoice,Chris7/django-invoice,simonluijk/django-invoice | ---
+++
@@ -1,4 +1,5 @@
from django.shortcuts import get_object_or_404
+from django.contrib.auth.decorators import login_required
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
@@ -9,6 +10,7 @@
return pdf_response(draw_pdf, invoice.file_name(), invo... |
4e40575147fd9af02c0e0a380e4d35f6c5d8f67a | polling_stations/apps/data_collection/management/commands/import_breckland.py | polling_stations/apps/data_collection/management/commands/import_breckland.py | from data_collection.management.commands import BaseXpressWebLookupCsvImporter
class Command(BaseXpressWebLookupCsvImporter):
council_id = 'E07000143'
addresses_name = 'May 2017/BrecklandPropertyPostCodePollingStationWebLookup-2017-02-20.TSV'
stations_name = 'May 2017/BrecklandPropertyPostCodePolli... | from data_collection.management.commands import BaseXpressWebLookupCsvImporter
class Command(BaseXpressWebLookupCsvImporter):
council_id = 'E07000143'
addresses_name = 'May 2017/BrecklandPropertyPostCodePollingStationWebLookup-2017-02-20.TSV'
stations_name = 'May 2017/BrecklandPropertyPostCodePolli... | Discard dodgy points in Breckland | Discard dodgy points in Breckland
These are clearly very wrong
use geocoding instead
| Python | bsd-3-clause | chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations | ---
+++
@@ -9,3 +9,15 @@
'parl.2017-06-08'
]
csv_delimiter = '\t'
+
+ def station_record_to_dict(self, record):
+
+ """
+ File supplied contained obviously inaccurate points
+ remove and fall back to geocoding
+ """
+ if record.pollingplaceid in ['5151', '5370'... |
31168c729ac486e6a0705e9c5117586dfb964cf7 | importer/loaders.py | importer/loaders.py | from django.conf import settings
import xlrd
import os
base_loader_error = 'The Loader class can only be used by extending it.'
extensions = getattr(
settings,
'IMPORTER_EXTENSIONS',
{
'excel': ('.xls', '.xlsx'),
}
)
class Loader(object):
def __init__(self, file_info, autoload=True):
... | from django.conf import settings
import xlrd
import os
base_loader_error = 'The Loader class can only be used by extending it.'
extensions = getattr(
settings,
'IMPORTER_EXTENSIONS',
{
'excel': ('.xls', '.xlsx'),
}
)
class Loader(object):
def __init__(self, file_info, autoload=True):
... | Move sheet_by_name after expected interfaces. | Move sheet_by_name after expected interfaces.
| Python | mit | monokrome/django-drift | ---
+++
@@ -43,11 +43,6 @@
self.sheet_names = self.backend.sheet_names()
self.sheet_count = len(self.sheet_names)
- def sheet_by_name(self, name):
- """ Returns a sheet based on it's name. """
-
- return self.backend.sheet_by_name(name)
-
def close(self):
self.backen... |
4a20a36aa920a6450eb526a9913d8fb0ab08fa8c | buildlet/runner/simple.py | buildlet/runner/simple.py | from .base import BaseRunner
class SimpleRunner(BaseRunner):
"""
Simple blocking task runner.
"""
@classmethod
def run(cls, task):
"""
Simple blocking task runner.
Run `task` and its unfinished ancestors.
"""
task.pre_run()
try:
for p... | from .base import BaseRunner
class SimpleRunner(BaseRunner):
"""
Simple blocking task runner.
"""
@classmethod
def run(cls, task):
"""
Simple blocking task runner.
Run `task` and its unfinished ancestors.
"""
for parent in task.get_parents():
... | Tweak SimpleRunner.run: make it close to the parallel one | Tweak SimpleRunner.run: make it close to the parallel one
| Python | bsd-3-clause | tkf/buildlet | ---
+++
@@ -15,12 +15,15 @@
Run `task` and its unfinished ancestors.
"""
+ for parent in task.get_parents():
+ # This is redundant because `.load` or `.run` is called
+ # for *all* tasks regardless the state (need rerun or not).
+ cls.run(parent)
+ # ... |
7a1a90cbaba73da44efeaf385865519cfa078a6c | astropy/vo/samp/tests/test_hub_script.py | astropy/vo/samp/tests/test_hub_script.py | import sys
from ..hub_script import hub_script
from ..utils import ALLOW_INTERNET
def setup_module(module):
ALLOW_INTERNET.set(False)
def test_hub_script():
sys.argv.append('-m') # run in multiple mode
sys.argv.append('-w') # disable web profile
hub_script(timeout=3)
| import sys
from ..hub_script import hub_script
from ..utils import ALLOW_INTERNET
def setup_module(module):
ALLOW_INTERNET.set(False)
def setup_function(function):
function.sys_argv_orig = sys.argv
sys.argv = ["samp_hub"]
def teardown_function(function):
sys.argv = function.sys_argv_orig
def t... | Fix isolation of SAMP hub script test. | Fix isolation of SAMP hub script test. | Python | bsd-3-clause | StuartLittlefair/astropy,dhomeier/astropy,saimn/astropy,funbaker/astropy,larrybradley/astropy,MSeifert04/astropy,kelle/astropy,lpsinger/astropy,bsipocz/astropy,aleksandr-bakanov/astropy,DougBurke/astropy,lpsinger/astropy,lpsinger/astropy,astropy/astropy,funbaker/astropy,AustereCuriosity/astropy,StuartLittlefair/astropy... | ---
+++
@@ -4,8 +4,18 @@
from ..utils import ALLOW_INTERNET
+
def setup_module(module):
ALLOW_INTERNET.set(False)
+
+
+def setup_function(function):
+ function.sys_argv_orig = sys.argv
+ sys.argv = ["samp_hub"]
+
+
+def teardown_function(function):
+ sys.argv = function.sys_argv_orig
def test... |
44749393191aebf730c4dca17766fbdb713e636b | systempay/app.py | systempay/app.py | from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
place_order_view = views.PlaceOrderView
cancel_response_view = views.CancelResponseView
secure_redirect_view = views.Secu... | from django.conf.urls import patterns, url
from oscar.core.application import Application
from systempay import views
class SystemPayApplication(Application):
name = 'systempay'
place_order_view = views.PlaceOrderView
cancel_response_view = views.CancelResponseView
secure_redirect_view = views.Secu... | Add missing handle ipn url | Add missing handle ipn url
| Python | mit | bastien34/django-oscar-systempay,bastien34/django-oscar-systempay,dulaccc/django-oscar-systempay | ---
+++
@@ -10,6 +10,7 @@
place_order_view = views.PlaceOrderView
cancel_response_view = views.CancelResponseView
secure_redirect_view = views.SecureRedirectView
+ handle_ipn_view = views.HandleIPN
def __init__(self, *args, **kwargs):
super(SystemPayApplication, self).__init__(*args,... |
3146aa3379f5c928fc7ba79776de19a1c64c7c01 | api/base/urls.py | api/base/urls.py | from django.conf import settings
from django.conf.urls import include, url, patterns
from django.conf.urls.static import static
from settings import API_BASE
from website.settings import DEV_MODE
from . import views
base_pattern = '^{}'.format(API_BASE)
urlpatterns = [
### API ###
url(base_pattern,
i... | from django.conf import settings
from django.conf.urls import include, url, patterns
from django.conf.urls.static import static
from settings import API_BASE
from website.settings import DEV_MODE
from . import views
base_pattern = '^{}'.format(API_BASE)
urlpatterns = [
### API ###
url(base_pattern,
i... | Make collections link go to v2 route | Make collections link go to v2 route
| Python | apache-2.0 | alexschiller/osf.io,laurenrevere/osf.io,Nesiehr/osf.io,emetsger/osf.io,zachjanicki/osf.io,aaxelb/osf.io,binoculars/osf.io,RomanZWang/osf.io,Johnetordoff/osf.io,HalcyonChimera/osf.io,Johnetordoff/osf.io,billyhunt/osf.io,doublebits/osf.io,cwisecarver/osf.io,DanielSBrown/osf.io,doublebits/osf.io,chrisseto/osf.io,abought/o... | ---
+++
@@ -24,7 +24,7 @@
if DEV_MODE:
urlpatterns.extend([
- url(r'^collections/', include('api.collections.urls', namespace='collections')),
+ url(r'^v2/collections/', include('api.collections.urls', namespace='collections')),
])
urlpatterns += static('/static/', document_root=settings... |
3d7e02e58353fdc3290440344efd5591d233f449 | bot/__init__.py | bot/__init__.py | import os
PACKAGEDIR = os.path.abspath(os.path.dirname(__file__))
| import os
PACKAGEDIR = os.path.abspath(os.path.dirname(__file__))
from .webapp import goldstarsapp
| Make the flask app easier to import | Make the flask app easier to import
| Python | mit | barentsen/AstroGoldStars,barentsen/AstroGoldStars | ---
+++
@@ -1,2 +1,4 @@
import os
PACKAGEDIR = os.path.abspath(os.path.dirname(__file__))
+
+from .webapp import goldstarsapp |
a53b0f540b8aac87f96743bf4d383607ad5a398f | setup.py | setup.py | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-djaken',
version='2.0.1',
... | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-djaken',
version='2.0.1',
... | Fix install_requires to limit Django version <2.0. | Fix install_requires to limit Django version <2.0.
| Python | bsd-2-clause | ethoms/django-djaken,ethoms/django-djaken | ---
+++
@@ -34,6 +34,6 @@
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
- install_requires=['Django>=1.9','docutils>=0.12', 'pycrypto>=2.6', ],
+ install_requires=['Django>=1.9,<2.0','docutils>=0.12', 'pycrypto>=2.6', ],
keywords='django note... |
b946768acb8c9e34dbb72cb6d3bc33a7e67f4548 | setup.py | setup.py | from distutils.core import setup
setup(
requires=['beautifulsoup4', 'requests'],
name='python-ninegag',
version='0.1',
py_modules=['pyninegag'],
url='https://github.com/sashgorokhov/python-ninegag',
license='MIT',
author='sashgorokhov',
author_email='sashgorokhov@gmail.com',
descrip... | from distutils.core import setup
with open('README.md') as file:
long_description = file.read()
setup(
requires=['beautifulsoup4', 'requests'],
name='python-ninegag',
version='0.1',
py_modules=['pyninegag'],
url='https://github.com/sashgorokhov/python-ninegag',
download_url='https://github... | Add download url and long description | Add download url and long description
| Python | mit | sashgorokhov/python-ninegag | ---
+++
@@ -1,4 +1,7 @@
from distutils.core import setup
+
+with open('README.md') as file:
+ long_description = file.read()
setup(
requires=['beautifulsoup4', 'requests'],
@@ -6,7 +9,9 @@
version='0.1',
py_modules=['pyninegag'],
url='https://github.com/sashgorokhov/python-ninegag',
- li... |
c136d5897a9c36cf5c4eca1d9a8c0be960ead730 | setup.py | setup.py | from setuptools import setup
from rohrpost import __version__
def read(filepath):
with open(filepath, "r", encoding="utf-8") as f:
return f.read()
setup(
name="rohrpost",
version=__version__,
description="rohrpost WebSocket protocol for ASGI",
long_description=read("README.rst"),
ur... | from setuptools import setup
from rohrpost import __version__
def read(filepath):
with open(filepath, "r", encoding="utf-8") as f:
return f.read()
setup(
name="rohrpost",
version=__version__,
description="rohrpost WebSocket protocol for ASGI",
long_description=read("README.rst"),
ur... | Enforce requirement on python >= 3.4 | Enforce requirement on python >= 3.4
| Python | mit | axsemantics/rohrpost,axsemantics/rohrpost | ---
+++
@@ -17,6 +17,7 @@
author="Tobias Kunze",
author_email="tobias.kunze@ax-semantics.com",
license="MIT",
+ python_requires=">=3.4",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3", |
86d17b1898b5654aeeb432722dcb599136376236 | setup.py | setup.py | # Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_descrip... | # Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_descrip... | Allow pip to decide which version of doit to install | Allow pip to decide which version of doit to install
| Python | mit | rbeagrie/wrapit | ---
+++
@@ -12,7 +12,7 @@
setup(
name='wrapit',
- version='0.3.0',
+ version='0.3.1',
description='A task loader for doit that supports argparse console scripts',
long_description=long_description,
url='https://github.com/rbeagrie/wrapit',
@@ -34,9 +34,6 @@
packages=['wrapit'],
-... |
a6d87b6e4dba63b0a74dc6173e90823bdb9fe070 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "biofloat",
version = "0.1.1",
packages = find_packages(),
scripts = ['scripts/load_biofloat_cache.py'],
# metadata for upload to PyPI
author = "Mike McCann",
author_email = "mccann@mbari.org",
description = "Software for working... | from setuptools import setup, find_packages
setup(
name = "biofloat",
version = "0.1.17",
packages = find_packages(),
requires = ['Python (>=2.7)'],
install_requires = [
'beautifulsoup4>=4.4',
'coverage>=4',
'jupyter>=1.0.0',
'matplotlib',
'numpy>=1.10',
... | Add install_requires packages, at version 0.1.17 | Add install_requires packages, at version 0.1.17
| Python | mit | MBARIMike/biofloat,MBARIMike/biofloat,biofloat/biofloat,biofloat/biofloat | ---
+++
@@ -1,8 +1,23 @@
from setuptools import setup, find_packages
+
setup(
name = "biofloat",
- version = "0.1.1",
+ version = "0.1.17",
packages = find_packages(),
+ requires = ['Python (>=2.7)'],
+ install_requires = [
+ 'beautifulsoup4>=4.4',
+ 'coverage>=4',
+ 'jupy... |
5db334fac528494006755703d4563fd08dbfc4b2 | setup.py | setup.py | import sys
from setuptools import setup
# See https://stackoverflow.com/questions/19534896/enforcing-python-version-in-setup-py
if sys.version_info < (3,6):
sys.exit("Sorry, Python < 3.6 is not supported by Auspex.")
setup(
name='auspex',
version='0.1',
author='auspex Developers',
package_dir={'':... | import sys
from setuptools import setup
# See https://stackoverflow.com/questions/19534896/enforcing-python-version-in-setup-py
if sys.version_info < (3,6):
sys.exit("Sorry, Python < 3.6 is not supported by Auspex.")
setup(
name='auspex',
version='0.1',
author='auspex Developers',
package_dir={'':... | Switch to ruamel_yaml from conda by default | Switch to ruamel_yaml from conda by default
| Python | apache-2.0 | BBN-Q/Auspex,BBN-Q/Auspex,BBN-Q/Auspex,BBN-Q/Auspex | ---
+++
@@ -25,7 +25,7 @@
"pandas >= 0.18.1",
"networkx >= 1.11",
"matplotlib >= 2.0.0",
- "ruamel.yaml >= 0.15.18",
+ "ruamel_yaml >= 0.11.14",
"psutil >= 5.0.0",
"pyzmq >= 16.0.0"
] |
17c18a610ba0fe35d88ffb4ca1b6d0c91ae4fad6 | setup.py | setup.py | from distutils.core import setup
setup(
name = 'watsongraph',
packages = ['watsongraph'], # this must be the same as the name above
install_requires=['networkx', 'requests', 'mwviews'],
version = '0.1.5',
description = 'Concept discovery and recommendation library built on top of the IBM Watson congitive API.... | from distutils.core import setup
setup(
name = 'watsongraph',
packages = ['watsongraph'], # this must be the same as the name above
install_requires=['networkx', 'requests', 'mwviews'],
version = '0.1.5',
description = 'Concept discovery and recommendation library built on top of the IBM Watson cognitive API.... | Fix incredibly lame spelling error. | Fix incredibly lame spelling error.
| Python | mit | ResidentMario/watson-graph,ResidentMario/watsongraph | ---
+++
@@ -4,7 +4,7 @@
packages = ['watsongraph'], # this must be the same as the name above
install_requires=['networkx', 'requests', 'mwviews'],
version = '0.1.5',
- description = 'Concept discovery and recommendation library built on top of the IBM Watson congitive API.',
+ description = 'Concept disco... |
11d1d3bc78ef734584065cc8fba9260da0b49bac | setup.py | setup.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='OpenFisca-Country-Template',
version='0.1.0',
author='OpenFisca Team',
author_email='contact@openfisca.fr',
description=u'Template of a tax and benefit system for OpenFisca',
keywords='ben... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='OpenFisca-Country-Template',
version='0.1.0',
author='OpenFisca Team',
author_email='contact@openfisca.fr',
description=u'Template of a tax and benefit system for OpenFisca',
keywords='ben... | Use regular version of openfisca-core | Use regular version of openfisca-core | Python | agpl-3.0 | openfisca/country-template,openfisca/country-template | ---
+++
@@ -15,7 +15,7 @@
license='http://www.fsf.org/licensing/licenses/agpl-3.0.html',
include_package_data = True, # Will read MANIFEST.in
install_requires=[
- 'OpenFisca-Core >= 6.1.0.dev0, < 7.0',
+ 'OpenFisca-Core >= 6.1.0, < 7.0',
],
packages=find_packages(),
te... |
330bdcb3bc50acf4c15299a15fb7fdf8b58e152c | setup.py | setup.py | #!/usr/bin/env python
import setuptools
setuptools.setup(
name='bumper',
version='0.1.1',
author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
description=open('README.rst').read(),
entry_points={
'console_scripts': [
'bump = bumper:bump',
],
},
install_requires=open('requir... | #!/usr/bin/env python
import setuptools
setuptools.setup(
name='bumper',
version='0.1.1',
author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
description='Bump (pin/manage) your dependency requirements with ease',
long_description=open('README.rst').read(),
url='https://github.com/maxzheng/... | Add long description / url | Add long description / url
| Python | mit | maxzheng/bumper | ---
+++
@@ -10,7 +10,10 @@
author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
- description=open('README.rst').read(),
+ description='Bump (pin/manage) your dependency requirements with ease',
+ long_description=open('README.rst').read(),
+
+ url='https://github.com/maxzheng/bumper',
entry_... |
e68ca88db996e817d607f51a25fabb47c8cf685c | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='gears-less',
version='0.1',
url='https://github.com/gears/gears-less',
license='ISC',
author='Mike Yumatov',
author_email='mike@yum... | import os
from setuptools import setup, find_packages
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='gears-less',
version='0.1',
url='https://github.com/gears/gears-less',
license='ISC',
author='Mike Yumatov',
author_email='mike@yum... | Drop Python 2.5 support, add support for Python 3.2 | Drop Python 2.5 support, add support for Python 3.2
| Python | isc | gears/gears-less,gears/gears-less | ---
+++
@@ -23,8 +23,8 @@
'License :: OSI Approved :: ISC License (ISCL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: ... |
9bf381993a6862a3413f5e1d3439ff1301260d62 | setup.py | setup.py | from setuptools import setup, find_packages
import os
ROOT = os.path.dirname(os.path.realpath(__file__))
setup(
name='grab',
version='0.6.30',
description='Web Scraping Framework',
long_description=open(os.path.join(ROOT, 'README.rst')).read(),
url='http://grablib.org',
author='Gregory Petukho... | from setuptools import setup, find_packages
import os
ROOT = os.path.dirname(os.path.realpath(__file__))
setup(
name='grab',
version='0.6.30',
description='Web Scraping Framework',
long_description=open(os.path.join(ROOT, 'README.rst')).read(),
url='http://grablib.org',
author='Gregory Petukho... | Convert double quotes to single quotes | Convert double quotes to single quotes
| Python | mit | lorien/grab,lorien/grab,istinspring/grab,istinspring/grab | ---
+++
@@ -16,9 +16,9 @@
install_requires=['lxml', 'pycurl', 'selection', 'weblib>=0.1.10', 'six',
'user_agent'],
- license="MIT",
- keywords="pycurl multicurl curl network parsing grabbing scraping"
- " lxml xpath data mining",
+ license='MIT',
+ keywords='pycur... |
34de8fbae91b367ed1ada417c5d3cea669ccc1f3 | setup.py | setup.py | import os, sys
from setuptools import setup, find_packages
pkgname = "SHARPpy"
### GET VERSION INFORMATION ###
setup_path = os.path.split(os.path.abspath(__file__))[0]
sys.path.append(os.path.join(setup_path, pkgname.lower()))
import version
version.write_git_version()
ver = version.get_version().split("+")[0]
sys.... | import os, sys
from setuptools import setup, find_packages
pkgname = "SHARPpy"
### GET VERSION INFORMATION ###
setup_path = os.path.split(os.path.abspath(__file__))[0]
sys.path.append(os.path.join(setup_path, pkgname.lower()))
import version
version.write_git_version()
ver = version.get_version().split("+")[0]
sys.... | Move classifier from Pre-Alpha to Beta | Move classifier from Pre-Alpha to Beta
| Python | bsd-3-clause | blizzardwarriorwx/SHARPpy,blizzardwarriorwx/SHARPpy,scollis/SHARPpy,scollis/SHARPpy,djgagne/SHARPpy,djgagne/SHARPpy,djgagne/SHARPpy,scollis/SHARPpy,djgagne/SHARPpy,blizzardwarriorwx/SHARPpy,blizzardwarriorwx/SHARPpy,scollis/SHARPpy | ---
+++
@@ -27,7 +27,7 @@
packages = find_packages()
package_data = {"": ["*.md", "*.txt", "*.png"],}
include_package_data = True
-classifiers = ["Development Status :: 2 - Pre-Alpha"]
+classifiers = ["Development Status :: 4 - Beta"]
setup( |
1eba15e0c187b7afca85c43e031ce9e9e926e622 | setup.py | setup.py | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-tenant-users',
version='0.2... | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-tenant-users',
version='0.2... | Fix so migrations get included with pypi package. Update version | Fix so migrations get included with pypi package. Update version
| Python | mit | Corvia/django-tenant-users | ---
+++
@@ -9,11 +9,13 @@
setup(
name='django-tenant-users',
- version='0.2.16',
+ version='0.2.17',
packages=[
'tenant_users',
'tenant_users.tenants',
+ 'tenant_users.tenants.migrations',
'tenant_users.permissions',
+ 'tenant_users.permissions.migrations',
... |
6c42dbb721feeacdfce182914f86b62dfa7cb3b4 | setup.py | setup.py | from setuptools import setup
import sys
REQUIREMENTS = [
'argparse',
'GitPython>=0.3.2.RC1',
'Pillow>=2.3.0',
'requests',
]
if sys.version_info <= (3,):
REQUIREMENTS.append('configparser')
setup(name='lolologist',
version='0.4.0',
description='A utility that ge... | from setuptools import setup
import sys
REQUIREMENTS = [
'argparse',
'GitPython>=0.3.2.RC1',
'Pillow>=2.3.0',
'requests',
]
if sys.version_info <= (3,):
REQUIREMENTS.append('configparser==3.5.0b2') # Using the beta for PyPy compatibility
setup(name='lolologist',
vers... | Upgrade configparser to fix pip build issue on PyPy. | Upgrade configparser to fix pip build issue on PyPy.
| Python | mpl-2.0 | arusahni/lolologist | ---
+++
@@ -9,7 +9,7 @@
]
if sys.version_info <= (3,):
- REQUIREMENTS.append('configparser')
+ REQUIREMENTS.append('configparser==3.5.0b2') # Using the beta for PyPy compatibility
setup(name='lolologist',
version='0.4.0', |
d803647eeb1644985f1788d232a72587ff156bb4 | setup.py | setup.py | from __future__ import unicode_literals
import re
from setuptools import setup
def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']
setup(
name='Mopidy-Scrobbler',
version=get_version('mopidy_scrob... | from __future__ import unicode_literals
import re
from setuptools import setup
def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']
setup(
name='Mopidy-Scrobbler',
version=get_version('mopidy_scrob... | Add Pykka as a dependency | Add Pykka as a dependency
| Python | apache-2.0 | mopidy/mopidy-scrobbler,mthssdrbrg/mopidy-scrobbler | ---
+++
@@ -25,6 +25,7 @@
install_requires=[
'setuptools',
'Mopidy',
+ 'Pykka >= 1.1',
'pylast >= 0.5.7',
],
entry_points={ |
b3d9696d02855ba7a3243b4dc10e931f22a587b8 | changes/utils/locking.py | changes/utils/locking.py | from flask import current_app
from functools import wraps
from hashlib import md5
from changes.ext.redis import UnableToGetLock
from changes.config import redis
def lock(func):
@wraps(func)
def wrapped(**kwargs):
key = '{0}:{1}:{2}'.format(
func.__module__,
func.__name__,
... | from flask import current_app
from functools import wraps
from hashlib import md5
from changes.ext.redis import UnableToGetLock
from changes.config import redis
def lock(func):
@wraps(func)
def wrapped(**kwargs):
key = '{0}:{1}:{2}'.format(
func.__module__,
func.__name__,
... | Raise exception when we fail to grab a redis lock. | Raise exception when we fail to grab a redis lock.
Summary:
I might be missing something but it seems odd that we don't raise an error
when we fail to grab a lock and consequently not run the wrapped function.
We wrap all our tracked tasks with this lock function so failing to grab
the lock will appear as if the task ... | Python | apache-2.0 | dropbox/changes,dropbox/changes,dropbox/changes,dropbox/changes | ---
+++
@@ -22,5 +22,6 @@
return func(**kwargs)
except UnableToGetLock:
current_app.logger.warn('Unable to get lock for %s', key)
+ raise
return wrapped |
0243af9efb3caf83268af35f9f2d80977e13afb1 | setup.py | setup.py | import os
from setuptools import setup, find_packages
long_description = (
open('README.rst').read()
+ '\n' +
open('CHANGES.txt').read())
setup(name='more.static',
version='0.1.dev0',
description="BowerStatic integration for Morepath",
long_description=long_description,
author="Mar... | import os
from setuptools import setup, find_packages
long_description = (
open('README.rst').read()
+ '\n' +
open('CHANGES.txt').read())
setup(name='more.static',
version='0.1.dev0',
description="BowerStatic integration for Morepath",
long_description=long_description,
author="Mar... | Add webtest as a dependency. | Add webtest as a dependency.
| Python | bsd-3-clause | morepath/more.static | ---
+++
@@ -26,6 +26,7 @@
],
extras_require = dict(
test=['pytest >= 2.0',
- 'pytest-cov'],
+ 'pytest-cov',
+ 'WebTest >= 2.0.14'],
),
) |
684e2894a8c4da327410a8898e63df504780d7f8 | setup.py | setup.py | """Config for PyPI."""
from setuptools import find_packages
from setuptools import setup
setup(
author='Kyle P. Johnson',
author_email='kyle@kyle-p-johnson.com',
classifiers=[
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MI... | """Config for PyPI."""
from setuptools import find_packages
from setuptools import setup
setup(
author='Kyle P. Johnson',
author_email='kyle@kyle-p-johnson.com',
classifiers=[
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MI... | Add fuzzywuzzy and python-Levenshtein as depends | Add fuzzywuzzy and python-Levenshtein as depends | Python | mit | TylerKirby/cltk,cltk/cltk,mbevila/cltk,LBenzahia/cltk,diyclassics/cltk,kylepjohnson/cltk,D-K-E/cltk,LBenzahia/cltk,coderbhupendra/cltk,TylerKirby/cltk | ---
+++
@@ -26,7 +26,9 @@
install_requires=['nltk',
'gitpython',
'regex',
- 'whoosh'],
+ 'whoosh',
+ 'fuzzywuzzy',
+ 'python-Levenshtein'],
keywords=['nlp', 'nltk', 'greek', 'lat... |
c7689244b6de2cc9a01568e7cdab543cf8790214 | setup.py | setup.py | import os
import subprocess
from distutils.core import setup
try:
if os.path.exists(".git"):
s = subprocess.Popen(["git", "rev-parse", "HEAD"],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = s.communicate()[0]
GIT_REVISION = out.strip()
else:
GIT_REVISIO... | import os
import subprocess
from distutils.core import setup
try:
if os.path.exists(".git"):
s = subprocess.Popen(["git", "rev-parse", "HEAD"],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = s.communicate()[0]
GIT_REVISION = out.strip()
else:
GIT_REVISIO... | Improve the version information string | ENH: Improve the version information string
| Python | bsd-3-clause | sahg/SAHGutils | ---
+++
@@ -9,14 +9,14 @@
out = s.communicate()[0]
GIT_REVISION = out.strip()
else:
- GIT_REVISION = ""
+ GIT_REVISION = "unknown"
except WindowsError:
- GIT_REVISION = ""
+ GIT_REVISION = "unknown"
-FULL_VERSION = '0.0.1dev'
+FULL_VERSION = '0.0.1-dev'
if "dev" in FULL_... |
c31bf6447f7b373ecbcc79e161dc406907887344 | commandcenter/app_test.py | commandcenter/app_test.py | from tornado.testing import AsyncHTTPTestCase
from tornado.websocket import websocket_connect
from . import app
class TestMyApp(AsyncHTTPTestCase):
def get_app(self):
return app.get_app()
def test_homepage(self):
response = self.fetch('/')
self.assertEqual(response.code, 200)
... | from tornado.testing import AsyncHTTPTestCase
from tornado.websocket import websocket_connect
from . import app
class TestMyApp(AsyncHTTPTestCase):
def get_app(self):
return app.get_app()
def test_homepage(self):
response = self.fetch('/')
self.assertEqual(response.code, 200)
... | Add another test to check that the "See new artists" page is basically rendered correctly | Add another test to check that the "See new artists" page is basically rendered correctly
| Python | apache-2.0 | chirpradio/command-center,chirpradio/command-center | ---
+++
@@ -20,3 +20,13 @@
self.assertRegexpMatches(
body,
r'<a href="/new-artists/" class="[^"]+">See new artists</a>')
+
+ def test_new_artists_page(self):
+ response = self.fetch('/new-artists/')
+ self.assertEqual(response.code, 200)
+ body = response.bod... |
bb951b655ca49b341fec3f6cb813f2b07c118696 | app/utils.py | app/utils.py | from urllib.parse import urlparse, urljoin
from flask import request
def get_or_create(model, **kwargs):
""" Returns an instance of model and whether or not it already existed in a tuple. """
instance = model.query.filter_by(**kwargs).first()
if instance:
return instance, False
else:
in... | from urllib.parse import urlparse, urljoin
from flask import request
def get_or_create(model, **kwargs):
""" Returns an instance of model and whether or not it already existed in a tuple. """
instance = model.query.filter_by(**kwargs).first()
if instance:
return instance, False
else:
in... | Add utility function for getting the redirect target | Add utility function for getting the redirect target
| Python | mit | Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary | ---
+++
@@ -15,3 +15,11 @@
ref_url = urlparse(request.host_url)
test_url = urlparse(urljoin(request.host_url, target))
return test_url.scheme in ("http", "https") and ref_url.netloc == test_url.netloc
+
+def get_redirect_target():
+ """ Returns the redirect target. """
+ for target in request.arg... |
02faa67481e0902501e9e269c17351d9b8f05afa | tests/python/pipeline_util/test-export_.py | tests/python/pipeline_util/test-export_.py | #!/usr/bin/env python
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def log(msg):
import sys
sys.stderr.write("%s\n" % msg)
def test_imp... | #!/usr/bin/env python
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def log(msg):
import sys
sys.stderr.write("%s\n" % msg)
def test_imp... | Add a test for exporting to dot from python | Add a test for exporting to dot from python
| Python | bsd-3-clause | mathstuf/sprokit,Kitware/sprokit,Kitware/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,linus-sherrill/sprokit,Kitware/sprokit,Kitware/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,mathstuf/sprokit,linus-sherrill/sprokit | ---
+++
@@ -17,9 +17,29 @@
log("Error: Failed to import the export_ module")
-def main(testname):
+def test_simple_pipeline(path):
+ import os
+
+ from vistk.pipeline import pipeline
+ from vistk.pipeline import modules
+ from vistk.pipeline_util import bake
+ from vistk.pipeline_util impo... |
499defc47f0647afda47be8a8a25d04095b07e1b | nn/slmc/accuracy.py | nn/slmc/accuracy.py | import tensorflow as tf
from ..util import static_shape, static_rank
def accuracy(output_layer, true_label):
assert static_rank(output_layer) == 2
#assert static_shape(output_layer)[0] == (batch size)
#assert static_shape(output_layer)[1] == (number of classes)
assert static_rank(true_label) == 1
#assert ... | import tensorflow as tf
from ..util import static_shape, static_rank
def accuracy(output_layer, true_label):
assert static_rank(output_layer) == 2
#assert static_shape(output_layer)[0] == (batch size)
#assert static_shape(output_layer)[1] == (number of classes)
assert static_rank(true_label) == 1
#assert ... | Use to_float instead of cast | Use to_float instead of cast
| Python | unlicense | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | ---
+++
@@ -13,4 +13,4 @@
assert static_shape(output_layer)[0] == static_shape(true_label)[0]
correct_prediction = tf.equal(tf.argmax(output_layer, 1), true_label)
- return tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
+ return tf.reduce_mean(tf.to_float(correct_prediction)) |
edd4cfd5cf4102ab77e889c680306f25280e6165 | lingcod/bookmarks/forms.py | lingcod/bookmarks/forms.py | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | from lingcod.features.forms import FeatureForm
from lingcod.bookmarks.models import Bookmark
from django import forms
class BookmarkForm(FeatureForm):
name = forms.CharField(label='Bookmark Name')
latitude = forms.FloatField(widget=forms.HiddenInput())
longitude = forms.FloatField(widget=forms.HiddenInput(... | Hide IP from input form | Hide IP from input form
| Python | bsd-3-clause | Alwnikrotikz/marinemap,google-code-export/marinemap,google-code-export/marinemap,Alwnikrotikz/marinemap,Alwnikrotikz/marinemap,Alwnikrotikz/marinemap,google-code-export/marinemap,google-code-export/marinemap | ---
+++
@@ -12,5 +12,6 @@
roll = forms.FloatField(widget=forms.HiddenInput())
altitudeMode = forms.FloatField(widget=forms.HiddenInput())
publicstate = forms.CharField(widget=forms.HiddenInput())
+ ip = forms.CharField(widget=forms.HiddenInput())
class Meta(FeatureForm.Meta):
model = B... |
51346025b638159c69fe2c8da85170784d065d60 | test_passgen.py | test_passgen.py | #!/usr/bin/env python3
import argparse
from passgen import make_parser, sanitize_input
import unittest
class PassGenTestCase(unittest.TestCase):
def setUp(self):
self.parse_args = make_parser().parse_args
def test_duplicate_flags(self):
for duplicate_flag in ['dd', 'll', 'uu', 'pp', 'ss']:
... | #!/usr/bin/env python3
import argparse
from passgen import make_parser, sanitize_input
import unittest
class PassGenTestCase(unittest.TestCase):
def setUp(self):
self.parse_args = make_parser().parse_args
def test_duplicate_flags(self):
for duplicate_flag in ['dd', 'll', 'uu', 'pp', 'ss']:
... | Add unit test for valid blacklist | Add unit test for valid blacklist
| Python | mit | Videonauth/passgen | ---
+++
@@ -33,5 +33,9 @@
dictionary = sanitize_input(self.parse_args(['-f', valid_flag]))
self.assertIsInstance(dictionary, argparse.Namespace)
+ def test_valid_blacklist(self):
+ dictionary = sanitize_input(self.parse_args(['-f', 'd', '-b', '012345678']))
+ self.assertIs... |
6e8efdbb31c8713eeee0105ddafbd88d6286cfc9 | ganttcharts/cli/send_summary_emails.py | ganttcharts/cli/send_summary_emails.py | import datetime
import time
from .. import emails
from ..database import get_sql_connection
from ..models import Account, Session as SqlSession
__description__ = 'Send out summary emails.'
def send_out_emails():
session = SqlSession()
today = datetime.date.today()
accounts = session.query(Account) \
... | import datetime
import time
from .. import emails
from ..database import get_sql_connection
from ..models import Account, Session as SqlSession
__description__ = 'Send out summary emails.'
def send_out_emails():
session = SqlSession()
today = datetime.date.today()
accounts = session.query(Account) \
... | Add check for no tasks | Add check for no tasks
| Python | mit | thomasleese/gantt-charts,thomasleese/gantt-charts,thomasleese/gantt-charts,thomasleese/gantt-charts,thomasleese/gantt-charts | ---
+++
@@ -17,7 +17,11 @@
accounts = session.query(Account) \
.filter(Account.receive_summary_email == True)
for account in accounts:
- email = emails.Summary(account, today)
+ try:
+ email = emails.Summary(account, today)
+ except RuntimeError: # no tasks
+ ... |
fbae1592e9a94a4b6faec0896abfc38acb06d5d2 | top40.py | top40.py | import click
import requests
url = 'http://ben-major.co.uk/labs/top40/api/singles/'
response = requests.get(url)
print response.json()
| #/usr/bin/env python
# -*- coding: utf-8 -*-
import click
import requests
url = 'http://ben-major.co.uk/labs/top40/api/singles/'
@click.command()
@click.option('--count',
default=10,
help='Number of songs to show. Maximum is 40')
def get_charts(count):
"""Prints the top COUNT songs in the UK Top 40 char... | Implement basic printing of the singles chart | Implement basic printing of the singles chart
| Python | mit | kevgathuku/top40,andela-kndungu/top40 | ---
+++
@@ -1,8 +1,27 @@
+#/usr/bin/env python
+# -*- coding: utf-8 -*-
+
import click
import requests
url = 'http://ben-major.co.uk/labs/top40/api/singles/'
-response = requests.get(url)
+@click.command()
+@click.option('--count',
+ default=10,
+ help='Number of songs to show. Maximum is 40')
-print r... |
d60b16912cc3aa5c0a4f231b63b564683b2b8f64 | parameters/enums.py | parameters/enums.py | # -*- coding: utf-8 -*-
# standard library
import collections
# django
from django.utils.translation import ugettext_lazy as _
ParameterDefinition = collections.namedtuple(
'Parameter',
[
'name',
'default',
'kind',
'verbose_name',
]
)
class ParameterDefinitionList(object... | # -*- coding: utf-8 -*-
# standard library
import collections
# django
from django.utils.translation import ugettext_lazy as _
ParameterDefinition = collections.namedtuple(
'Parameter',
[
'name',
'default',
'kind',
'verbose_name',
]
)
class ParameterDefinitionList(object... | Rename parameter DEFAULT_PROTOCOL to DEFAULT_URL_PROTOCOL | Rename parameter DEFAULT_PROTOCOL to DEFAULT_URL_PROTOCOL
| Python | mit | magnet-cl/django-project-template-py3,magnet-cl/django-project-template-py3,magnet-cl/django-project-template-py3,magnet-cl/django-project-template-py3 | ---
+++
@@ -20,10 +20,10 @@
class ParameterDefinitionList(object):
definitions = [
ParameterDefinition(
- name='DEFAULT_PROTOCOL',
+ name='DEFAULT_URL_PROTOCOL',
default='https',
kind='str',
- verbose_name=_('default protocol: https'),
+ ... |
fcc2a190a50327a2349dfbb8e93d3157a6c1f1e8 | src/sentry/utils/versioning.py | src/sentry/utils/versioning.py | from __future__ import absolute_import
import warnings
from collections import namedtuple
from sentry.exceptions import InvalidConfiguration
class Version(namedtuple('Version', 'major minor patch')):
def __str__(self):
return '.'.join(map(str, self))
def make_upgrade_message(service, modality, version... | from __future__ import absolute_import
import warnings
from collections import namedtuple
from sentry.exceptions import InvalidConfiguration
class Version(namedtuple('Version', 'major minor patch')):
def __str__(self):
return '.'.join(map(str, self))
def make_upgrade_message(service, modality, version... | Fix strange wording in version check docstring. | Fix strange wording in version check docstring.
| Python | bsd-3-clause | zenefits/sentry,BuildingLink/sentry,ifduyue/sentry,beeftornado/sentry,beeftornado/sentry,jean/sentry,jean/sentry,ifduyue/sentry,JackDanger/sentry,nicholasserra/sentry,gencer/sentry,fotinakis/sentry,mvaled/sentry,mvaled/sentry,daevaorn/sentry,jean/sentry,ifduyue/sentry,JamesMura/sentry,alexm92/sentry,daevaorn/sentry,fot... | ---
+++
@@ -22,7 +22,7 @@
def check_versions(service, versions, required, recommended=None):
"""
- Check that all members of mapping hosts fulfill version requirements.
+ Check that hosts fulfill version requirements.
:param service: service label, such as ``Redis``
:param versions: mapping ... |
3e9fe3ac1f261d66ee9842fa507752754ae3d5aa | src/server.py | src/server.py | import os
from flask import Flask, request
from flask.ext import restful # @UnresolvedImport
app = Flask(
__name__,
template_folder='../templates',
static_folder='../static'
)
api = restful.Api(app)
class Github(restful.Resource):
def handle_push(self, data):
print(data)
def post(self):... | import os
from flask import Flask, request
from flask.ext import restful # @UnresolvedImport
app = Flask(
__name__,
template_folder='../templates',
static_folder='../static'
)
api = restful.Api(app)
class PullRequest(Object):
def __init__(self, data):
self.data = data
def execute(self)... | Handle pull_request and create object | Handle pull_request and create object
| Python | agpl-3.0 | TooAngel/democratic-collaboration,TooAngel/democratic-collaboration,TooAngel/democratic-collaboration | ---
+++
@@ -10,15 +10,38 @@
)
api = restful.Api(app)
+
+class PullRequest(Object):
+ def __init__(self, data):
+ self.data = data
+
+ def execute(self):
+ if self.data['action'] == 'opened':
+ self.execute_opened()
+
+ def execute_opened():
+ // TODO check PR and add messa... |
87a07437c2481f92286f01f988405b4f3cfc5d37 | apps/accounts/models.py | apps/accounts/models.py | from django.contrib.auth.models import User
from django.db import models
class UserProfile(models.Model):
user = models.ForeignKey(User, unique = True)
dionysos_username = models.CharField(max_length = 15, unique = True)
dionysos_password = models.CharField(max_length = 30)
eclass_username = models.Cha... | from apps.teilar.models import Departments
from django.contrib.auth.models import User
from django.db import models
class UserProfile(models.Model):
user = models.ForeignKey(User, unique = True)
dionysos_username = models.CharField(max_length = 15, unique = True)
dionysos_password = models.CharField(max_le... | Make school field foreign key of Departments table | Make school field foreign key of Departments table
| Python | agpl-3.0 | LinuxTeam-teilar/cronos.teilar.gr,LinuxTeam-teilar/cronos.teilar.gr,LinuxTeam-teilar/cronos.teilar.gr | ---
+++
@@ -1,3 +1,4 @@
+from apps.teilar.models import Departments
from django.contrib.auth.models import User
from django.db import models
@@ -10,7 +11,7 @@
eclass_lessons = models.TextField(null = True, blank = True)
introduction_year = models.CharField(max_length = 5)
registration_number = mode... |
38bdff4d1d3bbf2416c6fe75036bf23d270f15a2 | plinth/__init__.py | plinth/__init__.py | #
# This file is part of Plinth.
#
# 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 the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Make plinth directory a package, add version | Make plinth directory a package, add version
| Python | agpl-3.0 | vignanl/Plinth,harry-7/Plinth,vignanl/Plinth,freedomboxtwh/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,kkampardi/Plinth,jvalleroy/plinth-debian,jvalleroy/plinth-debian,jvalleroy/plinth-debian,vignanl/Plinth,kkampardi/Plinth,kkampardi/Plinth,kkampardi/Plinth,freedomboxtwh/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,vignan... | ---
+++
@@ -0,0 +1,22 @@
+#
+# This file is part of Plinth.
+#
+# 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 the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later versi... | |
40bb8f55011f3426058313075cbb5f04cd9bfb97 | main/translations.py | main/translations.py | from django.utils.translation import ungettext_lazy, ugettext_lazy, pgettext_lazy
"""
Removing this code causes makemessages to comment out those PO entries, so don't do that
unless you find a better way to do this
http://stackoverflow.com/questions/7625991/how-to-properly-add-entries-for-computed-values-to-the-django... | from django.utils.translation import ungettext_lazy, ugettext_lazy, pgettext_lazy
"""
Removing this code causes makemessages to comment out those PO entries, so don't do that
unless you find a better way to do this
http://stackoverflow.com/questions/7625991/how-to-properly-add-entries-for-computed-values-to-the-django... | Fix formatting: use single quotes | Fix formatting: use single quotes
| Python | agpl-3.0 | Davidyuk/witcoin,Davidyuk/witcoin | ---
+++
@@ -11,4 +11,4 @@
ungettext_lazy('%d minute', '%d minutes')
ugettext_lazy('Comment')
ugettext_lazy('Threaded comment')
-pgettext_lazy("Person name", "Name")
+pgettext_lazy('Person name', 'Name') |
85db39e36c99e800e1008605213d1c25108b035d | angr/paths.py | angr/paths.py | import logging
l = logging.getLogger('angr.states')
class PathGenerator(object):
def __init__(self, project):
self._project = project
def blank_path(self, state=None, *args, **kwargs):
'''
blank_point - Returns a start path, representing a clean start of symbolic execution.
''... | import logging
l = logging.getLogger('angr.states')
class PathGenerator(object):
def __init__(self, project):
self._project = project
def blank_path(self, state=None, jumpkind='Ijk_Boring', *args, **kwargs):
'''
blank_point - Returns a start path, representing a clean start of symboli... | Allow specifying jumpkind with creating a Path via PathGenerator.blank_path() | Allow specifying jumpkind with creating a Path via PathGenerator.blank_path()
| Python | bsd-2-clause | angr/angr,GuardianRG/angr,iamahuman/angr,cureHsu/angr,tyb0807/angr,mingderwang/angr,fjferrer/angr,angr/angr,zhuyue1314/angr,axt/angr,cureHsu/angr,chubbymaggie/angr,schieb/angr,lowks/angr,fjferrer/angr,zhuyue1314/angr,schieb/angr,chubbymaggie/angr,GuardianRG/angr,axt/angr,mingderwang/angr,avain/angr,schieb/angr,angr/ang... | ---
+++
@@ -6,12 +6,12 @@
def __init__(self, project):
self._project = project
- def blank_path(self, state=None, *args, **kwargs):
+ def blank_path(self, state=None, jumpkind='Ijk_Boring', *args, **kwargs):
'''
blank_point - Returns a start path, representing a clean start of ... |
6ae83f01eacceb140435e72a216fa88bd97f2b0c | pyswarms/utils/console_utils.py | pyswarms/utils/console_utils.py | # -*- coding: utf-8 -*-
""" console_utils.py: various tools for printing into console """
def cli_print(message, verbosity, threshold):
"""Helper function to print console output
Parameters
----------
message : str
the message to be printed into the console
verbosity : int
verbosi... | # -*- coding: utf-8 -*-
""" console_utils.py: various tools for printing into console """
# Import from __future__
from __future__ import with_statement
from __future__ import absolute_import
from __future__ import print_function
# Import modules
import logging
def cli_print(message, verbosity, threshold, logger):
... | Add support for logging module | Add support for logging module
This package now prints using the logging module. It can still print
onto the console, but an additional tag like INFO, DEBUG, etc. are now
being used.
Author: ljvmiranda921
| Python | mit | ljvmiranda921/pyswarms,ljvmiranda921/pyswarms | ---
+++
@@ -2,7 +2,15 @@
""" console_utils.py: various tools for printing into console """
-def cli_print(message, verbosity, threshold):
+# Import from __future__
+from __future__ import with_statement
+from __future__ import absolute_import
+from __future__ import print_function
+
+# Import modules
+import log... |
5f30d91d35d090e28925613365d5d1f31f0259d2 | daapserver/bonjour.py | daapserver/bonjour.py | import zeroconf
import socket
class Bonjour(object):
"""
"""
def __init__(self):
"""
"""
self.zeroconf = zeroconf.Zeroconf()
self.servers = {}
def publish(self, server):
"""
"""
if server in self.servers:
self.unpublish(server)
... | import zeroconf
import socket
class Bonjour(object):
"""
"""
def __init__(self):
"""
"""
self.zeroconf = zeroconf.Zeroconf()
self.servers = {}
def publish(self, server):
"""
"""
if server in self.servers:
self.unpublish(server)
... | Fix for broken zeroconf publishing. | Fix for broken zeroconf publishing.
| Python | mit | ties/flask-daapserver,basilfx/flask-daapserver | ---
+++
@@ -23,12 +23,12 @@
ip = "127.0.0.1" if server.ip == "0.0.0.0" else server.ip
description = {
"txtvers": 1,
- "Password": server.password is not None,
+ "Password": int(bool(server.password)),
"Machine Name": server.server_name
}
... |
77cdf4de05b3edfe3231ffd831af38b290b178a1 | signals.py | signals.py | from django.core.signals import Signal
process_completed = Signal(providing_args=['result_text', 'result_data', 'files', 'profile','logs'])
process_aborted = Signal(providing_args=['error_text','result_data','profile','logs'])
| from django.core.signals import Signal
process_finished = Signal(providing_args=['result_text', 'result_data', 'files', 'profile','logs'])
process_aborted = Signal(providing_args=['error_text','result_data','profile','logs'])
| Add a little doc and callbacks | Add a little doc and callbacks
| Python | bsd-3-clause | hydroshare/django_docker_processes,JeffHeard/django_docker_processes | ---
+++
@@ -1,4 +1,4 @@
from django.core.signals import Signal
-process_completed = Signal(providing_args=['result_text', 'result_data', 'files', 'profile','logs'])
+process_finished = Signal(providing_args=['result_text', 'result_data', 'files', 'profile','logs'])
process_aborted = Signal(providing_args=['error_... |
5256408a2a5d7a4c5562962a590487b39da3dcff | core/helpers.py | core/helpers.py | from django.shortcuts import Http404
from django.utils import translation
def handle_cms_response(response):
if response.status_code == 404:
raise Http404()
response.raise_for_status()
return response.json()
def get_language_from_querystring(request):
language_code = request.GET.get('lang')
... | from django.shortcuts import Http404
from django.utils import translation
def handle_cms_response(response):
if response.status_code == 404:
raise Http404()
response.raise_for_status()
return response.json()
def get_language_from_querystring(request):
language_code = request.GET.get('languag... | Use 'language' for query string instead of 'lang' | Use 'language' for query string instead of 'lang'
| Python | mit | uktrade/directory-ui-supplier,uktrade/directory-ui-supplier,uktrade/directory-ui-supplier | ---
+++
@@ -10,7 +10,7 @@
def get_language_from_querystring(request):
- language_code = request.GET.get('lang')
+ language_code = request.GET.get('language')
language_codes = translation.trans_real.get_languages()
if language_code and language_code in language_codes:
return language_code |
e866e196f72f9965dfbca1f7628c8b90e5c627dc | CI/syntaxCheck.py | CI/syntaxCheck.py | import sys
from CITests import CITests
# Libs in Application Examples
appExamples = {
#"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo",
#"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo",
#"SevenBus":"/ApplicationExamples/SevenBus/package.mo",
#"IEEE9":"/ApplicationExamples/IEEE9/package.mo",
#"IEEE14":"... | import sys
from CITests import CITests
# Libs in Application Examples
appExamples = {
#"KundurSMIB":"/ApplicationExamples/KundurSMIB/package.mo",
#"TwoAreas":"/ApplicationExamples/TwoAreas/package.mo",
#"SevenBus":"/ApplicationExamples/SevenBus/package.mo",
#"IEEE9":"/ApplicationExamples/IEEE9/package.mo",
#"IEEE14":"... | Fix the location path of OpenIPSL | Fix the location path of OpenIPSL
| Python | bsd-3-clause | OpenIPSL/OpenIPSL,SmarTS-Lab/OpenIPSL,tinrabuzin/OpenIPSL,SmarTS-Lab/OpenIPSL | ---
+++
@@ -18,7 +18,7 @@
ci = CITests("/OpenIPSL")
# Run Check on OpenIPSL
-passLib = ci.runSyntaxCheck("OpenIPSL","/OpenIPSL/package.mo")
+passLib = ci.runSyntaxCheck("OpenIPSL","/OpenIPSL/OpenIPSL/package.mo")
if not passLib:
# Error in OpenIPSL |
eed21e06dbb61899e9c14352750258aa81cc5d3c | doc/en/example/nonpython/conftest.py | doc/en/example/nonpython/conftest.py | # content of conftest.py
import pytest
def pytest_collect_file(parent, path):
if path.ext == ".yml" and path.basename.startswith("test"):
return YamlFile(path, parent)
class YamlFile(pytest.File):
def collect(self):
import yaml # we need a yaml parser, e.g. PyYAML
raw = yaml.safe_load... | # content of conftest.py
import pytest
def pytest_collect_file(parent, path):
if path.ext == ".yml" and path.basename.startswith("test"):
return YamlFile(path, parent)
class YamlFile(pytest.File):
def collect(self):
import yaml # we need a yaml parser, e.g. PyYAML
raw = yaml.safe_load... | Sort yml items to get same results for regendoc runs | Sort yml items to get same results for regendoc runs
| Python | mit | The-Compiler/pytest,pfctdayelise/pytest,malinoff/pytest,tomviner/pytest,hackebrot/pytest,rmfitzpatrick/pytest,nicoddemus/pytest,tomviner/pytest,RonnyPfannschmidt/pytest,skylarjhdownes/pytest,etataurov/pytest,hpk42/pytest,alfredodeza/pytest,nicoddemus/pytest,markshao/pytest,ddboline/pytest,hpk42/pytest,jaraco/pytest,The... | ---
+++
@@ -10,7 +10,7 @@
def collect(self):
import yaml # we need a yaml parser, e.g. PyYAML
raw = yaml.safe_load(self.fspath.open())
- for name, spec in raw.items():
+ for name, spec in sorted(raw.items()):
yield YamlItem(name, self, spec)
class YamlItem(pytest.I... |
cf09237c9d889b83f76e22835cb62da3711b6342 | netmiko/__init__.py | netmiko/__init__.py | from __future__ import unicode_literals
import logging
# Logging configuration
log = logging.getLogger(__name__) # noqa
log.addHandler(logging.NullHandler()) # noqa
from netmiko.ssh_dispatcher import ConnectHandler
from netmiko.ssh_dispatcher import ssh_dispatcher
from netmiko.ssh_dispatcher import redispatch
from ... | from __future__ import unicode_literals
import logging
# Logging configuration
log = logging.getLogger(__name__) # noqa
log.addHandler(logging.NullHandler()) # noqa
from netmiko.ssh_dispatcher import ConnectHandler
from netmiko.ssh_dispatcher import ssh_dispatcher
from netmiko.ssh_dispatcher import redispatch
from ... | Fix markdown issue on pypi | Fix markdown issue on pypi
| Python | mit | ktbyers/netmiko,ktbyers/netmiko | ---
+++
@@ -23,7 +23,7 @@
NetmikoAuthError = NetMikoAuthenticationException
Netmiko = ConnectHandler
-__version__ = "2.3.2"
+__version__ = "2.3.3"
__all__ = (
"ConnectHandler",
"ssh_dispatcher", |
a3fce3124168cde5dec925c3346bab59f4e6d59c | blog/forms.py | blog/forms.py | from .models import BlogPost
from django import forms
class BlogPostForm(forms.ModelForm):
class Meta:
model = BlogPost
exclude = ('user',)
| from .models import BlogPost, Comment
from django.forms import ModelForm
class BlogPostForm(ModelForm):
class Meta:
model = BlogPost
exclude = ('user',)
class CommentForm(ModelForm):
class Meta:
model = Comment
exclude = ('post',)
| Add the form for Comment | Add the form for Comment
| Python | mit | andreagrandi/bloggato,andreagrandi/bloggato | ---
+++
@@ -1,7 +1,12 @@
-from .models import BlogPost
-from django import forms
+from .models import BlogPost, Comment
+from django.forms import ModelForm
-class BlogPostForm(forms.ModelForm):
+class BlogPostForm(ModelForm):
class Meta:
model = BlogPost
exclude = ('user',)
+
+class CommentFo... |
296005cae2af44e7e14a7e7ee9a99a2deab8c924 | pyvarnish/remote.py | pyvarnish/remote.py | # -*- coding: utf-8 -*-
__author__ = 'John Moylan'
import sys
from paramiko import SSHClient, SSHConfig, AutoAddPolicy
from pyvarnish.settings import SSH_CONFIG
class Varnish_admin():
def __init__(self, server=''):
self.server = server
self.conf = self.config()
def config(self):
s... | # -*- coding: utf-8 -*-
__author__ = 'John Moylan'
import sys
from paramiko import SSHClient, SSHConfig, AutoAddPolicy
from pyvarnish.settings import SSH_CONFIG
class Varnish_admin():
def __init__(self, server=''):
self.server = server
self.conf = {
'hostname': server,
... | Make the SSH configuration more resilient. | Make the SSH configuration more resilient.
If you don't have certain values specified in your ~/.ssh/config, use
the defaults instead of erroring out.
| Python | bsd-3-clause | redsnapper8t8/pyvarnish | ---
+++
@@ -12,7 +12,14 @@
def __init__(self, server=''):
self.server = server
- self.conf = self.config()
+ self.conf = {
+ 'hostname': server,
+ 'port': 22,
+ # If these are None, Paramiko will figure out the correct values.
+ 'user': None,
+... |
61605fa39920eca5bd47f7dc1b54eab67dd7d015 | quantum/__init__.py | quantum/__init__.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | Make the quantum top-level a namespace package. | Make the quantum top-level a namespace package.
Change-Id: I8fa596dedcc72fcec73972f6bf158e53c17b7e6d
| Python | apache-2.0 | gkotton/vmware-nsx,gkotton/vmware-nsx | ---
+++
@@ -0,0 +1,19 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2011 OpenStack LLC
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
... | |
3a8ea034e43985d4358b9f3e54c9bfc59ee6e99b | djangocms_spa_vue_js/templatetags/router_tags.py | djangocms_spa_vue_js/templatetags/router_tags.py | import json
from django import template
from django.utils.safestring import mark_safe
from ..menu_helpers import get_vue_js_router
register = template.Library()
@register.simple_tag(takes_context=True)
def vue_js_router(context):
if 'vue_js_router' in context:
router = context['vue_js_router']
else... | import json
from django import template
from django.utils.safestring import mark_safe
from ..menu_helpers import get_vue_js_router
register = template.Library()
@register.simple_tag(takes_context=True)
def vue_js_router(context):
if 'vue_js_router' in context:
router = context['vue_js_router']
else... | Remove single quote escaping for router js | Remove single quote escaping for router js
This used to be a html field which crippled the json when a single quote
was present. In the current usage it's required to print this json in a
script tag so this quote issue doesn't exist anymore
| Python | mit | dreipol/djangocms-spa-vue-js | ---
+++
@@ -16,5 +16,4 @@
router = get_vue_js_router(context=context)
router_json = json.dumps(router)
- escaped_router_json = router_json.replace("'", "'") # Escape apostrophes to prevent JS errors.
- return mark_safe(escaped_router_json)
+ return mark_safe(router_json) |
8514d379ac3a9d75722b3ccccd0a9da40d2c5819 | __openerp__.py | __openerp__.py | # -*- coding: utf-8 -*-
{
'name': "l10n_fr_ebics",
'summary': """Implementation of the EBICS banking protocol""",
'description': """
This module provides an interface to echanges files with banks. It's curently a beta version.
This program is distributed in the hope that it will be useful, b... | # -*- coding: utf-8 -*-
{
'name': "l10n_fr_ebics",
'summary': """Implementation of the EBICS banking protocol""",
'description': """
This module provides an interface to echanges files with banks. It's curently a beta version.
This module isbased on the library ebicsPy. It maps Odoo with the eb... | Add EbicsPy Launchpad repository url | Add EbicsPy Launchpad repository url
| Python | agpl-3.0 | yuntux/l10n_fr_ebics | ---
+++
@@ -6,7 +6,10 @@
'description': """
This module provides an interface to echanges files with banks. It's curently a beta version.
-
+ This module isbased on the library ebicsPy. It maps Odoo with the ebicspy API.
+
+ https://code.launchpad.net/~aurelien-dumaine/+junk/ebicspy
+
This prog... |
926aae6d674f03803158978e211fe0e9e3c51722 | scripts/util/iff.py | scripts/util/iff.py | #!/usr/bin/env python
from chunk import Chunk
import logging
import struct
class Parser(object):
ChunkAliasMap = {}
def __init__(self, kind):
self._kind = kind
self._chunks = []
def loadFile(self, filename):
with open(filename) as iff:
chunk = Chunk(iff)
logging.error('Reading file "%... | #!/usr/bin/env python
from chunk import Chunk
import logging
import struct
class Parser(object):
ChunkAliasMap = {}
def __init__(self, kind):
self._kind = kind
self._chunks = []
def loadFile(self, filename):
with open(filename) as iff:
chunk = Chunk(iff)
logging.info('Reading file "%s... | Correct logging level for messages. | Correct logging level for messages.
| Python | artistic-2.0 | cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene | ---
+++
@@ -15,7 +15,7 @@
with open(filename) as iff:
chunk = Chunk(iff)
- logging.error('Reading file "%s"' % filename)
+ logging.info('Reading file "%s"' % filename)
if chunk.getname() == 'FORM' and chunk.read(4) == self._kind:
iff.seek(12)
@@ -30,7 +30,7 @@
size... |
3e91ff11f93e491963f6e38965672a9694ea0786 | optimize/__init__.py | optimize/__init__.py | from __future__ import absolute_import
from .optimization import ParameterManager, minimize
from .jacobian import FunctionWithApproxJacobian, FunctionWithApproxJacobianCentral
| from __future__ import absolute_import
from .optimization import ParameterManager, minimize
from .jacobian import FunctionWithApproxJacobian, FunctionWithApproxJacobianCentral
try:
from .ipopt_wrapper import minimize_ipopt
except:
import logging
logging.error("Could not import ipopt wrapper. Maybe ipopt i... | Make sure package works even if ipopt is not installed | Make sure package works even if ipopt is not installed
Signed-off-by: Matthias Kümmerer <e388d34fd3c0456122779e95f262c0d70198a168@matthias-k.org>
| Python | mit | matthias-k/optpy | ---
+++
@@ -2,3 +2,9 @@
from .optimization import ParameterManager, minimize
from .jacobian import FunctionWithApproxJacobian, FunctionWithApproxJacobianCentral
+
+try:
+ from .ipopt_wrapper import minimize_ipopt
+except:
+ import logging
+ logging.error("Could not import ipopt wrapper. Maybe ipopt is no... |
e99855e31c30d0b554d24b14d98ae8b76e1fc0a0 | create_tables.py | create_tables.py | from models.base_model import db
from models.user_model import UserModel
from models.waifu_model import WaifuModel
from models.waifu_message_model import WaifuMessageModel
def create_tables():
db.connect()
db.create_tables((
UserModel,
WaifuModel,
WaifuMessageModel,
), True)
db... | from models.base_model import db
from models.user_model import UserModel
from models.waifu_model import WaifuModel
from models.waifu_message_model import WaifuMessageModel
def create_tables():
db.connect()
db.create_tables((
UserModel,
WaifuModel,
WaifuMessageModel,
), True)
if __... | Fix close connection only when called as script. | Fix close connection only when called as script.
| Python | cc0-1.0 | sketchturnerr/WaifuSim-backend,sketchturnerr/WaifuSim-backend | ---
+++
@@ -11,7 +11,7 @@
WaifuModel,
WaifuMessageModel,
), True)
- db.manual_close()
if __name__ == '__main__':
create_tables()
+ db.manual_close() |
95cb5fc25b3fb1470c4631b93fea11d6172240a4 | MeetingMinutes.py | MeetingMinutes.py | import sublime, sublime_plugin
import os
import re
from .mistune import markdown
HTML_START = '<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>'
HTML_END = '</body></html>'
class CreateMinuteCommand(sublime_plugin.TextCommand):
def run(self, edit):
region = sublime.Region(0, self.view.size())
md_s... | import sublime, sublime_plugin
import os
import re
from subprocess import call
from .mistune import markdown
HTML_START = '<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>'
HTML_END = '</body></html>'
class CreateMinuteCommand(sublime_plugin.TextCommand):
def run(self, edit):
region = sublime.Region... | Add save as pdf feature. | Add save as pdf feature.
| Python | mit | Txarli/sublimetext-meeting-minutes,Txarli/sublimetext-meeting-minutes | ---
+++
@@ -1,6 +1,7 @@
import sublime, sublime_plugin
import os
import re
+from subprocess import call
from .mistune import markdown
@@ -19,6 +20,7 @@
with open(html_file, 'w+') as file_:
file_.write(html_source)
+ self.save_pdf(html_file)
print(file_name)
print(html_file)
@@ -28,4 +30,8 @@... |
085bc7787eac2d44fd4c19c8161709b20dc324be | finny/commands/generate_structure.py | finny/commands/generate_structure.py | import os
from finny.command import Command
class GenerateStructure(Command):
def __init__(self, name, path):
self.name = name
self.path = path
def run(self):
os.mkdir(self.path, 0755)
"""
You need to create:
.gitignore
requirements.txt
README.md
manage.py
{{ app_name... | import os
from finny.command import Command
BASE_FOLDER_TEMPLATES = [
".gitignore",
"requirements.txt",
"README.md",
"manage.py"
]
CONFIG_INITIALIZERS_TEMPLATES = [ "app.py" ]
CONFIG_RUNNERS_TEMPLATES = [ "default.py" ]
CONFIG_TEMPLATES = [
"boot.py",
"development.py.sample"
"test.py.sample",
"produc... | Copy template structure for the create command | Copy template structure for the create command
| Python | mit | hurrycane/finny | ---
+++
@@ -1,6 +1,24 @@
import os
from finny.command import Command
+
+BASE_FOLDER_TEMPLATES = [
+ ".gitignore",
+ "requirements.txt",
+ "README.md",
+ "manage.py"
+]
+
+CONFIG_INITIALIZERS_TEMPLATES = [ "app.py" ]
+CONFIG_RUNNERS_TEMPLATES = [ "default.py" ]
+CONFIG_TEMPLATES = [
+ "boot.py",
+ "developme... |
4dcca124835655ddbcf34b9d661b63f43eadf4a6 | cms/manage.py | cms/manage.py | #!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized t... | #!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. "
"It app... | Fix string layout for readability | Fix string layout for readability
| Python | agpl-3.0 | jamesblunt/edx-platform,hkawasaki/kawasaki-aio8-0,sameetb-cuelogic/edx-platform-test,zofuthan/edx-platform,mtlchun/edx,zerobatu/edx-platform,carsongee/edx-platform,devs1991/test_edx_docmode,dkarakats/edx-platform,franosincic/edx-platform,Lektorium-LLC/edx-platform,dkarakats/edx-platform,procangroup/edx-platform,gsehub/... | ---
+++
@@ -5,7 +5,9 @@
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
- sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your... |
38ac22c8380e91777c22f7dcb9a5297e9737d522 | pymatgen/io/cp2k/tests/test_outputs.py | pymatgen/io/cp2k/tests/test_outputs.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
from pathlib import Path
from pymatgen.util.testing import PymatgenTest
from pymatgen.io.cp2k.outputs import Cp2kOutput
MODULE_DIR = Path(__file__).resolve().parent
class SetTest(PymatgenTes... | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
from pathlib import Path
from pymatgen.util.testing import PymatgenTest
from pymatgen.io.cp2k.outputs import Cp2kOutput
TEST_FILES = Path(__file__).parent.parent.joinpath("test_files").resolve... | Switch output to to use TEST_FILES path | Switch output to to use TEST_FILES path | Python | mit | davidwaroquiers/pymatgen,davidwaroquiers/pymatgen,gmatteo/pymatgen,richardtran415/pymatgen,davidwaroquiers/pymatgen,gVallverdu/pymatgen,fraricci/pymatgen,davidwaroquiers/pymatgen,gmatteo/pymatgen,gVallverdu/pymatgen,fraricci/pymatgen,richardtran415/pymatgen,vorwerkc/pymatgen,gVallverdu/pymatgen,vorwerkc/pymatgen,fraric... | ---
+++
@@ -8,13 +8,13 @@
from pymatgen.util.testing import PymatgenTest
from pymatgen.io.cp2k.outputs import Cp2kOutput
-MODULE_DIR = Path(__file__).resolve().parent
+TEST_FILES = Path(__file__).parent.parent.joinpath("test_files").resolve()
class SetTest(PymatgenTest):
def setUp(self):
- self... |
33e610576462d017bf25a65f1e879e6340f2ca06 | python2/raygun4py/middleware/django.py | python2/raygun4py/middleware/django.py | from __future__ import absolute_import
from django.conf import settings
from raygun4py import raygunprovider
class Provider(object):
def __init__(self):
config = getattr(settings, 'RAYGUN4PY_CONFIG', {})
apiKey = getattr(settings, 'RAYGUN4PY_API_KEY', config.get('api_key', None))
self.se... | from __future__ import absolute_import
from django.conf import settings
from raygun4py import raygunprovider
class Provider(object):
def __init__(self):
config = getattr(settings, 'RAYGUN4PY_CONFIG', {})
apiKey = getattr(settings, 'RAYGUN4PY_API_KEY', config.get('api_key', None))
self.se... | Fix RawPostDataException on request.body access. | Fix RawPostDataException on request.body access.
Django's HttpRequest class doesn't like the `request.body` to be accessed more than one time. Upon the second attempt to read from `request.body`, Django throws a `RawPostDataException`. Since the previous code in this spot was conditional upon a `hasattr(request, 'bo... | Python | mit | MindscapeHQ/raygun4py | ---
+++
@@ -24,6 +24,7 @@
if not k.startswith('wsgi'):
_headers[k] = v
+
return {
'hostName': request.get_host(),
'url': request.path, |
229b8161f690154620faffd700335920648e1a96 | services/netflix.py | services/netflix.py | import foauth.providers
class Netflix(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'https://www.netflix.com/'
docs_url = 'http://developer.netflix.com/docs'
# URLs to interact with the API
request_token_url = 'http://api.netflix.com/oauth/request_token'
authorize... | import foauth.providers
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_QUERY
class Netflix(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'https://www.netflix.com/'
docs_url = 'http://developer.netflix.com/docs'
# URLs to interact with the API
request_token_url = '... | Fix token retrieval for Netflix | Fix token retrieval for Netflix
| Python | bsd-3-clause | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | ---
+++
@@ -1,4 +1,5 @@
import foauth.providers
+from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_QUERY
class Netflix(foauth.providers.OAuth1):
@@ -15,3 +16,11 @@
available_permissions = [
(None, 'read and manage your queue'),
]
+
+ https = False
+ signature_type = SIGNATURE_TYPE_QUER... |
19de35d8124a67e459a69080156bd310bb3814ea | rate_delta_point.py | rate_delta_point.py | #!/usr/bin/env python3
from numpy import *
from scipy import *
from scipy.interpolate import interp1d
from scipy.interpolate import pchip
import sys
import os
import argparse
import json
a = flipud(loadtxt(sys.argv[1]));
b = flipud(loadtxt(sys.argv[2]));
for m in range(0,4):
ya = a[:,3+m]
yb = b[:,3+m]
r... | #!/usr/bin/env python3
from numpy import *
from scipy import *
from scipy.interpolate import interp1d
from scipy.interpolate import pchip
import sys
import os
import argparse
import json
a = flipud(loadtxt(sys.argv[1]));
b = flipud(loadtxt(sys.argv[2]));
for m in range(0,11):
try:
ya = a[:,3+m]
y... | Support all metrics for points. | Support all metrics for points.
| Python | mit | tdaede/awcy,tdaede/awcy,tdaede/awcy,tdaede/awcy,tdaede/awcy,tdaede/awcy | ---
+++
@@ -12,11 +12,14 @@
a = flipud(loadtxt(sys.argv[1]));
b = flipud(loadtxt(sys.argv[2]));
-for m in range(0,4):
- ya = a[:,3+m]
- yb = b[:,3+m]
- ra = a[:,2]*8./a[:,1]
- rb = b[:,2]*8./b[:,1]
- a_rate = pchip(ya, log(ra))(float(sys.argv[3]))
- b_rate = pchip(yb, log(rb))(float(sys.argv[3])... |
0ce9a29f83bb9c87df04f49b5e927d7a6aa4c53c | pdfminer/pdfcolor.py | pdfminer/pdfcolor.py |
from .psparser import LIT
import six #Python 2+3 compatibility
## PDFColorSpace
##
LITERAL_DEVICE_GRAY = LIT('DeviceGray')
LITERAL_DEVICE_RGB = LIT('DeviceRGB')
LITERAL_DEVICE_CMYK = LIT('DeviceCMYK')
class PDFColorSpace(object):
def __init__(self, name, ncomponents):
self.name = name
self.nc... | import collections
from .psparser import LIT
import six #Python 2+3 compatibility
## PDFColorSpace
##
LITERAL_DEVICE_GRAY = LIT('DeviceGray')
LITERAL_DEVICE_RGB = LIT('DeviceRGB')
LITERAL_DEVICE_CMYK = LIT('DeviceCMYK')
class PDFColorSpace(object):
def __init__(self, name, ncomponents):
self.name = na... | Fix colorspace determinism with OrderedDict | Fix colorspace determinism with OrderedDict
| Python | mit | pdfminer/pdfminer.six,goulu/pdfminer | ---
+++
@@ -1,4 +1,4 @@
-
+import collections
from .psparser import LIT
import six #Python 2+3 compatibility
@@ -21,17 +21,16 @@
return '<PDFColorSpace: %s, ncomponents=%d>' % (self.name, self.ncomponents)
-PREDEFINED_COLORSPACE = {}
-for (name, n) in six.iteritems({
- 'CalRGB': 3,
- 'CalGray':... |
fc2085e3c86e1596f5dc9c032e445887430602b5 | rotational-cipher/rotational_cipher.py | rotational-cipher/rotational_cipher.py | import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
return "".join(rot_gen(s,n))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
def rot_gen(s, n):
rules = shift_rules(n)
f... | import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
| Use lambda function with method | Use lambda function with method
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | ---
+++
@@ -6,18 +6,10 @@
def rotate(s, n):
- return "".join(rot_gen(s,n))
+ rules = shift_rules(n)
+ return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
-
-
-def ro... |
7a985d102a347e252b4e6be1776c6b6609fdcdea | pupa/core/default_settings.py | pupa/core/default_settings.py | MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'pupa'
SCRAPELIB_RPM = 60
SCRAPELIB_TIMEOUT = 60
SCRAPELIB_RETRY_ATTEMPTS = 3
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {}
EVENT_FILTERS = {}
LOGGING_CONFIG = {
'version': 1,
'disable_exi... | MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'pupa'
SCRAPELIB_RPM = 60
SCRAPELIB_TIMEOUT = 60
SCRAPELIB_RETRY_ATTEMPTS = 3
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
ELASTICSEARCH_HOST = 'localhost'
ELASTICSEARCH_TIMEOUT = 2
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {}
EVENT_FILTERS ... | Add sensible defaults for ElasticSearch settings | Add sensible defaults for ElasticSearch settings
| Python | bsd-3-clause | opencivicdata/pupa,datamade/pupa,influence-usa/pupa,datamade/pupa,opencivicdata/pupa,mileswwatkins/pupa,mileswwatkins/pupa,influence-usa/pupa,rshorey/pupa,rshorey/pupa | ---
+++
@@ -8,6 +8,8 @@
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
+ELASTICSEARCH_HOST = 'localhost'
+ELASTICSEARCH_TIMEOUT = 2
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {} |
8d18df92373c1fd4c2cfa2fb59f5f49a4f89b78f | djoauth2/conf.py | djoauth2/conf.py | # coding: utf-8
from django.config import settings
from appconf import AppConf
class DJOAuthConf(AppConf):
class Meta:
prefix = 'djoauth'
ACCESS_TOKEN_LENGTH = 30
ACCESS_TOKEN_LIFETIME = 3600
ACCESS_TOKENS_REFRESHABLE = True
AUTHORIZATION_CODE_LENGTH = 30
AUTHORIZATION_CODE_LIFETIME = 120
CLIENT_K... | # coding: utf-8
from django.config import settings
from appconf import AppConf
class DJOAuthConf(AppConf):
class Meta:
prefix = 'djoauth'
ACCESS_TOKEN_LENGTH = 30
ACCESS_TOKEN_LIFETIME = 3600
ACCESS_TOKENS_REFRESHABLE = True
AUTHORIZATION_CODE_LENGTH = 30
AUTHORIZATION_CODE_LIFETIME = 120
CLIENT_K... | Add option for determining requirement of 'state' parameter. | Add option for determining requirement of 'state' parameter.
| Python | mit | vden/djoauth2-ng,Locu/djoauth2,seler/djoauth2,vden/djoauth2-ng,seler/djoauth2,Locu/djoauth2 | ---
+++
@@ -19,5 +19,6 @@
REFRESH_TOKEN_LENGTH = 30
REALM = ''
+ REQUIRE_STATE = True
SSL_ONLY = True
|
1e91b4ad94dd4a986adce22350cec8bd24fa4865 | test/test_connection.py | test/test_connection.py | # -*- coding: utf-8 -*-
"""
test/test_connection
~~~~~~~~~~~~~~~~~~~~~
Tests for the SPDYConnection object.
"""
import spdypy
import spdypy.connection
class TestSPDYConnection(object):
def test_can_create_connection(self):
conn = spdypy.SPDYConnection(None)
assert conn
class TestSPDYConnectionS... | # -*- coding: utf-8 -*-
"""
test/test_connection
~~~~~~~~~~~~~~~~~~~~~
Tests for the SPDYConnection object.
"""
import spdypy
import spdypy.connection
from .test_stream import MockConnection
class TestSPDYConnection(object):
def test_can_create_connection(self):
conn = spdypy.SPDYConnection(None)
... | Test correctly incrementing stream IDs. | Test correctly incrementing stream IDs.
| Python | mit | Lukasa/spdypy | ---
+++
@@ -7,6 +7,7 @@
"""
import spdypy
import spdypy.connection
+from .test_stream import MockConnection
class TestSPDYConnection(object):
@@ -23,3 +24,18 @@
def test_initial_connection_state_is_new(self):
conn = spdypy.SPDYConnection(None)
assert conn._state == spdypy.connection.NEW... |
6200b0655f56ecfe85095d695c4914e390520536 | preferences/forms.py | preferences/forms.py | from django import forms
from registration.forms import RegistrationFormUniqueEmail
from preferences.models import Preferences
from opencivicdata.models.people_orgs import Person
class CustomModelFilter(forms.ModelChoiceField):
def label_from_instance(self, obj):
return "%s" % (obj.name)
class Preferen... | from django import forms
from registration.forms import RegistrationFormUniqueEmail
from preferences.models import Preferences
from opencivicdata.models.people_orgs import Person
class CustomModelFilter(forms.ModelChoiceField):
def label_from_instance(self, obj):
return "%s" % (obj.name)
class Preferen... | Add maybe right connection for name | Add maybe right connection for name
| Python | mit | jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot | ---
+++
@@ -11,7 +11,7 @@
return "%s" % (obj.name)
class PreferencesForm(forms.ModelForm):
- senator = CustomModelFilter(queryset=Person.objects.filter(memberships__organization='Florida Senate'))
+ senator = CustomModelFilter(queryset=Person.objects.filter(memberships__organization__name='Florida S... |
73c72e3723c20019bb839ba7cd4494483fb65c0a | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
import sys
sys.path.insert(0, '../')
#needs_sphinx = '1.0'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
'sphinx.ext.intersphinx']
intersphinx_mapping = {'python': ('https://docs.python.org/3/',
'https://docs.python.org/3/objects.inv... | # -*- coding: utf-8 -*-
import sys
sys.path.insert(0, '../')
#needs_sphinx = '1.0'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
'sphinx.ext.intersphinx']
intersphinx_mapping = {'python': ('https://docs.python.org/3/',
'https://docs.python.org/3/objects.inv... | Update (c) year and line | Update (c) year and line | Python | bsd-3-clause | pika/pika,vitaly-krugl/pika | ---
+++
@@ -17,7 +17,7 @@
master_doc = 'index'
project = 'pika'
-copyright = '2009-2015, Tony Garnock-Jones, Gavin M. Roy, Pivotal and others.'
+copyright = '2009-2017, Tony Garnock-Jones, Gavin M. Roy, Pivotal Software, Inc and contributors.'
import pika
release = pika.__version__ |
3cfb623b16aa5e52f3617a8d250b58a74b30b65d | project_name/wsgi.py | project_name/wsgi.py | """
WSGI config for {{ project_name }} project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APP... | """
WSGI config for {{ project_name }} project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APP... | Revert "Should break travis integration" | Revert "Should break travis integration"
This reverts commit a0dc0168e103ec836e434019c34b345b51e16257.
| Python | mit | pinax/pinax-project-forums,pinax/pinax-project-forums | ---
+++
@@ -17,7 +17,7 @@
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
-import project_name.startup as startup
+import {{ project_name }}.startup as startup
startup.run()
# This application object is used by any WSGI server configured to use this |
deb5775d0c8adad078ce5d0976f7f6f49963ca2e | accounts/features/steps/logout.py | accounts/features/steps/logout.py | from behave import *
# Unique to Scenario: User logs out
@when('I click on the logout link')
def impl(context):
context.browser.find_link_by_text('Logout').first.click()
@then('I am no longer authenticated')
def impl(context):
pass
| from behave import *
# Unique to Scenario: User logs out
@when('I click on the logout link')
def impl(context):
context.browser.find_link_by_text('Logout').first.click()
@then('I am no longer authenticated')
def impl(context):
#Try to visit my profile page
context.browser.visit(context.server_url + 'acco... | Test that the user is logged out | Test that the user is logged out
| Python | bsd-3-clause | f3r3nc/connect,nlhkabu/connect,nlhkabu/connect,f3r3nc/connect,f3r3nc/connect,nlhkabu/connect,f3r3nc/connect,nlhkabu/connect | ---
+++
@@ -8,4 +8,8 @@
@then('I am no longer authenticated')
def impl(context):
- pass
+ #Try to visit my profile page
+ context.browser.visit(context.server_url + 'accounts/profile/')
+
+ #But find that we're redirected to the login page
+ assert context.browser.url == 'http://localhost:8081/acco... |
dd50a2b3fb157eaa3add329d90de3641ef9ea1ec | flocker/docs/test/test_version_extensions.py | flocker/docs/test/test_version_extensions.py | from textwrap import dedent
from twisted.python.filepath import FilePath
from twisted.trial.unittest import SynchronousTestCase
from flocker import __version__ as version
from flocker.common.version import get_installable_version
from flocker.testtools import run_process
class VersionExtensionsTest(SynchronousTestC... | from textwrap import dedent
from twisted.python.filepath import FilePath
from twisted.trial.unittest import SynchronousTestCase
from flocker import __version__ as version
from flocker.common.version import get_installable_version
from flocker.testtools import run_process
class VersionExtensionsTest(SynchronousTestC... | Remove unneeded variable from test. | Remove unneeded variable from test.
| Python | apache-2.0 | w4ngyi/flocker,mbrukman/flocker,w4ngyi/flocker,w4ngyi/flocker,AndyHuu/flocker,hackday-profilers/flocker,hackday-profilers/flocker,wallnerryan/flocker-profiles,hackday-profilers/flocker,mbrukman/flocker,mbrukman/flocker,AndyHuu/flocker,AndyHuu/flocker,wallnerryan/flocker-profiles,wallnerryan/flocker-profiles | ---
+++
@@ -27,7 +27,6 @@
$ PRE-|latest-installable|-POST
'''))
- target = temp_dir.child('contents.html')
run_process([
'sphinx-build', '-b', 'html',
'-C', # don't look for config file, use -D flags instead
@@ -35,6 +34,6 @@
temp... |
6b38ca9283b3b367aa19a2722f9f6eea22c6c90b | cms_chunks/models.py | cms_chunks/models.py | from django.db import models
from cms.models.fields import PlaceholderField
from managers import ChunkManager
class Chunk(models.Model):
tags = models.CharField(max_length=200)
code = PlaceholderField('chunk_placeholder', related_name="chunks")
priority = models.IntegerField()
objects = ChunkManager(... | from django.db import models
from cms.models.fields import PlaceholderField
from managers import ChunkManager
class Chunk(models.Model):
tags = models.CharField(max_length=200)
code = PlaceholderField('chunk_placeholder', related_name="chunks")
priority = models.IntegerField()
objects = ChunkManager(... | Add useful method to know if a chunk has a tag | Add useful method to know if a chunk has a tag
| Python | mit | devartis/django-cms-chunks | ---
+++
@@ -10,6 +10,9 @@
objects = ChunkManager()
+ def __unicode__(self):
+ return "Tags: %s. Priority: %s" % (self.tags, self.priority)
+
def has_tag(self, tag):
tags = [string.strip() for string in str(self.tags).split(",")]
return tag in tags |
971a180a5afab6ee53a9b15413341c649cda0a1c | dtags/config.py | dtags/config.py | import os
import json
from dtags.utils import halt, expand_path
TAGS = os.path.expanduser('~/.dtags')
def load_tags():
"""Load the tags from disk."""
if not os.path.exists(TAGS):
try:
with open(TAGS, "w") as config_file:
json.dump({}, config_file)
except (IOError,... | import os
import json
from dtags.utils import halt, expand_path
TAGS = os.path.expanduser('~/.dtags')
def load_tags():
"""Load the tags from disk."""
if not os.path.exists(TAGS):
try:
with open(TAGS, "w") as config_file:
json.dump({}, config_file)
except (IOError,... | Fix a bug in load_tags function | Fix a bug in load_tags function
| Python | mit | joowani/dtags | ---
+++
@@ -18,7 +18,11 @@
try:
with open(TAGS, "r") as config_file:
json_str = config_file.read().strip()
- tag_data = {} if not json_str else json.loads(json_str)
+ if not json_str:
+ return {}
+ tag_data = json.l... |
10e37d95dde00cd02d91998662a22f555837e877 | hp3parclient/__init__.py | hp3parclient/__init__.py | # Copyright 2012-2014 Hewlett Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | # Copyright 2012-2014 Hewlett Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | Update the version to 3.1.1 | Update the version to 3.1.1
Change-Id: Ia24c8a9e62330243fa7413a649f885c2a40dd4fb
| Python | apache-2.0 | hp-storage/python-3parclient,hpe-storage/python-3parclient | ---
+++
@@ -22,7 +22,7 @@
"""
-version_tuple = (3, 1, 0)
+version_tuple = (3, 1, 1)
def get_version_string(): |
9f95715cc7260d02d88781c208f6a6a167496015 | aiohttp_json_api/jsonpointer/__init__.py | aiohttp_json_api/jsonpointer/__init__.py | """
Extended JSONPointer from python-json-pointer_
==============================================
.. _python-json-pointer: https://github.com/stefankoegl/python-json-pointer
"""
import typing
from jsonpointer import JsonPointer as BaseJsonPointer
class JSONPointer(BaseJsonPointer):
def __init__(self, pointer):... | """
Extended JSONPointer from python-json-pointer_
==============================================
.. _python-json-pointer: https://github.com/stefankoegl/python-json-pointer
"""
import typing
from jsonpointer import JsonPointer as BaseJsonPointer
class JSONPointer(BaseJsonPointer):
def __init__(self, pointer):... | Fix bug with JSONPointer if part passed via __truediv__ is integer | Fix bug with JSONPointer if part passed via __truediv__ is integer
| Python | mit | vovanbo/aiohttp_json_api | ---
+++
@@ -17,6 +17,10 @@
def __truediv__(self,
path: typing.Union['JSONPointer', str]) -> 'JSONPointer':
parts = self.parts.copy()
+
+ if isinstance(path, int):
+ path = str(path)
+
if isinstance(path, str):
if not path.startswith('/'):
... |
c60060f08700bfdbbcb566927624e2ec3af53145 | slash_bot/errors.py | slash_bot/errors.py | # coding: utf-8
"""
Created on 2016-08-23
@author: naoey
"""
class SlashBotError(Exception):
pass
class ConfigError(SlashBotError):
def __init__(self, config_attr=None):
if config_attr:
super().init("Missing/invalid config for {}".format(config_attr))
else:
super().in... | # coding: utf-8
"""
Created on 2016-08-23
@author: naoey
"""
class SlashBotError(Exception):
pass
class ConfigError(SlashBotError):
def __init__(self, config_attr=None):
if config_attr:
super().init("Missing/invalid config for {}".format(config_attr))
else:
super().i... | Add missing newline for PEP8. | Add missing newline for PEP8.
| Python | mit | naoey/slash-bot,naoey/slash-bot | ---
+++
@@ -4,6 +4,7 @@
Created on 2016-08-23
@author: naoey
"""
+
class SlashBotError(Exception):
pass |
fb61c3c64d2426e4e7a6e454cbf57b15e003ce66 | etl/__init__.py | etl/__init__.py | from base import BaseCSV, get_local_handles, ingest_feeds, create_seasons
from overview import (ClubIngest, CountryIngest, CompetitionIngest, PlayerIngest, PersonIngest)
from financial import (AcquisitionIngest, PlayerSalaryIngest, PartialTenureIngest)
from statistics import (FieldStatIngest, GoalkeeperStatIngest, Leag... | from base import BaseCSV, get_local_handles, ingest_feeds, create_seasons
from overview import (ClubIngest, CountryIngest, CompetitionIngest, PlayerIngest, PersonIngest)
from financial import (AcquisitionIngest, PlayerSalaryIngest, PartialTenureIngest)
from statistics import (FieldStatIngest, GoalkeeperStatIngest, Leag... | Add list of entities and ETL classes for CSV files | Add list of entities and ETL classes for CSV files
| Python | mit | soccermetrics/marcotti-mls | ---
+++
@@ -3,3 +3,15 @@
from financial import (AcquisitionIngest, PlayerSalaryIngest, PartialTenureIngest)
from statistics import (FieldStatIngest, GoalkeeperStatIngest, LeaguePointIngest)
+
+CSV_ETL_CLASSES = [
+ ('Clubs', ClubIngest),
+ ('Competitions', CompetitionIngest),
+ ('Players', PlayerIngest),... |
0da19042c74d2a85ef4652b36186a1ee6c4fc247 | tilequeue/format/mvt.py | tilequeue/format/mvt.py | from mapbox_vector_tile.encoder import on_invalid_geometry_make_valid
from mapbox_vector_tile import encode as mvt_encode
def encode(fp, feature_layers, coord, bounds_merc):
tile = mvt_encode(feature_layers, quantize_bounds=bounds_merc,
on_invalid_geometry=on_invalid_geometry_make_valid)
... | from mapbox_vector_tile.encoder import on_invalid_geometry_make_valid
from mapbox_vector_tile import encode as mvt_encode
def encode(fp, feature_layers, coord, bounds_merc):
tile = mvt_encode(
feature_layers,
quantize_bounds=bounds_merc,
on_invalid_geometry=on_invalid_geometry_make_valid,
... | Use round_fn to specify built-in round function | Use round_fn to specify built-in round function
| Python | mit | mapzen/tilequeue,tilezen/tilequeue | ---
+++
@@ -3,6 +3,10 @@
def encode(fp, feature_layers, coord, bounds_merc):
- tile = mvt_encode(feature_layers, quantize_bounds=bounds_merc,
- on_invalid_geometry=on_invalid_geometry_make_valid)
+ tile = mvt_encode(
+ feature_layers,
+ quantize_bounds=bounds_merc,
+ ... |
464bc1b511415459e99700b94101776d00b23796 | indra/pre_assemble_for_db/pre_assemble_script.py | indra/pre_assemble_for_db/pre_assemble_script.py | import indra.tools.assemble_corpus as ac
def process_statements(stmts):
stmts = ac.map_grounding(stmts)
stmts = ac.map_sequence(stmts)
stmts = ac.run_preassembly(stmts, return_toplevel=False)
return stmts
| import indra.tools.assemble_corpus as ac
from indra.db.util import get_statements, insert_pa_stmts
def process_statements(stmts, num_procs=1):
stmts = ac.map_grounding(stmts)
stmts = ac.map_sequence(stmts)
stmts = ac.run_preassembly(stmts, return_toplevel=False,
poolsize=num... | Create function to handle full pipeline. | Create function to handle full pipeline.
| Python | bsd-2-clause | bgyori/indra,johnbachman/indra,bgyori/indra,sorgerlab/belpy,pvtodorov/indra,johnbachman/indra,sorgerlab/indra,bgyori/indra,johnbachman/belpy,pvtodorov/indra,sorgerlab/belpy,johnbachman/belpy,sorgerlab/indra,sorgerlab/belpy,johnbachman/indra,johnbachman/belpy,sorgerlab/indra,pvtodorov/indra,pvtodorov/indra | ---
+++
@@ -1,7 +1,18 @@
import indra.tools.assemble_corpus as ac
+from indra.db.util import get_statements, insert_pa_stmts
-def process_statements(stmts):
+
+def process_statements(stmts, num_procs=1):
stmts = ac.map_grounding(stmts)
stmts = ac.map_sequence(stmts)
- stmts = ac.run_preassembly(stmts,... |
60430260f0bec7b9231c2dcb3ed3394dd81442b2 | fbmsgbot/bot.py | fbmsgbot/bot.py | from http_client import HttpClient
"""
@breif Facebook messenger bot
"""
class Bot():
def __init__(self, token):
self.api_token = token
self.client = HttpClient()
def send_message(self, message, completion):
def completion(response, error):
if error is None:
... | from http_client import HttpClient
class Bot():
"""
@breif Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient()
def send_message(self, message, completion):
def completion(response, error):
if error is None:
... | Remove ability to recieve messages | Remove ability to recieve messages
| Python | mit | ben-cunningham/python-messenger-bot,ben-cunningham/pybot | ---
+++
@@ -1,13 +1,13 @@
from http_client import HttpClient
-"""
-@breif Facebook messenger bot
-"""
class Bot():
+ """
+ @breif Facebook messenger bot
+ """
def __init__(self, token):
self.api_token = token
- self.client = HttpClient()
+ self.client = HttpClient()
... |
f54e7d2da0ba321bdd5900c9893f6fe76adad12f | telegramschoolbot/database.py | telegramschoolbot/database.py | """
Interact with your school website with telegram!
Copyright (c) 2016-2017 Paolo Barbolini <paolo@paolo565.org>
Released under the MIT license
"""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
import threading
# Temporary logging
"""
import logging
logging.basicConfi... | """
Interact with your school website with telegram!
Copyright (c) 2016-2017 Paolo Barbolini <paolo@paolo565.org>
Released under the MIT license
"""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
import threading
# Temporary logging
"""
import logging
logging.basicConfi... | Put the session factory in threadLocal, not the session | Put the session factory in threadLocal, not the session
| Python | mit | paolobarbolini/TelegramSchoolBot | ---
+++
@@ -30,9 +30,9 @@
if engine is None:
threadLocal.engine = create_engine(self.config["database_url"])
- session = getattr(threadLocal, "session", None)
- if session is None:
+ session_factory = getattr(threadLocal, "session_factory", None)
+ if session_factor... |
08522cc9c14dca4ea18cd96bf47a43e2f1285248 | kai/controllers/tracs.py | kai/controllers/tracs.py | import logging
from pylons import response, config, tmpl_context as c
from pylons.controllers.util import abort
# Monkey patch the lazywriter, since mercurial needs that on the stdout
import paste.script.serve as serve
serve.LazyWriter.closed = False
# Conditionally import the trac components in case things trac isn... | import logging
from pylons import response, config, tmpl_context as c
from pylons.controllers.util import abort
# Monkey patch the lazywriter, since mercurial needs that on the stdout
import paste.script.serve as serve
serve.LazyWriter.closed = False
# Conditionally import the trac components in case things trac isn... | Add proper timezone data for trac | Add proper timezone data for trac
| Python | bsd-3-clause | Pylons/kai,Pylons/kai | ---
+++
@@ -15,6 +15,8 @@
import trac.web.main
trac_app = trac.web.main.dispatch_request
from trac.web import HTTPException
+ from trac.util.datefmt import _tzoffsetmap
+ from pytz import timezone
except:
pass
@@ -29,7 +31,7 @@
if c.user:
environ['REMOTE_USER'] = c.u... |
8964861c877797de7932978357ebe3c35eec6715 | qtui/master_page.py | qtui/master_page.py | from PyQt4.QtGui import *
from PyQt4 import uic
import os
from os.path import join
import api
class MasterPage(QWizardPage):
path = "qtui/ui/page1_master.ui"
def __init__(self, project, parentW=None):
super(MasterPage, self).__init__()
self.ui = uic.loadUi(join(os.environ['AUTOEXAM_FOLDER'], ... | from PyQt4.QtGui import *
from PyQt4 import uic
import os
from os.path import join
import api
#TODO: Save current question on close
class MasterPage(QWizardPage):
path = "qtui/ui/page1_master.ui"
def __init__(self, project, parentW=None):
super(MasterPage, self).__init__()
self.ui = uic.load... | Add a TODO for the Wizard | Add a TODO for the Wizard
| Python | mit | matcom/autoexam,matcom/autoexam,matcom/autoexam,matcom/autoexam,matcom/autoexam | ---
+++
@@ -3,6 +3,8 @@
import os
from os.path import join
import api
+
+#TODO: Save current question on close
class MasterPage(QWizardPage): |
08472dce69bb861f72684037c912625cf70546c1 | kibitzr/fetcher/shell.py | kibitzr/fetcher/shell.py | import sh
import tempfile
import logging
logger = logging.getLogger(__name__)
def fetch_bash(conf, **kwargs):
code = conf['script']
logger.info("Executing bash fetcher")
logger.debug(code)
with tempfile.NamedTemporaryFile() as fp:
logger.debug("Saving code to %r", fp.name)
fp.write(c... | import sh
import tempfile
import logging
logger = logging.getLogger(__name__)
def fetch_bash(conf, **kwargs):
code = conf['script']
logger.info("Executing bash fetcher")
logger.debug(code)
with tempfile.NamedTemporaryFile() as fp:
logger.debug("Saving code to %r", fp.name)
fp.write(c... | Return stderr on script failure | Return stderr on script failure
| Python | mit | kibitzr/kibitzr,kibitzr/kibitzr | ---
+++
@@ -22,4 +22,8 @@
logger.debug("Bash stdout: %s", stdout)
logger.debug("Bash stderr: %s", stderr)
ok = (result.exit_code == 0)
- return ok, stdout
+ if ok:
+ report = stdout
+ else:
+ report = u'\n'.join([stdout, stderr])
+ return ok... |
e11b3c344b52c84b5e86bdc381df2f359fe63dae | fparser/setup.py | fparser/setup.py |
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fparser',parent_package,top_path)
return config
|
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fparser',parent_package,top_path)
config.add_data_files('log.config')
return config
| Add log.config to data files to fix installed fparser. | Add log.config to data files to fix installed fparser.
| Python | bsd-3-clause | dagss/f2py-g3,dagss/f2py-g3 | ---
+++
@@ -2,4 +2,5 @@
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fparser',parent_package,top_path)
+ config.add_data_files('log.config')
return config |
9e41011a5f164732ffd33ba5ca5edc7813735aeb | bundle_data.py | bundle_data.py | #!/usr/bin/env python
import pickle
import os.path
import glob
import uuid
import sys
import os.path
import numpy as np
def main():
if len(sys.argv) != 4:
print('Usage: bundle_data.py <input dir> <output dir> <samples per bundle>')
exit(1)
p = sys.argv[1]
b = sys.argv[2]
lim = int(sys... | #!/usr/bin/env python
import pickle
import os.path
import glob
import uuid
import sys
import os.path
import numpy as np
def pack(b, x, y):
name = str(uuid.uuid4())
pack = os.path.join(b, name + '.npz')
with open(pack, 'wb') as f:
np.savez(f, images=np.stack(x), offsets=np.stack(y))
print('pa... | Fix saving when number of items is less than configured bundle size | Fix saving when number of items is less than configured bundle size
| Python | apache-2.0 | baudm/HomographyNet | ---
+++
@@ -9,28 +9,36 @@
import numpy as np
+def pack(b, x, y):
+ name = str(uuid.uuid4())
+ pack = os.path.join(b, name + '.npz')
+ with open(pack, 'wb') as f:
+ np.savez(f, images=np.stack(x), offsets=np.stack(y))
+ print('packed:', pack)
+
+
def main():
- if len(sys.argv) != 4:
- ... |
1bf6211f2fd5aef99e529fdc0e714b1a36ace346 | gallery/util.py | gallery/util.py | import os
from addict import Dict
from gallery.models import File
def get_dir_file_contents(dir_id):
print(File.query.filter(File.parent == dir_id).all())
return File.query.filter(File.parent == dir_id).all()
def get_dir_tree_dict():
path = os.path.normpath("/gallery-data/root")
file_tree = Dict()
... | import os
from addict import Dict
from gallery.models import File
def get_dir_file_contents(dir_id):
print(File.query.filter(File.parent == dir_id).all())
return File.query.filter(File.parent == dir_id).all()
def get_dir_tree_dict():
path = os.path.normpath("/gallery-data/root")
file_tree = Dict()
... | Add CR2 to allowed files | Add CR2 to allowed files
| Python | mit | liam-middlebrook/gallery,liam-middlebrook/gallery,liam-middlebrook/gallery,liam-middlebrook/gallery | ---
+++
@@ -41,5 +41,6 @@
'jpeg',
'mpg',
'mp4',
- 'avi'
+ 'avi',
+ 'cr2'
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.