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 |
|---|---|---|---|---|---|---|---|---|---|---|
e4e930587e6ad145dbdbf1f742b942d63bf645a2 | wandb/git_repo.py | wandb/git_repo.py | from git import Repo, exc
import os
class GitRepo(object):
def __init__(self, root=None, remote="origin", lazy=True):
self.remote_name = remote
self.root = root
self._repo = None
if not lazy:
self.repo
@property
def repo(self):
if self._repo is None:
... | from git import Repo, exc
import os
class GitRepo(object):
def __init__(self, root=None, remote="origin", lazy=True):
self.remote_name = remote
self.root = root
self._repo = None
if not lazy:
self.repo
@property
def repo(self):
if self._repo is None:
... | Handle no git user configured | Handle no git user configured
| Python | mit | wandb/client,wandb/client,wandb/client | ---
+++
@@ -51,7 +51,11 @@
return self.remote.url
def tag(self, name, message):
- return self.repo.create_tag("wandb/"+name, message=message, force=True)
+ try:
+ return self.repo.create_tag("wandb/"+name, message=message, force=True)
+ except GitCommandError:
+ ... |
cc46e4d251c479563318c93f419fead373fa0c12 | bugsnag/tornado/__init__.py | bugsnag/tornado/__init__.py | from tornado.web import RequestHandler
import bugsnag
class BugsnagRequestHandler(RequestHandler):
def _handle_request_exception(self, e):
# Set the request info
bugsnag.configure_request(
user_id = self.request.remote_ip,
context = "%s %s" % (self.request.method, self.reque... | from tornado.web import RequestHandler
import bugsnag
class BugsnagRequestHandler(RequestHandler):
def _handle_request_exception(self, e):
# Set the request info
bugsnag.configure_request(
user_id = self.request.remote_ip,
context = "%s %s" % (self.request.method, self.reque... | Remove cookie support from tornado until it works in all situations | Remove cookie support from tornado until it works in all situations
| Python | mit | bugsnag/bugsnag-python,overplumbum/bugsnag-python,bugsnag/bugsnag-python,overplumbum/bugsnag-python | ---
+++
@@ -11,7 +11,6 @@
"url": self.request.full_url(),
"method": self.request.method,
"arguments": self.request.arguments,
- "cookies": self.cookies,
},
)
|
187e55c8ad204c3a6196794aba1b59fd0fa62b00 | instance/config.py | instance/config.py | import os
class Config(object):
"""Parent configuration class"""
DEBUG = False
CSRF_ENABLED = True
# ALT: <variable> = os.getenv('<env_var_name>')
SECRET = 'HeathLEDGERwasTHEBESTidc'
# database with host configuration removed. Defaults to machine localhost
SQLALCHEMY_DATABASE_URI = "postgr... | import os
class Config(object):
"""Parent configuration class"""
DEBUG = False
CSRF_ENABLED = True
# ALT: <variable> = os.getenv('<env_var_name>')
__SECRET = 'HeathLEDGERwasTHEBESTidc'
# database with host configuration removed. Defaults to machine localhost
__DB_NAME = "postgresql://bruce... | Modify Config file Pick DB_NAME, TOKEN_DURATION and SECRET from the environment Use the hard coded details as backup in case not in the environment | Modify Config file
Pick DB_NAME, TOKEN_DURATION and SECRET from the environment
Use the hard coded details as backup in case not in the environment
| Python | mit | Elbertbiggs360/buckelist-api | ---
+++
@@ -6,10 +6,13 @@
DEBUG = False
CSRF_ENABLED = True
# ALT: <variable> = os.getenv('<env_var_name>')
- SECRET = 'HeathLEDGERwasTHEBESTidc'
+ __SECRET = 'HeathLEDGERwasTHEBESTidc'
# database with host configuration removed. Defaults to machine localhost
- SQLALCHEMY_DATABASE_URI = "... |
494884ae3510c0cf23704cb772ad4a024040a9c7 | bitHopper/Website/Worker_Page.py | bitHopper/Website/Worker_Page.py | from bitHopper.Website import app, flask
import btcnet_info
import bitHopper.Configuration.Workers
import logging
@app.route("/worker", methods=['POST', 'GET'])
def worker():
#Check if this is a form submission
handle_worker_post(flask.request.form)
#Get a list of currently configured workers
... | from bitHopper.Website import app, flask
import btcnet_info
import bitHopper.Configuration.Workers
import logging
@app.route("/worker", methods=['POST', 'GET'])
def worker():
#Check if this is a form submission
handle_worker_post(flask.request.form)
#Get a list of currently configured workers
... | Update the ignoring error message | Update the ignoring error message
| Python | mit | c00w/bitHopper,c00w/bitHopper | ---
+++
@@ -13,7 +13,7 @@
pools_workers = {}
for pool in btcnet_info.get_pools():
if pool.name is None:
- logging.debug('Ignoring %s', pool)
+ logging.debug('Ignoring a Pool. If no pools apear on /worker please update your version of btcnet_info')
continue
... |
194748bfbc67741275fd36eb2eaafbde55caeabb | django_emarsys/management/commands/emarsys_sync_events.py | django_emarsys/management/commands/emarsys_sync_events.py | # -*- coding: utf-8 -*-
from django.core.management import BaseCommand
from ...event import sync_events
class Command(BaseCommand):
def handle(self, *args, **options):
num_new_events, num_updated_ids, num_deleted_ids, \
unsynced_event_names = sync_events()
print("{} new events, {} ev... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.management import BaseCommand
from ...event import sync_events
class Command(BaseCommand):
def handle(self, *args, **options):
num_new_events, num_updated_ids, num_deleted_ids, \
unsynced_event_names = sync_eve... | Fix issue with management command log output and non ascii event names | Fix issue with management command log output and non ascii event names
| Python | mit | machtfit/django-emarsys,machtfit/django-emarsys | ---
+++
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
+
+from __future__ import unicode_literals
from django.core.management import BaseCommand
|
a2abc6342162c9158551b810f4d666d6d13dcd15 | client/python/plot_request_times.py | client/python/plot_request_times.py | import requests
r = requests.get('http://localhost:8081/monitor_results/1')
print(r.json())
for monitoring_data in r.json():
print 'URL: ' + monitoring_data['urlToMonitor']['url']
| import requests
from plotly.offline import plot
import plotly.graph_objs as go
r = requests.get('http://localhost:8081/monitor_results/1')
print(r.json())
# build traces for plotting from monitoring data
request_times = list()
timestamps = list()
timestamp = 0
url = r.json()[0]['urlToMonitor']['url']
for monitoring_d... | Add prototype for plotting client | Add prototype for plotting client
| Python | mit | gernd/simple-site-mon | ---
+++
@@ -1,6 +1,19 @@
import requests
+from plotly.offline import plot
+import plotly.graph_objs as go
r = requests.get('http://localhost:8081/monitor_results/1')
print(r.json())
+# build traces for plotting from monitoring data
+request_times = list()
+timestamps = list()
+timestamp = 0
+url = r.json()[0]['... |
cc2f0900b02891e0ab23133778065a6f6768cd5c | setup.py | setup.py | from distutils.core import setup
setup(
name = 'furs_fiscal',
packages = ['furs_fiscal'],
version = '0.1.0',
description = 'Python library for simplified communication with FURS (Financna uprava Republike Slovenije).',
author = 'Boris Savic',
author_email = 'boris70@gmail.com',
url = 'https://github.com/b... | from distutils.core import setup
setup(
name = 'furs_fiscal',
packages = ['furs_fiscal'],
version = '0.1.3',
description = 'Python library for simplified communication with FURS (Financna uprava Republike Slovenije).',
author = 'Boris Savic',
author_email = 'boris70@gmail.com',
url = 'https://github.com/b... | Add test_certificate.pem to the release | Add test_certificate.pem to the release
| Python | mit | boris-savic/python-furs-fiscal | ---
+++
@@ -2,14 +2,15 @@
setup(
name = 'furs_fiscal',
packages = ['furs_fiscal'],
- version = '0.1.0',
+ version = '0.1.3',
description = 'Python library for simplified communication with FURS (Financna uprava Republike Slovenije).',
author = 'Boris Savic',
author_email = 'boris70@gmail.com',
ur... |
5ea25bc6c72e5c934e56a90c44f8019ad176bb27 | comet/utility/test/test_spawn.py | comet/utility/test/test_spawn.py | import sys
from twisted.trial import unittest
from twisted.python import failure
from ..spawn import SpawnCommand
class DummyEvent(object):
text = ""
class SpawnCommandProtocolTestCase(unittest.TestCase):
def test_good_process(self):
spawn = SpawnCommand(sys.executable)
d = spawn(DummyEvent(... | import sys
from twisted.trial import unittest
from twisted.python import failure
from twisted.python import util
from ..spawn import SpawnCommand
class DummyEvent(object):
def __init__(self, text=None):
self.text = text
class SpawnCommandProtocolTestCase(unittest.TestCase):
def test_good_process(sel... | Test that spawned process actually writes data | Test that spawned process actually writes data
| Python | bsd-2-clause | jdswinbank/Comet,jdswinbank/Comet | ---
+++
@@ -2,11 +2,13 @@
from twisted.trial import unittest
from twisted.python import failure
+from twisted.python import util
from ..spawn import SpawnCommand
class DummyEvent(object):
- text = ""
+ def __init__(self, text=None):
+ self.text = text
class SpawnCommandProtocolTestCase(unitt... |
078f00ae743c2e16df76653090298ba56b277caf | pegasus/metrics/__init__.py | pegasus/metrics/__init__.py | import sys
import logging
def init_logging():
logFormat = "%(asctime)s %(levelname)s %(filename)s:%(lineno)s %(message)s"
logFormatter = logging.Formatter(fmt=logFormat)
logHandler = logging.StreamHandler(stream=sys.stderr)
logHandler.setFormatter(logFormatter)
log = logging.getLogger(__name__)
... | import sys
import logging
def init_logging():
logFormat = "%(asctime)s %(levelname)s %(filename)s:%(lineno)s %(message)s"
logFormatter = logging.Formatter(fmt=logFormat)
logHandler = logging.StreamHandler()
logHandler.setFormatter(logFormatter)
log = logging.getLogger(__name__)
log.addHandler(l... | Use default argument for StreamHandler (which is what want, sys.stderr) because they changed the name of the keyword argument in 2.7 | Use default argument for StreamHandler (which is what want, sys.stderr) because they changed the name of the keyword argument in 2.7
| Python | apache-2.0 | pegasus-isi/pegasus-metrics,pegasus-isi/pegasus-metrics,pegasus-isi/pegasus-metrics | ---
+++
@@ -4,7 +4,7 @@
def init_logging():
logFormat = "%(asctime)s %(levelname)s %(filename)s:%(lineno)s %(message)s"
logFormatter = logging.Formatter(fmt=logFormat)
- logHandler = logging.StreamHandler(stream=sys.stderr)
+ logHandler = logging.StreamHandler()
logHandler.setFormatter(logFormat... |
2d52b37e8ed868099f5e808402b6c966987589e5 | nn-patterns/utils/tests/networks/__init__.py | nn-patterns/utils/tests/networks/__init__.py | # Begin: Python 2/3 compatibility header small
# Get Python 3 functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
from future.utils import raise_with_traceback, raise_from
# catch exception with: except Exception as e
from builtins import range, map, zip, filter
from i... | # Begin: Python 2/3 compatibility header small
# Get Python 3 functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
from future.utils import raise_with_traceback, raise_from
# catch exception with: except Exception as e
from builtins import range, map, zip, filter
from i... | Add filter to customize which networks to test. | Add filter to customize which networks to test.
| Python | mit | pikinder/nn-patterns | ---
+++
@@ -10,6 +10,8 @@
# End: Python 2/3 compatability header small
+import fnmatch
+import os
import theano.tensor as T
from . import mnist
@@ -24,10 +26,20 @@
default_nonlinearity = T.nnet.relu
+ # TODO: make this more transparent!
+ # Default test only for one network. To test all put "*... |
2cc9f1781691865222acb90fb8bbd5e721cc2549 | csunplugged/utils/errors/InvalidYAMLFileError.py | csunplugged/utils/errors/InvalidYAMLFileError.py | """Custom error for invalid yaml file."""
from .Error import Error
ERROR_MESSAGE = """
Invalid YAML file (.yaml)
Options:
- Does the file match the expected layout?
- Does the file contain at least one key:value pair?
- Is the syntax correct? (are you missing a colon somewhere?)
"""
class InvalidYAMLFileErro... | """Custom error for invalid yaml file."""
from .Error import Error
ERROR_MESSAGE = """
Invalid YAML file (.yaml).
Options:
- Does the file match the expected layout?
- Does the file contain at least one key:value pair?
- Is the syntax correct? (are you missing a colon somewhere?)
"""
class InvalidYAMLFileErr... | Fix typo in error message | Fix typo in error message
| Python | mit | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | ---
+++
@@ -3,7 +3,7 @@
from .Error import Error
ERROR_MESSAGE = """
-Invalid YAML file (.yaml)
+Invalid YAML file (.yaml).
Options:
- Does the file match the expected layout? |
cb39de495da5256e6e44773036f78d704f0d563d | tapioca_instagram/tapioca_instagram.py | tapioca_instagram/tapioca_instagram.py | # coding: utf-8
from tapioca import (JSONAdapterMixin, TapiocaAdapter,
generate_wrapper_from_adapter)
from .resource_mapping import RESOURCE_MAPPING
class InstagramClientAdapter(JSONAdapterMixin, TapiocaAdapter):
api_root = 'https://api.instagram.com/v1/'
resource_mapping = RESOURCE_MAP... | # coding: utf-8
from tapioca import (JSONAdapterMixin, TapiocaAdapter,
generate_wrapper_from_adapter)
from .resource_mapping import RESOURCE_MAPPING
class InstagramClientAdapter(JSONAdapterMixin, TapiocaAdapter):
api_root = 'https://api.instagram.com/v1/'
resource_mapping = RESOURCE_MAP... | Fix KeyError exception when called with no parameters | Fix KeyError exception when called with no parameters
| Python | mit | vintasoftware/tapioca-instagram | ---
+++
@@ -13,9 +13,9 @@
def get_request_kwargs(self, api_params, *args, **kwargs):
params = super(InstagramClientAdapter, self).get_request_kwargs(
api_params, *args, **kwargs)
- params['params'].update({
- 'access_token': api_params.get('access_token', '')
- })
+... |
93ed6f7db7060893214571bf5ec8a633fffa48ab | python/completers/cpp/clang_helpers.py | python/completers/cpp/clang_helpers.py | #!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Strahinja Val Markovic <val@markovic.io>
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ve... | #!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Strahinja Val Markovic <val@markovic.io>
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ve... | Fix bug with removing flag after "-c" | Fix bug with removing flag after "-c"
-c does not take an argument. Why did I think it did?
| Python | mit | nikmartin/dotfiles | ---
+++
@@ -31,7 +31,6 @@
continue
if flag == '-c':
- skip = True;
continue
if flag == '-o': |
c7fb70585b0c488d523a4ff173e3b0675029e90b | cmsplugin_filer_link/cms_plugins.py | cmsplugin_filer_link/cms_plugins.py | from __future__ import unicode_literals
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import ugettext as _
from django.conf import settings
from .models import FilerLinkPlugin
class FilerLinkPlugin(CMSPluginBase):
module = 'Filer'
model = File... | from __future__ import unicode_literals
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import ugettext as _
from django.conf import settings
from .models import FilerLinkPlugin
class FilerLinkPlugin(CMSPluginBase):
module = 'Filer'
model = File... | Revert "Add "page_link" to "raw_id_fields" to prevent the run of "decompress"" | Revert "Add "page_link" to "raw_id_fields" to prevent the run of "decompress""
This reverts commit 4a85ecaaae1452e74acc485d032f00e8bedace47.
| Python | bsd-3-clause | yvess/cmsplugin-filer,divio/cmsplugin-filer,alsoicode/cmsplugin-filer,creimers/cmsplugin-filer,jschneier/cmsplugin-filer,stefanfoulis/cmsplugin-filer,brightinteractive/cmsplugin-filer,nephila/cmsplugin-filer,creimers/cmsplugin-filer,jschneier/cmsplugin-filer,brightinteractive/cmsplugin-filer,skirsdeda/cmsplugin-filer,d... | ---
+++
@@ -12,7 +12,6 @@
model = FilerLinkPlugin
name = _("Link")
text_enabled = True
- raw_id_fields = ('page_link', )
render_template = "cmsplugin_filer_link/link.html"
def render(self, context, instance, placeholder): |
dafa014fa5c4788affd2712b68ef5bee56b5e600 | engine/game.py | engine/game.py | from .gobject import GObject
from . import signals
class Game(GObject):
def __init__(self):
self.maps = {}
self.player = None
def run(self):
pass
def handle_signals(self):
signals.handle_signals(self)
@staticmethod
def reg_signal(*args):
signals.reg_signal... | from .gobject import GObject
from . import signals
import time
class Game(GObject):
def __init__(self):
self.maps = {}
self.player = None
def run(self):
while True:
self.handle_signals()
time.sleep(0.3)
def handle_signals(self):
signals.handle_signa... | Handle signals with default interface | Handle signals with default interface
| Python | bsd-3-clause | entwanne/NAGM | ---
+++
@@ -1,5 +1,6 @@
from .gobject import GObject
from . import signals
+import time
class Game(GObject):
def __init__(self):
@@ -7,7 +8,9 @@
self.player = None
def run(self):
- pass
+ while True:
+ self.handle_signals()
+ time.sleep(0.3)
def han... |
9858837add5105f2f4e78abe84930c4e164071b9 | examples/me.py | examples/me.py | from buffer.api import API
from buffer.user import User
token = '1/714ebdb617705ef9491a81fb21c1da42'
api = API(client_id='51cc6dd5f882a8ba18000055', client_secret='83b019d154cae4d2c734d813b33e5e53')
r = api.get('user.json?')
print r.content
#user = User(api=api)
| from buffer.api import API
from buffer.user import User
token = '1/714ebdb617705ef9491a81fb21c1da42'
api = API(client_id='51cc6dd5f882a8ba18000055', client_secret='83b019d154cae4d2c734d813b33e5e53', access_token=token)
user = User(api=api)
print user.id
| Create first examples that used the actual API | Create first examples that used the actual API
| Python | mit | vtemian/buffpy,bufferapp/buffer-python | ---
+++
@@ -3,8 +3,7 @@
from buffer.user import User
token = '1/714ebdb617705ef9491a81fb21c1da42'
-api = API(client_id='51cc6dd5f882a8ba18000055', client_secret='83b019d154cae4d2c734d813b33e5e53')
+api = API(client_id='51cc6dd5f882a8ba18000055', client_secret='83b019d154cae4d2c734d813b33e5e53', access_token=token... |
30e10449205763363fe8663765645796b0dc8fd5 | IPython/nbconvert/preprocessors/clearoutput.py | IPython/nbconvert/preprocessors/clearoutput.py | """Module containing a preprocessor that removes the outputs from code cells"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------... | """Module containing a preprocessor that removes the outputs from code cells"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------... | Use cell.prompt_number rather than cell['prompt_number'] | Use cell.prompt_number rather than cell['prompt_number']
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | ---
+++
@@ -24,5 +24,5 @@
"""
if cell.cell_type == 'code':
cell.outputs = []
- cell['prompt_number'] = None
+ cell.prompt_number = None
return cell, resources |
dac3c4f163c694b9b083247e72189996e5e2125c | just/json_.py | just/json_.py | import json
def read(fn):
if fn.endswith(".jsonl"):
raise TypeError("JSON Newline format can only be read by iread")
with open(fn) as f:
return json.load(f)
def append(obj, fn):
with open(fn, "a+") as f:
f.write(json.dumps(obj) + "\n")
def write(obj, fn):
with open(fn, "w")... | import json
def read(fn):
if fn.endswith(".jsonl"):
raise TypeError("JSON Newline format can only be read by iread")
with open(fn) as f:
return json.load(f)
def append(obj, fn):
with open(fn, "a+") as f:
f.write(json.dumps(obj) + "\n")
def write(obj, fn):
with open(fn, "w")... | Add detailed error message to jsonl parsing | Add detailed error message to jsonl parsing | Python | agpl-3.0 | kootenpv/just | ---
+++
@@ -20,8 +20,13 @@
def iread(fn):
with open(fn) as f:
- for line in f:
- yield json.loads(line)
+ for i, line in enumerate(f):
+ try:
+ yield json.loads(line)
+ except json.decoder.JSONDecodeError as e:
+ raise json.decoder.J... |
60cbe21d95cc6e079979022a505dcc2099bd30c1 | cla_public/libs/call_centre_availability.py | cla_public/libs/call_centre_availability.py | import datetime
from flask.ext.babel import lazy_gettext as _
def time_choice(time):
display_format = "%I:%M %p"
end = time + datetime.timedelta(minutes=30)
display_string = time.strftime(display_format).lstrip("0") + " - " + end.strftime(display_format).lstrip("0")
return time.strftime("%H%M"), displ... | import datetime
from cla_public.libs.utils import get_locale
from flask.ext.babel import lazy_gettext as _
def time_choice(time):
display_format = "%I:%M %p"
end = time + datetime.timedelta(minutes=30)
display_string = time.strftime(display_format).lstrip("0") + " - " + end.strftime(display_format).lstrip... | Add welsh days ordinal suffix | Add welsh days ordinal suffix
| Python | mit | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public | ---
+++
@@ -1,4 +1,5 @@
import datetime
+from cla_public.libs.utils import get_locale
from flask.ext.babel import lazy_gettext as _
@@ -9,10 +10,43 @@
return time.strftime("%H%M"), display_string
-def suffix(d):
- if 11 <= d <= 13:
+def suffix_welsh(day):
+ ordinals = {
+ "1": "af",
+ ... |
c33bbe44708ccf60f4a0cf759b3f38b739b7fb5d | PartyUPLambda/purge.py | PartyUPLambda/purge.py | """
Scan through the Samples table for oldish entries and remove them.
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def purge_item(item, batch):
response = batch.delete_item(
Key={
'event' : item['event'],
'id': item['id']
... | """
Scan through the Samples table for oldish entries and remove them.
"""
import logging
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
def purge_item(item, batch):
response = batch.delete_item(
... | Add error logging to aid tracking down future issues. | Add error logging to aid tracking down future issues.
| Python | mit | SandcastleApps/partyup,SandcastleApps/partyup,SandcastleApps/partyup | ---
+++
@@ -1,12 +1,15 @@
"""
Scan through the Samples table for oldish entries and remove them.
"""
-
+import logging
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
+
+logger = logging.getLogger()
+logger.setLevel(logging.ERROR)
def purge_item(item, bat... |
3f750865762e7751ce0cbd4a171d68e9d1d5a8a6 | contrib/tempest/tempest/cli/manilaclient.py | contrib/tempest/tempest/cli/manilaclient.py | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Fix tempest compatibility for cli tests | Fix tempest compatibility for cli tests
Commit https://github.com/openstack/tempest/commit/2474f41f made changes to
tempest project that are inconsistent with our plugin.
Make our plugin use latest changes to keep compatibility.
Change-Id: I08d28b40fdd9ad54a0bcce30647d796943332116
| Python | apache-2.0 | bswartz/manila,jcsp/manila,bswartz/manila,weiting-chen/manila,sajuptpm/manila,openstack/manila,NetApp/manila,redhat-openstack/manila,sajuptpm/manila,vponomaryov/manila,weiting-chen/manila,NetApp/manila,jcsp/manila,vponomaryov/manila,redhat-openstack/manila,openstack/manila,scality/manila,scality/manila | ---
+++
@@ -13,15 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tempest_lib.cli import base # noqa
-
-from tempest import config_share as config
-from tempest import test
-
-CONF = config.CONF
+from tempest import cli
-class ClientTestBas... |
0a9aed9427b0b36d71a2e8fee74db74690727b15 | hardware/gpio/LEDblink_gpiozero.py | hardware/gpio/LEDblink_gpiozero.py | from gpiozero import LED
import time
# GPIO 24 ... LED ... 470 ohm resistor ... GND
led = LED(24)
try:
led.blink()
time.sleep(20)
except KeyboardInterrupt:
led.off()
| from gpiozero import LED
import time
# GPIO 24 ... LED ... 470 ohm resistor ... GND
led = LED(24)
try:
led.blink()
time.sleep(20)
except KeyboardInterrupt:
led.off()
print "done"
| Print message on completion, to aid debugging | Print message on completion, to aid debugging | Python | mit | claremacrae/raspi_code,claremacrae/raspi_code,claremacrae/raspi_code | ---
+++
@@ -9,4 +9,4 @@
time.sleep(20)
except KeyboardInterrupt:
led.off()
-
+print "done" |
f375fc031640c24dd7761283b931b402d8366421 | django_compat_patcher/patcher.py | django_compat_patcher/patcher.py | from __future__ import absolute_import, print_function, unicode_literals
from . import fixers, utilities, deprecation, registry
# TODO make it idempotent with registry of applied fixes, just log if double applications of same fixers !!!!!
def patch(settings=None):
"""Patches the Django package with relevant fix... | from __future__ import absolute_import, print_function, unicode_literals
from . import fixers, utilities, deprecation, registry
__APPLIED_FIXERS = set()
def patch(settings=None):
"""Patches the Django package with relevant fixers.
A settings dict/objects can be provided, to REPLACE lookups in Django set... | Add __APPLIED_FIXERS set to make sure we are idempotent | Add __APPLIED_FIXERS set to make sure we are idempotent
| Python | mit | pakal/django-compat-patcher,pakal/django-compat-patcher | ---
+++
@@ -2,8 +2,7 @@
from . import fixers, utilities, deprecation, registry
-
-# TODO make it idempotent with registry of applied fixes, just log if double applications of same fixers !!!!!
+__APPLIED_FIXERS = set()
def patch(settings=None):
"""Patches the Django package with relevant fixers.
@@ -19,5... |
e87017a724b274ad3289f4af674ae88bf8f21b8a | devbin/benchmark_proc_get_all.py | devbin/benchmark_proc_get_all.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Benchmark listing all processes
Usage:
benchmark_proc_get_all.py
"""
import os
MYDIR = os.path.dirname(os.path.abspath(__file__))
import sys
sys.path.insert(0, os.path.join(MYDIR, ".."))
import time
from px import px_process
LAPS=20
def main():
t0 = time.ti... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Benchmark listing all processes
Usage:
benchmark_proc_get_all.py
"""
import os
MYDIR = os.path.dirname(os.path.abspath(__file__))
import sys
sys.path.insert(0, os.path.join(MYDIR, ".."))
import time
from px import px_process
LAPS=20
def main():
t0 = time.ti... | Use ms rather than s for process getting benchmark | Use ms rather than s for process getting benchmark
| Python | mit | walles/px,walles/px | ---
+++
@@ -26,7 +26,7 @@
t1 = time.time()
dt_seconds = t1 - t0
- print("Getting all processes takes {:.3f}s".format(dt_seconds/LAPS))
+ print("Getting all processes takes {:.0f}ms".format(1000*dt_seconds/LAPS))
if __name__ == "__main__": |
b49844f2c6da136d4b4c350b2b176e5f4cbdcd88 | reversebinary.py | reversebinary.py | #!/bin/python
"""
reversebinary puzzle for Spotify.com
v1
Jose Antonio Navarrete
You can find me at janavarretecristino@gmail.com
Follow me on twitter @joseanavarrete
"""
import unittest
MAX_VALUE = 1000000000
def reverse_binary(n):
"""
Receives an integer (n), converts it to its reverse binary
"""
... | #!/bin/python
"""
reversebinary puzzle for Spotify.com
v1
Jose Antonio Navarrete
You can find me at janavarretecristino@gmail.com
Follow me on twitter @joseanavarrete
"""
import unittest
MAX_VALUE = 1000000000
def reverse_binary(n):
"""
Receives an integer (n), converts it to its reverse binary
"""
... | Add breakline to better reading | Add breakline to better reading
| Python | mit | josenava/spotify_puzzle | ---
+++
@@ -20,7 +20,7 @@
"""
if not 1 <= n <= MAX_VALUE:
raise ValueError
-
+
binary_str = bin(n) # '0bXXXX' where XXXX is n in binary
return int(binary_str[::-1][:-2], 2)
|
4f35af8502b8d091cd88ab61c0aca343918ac9f1 | ec2api/cmd/__init__.py | ec2api/cmd/__init__.py | # Copyright 2014
# The Cloudscaling Group, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | Enable greenthreading for ec2api services | Enable greenthreading for ec2api services
Since ec2api and metadata services based on greenthreading, it have to
be initialized properly. This patch initializes it for cmd modules,
which allows to debug services from IDE.
Change-Id: Ic7ae69fbf5b58cfa4df822cd5d42f7c2cf45d848
| Python | apache-2.0 | openstack/ec2-api,stackforge/ec2-api,hayderimran7/ec2-api,stackforge/ec2-api,hayderimran7/ec2-api,openstack/ec2-api | ---
+++
@@ -0,0 +1,17 @@
+# Copyright 2014
+# The Cloudscaling Group, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless req... | |
92cb843c1b6ada9b63038ed1ce22f83ee6146aff | jazzy/scope.py | jazzy/scope.py | import uuid
class Scope:
def __init__(self):
self.pc = 0;
self.variables = {}
self.lvalue = self
self.rvalue = self
self.stack = [1,2,3]
self.name = uuid.uuid1()
def GetVar(self, name):
if name in self.variables:
return self.variables[name]
... | import uuid
class Scope:
def __init__(self):
self.pc = 0;
self.variables = {}
self.lvalue = self
self.rvalue = self
self.stack = [1,2,3]
self.name = uuid.uuid1()
def GetVar(self, name):
if name in self.variables:
return self.variables[name]
... | Add functions to get/set variables addresses | Add functions to get/set variables addresses
Since some of the jaz commands depend on the address of an variable,
made function to obtain it.
| Python | mit | joewashear007/jazzy | ---
+++
@@ -16,6 +16,20 @@
def SetVar(self, name, value):
self.variables[name] = value
+
+ def GetAddress(self, name):
+ if name in self.variables:
+ return list(self.variables.keys()).index(name)
+ else:
+ return None
+ def GetVarFromAddress(self, addr):
+ ... |
cab8fc7ae9c7e162d555c107ed415f18782512e7 | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Update dsub version to 0.4.5 | Update dsub version to 0.4.5
PiperOrigin-RevId: 393155372
| Python | apache-2.0 | DataBiosphere/dsub,DataBiosphere/dsub | ---
+++
@@ -26,4 +26,4 @@
0.1.3.dev0 -> 0.1.3 -> 0.1.4.dev0 -> ...
"""
-DSUB_VERSION = '0.4.5.dev0'
+DSUB_VERSION = '0.4.5' |
c407c067495d76ebed7c36ef005861c80fdcfdce | textx/__init__.py | textx/__init__.py | __version__ = "1.6.dev"
| from textx.metamodel import metamodel_from_file, metamodel_from_str # noqa
from textx.langapi import get_language, iter_languages # noqa
__version__ = "1.6.dev"
| Make metamodel factory methods and lang API available in textx package. | Make metamodel factory methods and lang API available in textx package.
| Python | mit | igordejanovic/textX,igordejanovic/textX,igordejanovic/textX | ---
+++
@@ -1 +1,4 @@
+from textx.metamodel import metamodel_from_file, metamodel_from_str # noqa
+from textx.langapi import get_language, iter_languages # noqa
+
__version__ = "1.6.dev" |
0e044d1ad8b6fb2b0ac2126bb0fccfa05de9da14 | file_transfer/datamover/__init__.py | file_transfer/datamover/__init__.py |
from .connectors import (GithubConnector, S3Connector,
FTPConnector, LocalConnector)
from .transporters import (BaltradToS3, LocalToS3)
from .s3enram import S3EnramHandler
from .utils import (parse_filename, extract_month_updates,
parse_coverage_month, coverage_to_csv)
|
from .connectors import (GithubConnector, S3Connector,
FTPConnector, LocalConnector)
from .transporters import (BaltradToS3, LocalToS3)
from .s3enram import S3EnramHandler
from .utils import (parse_filename, extract_month_updates,
parse_coverage_month, coverage_to_csv,
... | Add csv handling to module | Add csv handling to module
| Python | mit | enram/data-repository,enram/data-repository,enram/data-repository,enram/infrastructure,enram/data-repository,enram/infrastructure | ---
+++
@@ -4,4 +4,5 @@
from .transporters import (BaltradToS3, LocalToS3)
from .s3enram import S3EnramHandler
from .utils import (parse_filename, extract_month_updates,
- parse_coverage_month, coverage_to_csv)
+ parse_coverage_month, coverage_to_csv,
+ most... |
abc1d2095f18f6c7ff129f3b8bf9eae2d7a6239a | skimage/io/tests/test_io.py | skimage/io/tests/test_io.py | import os
from numpy.testing import *
import numpy as np
import skimage.io as io
from skimage import data_dir
def test_stack_basic():
x = np.arange(12).reshape(3, 4)
io.push(x)
assert_array_equal(io.pop(), x)
@raises(ValueError)
def test_stack_non_array():
io.push([[1, 2, 3]])
def test_imread_u... | import os
from numpy.testing import *
import numpy as np
import skimage.io as io
from skimage import data_dir
def test_stack_basic():
x = np.arange(12).reshape(3, 4)
io.push(x)
assert_array_equal(io.pop(), x)
@raises(ValueError)
def test_stack_non_array():
io.push([[1, 2, 3]])
def test_imread_u... | Fix file URI in test (2nd attempt) | BUG: Fix file URI in test (2nd attempt)
| Python | bsd-3-clause | WarrenWeckesser/scikits-image,SamHames/scikit-image,chintak/scikit-image,chintak/scikit-image,juliusbierk/scikit-image,oew1v07/scikit-image,blink1073/scikit-image,bsipocz/scikit-image,bennlich/scikit-image,youprofit/scikit-image,dpshelio/scikit-image,newville/scikit-image,dpshelio/scikit-image,GaZ3ll3/scikit-image,ofgu... | ---
+++
@@ -20,7 +20,10 @@
def test_imread_url():
- image_url = 'file:{0}{0}{1}{0}camera.png'.format(os.path.sep, data_dir)
+ # tweak data path so that file URI works on both unix and windows.
+ data_path = data_dir.lstrip(os.path.sep)
+ data_path = data_path.replace(os.path.sep, '/')
+ image_url ... |
f87cbadbbcfc9d67aa3e5d0662236c18f23ba63b | DataBase.py | DataBase.py |
''' Copyright 2015 RTeam (Edgar Kaziahmedov, Klim Kireev, Artem Yashuhin)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless re... |
'''
Copyright 2015 OneRTeam (Edgar Kaziahmedov, Klim Kireev, Artem Yashuhin)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Un... | Use source file with license 2 | Use source file with license 2
| Python | apache-2.0 | proffK/CourseManager | ---
+++
@@ -1,5 +1,6 @@
-''' Copyright 2015 RTeam (Edgar Kaziahmedov, Klim Kireev, Artem Yashuhin)
+'''
+ Copyright 2015 OneRTeam (Edgar Kaziahmedov, Klim Kireev, Artem Yashuhin)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the ... |
847ffbfaeb2c7ade9a6c74efad18cdc283b46fe7 | fedorasummerofhardware/models.py | fedorasummerofhardware/models.py | from datetime import datetime
from sqlalchemy import Column, DateTime, Integer, Text, Boolean, Date
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
Base = declarative_base()
class Application(Base):
__tablen... | from datetime import datetime
from sqlalchemy import Column, DateTime, Integer, Text, Boolean, Date
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
Base = declarative_base()
class Application(Base):
__tablen... | Fix the phone Column type | Fix the phone Column type
| Python | agpl-3.0 | fedora-infra/fedora-openhw2012,fedora-infra/fedora-openhw2012,fedora-infra/fedora-openhw2012 | ---
+++
@@ -19,7 +19,7 @@
text = Column(Text)
approved = Column(Boolean, default=False)
address = Column(Text)
- phone = Column(Date)
+ phone = Column(Text)
def __repr__(self):
return "<Application %s %s>" % (self.username, self.hardware) |
4e699d94c84f1123f36a331926ca77af3f86b474 | tensorflow/python/profiler/traceme.py | tensorflow/python/profiler/traceme.py | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Remove tf_export from TraceMe Python API. | Remove tf_export from TraceMe Python API.
PiperOrigin-RevId: 262247599
| Python | apache-2.0 | cxxgtxy/tensorflow,karllessard/tensorflow,jhseu/tensorflow,tensorflow/tensorflow,jhseu/tensorflow,yongtang/tensorflow,renyi533/tensorflow,petewarden/tensorflow,renyi533/tensorflow,freedomtan/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries... | ---
+++
@@ -24,10 +24,8 @@
from __future__ import print_function
from tensorflow.python import pywrap_tensorflow
-from tensorflow.python.util.tf_export import tf_export
-@tf_export('profiler.TraceMe')
class TraceMe(object):
"""Context manager that generates a trace event in the profiler."""
|
759f6a2e4ced9ce9beeda01e638f109d946050b1 | server/migrations/0006_auto_20150811_0811.py | server/migrations/0006_auto_20150811_0811.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('server', '0005_auto_20150717_1827'),
]
operations = [
migrations.AddField(
model_name='machine',
nam... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import get_object_or_404
from django.db import models, migrations
def add_initial_date(apps, schema_editor):
Machine = apps.get_model("server", "Machine")
for machine in Machine.objects.all():
if not machine.first_che... | Add in the first checkin date if it doesn't exist | Add in the first checkin date if it doesn't exist
| Python | apache-2.0 | sheagcraig/sal,salopensource/sal,salopensource/sal,macjustice/sal,chasetb/sal,salopensource/sal,sheagcraig/sal,erikng/sal,macjustice/sal,erikng/sal,chasetb/sal,chasetb/sal,erikng/sal,macjustice/sal,macjustice/sal,sheagcraig/sal,erikng/sal,sheagcraig/sal,chasetb/sal,salopensource/sal | ---
+++
@@ -1,8 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
-
+from django.shortcuts import get_object_or_404
from django.db import models, migrations
+def add_initial_date(apps, schema_editor):
+ Machine = apps.get_model("server", "Machine")
+ for machine in Machine.objects.al... |
343d0bcdeb6981ca90673de342eb6064ca62c24e | pip_deploy.py | pip_deploy.py | import subprocess
subprocess.call('python setup.py sdist')
subprocess.call('python setup.py sdist bdist_wheel upload')
| import subprocess
subprocess.call('python setup.py sdist')
subprocess.call('python setup.py bdist_wheel --universal')
subprocess.call('twine upload dist/*')
| Update pip deploy script to use twine | Update pip deploy script to use twine
| Python | mit | partrita/Gooey,chriskiehl/Gooey,codingsnippets/Gooey | ---
+++
@@ -1,4 +1,5 @@
import subprocess
subprocess.call('python setup.py sdist')
-subprocess.call('python setup.py sdist bdist_wheel upload')
+subprocess.call('python setup.py bdist_wheel --universal')
+subprocess.call('twine upload dist/*') |
b916e8dbb08b6c4ebb2ff37e8515a41f05261f5b | scripts/setup.py | scripts/setup.py | import setuptools
from imgtool import imgtool_version
setuptools.setup(
name="imgtool",
version=imgtool_version,
author="The MCUboot commiters",
description=("MCUboot's image signing and key management"),
license="Apache Software License",
url="http://github.com/JuulLabs-OSS/mcuboot",
packa... | import setuptools
from imgtool import imgtool_version
setuptools.setup(
name="imgtool",
version=imgtool_version,
author="The MCUboot commiters",
author_email="None",
description=("MCUboot's image signing and key management"),
license="Apache Software License",
url="http://github.com/JuulLab... | Fix author_email UNKNOWN in pip show | Fix author_email UNKNOWN in pip show
Signed-off-by: Fabio Utzig <66676b1ceaf93296e098708c09494361103aa635@apache.org>
| Python | apache-2.0 | utzig/mcuboot,utzig/mcuboot,ATmobica/mcuboot,runtimeco/mcuboot,runtimeco/mcuboot,runtimeco/mcuboot,runtimeco/mcuboot,tamban01/mcuboot,ATmobica/mcuboot,utzig/mcuboot,utzig/mcuboot,tamban01/mcuboot,tamban01/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,runtimeco/mcuboot,tamban01/mcuboot,tamban01/mcuboot,utzi... | ---
+++
@@ -5,6 +5,7 @@
name="imgtool",
version=imgtool_version,
author="The MCUboot commiters",
+ author_email="None",
description=("MCUboot's image signing and key management"),
license="Apache Software License",
url="http://github.com/JuulLabs-OSS/mcuboot", |
9ee03ea335b438cf1005a2295360310456e27bad | repos/urls.py | repos/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views
from django.http import HttpResponseRedirect
urlpatterns = [
url(r'^$', lambda u: HttpResponseRedirect('/repo')),
url(r'^controller/logout/$', views.logout, {'next_page': '/repo/home/'}),
url(r'^co... | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views
from django.http import HttpResponseRedirect
urlpatterns = [
url(r'^$', lambda u: HttpResponseRedirect('/reg')),
url(r'^controller/logout/$', views.logout, {'next_page': '/repo/home/'}),
url(r'^con... | Switch home page to reg/home | Switch home page to reg/home
| Python | mit | giantas/elibrary,giantas/elibrary,giantas/elibrary | ---
+++
@@ -4,7 +4,7 @@
from django.http import HttpResponseRedirect
urlpatterns = [
- url(r'^$', lambda u: HttpResponseRedirect('/repo')),
+ url(r'^$', lambda u: HttpResponseRedirect('/reg')),
url(r'^controller/logout/$', views.logout, {'next_page': '/repo/home/'}),
url(r'^controller/', admin.site.u... |
7a98cd1c58985da9230ba5861731b6f252d2c611 | source/update.py | source/update.py | """updates subreddit css with compiled sass"""
import time
import sass
import praw
def css() -> str:
"""compiles sass and returns css"""
return sass.compile(filename="index.scss", output_style="compressed")
def uid() -> str:
"""return date and time"""
return "Subreddit upload on {}".format(time.str... | """updates subreddit css with compiled sass"""
import os
import time
from typing import List, Dict, Any, Tuple
import praw
import sass
WebhookResponse = Dict[str, Any] # pylint: disable=C0103
def css() -> str:
"""compiles sass and returns css"""
return sass.compile(filename="index.scss", output_style="compr... | Check for changed files from webhook | Check for changed files from webhook
Prevents uploading everything, only the changed assets
| Python | mit | neoliberal/css-updater | ---
+++
@@ -1,8 +1,12 @@
"""updates subreddit css with compiled sass"""
+import os
import time
+from typing import List, Dict, Any, Tuple
+import praw
import sass
-import praw
+
+WebhookResponse = Dict[str, Any] # pylint: disable=C0103
def css() -> str:
@@ -14,7 +18,26 @@
"""return date and time"""
... |
e6b5c93a8c23fcea84768a8b50708ef7ef78dcd8 | functionaltests/api/base.py | functionaltests/api/base.py | # -*- coding: utf-8 -*-
#
# Copyright 2013 - Noorul Islam K M
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | # -*- coding: utf-8 -*-
#
# Copyright 2013 - Noorul Islam K M
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Fix functionaltests (imported tempest code has changed) | Fix functionaltests (imported tempest code has changed)
get_auth_provider now takes an argument.
Change-Id: I4a80ef3fdf2914854268459cf1080a46922e93d5
| Python | apache-2.0 | gilbertpilz/solum,ed-/solum,ed-/solum,gilbertpilz/solum,openstack/solum,devdattakulkarni/test-solum,gilbertpilz/solum,stackforge/solum,openstack/solum,ed-/solum,stackforge/solum,devdattakulkarni/test-solum,ed-/solum,gilbertpilz/solum | ---
+++
@@ -37,5 +37,5 @@
password = CONF.identity.password
tenant_name = CONF.identity.tenant_name
mgr = clients.Manager(username, password, tenant_name)
- auth_provider = mgr.get_auth_provider()
+ auth_provider = mgr.get_auth_provider(mgr.get_default_credentials())
... |
32994f27d1644415e8cd4a22f1b47d4938d3620c | fulfil_client/oauth.py | fulfil_client/oauth.py | from requests_oauthlib import OAuth2Session
class Session(OAuth2Session):
client_id = None
client_secret = None
def __init__(self, subdomain, **kwargs):
client_id = self.client_id
client_secret = self.client_secret
self.fulfil_subdomain = subdomain
if not (client_id and c... | from requests_oauthlib import OAuth2Session
class Session(OAuth2Session):
client_id = None
client_secret = None
def __init__(self, subdomain, **kwargs):
client_id = self.client_id
client_secret = self.client_secret
self.fulfil_subdomain = subdomain
if not (client_id and c... | Add provision to pass extra args in auth url | Add provision to pass extra args in auth url
| Python | isc | fulfilio/fulfil-python-api,sharoonthomas/fulfil-python-api | ---
+++
@@ -28,10 +28,11 @@
else:
return 'https://%s.fulfil.io/' % self.fulfil_subdomain
- def create_authorization_url(self, redirect_uri, scope):
+ def create_authorization_url(self, redirect_uri, scope, **kwargs):
self.redirect_uri = redirect_uri
self.scope = scope
-... |
c7d5a39fd21c2d5c9c5f8a2b88b5e09c98e9e776 | ovp_users/emails.py | ovp_users/emails.py | from ovp_core.emails import BaseMail
class UserMail(BaseMail):
"""
This class is responsible for firing emails for Users
"""
def __init__(self, user, async_mail=None):
super(UserMail, self).__init__(user.email, async_mail)
def sendWelcome(self, context={}):
"""
Sent when user registers
"""
... | from ovp_core.emails import BaseMail
class UserMail(BaseMail):
"""
This class is responsible for firing emails for Users
"""
def __init__(self, user, async_mail=None):
super(UserMail, self).__init__(user.email, async_mail)
def sendWelcome(self, context={}):
"""
Sent when user registers
"""
... | Revert "pass 'user_email' on sendRecoveryToken's context" | Revert "pass 'user_email' on sendRecoveryToken's context"
This info is already sent as 'email' on context. This reverts commit a366c2ed02cd7dda54607fe5e6a317603d442b47.
| Python | agpl-3.0 | OpenVolunteeringPlatform/django-ovp-users,OpenVolunteeringPlatform/django-ovp-users | ---
+++
@@ -18,8 +18,5 @@
"""
Sent when volunteer requests recovery token
"""
- context.update({
- 'user_email': user.email
- })
return self.sendEmail('recoveryToken', 'Password recovery', context)
|
387ca6153d0f584f3caf27add6cf01d1da081fc3 | plasmapy/physics/__init__.py | plasmapy/physics/__init__.py | # 'physics' is a tentative name for this subpackage. Another
# possibility is 'plasma'. The organization is to be decided by v0.1.
from .parameters import Alfven_speed, ion_sound_speed, thermal_speed, kappa_thermal_speed, gyrofrequency, gyroradius, plasma_frequency, Debye_length, Debye_number, inertial_length, magne... | # 'physics' is a tentative name for this subpackage. Another
# possibility is 'plasma'. The organization is to be decided by v0.1.
from .parameters import Alfven_speed, ion_sound_speed, thermal_speed, kappa_thermal_speed, gyrofrequency, gyroradius, plasma_frequency, Debye_length, Debye_number, inertial_length, magne... | Add classical_transport to init file | Add classical_transport to init file
| Python | bsd-3-clause | StanczakDominik/PlasmaPy | ---
+++
@@ -4,6 +4,6 @@
from .parameters import Alfven_speed, ion_sound_speed, thermal_speed, kappa_thermal_speed, gyrofrequency, gyroradius, plasma_frequency, Debye_length, Debye_number, inertial_length, magnetic_pressure, magnetic_energy_density, upper_hybrid_frequency, lower_hybrid_frequency
from .quantum import... |
2d45775e3823cf5a27df92350cbc89963aecc84c | gym/envs/tests/test_registration.py | gym/envs/tests/test_registration.py | # -*- coding: utf-8 -*-
from gym import error, envs
from gym.envs import registration
from gym.envs.classic_control import cartpole
def test_make():
env = envs.make('CartPole-v0')
assert env.spec.id == 'CartPole-v0'
assert isinstance(env, cartpole.CartPoleEnv)
def test_make_deprecated():
try:
... | # -*- coding: utf-8 -*-
from gym import error, envs
from gym.envs import registration
from gym.envs.classic_control import cartpole
def test_make():
env = envs.make('CartPole-v0')
assert env.spec.id == 'CartPole-v0'
assert isinstance(env, cartpole.CartPoleEnv)
def test_make_deprecated():
try:
... | Fix broken registration test to handle new DeprecatedEnv error | Fix broken registration test to handle new DeprecatedEnv error
| Python | mit | d1hotpep/openai_gym,d1hotpep/openai_gym,dianchen96/gym,machinaut/gym,Farama-Foundation/Gymnasium,machinaut/gym,dianchen96/gym,Farama-Foundation/Gymnasium | ---
+++
@@ -27,7 +27,14 @@
registry.register(id='Test-v9', entry_point=None)
registry.register(id='Other-v100', entry_point=None)
try:
- registry.spec('Test-v1')
+ registry.spec('Test-v1') # must match an env name but not the version above
+ except error.DeprecatedEnv:
+ pass
+... |
7599f60a0e64f1d1d076695af67a212be751a89b | tests/rules_tests/grammarManipulation_tests/InactiveRulesTest.py | tests/rules_tests/grammarManipulation_tests/InactiveRulesTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Grammar, Nonterminal, Rule as _R
from ..grammar import *
class InactiveRulesTest(TestCase):
def __init__(self, *args):
super().__init__(*... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Grammar, Nonterminal, Rule as _R
from ..grammar import *
class InactiveRulesTest(TestCase):
def __init__(self, *args):
super().__init__(*... | Add test when rule with inactive is passed | Add test when rule with inactive is passed
| Python | mit | PatrikValkovic/grammpy | ---
+++
@@ -23,6 +23,22 @@
g.add_nonterm([NFirst, NSecond, NThird, NFourth])
self.g = g
+ def test_countWithInactive(self):
+ class Tmp1(_R):
+ rule = ([NFirst], ['a', 0])
+ _active = False
+ self.g.add_rule(Tmp1)
+ self.assertEqual(self.g.rules_count(... |
1370018ac3f96a5a04d119afa95d482a7504119e | IPython/utils/dir2.py | IPython/utils/dir2.py | # encoding: utf-8
"""A fancy version of Python's builtin :func:`dir` function.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, di... | # encoding: utf-8
"""A fancy version of Python's builtin :func:`dir` function.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, di... | Remove mention of Traits (removed in e1ced0b3) | Remove mention of Traits (removed in e1ced0b3)
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | ---
+++
@@ -34,7 +34,7 @@
"""dir2(obj) -> list of strings
Extended version of the Python builtin dir(), which does a few extra
- checks, and handles Traits objects, which can confuse dir().
+ checks.
This version is guaranteed to return only a list of true strings, whereas
dir() returns ... |
38a2a2d6a1e8307e1e0ed58769df7b77d2ef9355 | loom/tasks.py | loom/tasks.py | from fabric.api import *
import subprocess
__all__ = ['ssh', 'all', 'uptime', 'upgrade', 'restart']
@task
def all():
"""
Select all hosts
"""
env.hosts = []
for hosts in env.roledefs.values():
env.hosts.extend(hosts)
# remove dupes
env.hosts = list(set(env.hosts))
@task
def uptime... | from fabric.api import *
import subprocess
__all__ = ['ssh', 'all', 'uptime', 'upgrade', 'restart']
@task
def all():
"""
Select all hosts
"""
env.hosts = []
for hosts in env.roledefs.values():
env.hosts.extend(hosts)
# remove dupes
env.hosts = list(set(env.hosts))
@task
def uptime... | Remove "-y" flag from apt-get upgrade | Remove "-y" flag from apt-get upgrade
| Python | bsd-3-clause | nithinphilips/loom,bfirsh/loom,nithinphilips/loom,bfirsh/loom | ---
+++
@@ -25,7 +25,7 @@
"""
with settings(hide('stdout'), show('running')):
sudo('apt-get update')
- sudo("apt-get upgrade -y")
+ sudo("apt-get upgrade")
@task
def ssh(*cmd): |
e9541dbd1959b7a2ad1ee9145d3168c5898fe204 | python/generate_sorl_xml.py | python/generate_sorl_xml.py | #!/usr/bin/env python3
import sys
from message import Message
from persistence import Persistence
from const import XML_FILE_EXTENSION
message = Persistence.get_message_from_file(sys.argv[1])
if (message is not None):
Persistence.message_to_solr_xml(message, sys.argv[2] + message.identifier + XML_FILE_EXTENSION... | #!/usr/bin/env python3
import sys
from document import Document
from persistence import Persistence
from const import XML_FILE_EXTENSION
document = Persistence.get_document_from_file(sys.argv[1])
if (document is not None):
Persistence.document_to_solr_xml(document, sys.argv[2] + document.identifier + XML_FILE_E... | Fix wrong naming in generate...py | Fix wrong naming in generate...py
Signed-off-by: Fabio Benigno <7de248c2f6c04081ad3a3569b5954b1b677fee3b@gmail.com>
| Python | apache-2.0 | fpbfabio/newsgroups1000s,fpbfabio/dblp_data_processing | ---
+++
@@ -2,11 +2,11 @@
import sys
-from message import Message
+from document import Document
from persistence import Persistence
from const import XML_FILE_EXTENSION
-message = Persistence.get_message_from_file(sys.argv[1])
-if (message is not None):
- Persistence.message_to_solr_xml(message, sys.ar... |
76afe0ef2f45ff7ff62dd5ea4d1217ce794770ba | us_ignite/snippets/management/commands/snippets_load_fixtures.py | us_ignite/snippets/management/commands/snippets_load_fixtures.py | from django.core.management.base import BaseCommand
from us_ignite.snippets.models import Snippet
FIXTURES = [
{
'slug': 'home-box',
'name': 'UP NEXT: LOREM IPSUM',
'body': '',
'url_text': 'GET INVOLVED',
'url': '',
},
{
'slug': 'featured',
'name': ... | from django.core.management.base import BaseCommand
from us_ignite.snippets.models import Snippet
FIXTURES = [
{
'slug': 'home-box',
'name': 'UP NEXT: LOREM IPSUM',
'body': '',
'url_text': 'GET INVOLVED',
'url': '',
},
{
'slug': 'featured',
'name': ... | Load initial fixture for the welcome email. | Load initial fixture for the welcome email.
https://github.com/madewithbytes/us_ignite/issues/172
| Python | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | ---
+++
@@ -16,6 +16,13 @@
'name': 'FEATURED CONTENT',
'body': '',
'url_text': 'FEATURED',
+ 'url': '',
+ },
+ {
+ 'slug': 'welcome-email',
+ 'name': 'Welcome to US Ignite',
+ 'body': '',
+ 'url_text': '',
'url': '',
},
] |
b8386212826701131e3c5aaaadef726df97f6646 | api/serializers.py | api/serializers.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import serializers
from core.models import Timesheet, Task, Entry
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id'... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import serializers
from core.models import Timesheet, Task, Entry
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id'... | Add complete field to task and timesheet api | Add complete field to task and timesheet api
| Python | bsd-2-clause | Leahelisabeth/timestrap,overshard/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,overshard/timestrap,muhleder/timestrap,Leahelisabeth/timestrap,cdubz/timestrap,overshard/timestrap,muhleder/timestrap,cdubz/timestrap,muhleder/timestrap,Leahelisabeth/timestrap | ---
+++
@@ -17,7 +17,7 @@
class TimesheetSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timesheet
- fields = ('id', 'url', 'name',)
+ fields = ('id', 'url', 'name', 'complete',)
class TaskSerializer(serializers.HyperlinkedModelSerializer):
@@ -25,7 +25,8 @@
... |
ffb42ba8e9b0a5d7a269ee9d13a5347f4ffee563 | mama_cas/tests/test_callbacks.py | mama_cas/tests/test_callbacks.py | from django.test import TestCase
from .factories import UserFactory
from mama_cas.callbacks import user_model_attributes
from mama_cas.callbacks import user_name_attributes
class CallbacksTests(TestCase):
url = 'http://www.example.com/'
def setUp(self):
self.user = UserFactory()
def test_user_n... | from django.test import TestCase
from .factories import UserFactory
from mama_cas.callbacks import user_model_attributes
from mama_cas.callbacks import user_name_attributes
class CallbacksTests(TestCase):
def setUp(self):
self.user = UserFactory()
def test_user_name_attributes(self):
"""
... | Test short_name for user name attributes callback | Test short_name for user name attributes callback
| Python | bsd-3-clause | jbittel/django-mama-cas,orbitvu/django-mama-cas,orbitvu/django-mama-cas,jbittel/django-mama-cas | ---
+++
@@ -6,26 +6,24 @@
class CallbacksTests(TestCase):
- url = 'http://www.example.com/'
-
def setUp(self):
self.user = UserFactory()
- def test_user_name(self):
+ def test_user_name_attributes(self):
"""
- The callback should return a username and full_name
- a... |
8c0d1acf6ea41adc3743a4e190eaf777188282c0 | nova/policies/floating_ip_pools.py | nova/policies/floating_ip_pools.py | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Introduce scope_types in FIP pools | Introduce scope_types in FIP pools
Appropriate scope_type for nova case:
- https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/policy-defaults-refresh.html#scope
This commit introduce scope_type for FIP pools policies
as 'system' and 'project'
Partial implement blueprint policy-defaults-refresh-de... | Python | apache-2.0 | mahak/nova,mahak/nova,klmitch/nova,openstack/nova,klmitch/nova,openstack/nova,mahak/nova,klmitch/nova,openstack/nova,klmitch/nova | ---
+++
@@ -23,15 +23,16 @@
floating_ip_pools_policies = [
policy.DocumentedRuleDefault(
- BASE_POLICY_NAME,
- base.RULE_ADMIN_OR_OWNER,
- "List floating IP pools. This API is deprecated.",
- [
+ name=BASE_POLICY_NAME,
+ check_str=base.RULE_ADMIN_OR_OWNER,
+ de... |
67c6ecff4d5c65cd5b919bb1316f188bc6ab1098 | tests/python_tests/test_core_device.py | tests/python_tests/test_core_device.py | import pytest
import xchainer
def test_device():
device = xchainer.get_current_device()
xchainer.set_current_device('cpu')
assert str(xchainer.get_current_device()) == '<Device cpu>'
xchainer.set_current_device('cuda')
assert str(xchainer.get_current_device()) == '<Device cuda>'
with pytes... | import pytest
import xchainer
def test_device():
cpu1 = xchainer.Device('cpu')
cpu2 = xchainer.Device('cpu')
cuda = xchainer.Device('cuda')
assert cpu1 == cpu2
assert not (cpu1 != cpu2)
assert not (cpu1 == cuda)
assert cpu1 != cuda
with pytest.raises(xchainer.DeviceError):
xc... | Add tests for python device | Add tests for python device
| Python | mit | okuta/chainer,keisuke-umezawa/chainer,chainer/chainer,ktnyt/chainer,ktnyt/chainer,ktnyt/chainer,wkentaro/chainer,hvy/chainer,jnishi/chainer,okuta/chainer,hvy/chainer,pfnet/chainer,niboshi/chainer,niboshi/chainer,wkentaro/chainer,hvy/chainer,tkerola/chainer,jnishi/chainer,niboshi/chainer,jnishi/chainer,keisuke-umezawa/c... | ---
+++
@@ -4,6 +4,19 @@
def test_device():
+ cpu1 = xchainer.Device('cpu')
+ cpu2 = xchainer.Device('cpu')
+ cuda = xchainer.Device('cuda')
+ assert cpu1 == cpu2
+ assert not (cpu1 != cpu2)
+ assert not (cpu1 == cuda)
+ assert cpu1 != cuda
+
+ with pytest.raises(xchainer.DeviceError):
+ ... |
6dea14c3b8d0d607fa5d9e4adbbd8d07d41cd272 | procurement_purchase_no_grouping/__manifest__.py | procurement_purchase_no_grouping/__manifest__.py | # Copyright 2015 AvanzOsc (http://www.avanzosc.es)
# Copyright 2015-2017 Tecnativa - Pedro M. Baeza
# Copyright 2018 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": "Procurement Purchase No Grouping",
"version": "13.0.1.0.1",
"author": "AvanzOSC," "Tecnati... | # Copyright 2015 AvanzOsc (http://www.avanzosc.es)
# Copyright 2015-2017 Tecnativa - Pedro M. Baeza
# Copyright 2018 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": "Procurement Purchase No Grouping",
"version": "13.0.1.0.1",
"author": "AvanzOSC, Tecnativa... | Delete empty " " spaces in same string line | [FIX] Delete empty " " spaces in same string line
| Python | agpl-3.0 | OCA/purchase-workflow,OCA/purchase-workflow | ---
+++
@@ -6,7 +6,7 @@
{
"name": "Procurement Purchase No Grouping",
"version": "13.0.1.0.1",
- "author": "AvanzOSC," "Tecnativa," "Odoo Community Association (OCA)",
+ "author": "AvanzOSC, Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
... |
3c798673cfb5f7e63e2aebb300ba7cc92c72fa8a | aggregator/base.py | aggregator/base.py | from abc import ABCMeta, abstractmethod
import requests
from bs4 import BeautifulSoup
def make_soup(url):
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
return soup
class Aggregator(metaclass=ABCMeta):
base_url = ''
@abstractmethod
def extract(self):
pass
@abstractm... | import collections
from abc import ABCMeta, abstractmethod
import requests
from bs4 import BeautifulSoup
Article = collections.namedtuple('Article', ['source', 'title', 'url', 'author',
'date_published'])
def make_soup(url):
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.par... | Define new abstract methods and namedtuple | Define new abstract methods and namedtuple
| Python | apache-2.0 | footynews/fn_backend | ---
+++
@@ -1,8 +1,12 @@
+import collections
from abc import ABCMeta, abstractmethod
import requests
+from bs4 import BeautifulSoup
-from bs4 import BeautifulSoup
+
+Article = collections.namedtuple('Article', ['source', 'title', 'url', 'author',
+ 'date_published'])
def make_soup(url):
@@ -14,6... |
9da3f2a835fa2aaba5d91ffe31b3fcaf8d83a4c9 | snake/main.py | snake/main.py | import os
import sys
from snake.core import Snake
SNAKEFILE_LOADED = False
def abort(msg):
print >> sys.stderr, "Error: %s" % msg
sys.exit(1)
def load_snakefile(path, fail_silently=False):
global SNAKEFILE_LOADED
if not SNAKEFILE_LOADED:
sys.path.insert(0, path)
try:
r... | import imp
import os
import sys
from snake.core import Snake
def abort(msg):
print >> sys.stderr, "Error: %s" % msg
sys.exit(1)
def get_ascending_paths(path):
paths = []
while True:
paths.append(path)
path, tail = os.path.split(path)
if not tail:
break
return ... | Improve the way snakefile loading works | Improve the way snakefile loading works
| Python | bsd-2-clause | yumike/snake | ---
+++
@@ -1,10 +1,7 @@
+import imp
import os
import sys
-
from snake.core import Snake
-
-
-SNAKEFILE_LOADED = False
def abort(msg):
@@ -12,40 +9,34 @@
sys.exit(1)
-def load_snakefile(path, fail_silently=False):
- global SNAKEFILE_LOADED
- if not SNAKEFILE_LOADED:
- sys.path.insert(0, ... |
b2239ab0329f129da21f3ab82eaf9543b95fc01b | pal/services/joke_service.py | pal/services/joke_service.py | import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'open the pod bay doors pal':
"I'm sorry, Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not injure a human bei... | import re
from pal.services.service import Service
from pal.services.service import wrap_response
class JokeService(Service):
_JOKES = {
'pod bay doors':
"I'm sorry Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not injure a human being or, through... | Add Waldo joke and simplify HAL joke | Add Waldo joke and simplify HAL joke
| Python | bsd-3-clause | Machyne/pal,Machyne/pal,Machyne/pal,Machyne/pal | ---
+++
@@ -6,8 +6,8 @@
class JokeService(Service):
_JOKES = {
- 'open the pod bay doors pal':
- "I'm sorry, Jeff, I'm afraid I can't do that.",
+ 'pod bay doors':
+ "I'm sorry Jeff, I'm afraid I can't do that.",
'laws of robotics':
"1. A robot may not... |
c046d7915c08221e4a84a01edf3ca08a27a931a8 | opps/api/urls.py | opps/api/urls.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from piston.resource import Resource
from opps.containers.api import ContainerHandler, ContainerBoxHandler
container = Resource(handler=ContainerHandler)
containerbox = Resource(handler=ContainerBoxHandler)
urlpatterns = patte... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from piston.resource import Resource
from opps.containers.api import ContainerHandler, ContainerBoxHandler
container = Resource(handler=ContainerHandler)
containerbox = Resource(handler=ContainerBoxHandler)
urlpatterns = patte... | Set emitter format json in api | Set emitter format json in api
| Python | mit | williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,williamroot/opps,williamroot/opps,opps/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps | ---
+++
@@ -12,6 +12,6 @@
urlpatterns = patterns(
'',
- url(r'^container/$', container),
- url(r'^containerbox/$', containerbox),
+ url(r'^container/$', container, {'emitter_format': 'json'}),
+ url(r'^containerbox/$', containerbox, {'emitter_format': 'json'}),
) |
a18339c0d5ed9bbfcfc7b763d31a18c117a38069 | bed/record.py | bed/record.py | from __future__ import division
import time
import serial
import csv
from datetime import datetime as dt
DEBUG = True
def timestamp():
ts = dt.now()
return time.mktime(ts.timetuple())+(ts.microsecond/1e6)
bufsize = 1 if DEBUG else -1
with open('rec.csv', 'wa', bufsize) as f:
writer = csv.writer(f)
w... | from __future__ import division
import time
import serial
import csv
from datetime import datetime as dt
DEBUG = True
def timestamp():
ts = dt.now()
return time.mktime(ts.timetuple())+(ts.microsecond/1e6)
bufsize = 1 if DEBUG else -1
with open('db/rec.csv', 'wa', bufsize) as f:
writer = csv.writer(f)
... | Fix path to data file | Fix path to data file
| Python | mit | wonkoderverstaendige/telemetry,wonkoderverstaendige/telemetry,wonkoderverstaendige/telemetry | ---
+++
@@ -12,7 +12,7 @@
return time.mktime(ts.timetuple())+(ts.microsecond/1e6)
bufsize = 1 if DEBUG else -1
-with open('rec.csv', 'wa', bufsize) as f:
+with open('db/rec.csv', 'wa', bufsize) as f:
writer = csv.writer(f)
with serial.Serial('/dev/ttyACM0', 57600, timeout=1.0) as ser:
# Emp... |
5b2a63706d2f9d2853ba1f6ad8d1cf80f8c07676 | tohu/__init__.py | tohu/__init__.py | from .v4.base import *
from .v4.primitive_generators import *
from .v4.derived_generators import *
from .v4.dispatch_generators import *
from .v4.custom_generator import CustomGenerator
from .v4.logging import logger
from .v4.utils import print_generated_sequence
from .v4 import base
from .v4 import primitive_generator... | from distutils.version import StrictVersion
from platform import python_version
min_supported_python_version = '3.6'
if StrictVersion(python_version()) < StrictVersion(min_supported_python_version):
error_msg = (
"Tohu requires Python {min_supported_python_version} or greater to run "
"(currently ... | Check Python version at startup | Check Python version at startup
| Python | mit | maxalbert/tohu | ---
+++
@@ -1,3 +1,15 @@
+from distutils.version import StrictVersion
+from platform import python_version
+
+min_supported_python_version = '3.6'
+
+if StrictVersion(python_version()) < StrictVersion(min_supported_python_version):
+ error_msg = (
+ "Tohu requires Python {min_supported_python_version} or gr... |
3bf41213abc7ddd8421e11c2149b536c255c13eb | pixpack/utils.py | pixpack/utils.py | #!/usr/bin/env python3
# utility.py
# PixPack Photo Organiser
# It contains some useful functions to increase user experience
import locale
import os
def sys_trans_var():
# check system language
sys_loc = locale.getlocale()
sys_lang = sys_loc[0] # system default language
if sys_lang == 'en_EN' or sys... | #!/usr/bin/env python3
# utility.py
# PixPack Photo Organiser
# It contains some useful functions to increase user experience
import locale
import os
def sys_trans_var():
# check system language
sys_loc = locale.getlocale()
sys_lang = sys_loc[0] # system default language
if sys_lang == 'en_EN' or sys... | Store the duplicated items separately in related folder | Store the duplicated items separately in related folder
| Python | mit | OrhanOdabasi/PixPack,OrhanOdabasi/PixPack | ---
+++
@@ -22,6 +22,10 @@
# rename if the file is existed already, for instance: photo_1
dest_file_path = os.path.join(dest_directory, dest_file)
i=1
+ if os.path.exists(dest_file_path):
+ dest_directory = os.path.join(dest_directory, "copies")
+ if not os.path.exists(dest_directory):... |
b99f0839a8c9ce88127634f507605d065c22e5a7 | kafka/kafkaConsumer.py | kafka/kafkaConsumer.py | #!/usr/bin/env python
import threading, logging, time
from kafka import KafkaConsumer
class Consumer(threading.Thread):
daemon = True
def run(self):
#consumer = KafkaConsumer(bootstrap_servers='10.100.198.220:9092',
consumer = KafkaConsumer(bootstrap_servers='10.0.2.15:9092',
... | #!/usr/bin/env python
import threading, logging, time
from kafka import KafkaConsumer
class Consumer(threading.Thread):
daemon = True
def run(self):
consumer = KafkaConsumer(bootstrap_servers='10.100.198.220:9092',
#consumer = KafkaConsumer(bootstrap_servers='10.0.2.15:9092',
... | Update IP address of kafka consumer | Update IP address of kafka consumer
| Python | apache-2.0 | opencord/voltha,opencord/voltha,opencord/voltha,opencord/voltha,opencord/voltha | ---
+++
@@ -8,8 +8,8 @@
daemon = True
def run(self):
- #consumer = KafkaConsumer(bootstrap_servers='10.100.198.220:9092',
- consumer = KafkaConsumer(bootstrap_servers='10.0.2.15:9092',
+ consumer = KafkaConsumer(bootstrap_servers='10.100.198.220:9092',
+ #consumer = KafkaConsum... |
956f4d02036aa20fa594ee7d369573496525d15e | src/server.py | src/server.py | from flow import Flow
import logging
from . import settings
LOG = logging.getLogger("flowbot.server")
class Server(object):
"""A connection to Flow."""
def __init__(self):
"""Initialize a flow server instance."""
self.flow = Flow()
self._start_server()
self._setup_account()... | from flow import Flow
import logging
from . import settings
LOG = logging.getLogger("flowbot.server")
class Server(object):
"""A connection to Flow."""
def __init__(self):
"""Initialize a flow server instance."""
self.flow = Flow()
self._start_server()
self._setup_account()... | Remove create device step (not needed?) | Remove create device step (not needed?)
| Python | mpl-2.0 | SpiderOak/flowbot | ---
+++
@@ -15,7 +15,6 @@
self._start_server()
self._setup_account()
- self._setup_device()
self._setup_org()
def _start_server(self):
@@ -36,17 +35,6 @@
except Flow.FlowError as create_account_err:
LOG.debug("Create account failed: '%s'", str(create_ac... |
dcb62a352b7473779f1cc907c920c9b42ee9ceac | django_extensions/management/commands/print_settings.py | django_extensions/management/commands/print_settings.py | from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
help = "Print the active Django settings."
def handle(self, *args, **options):
for key in dir(settings):
if key.startswith('__'):
continue
value = ... | """
print_settings
==============
Django command similar to 'diffsettings' but shows all active Django settings.
"""
from django.core.management.base import NoArgsCommand
from django.conf import settings
from optparse import make_option
class Command(NoArgsCommand):
"""print_settings command"""
help = "Pri... | Make output format configurable (simple, pprint, json, yaml) | Make output format configurable (simple, pprint, json, yaml)
$ pylint django-extensions/django_extensions/management/commands/print_settings.py | grep rated
No config file found, using default configuration
Your code has been rated at 10.00/10 (previous run: 10.00/10)
| Python | mit | lamby/django-extensions,barseghyanartur/django-extensions,dpetzold/django-extensions,jpadilla/django-extensions,Moulde/django-extensions,marctc/django-extensions,levic/django-extensions,kevgathuku/django-extensions,bionikspoon/django-extensions,atchariya/django-extensions,maroux/django-extensions,frewsxcv/django-extens... | ---
+++
@@ -1,14 +1,73 @@
-from django.core.management.base import BaseCommand
+"""
+print_settings
+==============
+
+Django command similar to 'diffsettings' but shows all active Django settings.
+"""
+
+from django.core.management.base import NoArgsCommand
from django.conf import settings
+from optparse import ma... |
a1ec7fbf4bb00d2a24dfba0acf6baf18d1b016ee | froide/comments/forms.py | froide/comments/forms.py | from django import forms
from django.utils.translation import gettext_lazy as _
from django_comments.forms import (
CommentForm as DjangoCommentForm,
COMMENT_MAX_LENGTH
)
class CommentForm(DjangoCommentForm):
name = forms.CharField(
label=_('Name'),
required=True,
help_text=_('You... | from django import forms
from django.utils.translation import gettext_lazy as _
from django_comments.forms import (
CommentForm as DjangoCommentForm,
COMMENT_MAX_LENGTH
)
class CommentForm(DjangoCommentForm):
name = forms.CharField(
label=_('Name'),
required=True,
max_length=50,
... | Add max length to comment field | Add max length to comment field | Python | mit | fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide | ---
+++
@@ -11,6 +11,7 @@
name = forms.CharField(
label=_('Name'),
required=True,
+ max_length=50,
help_text=_('Your name will only be visible to logged in users.'),
widget=forms.TextInput(
attrs={ |
06458ef8dd3db840c37127a6a4c0c41ed2ffe6f4 | pybossa/sentinel/__init__.py | pybossa/sentinel/__init__.py | from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connec... | from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connec... | Add retry on timeout option to sentinel connection | Add retry on timeout option to sentinel connection
| Python | agpl-3.0 | geotagx/pybossa,inteligencia-coletiva-lsd/pybossa,jean/pybossa,geotagx/pybossa,OpenNewsLabs/pybossa,PyBossa/pybossa,OpenNewsLabs/pybossa,jean/pybossa,PyBossa/pybossa,Scifabric/pybossa,inteligencia-coletiva-lsd/pybossa,Scifabric/pybossa | ---
+++
@@ -12,7 +12,8 @@
def init_app(self, app):
self.connection = sentinel.Sentinel(app.config['REDIS_SENTINEL'],
- socket_timeout=0.1)
+ socket_timeout=0.1,
+ retr... |
ec92c0cedb6da3180284273926ccfe05ac334729 | snippets/base/middleware.py | snippets/base/middleware.py | from django.core.urlresolvers import resolve
from snippets.base.views import fetch_snippets
class FetchSnippetsMiddleware(object):
"""
If the incoming request is for the fetch_snippets view, execute the view
and return it before other middleware can run.
fetch_snippets is a very very basic view that... | from django.core.urlresolvers import resolve
from snippets.base.views import fetch_snippets
class FetchSnippetsMiddleware(object):
"""
If the incoming request is for the fetch_snippets view, execute the view
and return it before other middleware can run.
fetch_snippets is a very very basic view that... | Disable New Relic's apdex metric on non-fetch_snippets views. | Disable New Relic's apdex metric on non-fetch_snippets views.
New Relic doesn't allow us to set different thresholds for different
pages across the site, so in order to get valuable metrics on the main
view for snippets, fetch_snippets, we need to disable apdex for the
admin interface and public snippets views, which ... | Python | mpl-2.0 | akatsoulas/snippets-service,schalkneethling/snippets-service,mozilla/snippets-service,mozilla/snippets-service,mozilla/snippets-service,mozmar/snippets-service,schalkneethling/snippets-service,Osmose/snippets-service,bensternthal/snippets-service,akatsoulas/snippets-service,mozmar/snippets-service,glogiotatidis/snippet... | ---
+++
@@ -13,8 +13,20 @@
middlewares. To avoid unintended issues (such as headers we don't want
being added to the response) this middleware detects requests to that view
and executes the view early, bypassing the rest of the middleware.
+
+ Also disables New Relic's apdex for views that aren't th... |
439f0326cc71cf19e41137745aedeec391727207 | src/sentry/web/frontend/organization_api_keys.py | src/sentry/web/frontend/organization_api_keys.py | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.frontend.base import OrganizationView
class OrganizationApiKeysView(OrganizationView):
required_access = Organ... | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from operator import or_
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.frontend.base import OrganizationView
DEFAULT_SCOPES = [
'project:read',
'event:re... | Set default scopes to read | Set default scopes to read
| Python | bsd-3-clause | pauloschilling/sentry,llonchj/sentry,JamesMura/sentry,hongliang5623/sentry,gg7/sentry,gencer/sentry,BuildingLink/sentry,llonchj/sentry,ifduyue/sentry,kevinastone/sentry,drcapulet/sentry,BayanGroup/sentry,Kryz/sentry,1tush/sentry,kevinlondon/sentry,beeftornado/sentry,beeftornado/sentry,felixbuenemann/sentry,JamesMura/se... | ---
+++
@@ -2,9 +2,17 @@
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
+from operator import or_
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.frontend.base import OrganizationView
+
+DEFAULT_SCOPES = [
+ 'project:read',
+ 'event:rea... |
f8bb6849aaf82ed74a37d12eaa14d111a85e5e50 | lms/djangoapps/philu_overrides/migrations/0001_initial.py | lms/djangoapps/philu_overrides/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, connection
#TODO: find a more better way of handling history of builtin packages
class Migration(migrations.Migration):
dependencies = [
('enterprise', '0009_auto_20161130_1651'),
]
def add_history_c... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, connection
#TODO: find a more better way of handling history of builtin packages
class Migration(migrations.Migration):
dependencies = [
('enterprise', '0009_auto_20161130_1651'),
]
def add_history_c... | Add history columns `start_date` and `end_date` to edx builtin packages | Add history columns `start_date` and `end_date` to edx builtin packages
| Python | agpl-3.0 | philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform | ---
+++
@@ -11,8 +11,18 @@
def add_history_columns(apps, schema_editor):
cursor = connection.cursor()
- query = 'ALTER TABLE enterprise_historicalenterprisecustomer ADD start_date DATETIME NULL, ADD end_date DATETIME NULL;'
- cursor.execute(query)
+ tables = [
+ 'enterp... |
b9a25c0bf991c0579a9c9f1ed371251337173214 | namestand/patterns.py | namestand/patterns.py | import re
non_alphanumeric = re.compile(r"[^0-9a-z]+", re.I)
non_namey = re.compile(r"[^\w\-' ]+", re.UNICODE)
comma_suffix = re.compile(r", *(JR|SR|I+|IV|VI*)\b")
last_first = re.compile(r"([^,]*), +([^,]*)")
starts_with_num = re.compile(r"^(\d)")
name_cruft = re.compile(r"\b(MR|MS|MRS|ESQ|SIR|HON)\b")
company_... | import re
non_alphanumeric = re.compile(r"[^0-9a-z]+", re.I)
non_namey = re.compile(r"[^\w\-' ]+", re.UNICODE)
comma_suffix = re.compile(r", *(JR|SR|I+|IV|VI*)\b")
last_first = re.compile(r"([^,]*), +([^,]*)")
starts_with_num = re.compile(r"^(\d)")
name_cruft = re.compile(r"\b(MR|MS|MRS|ESQ|SIR|HON)\b")
company_... | Add "LLP" to company cruft | Add "LLP" to company cruft
| Python | mit | BuzzFeedNews/namestand | ---
+++
@@ -12,6 +12,6 @@
name_cruft = re.compile(r"\b(MR|MS|MRS|ESQ|SIR|HON)\b")
-company_cruft = re.compile(r"\b(LLC|LTD|INC)\b")
+company_cruft = re.compile(r"\b(LLC|LTD|INC|LLP)\b")
whitespace = re.compile(r"\s+") |
2c26434b7dcd71530d453989372b8d67d90ad3c7 | rwt/scripts.py | rwt/scripts.py | import sys
import tokenize
def run(cmdline):
"""
Execute the script as if it had been invoked naturally.
"""
namespace = dict()
filename = cmdline[0]
namespace['__file__'] = filename
namespace['__name__'] = '__main__'
sys.argv[:] = cmdline
open_ = getattr(tokenize, 'open', open)
script = open_(filename).re... | import sys
import ast
import tokenize
def read_deps(script, var_name='__requires__'):
"""
Given a script path, read the dependencies from the
indicated variable (default __requires__). Does not
execute the script, so expects the var_name to be
assigned a static list of strings.
"""
with open(script) as stream:... | Add routine for loading deps from a script. | Add routine for loading deps from a script.
| Python | mit | jaraco/rwt | ---
+++
@@ -1,5 +1,33 @@
import sys
+import ast
import tokenize
+
+
+def read_deps(script, var_name='__requires__'):
+ """
+ Given a script path, read the dependencies from the
+ indicated variable (default __requires__). Does not
+ execute the script, so expects the var_name to be
+ assigned a static list of strin... |
dec97fd68509cabfd53dcf588952b3b25d3e0e17 | normandy/base/urls.py | normandy/base/urls.py | from django.conf.urls import include, url
from normandy.base import views
from normandy.base.api import views as api_views
from normandy.base.api.routers import MixedViewRouter
# API Router
router = MixedViewRouter()
router.register("user", api_views.UserViewSet)
router.register("group", api_views.GroupViewSet)
ur... | from django.conf.urls import include, url
from normandy.base import views
from normandy.base.api import views as api_views
from normandy.base.api.routers import MixedViewRouter
# API Router
router = MixedViewRouter()
router.register("user", api_views.UserViewSet)
router.register("group", api_views.GroupViewSet)
ur... | Make service info available on v3 API | Make service info available on v3 API
| Python | mpl-2.0 | mozilla/normandy,mozilla/normandy,mozilla/normandy,mozilla/normandy | ---
+++
@@ -14,7 +14,8 @@
urlpatterns = [
url(r"^$", views.index, name="index"),
url(r"^favicon.ico", views.favicon),
- url(r"^api/v2/service_info/", api_views.ServiceInfoView.as_view(), name="service-info"),
+ url(r"^api/v2/service_info/", api_views.ServiceInfoView.as_view(), name="service-info-v2")... |
767b9867a1e28063fae33ea46478372818b5a129 | cla_backend/apps/core/views.py | cla_backend/apps/core/views.py | from django.views import defaults
from sentry_sdk import capture_message, push_scope
def page_not_found(request, *args, **kwargs):
with push_scope() as scope:
scope.set_tag("type", "404")
scope.set_extra("path", request.path)
capture_message("Page not found", level="error")
return de... | from django.views import defaults
from sentry_sdk import capture_message, push_scope
def page_not_found(request, *args, **kwargs):
with push_scope() as scope:
scope.set_tag("path", request.path)
for i, part in enumerate(request.path.strip("/").split("/")):
scope.set_tag("path_{}".forma... | Tag sentry event with each part of path | Tag sentry event with each part of path
| Python | mit | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | ---
+++
@@ -4,8 +4,9 @@
def page_not_found(request, *args, **kwargs):
with push_scope() as scope:
- scope.set_tag("type", "404")
- scope.set_extra("path", request.path)
+ scope.set_tag("path", request.path)
+ for i, part in enumerate(request.path.strip("/").split("/")):
+ ... |
e08c7352fc5de7e098e434bfc1f2df4384c3405a | tests/base.py | tests/base.py | import unittest
import glob
import os
import mmstats
class MmstatsTestCase(unittest.TestCase):
def setUp(self):
super(MmstatsTestCase, self).setUp()
self.path = mmstats.DEFAULT_PATH
# Clean out stale mmstats files
for fn in glob.glob(os.path.join(self.path, 'test*.mmstats')):
... | import unittest
import glob
import os
import mmstats
class MmstatsTestCase(unittest.TestCase):
@property
def files(self):
return glob.glob(os.path.join(self.path, 'test*.mmstats'))
def setUp(self):
super(MmstatsTestCase, self).setUp()
self.path = mmstats.DEFAULT_PATH
# ... | Refactor test harness file discovery | Refactor test harness file discovery
| Python | bsd-3-clause | schmichael/mmstats,schmichael/mmstats,schmichael/mmstats,schmichael/mmstats | ---
+++
@@ -7,12 +7,16 @@
class MmstatsTestCase(unittest.TestCase):
+ @property
+ def files(self):
+ return glob.glob(os.path.join(self.path, 'test*.mmstats'))
+
def setUp(self):
super(MmstatsTestCase, self).setUp()
self.path = mmstats.DEFAULT_PATH
# Clean out stale... |
35b08e6e7e60a440fe33b7120843766b9f2592c6 | tests/urls.py | tests/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url('foo/', views.MyView.as_view(), name='class-view'),
url('bar/', views.MyAPIView.as_view(), name='api-view'),
url('', views.my_view, name='funct... | from django.conf.urls import include, url
from django.contrib import admin
from . import views
from incuna_test_utils.compat import DJANGO_LT_17
if DJANGO_LT_17:
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url('foo/', views.MyView.as_view(), name='class-view'),
u... | Add compatibility with django < 1.7 | Add compatibility with django < 1.7
| Python | bsd-2-clause | incuna/incuna-test-utils,incuna/incuna-test-utils | ---
+++
@@ -2,6 +2,11 @@
from django.contrib import admin
from . import views
+from incuna_test_utils.compat import DJANGO_LT_17
+
+
+if DJANGO_LT_17:
+ admin.autodiscover()
urlpatterns = [ |
c0de670c5b8b78280ee588ee31a75cf8b3f44799 | lms/djangoapps/commerce/migrations/0001_data__add_ecommerce_service_user.py | lms/djangoapps/commerce/migrations/0001_data__add_ecommerce_service_user.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from django.db import migrations, models
USERNAME = settings.ECOMMERCE_SERVICE_WORKER_USERNAME
EMAIL = USERNAME + '@fake.email'
def forwards(apps, schema_editor):
"... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from django.db import migrations, models
USERNAME = settings.ECOMMERCE_SERVICE_WORKER_USERNAME
EMAIL = USERNAME + '@fake.email'
def forwards(apps, schema_editor):
"... | Fix sandboax builds, because of signal chains, UserProfile table must be predent before adding a User | Fix sandboax builds, because of signal chains, UserProfile table must be predent before adding a User
| Python | agpl-3.0 | arbrandes/edx-platform,eduNEXT/edx-platform,stvstnfrd/edx-platform,stvstnfrd/edx-platform,EDUlib/edx-platform,arbrandes/edx-platform,angelapper/edx-platform,arbrandes/edx-platform,eduNEXT/edunext-platform,EDUlib/edx-platform,stvstnfrd/edx-platform,edx/edx-platform,EDUlib/edx-platform,edx/edx-platform,stvstnfrd/edx-plat... | ---
+++
@@ -26,6 +26,7 @@
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('user_api', '0002_retirementstate_userretirementstatus'),
+ ('student', '0033_userprofile_state'),
]
operations = [ |
47ddf999dd7ef8cd7600710ad6ad7611dd55a218 | bin/testNetwork.py | bin/testNetwork.py | #!/usr/bin/python3
import subprocess
import os
from time import sleep
env = {}
HOME = os.environ.get("HOME", "/root")
scannerConf = open(HOME+"/scanner.conf", "rt")
while True:
in_line = scannerConf.readline()
if not in_line:
break
in_line = in_line[:-1]
key, value = in_line.split("=")
env... | #!/usr/bin/python3
import subprocess
import os
from time import sleep
env = {}
HOME = os.environ.get("HOME", "/root")
scannerConf = open(HOME+"/scanner.conf", "rt")
while True:
in_line = scannerConf.readline()
if not in_line:
break
in_line = in_line[:-1]
key, value = in_line.split("=")
env... | Change the config dictionary key validation | Change the config dictionary key validation
| Python | apache-2.0 | starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser | ---
+++
@@ -17,10 +17,10 @@
scannerConf.close()
GATEWAY = '192.168.1.1'
-if env['GATEWAY']:
+if 'GATEWAY' in env:
GATEWAY = env['GATEWAY']
IFACE = 'wlan0'
-if env['IFACE']:
+if 'IFACE' in env:
IFACE = env['IFACE']
print("Testing GATEWAY=%s, IFACE=%s" % (GATEWAY, IFACE)) |
22e16ba6e2bf7135933895162744424e89ca514d | article/tests/article_admin_tests.py | article/tests/article_admin_tests.py | from django.contrib.auth.models import User
from django.test import TestCase, override_settings, Client
from django.test import RequestFactory
from mock import MagicMock
from wagtail.wagtailsearch.backends.elasticsearch import Elasticsearch
from django.db import DataError, IntegrityError
from django.core.exceptions imp... | from django.contrib.auth.models import User
from django.test import TestCase, override_settings, Client
from django.test import RequestFactory
from mock import MagicMock
from wagtail.wagtailsearch.backends.elasticsearch import Elasticsearch
from django.db import DataError, IntegrityError
from django.core.exceptions imp... | Fix test for storing article without any content | Fix test for storing article without any content
| Python | bsd-3-clause | PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari | ---
+++
@@ -25,10 +25,9 @@
"This field cannot be blank"): # Slug and title fields cannot be null.
ArticleFactory(title="")
- def test_article_cannot_be_stored_without_content(self):
- with self.assertRaisesRegexp(ValidationError,
- ... |
d12be3446cad8b3fa3ae9a1860b3bd6ed20a1d9e | cass-prototype/reddit/api/serializers.py | cass-prototype/reddit/api/serializers.py | from reddit.models import Blog
from rest_framework import serializers
class BlogSerializer(serializers.Serializer):
blog_id = serializers.UUIDField()
created_at = serializers.DateTimeField()
user = serializers.CharField()
description = serializers.CharField()
def create(self, validated_data):
... | from reddit.models import Blog
from rest_framework import serializers
class BlogSerializer(serializers.Serializer):
blog_id = serializers.UUIDField()
created_at = serializers.DateTimeField()
user = serializers.CharField()
description = serializers.CharField()
def create(self, validated_data):
... | Fix to API Update to allow PATCH | Fix to API Update to allow PATCH
| Python | mit | WilliamQLiu/django-cassandra-prototype,WilliamQLiu/django-cassandra-prototype | ---
+++
@@ -22,7 +22,8 @@
return validated_data
def update(self, instance, validated_data):
- validated_data = self._validate_created_at(validated_data) # Clean data
+ if validated_data.get('created_at', None):
+ validated_data = self._validate_created_at(validated_data) # C... |
bbd98c7da097d4962d371cd5ff75d9f67a0e3fd1 | renderMenu.py | renderMenu.py | #!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
from datetime import datetime
from pytz import timezone
from flask import Flask, render_template, url_for
app = Flask(__name__)
@app.route("/")
def renderMenu():
nowWaterloo = datetime.now(timezone('America/Toronto'))
currentDatetime = nowWa... | #!/usr/bin/env python
import json, os, requests
from awsauth import S3Auth
from datetime import datetime
from pytz import timezone
from flask import Flask, render_template, url_for
app = Flask(__name__)
@app.route("/")
def renderMenu():
nowWaterloo = datetime.now(timezone('America/Toronto'))
currentDatetime = nowWa... | Switch from development to actual data. | Switch from development to actual data.
| Python | mit | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | ---
+++
@@ -14,7 +14,7 @@
ACCESS_KEY = os.environ.get('AWS_ACCESS_KEY_ID')
SECRET_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY')
MIXPANEL_TOKEN = os.environ.get('MIXPANEL_TOKEN')
- r = requests.get('http://s3.amazonaws.com/uwfoodmenu/multi.txt', auth=S3Auth(ACCESS_KEY, SECRET_KEY))
+ r = requests.get('http://s3.... |
9b7f23e02d0f35b27a5a0f1aad47c363b59d48e3 | configuration/configuration.py | configuration/configuration.py | from ConfigParser import ConfigParser
from environment import ENV
import sys
import os
import re
def get_config(environment):
config_dir = "%s/%s" % (re.sub('configuration\.(py|pyc)', '', os.path.abspath(__file__)), environment)
config_files = os.listdir(config_dir)
config_files = ["%s/%s" % (config_dir, f... | from ConfigParser import ConfigParser
from environment import ENV
import sys
import os
import re
def get_config(environment):
config_dir = "%s/%s" % (re.sub('configuration\.(pyc|py)', '', os.path.abspath(__file__)), environment)
config_files = os.listdir(config_dir)
config_files = ["%s/%s" % (config_dir, f... | Fix to the order of py and pyc in the regex | Fix to the order of py and pyc in the regex
| Python | agpl-3.0 | ushahidi/swiftgate,ushahidi/swiftgate | ---
+++
@@ -5,7 +5,7 @@
import re
def get_config(environment):
- config_dir = "%s/%s" % (re.sub('configuration\.(py|pyc)', '', os.path.abspath(__file__)), environment)
+ config_dir = "%s/%s" % (re.sub('configuration\.(pyc|py)', '', os.path.abspath(__file__)), environment)
config_files = os.listdir(conf... |
d8e0c07363069e664dcb6071bc84e8ecc0706739 | plugins/join_on_invite/plugin.py | plugins/join_on_invite/plugin.py | class InviteJoinPlugin(object):
"""Simple plugin that joins a channel if an invite is given."""
callback_id = None
"""ID generated when callback was added for the irc.invite event"""
def __init__(self, cardinal):
"""Register our callback and save the callback ID"""
self.callback_id = c... | from cardinal.decorators import event
class InviteJoinPlugin(object):
"""Simple plugin that joins a channel if an invite is given."""
@event('irc.invite')
def join_channel(self, cardinal, user, channel):
"""Callback for irc.invite that joins a channel"""
cardinal.join(channel)
def setup... | Use join_on_invite as @event decorator example | Use join_on_invite as @event decorator example
| Python | mit | JohnMaguire/Cardinal,BiohZn/Cardinal | ---
+++
@@ -1,20 +1,14 @@
+from cardinal.decorators import event
+
+
class InviteJoinPlugin(object):
"""Simple plugin that joins a channel if an invite is given."""
- callback_id = None
- """ID generated when callback was added for the irc.invite event"""
-
- def __init__(self, cardinal):
- ""... |
efdb4f57f3fe18f3c9a16df0adb735f13cd7c567 | vigir_synthesis_manager/src/vigir_synthesis_manager/ltl_compilation_client.py | vigir_synthesis_manager/src/vigir_synthesis_manager/ltl_compilation_client.py | #!/usr/bin/env python
import rospy
from vigir_synthesis_msgs.srv import LTLCompilation
# from vigir_synthesis_msgs.msg import LTLSpecification, BSErrorCodes
def ltl_compilation_client(system, goals, initial_conditions, custom_ltl = None):
'''Client'''
rospy.wait_for_service('ltl_compilation')
try:
... | #!/usr/bin/env python
import rospy
from vigir_synthesis_msgs.srv import LTLCompilation
# from vigir_synthesis_msgs.msg import LTLSpecification, BSErrorCodes
def ltl_compilation_client(system, goals, initial_conditions, custom_ltl = None):
'''Client'''
rospy.wait_for_service('ltl_compilation')
try:
... | Remove prints from LTL compilation client | [vigir_synthesis_manager] Remove prints from LTL compilation client
| Python | bsd-3-clause | team-vigir/vigir_behavior_synthesis,team-vigir/vigir_behavior_synthesis | ---
+++
@@ -15,12 +15,7 @@
response = ltl_compilation_srv(system, goals, initial_conditions)
#DEBUG
- print response.ltl_specification.sys_init
- print response.ltl_specification.env_init
- print response.ltl_specification.sys_trans
- print response.ltl_specific... |
bc32e0aadfe2d83d8acb2f219f2fb6bf5f5bb150 | ehriportal/portal/management/commands/geocode_addresses.py | ehriportal/portal/management/commands/geocode_addresses.py | """Geocode Contact objects."""
import sys
from geopy import geocoders
from django.core.management.base import BaseCommand, CommandError
from portal import models
class Command(BaseCommand):
"""Set lat/long fields on contacts with a street address,
currently just using Google's geocoder."""
def handle(... | """Geocode Contact objects."""
import sys
import time
from geopy import geocoders
from django.core.management.base import BaseCommand, CommandError
from portal import models
class Command(BaseCommand):
"""Set lat/long fields on contacts with a street address,
currently just using Google's geocoder."""
... | Fix logging, add a sleep to molify Google's rate limit. | Fix logging, add a sleep to molify Google's rate limit.
| Python | mit | mikesname/ehri-collections,mikesname/ehri-collections,mikesname/ehri-collections | ---
+++
@@ -1,6 +1,7 @@
"""Geocode Contact objects."""
import sys
+import time
from geopy import geocoders
@@ -14,14 +15,14 @@
currently just using Google's geocoder."""
def handle(self, *args, **kwargs):
"""Run geocode."""
- self.geocoder = geocoders.GeoNames()
+ self.geocod... |
082076cce996593c9959fc0743f13b62d2e4842b | chared/__init__.py | chared/__init__.py | # Copyright (c) 2011 Vit Suchomel and Jan Pomikalek
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
try:
__version__ = 'v' + __import__('pkg_resources').get_distribution('chared').version
except:
__version__ =... | # Copyright (c) 2011 Vit Suchomel and Jan Pomikalek
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
try:
__version__ = 'v' + __import__('pkg_resources').get_distribution('chared').version
except:
import re
... | Make sure the version is displayed as r<revision number> if the information about the package version is not available. | Make sure the version is displayed as r<revision number> if the information about the package version is not available. | Python | bsd-2-clause | gilesbrown/chared,xmichelf/chared | ---
+++
@@ -7,4 +7,5 @@
try:
__version__ = 'v' + __import__('pkg_resources').get_distribution('chared').version
except:
- __version__ = 'r$Rev$'
+ import re
+ __version__ = re.sub('.*(\d+).*', r'rev\1', '$Rev$') |
2db4fda62c2eec2d5424448fcd57bedd91ad2e64 | test_support/test_fdbsql.py | test_support/test_fdbsql.py | DATABASES = {
'default': {
'ENGINE': 'django_fdbsql',
'NAME': 'django_default',
'OPTIONS': {
'supports_sequence_reset': True,
'use_sequence_reset_function': True,
},
},
'other': {
'ENGINE': 'django_fdbsql',
'NAME': 'django_other',
}... | # https://docs.djangoproject.com/en/1.7/internals/contributing/writing-code/unit-tests/#using-another-settings-module
DATABASES = {
'default': {
'ENGINE': 'django_fdbsql',
'NAME': 'django_default',
'OPTIONS': {
'supports_sequence_reset': True,
'use_sequence_reset_func... | Use sqlite3 for 'other' database test config | Use sqlite3 for 'other' database test config
| Python | mit | freyley/sql-layer-adapter-django | ---
+++
@@ -1,3 +1,4 @@
+# https://docs.djangoproject.com/en/1.7/internals/contributing/writing-code/unit-tests/#using-another-settings-module
DATABASES = {
'default': {
'ENGINE': 'django_fdbsql',
@@ -7,9 +8,9 @@
'use_sequence_reset_function': True,
},
},
+ # Nothing adapt... |
d63463d8dc8acb4445b01fcebeeb6a20ea1d7b9b | tests/unit/test_template.py | tests/unit/test_template.py | import json
import pytest
from path import Path
from formica import cli
@pytest.fixture
def logger(mocker):
return mocker.patch('formica.cli.logger')
def test_template_calls_template(tmpdir, logger):
with Path(tmpdir):
with open('test.template.json', 'w') as f:
f.write('{"Description": ... | import json
import yaml
import pytest
from path import Path
from formica import cli
@pytest.fixture
def logger(mocker):
return mocker.patch('formica.cli.logger')
def test_template_calls_template(tmpdir, logger):
with Path(tmpdir):
with open('test.template.json', 'w') as f:
f.write('{"De... | Test yaml argument for template command | Test yaml argument for template command
| Python | mit | flomotlik/formica | ---
+++
@@ -1,4 +1,5 @@
import json
+import yaml
import pytest
from path import Path
@@ -17,3 +18,12 @@
cli.main(['template'])
logger.info.assert_called()
assert {"Description": "Test"} == json.loads(logger.info.call_args[0][0])
+
+
+def test_template_calls_template_with_yaml(tmpdir, l... |
1de93393e402d1387e7d1c8057c6010c12a21848 | tests/window/window_util.py | tests/window/window_util.py | #!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | #!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | Fix window test border _again_ (more fixed). | Fix window test border _again_ (more fixed).
| Python | bsd-3-clause | shaileshgoogler/pyglet,mpasternak/pyglet-fix-issue-518-522,mpasternak/pyglet-fix-issue-518-522,odyaka341/pyglet,cledio66/pyglet,kmonsoor/pyglet,Alwnikrotikz/pyglet,gdkar/pyglet,Alwnikrotikz/pyglet,mpasternak/pyglet-fix-issue-552,arifgursel/pyglet,Alwnikrotikz/pyglet,google-code-export/pyglet,gdkar/pyglet,cledio66/pygle... | ---
+++
@@ -22,7 +22,7 @@
glEnd()
glColor3f(1, 0, 0)
- rect(-1, -1, window.width + 1, window.height - 1)
+ rect(-1, -1, window.width, window.height)
glColor3f(0, 1, 0)
rect(0, 0, window.width - 1, window.height - 1) |
cd71740daaf4f1f770b7d6959e2865ed50b76bd7 | tilequeue/query/__init__.py | tilequeue/query/__init__.py | import tilequeue.query.postgres
make_db_data_fetcher = postgres.make_db_data_fetcher
| import tilequeue.query.postgres
make_db_data_fetcher = tilequeue.query.postgres.make_db_data_fetcher
| Fix error identified by flake8. | Fix error identified by flake8.
| Python | mit | mapzen/tilequeue,tilezen/tilequeue | ---
+++
@@ -1,3 +1,3 @@
import tilequeue.query.postgres
-make_db_data_fetcher = postgres.make_db_data_fetcher
+make_db_data_fetcher = tilequeue.query.postgres.make_db_data_fetcher |
0e6646de573dc04360634828cdb3b7da8cc31d2b | cobe/instatrace.py | cobe/instatrace.py | # Copyright (C) 2010 Peter Teichman
import math
import time
def singleton(cls):
instances = {}
def getinstance():
if cls not in instances:
instances[cls] = cls()
return instances[cls]
return getinstance
@singleton
class Instatrace:
def __init__(self):
self._fd = No... | # Copyright (C) 2010 Peter Teichman
import math
import time
def singleton(cls):
instances = {}
def getinstance():
if cls not in instances:
instances[cls] = cls()
return instances[cls]
return getinstance
@singleton
class Instatrace:
def __init__(self):
self._fd = No... | Allow Instatrace().init(None) to disable tracing at runtime | Allow Instatrace().init(None) to disable tracing at runtime
| Python | mit | meska/cobe,pteichman/cobe,DarkMio/cobe,wodim/cobe-ng,LeMagnesium/cobe,tiagochiavericosta/cobe,wodim/cobe-ng,DarkMio/cobe,LeMagnesium/cobe,meska/cobe,tiagochiavericosta/cobe,pteichman/cobe | ---
+++
@@ -20,7 +20,10 @@
if self._fd is not None:
self._fd.close()
- self._fd = open(filename, "w")
+ if filename is None:
+ self._fd = None
+ else:
+ self._fd = open(filename, "w")
def is_enabled(self):
return self._fd is not None |
3d2f9087e62006f8a5f19476ae23324a4cfa7793 | regex.py | regex.py | import re
import sys
f = open ('/var/local/meTypesetTests/tests/testOutput/'+sys.argv[1] +'/nlm/out.xml', "r")
print ("open operation complete")
fd = f.read()
s = ''
fd =
pattern = re.compile(r'(?:(&#\d*|>))(.*?)(?=(&#\d*|<))')
for e in re.findall(pattern, fd):
s += ' '
s += e[1]
s = re.sub('-', ' ', s)
s = re.sub... | import re
import sys
f = open ('/var/local/meTypesetTests/tests/testOutput/'+sys.argv[1] +'/nlm/out.xml', "r")
print ("open operation complete")
fd = f.read()
s = ''
fd = re.sub(r'\<.*?\>\;', ' ', fd)
pattern = re.compile(r'(?:(&#\d*|>))(.*?)(?=(&#\d*|<))')
for e in re.findall(pattern, fd):
s += ' '
s += e[1]
... | Update of work over prior couple weeks. | Update of work over prior couple weeks.
| Python | mit | jnicolls/meTypeset-Test,jnicolls/Joseph | ---
+++
@@ -5,7 +5,8 @@
fd = f.read()
s = ''
-fd =
+fd = re.sub(r'\<.*?\>\;', ' ', fd)
+
pattern = re.compile(r'(?:(&#\d*|>))(.*?)(?=(&#\d*|<))')
for e in re.findall(pattern, fd):
s += ' ' |
0946379d23131aeec07dc29bebd4e57d95298d00 | recipes/sos-notebook/run_test.py | recipes/sos-notebook/run_test.py | # Test that sos kernel is installed
import jupyter_client
try:
jupyter_client.kernelspec.get_kernel_spec('sos')
except jupyter_client.kernelspec.NoSuchKernel:
print('sos kernel was not installed')
print('The following kernels are installed:')
print('jupyter_client.kernelspec.find_kernel_specs()')
... | # Test that sos kernel is installed
import jupyter_client
try:
jupyter_client.kernelspec.get_kernel_spec('sos')
except jupyter_client.kernelspec.NoSuchKernel:
print('sos kernel was not installed')
print('The following kernels are installed:')
print('jupyter_client.kernelspec.find_kernel_specs()')
... | Use longer TIMEOUT defined in sos_notebook.test_utils. | Use longer TIMEOUT defined in sos_notebook.test_utils.
| Python | bsd-3-clause | SylvainCorlay/staged-recipes,synapticarbors/staged-recipes,jochym/staged-recipes,mcs07/staged-recipes,ceholden/staged-recipes,igortg/staged-recipes,goanpeca/staged-recipes,johanneskoester/staged-recipes,isuruf/staged-recipes,scopatz/staged-recipes,chrisburr/staged-recipes,petrushy/staged-recipes,asmeurer/staged-recipes... | ---
+++
@@ -14,8 +14,8 @@
import unittest
+from sos_notebook.test_utils import sos_kernel
from ipykernel.tests.utils import execute, wait_for_idle, assemble_output
-from sos_notebook.test_utils import sos_kernel
class TestSoSKernel(unittest.TestCase):
def testKernel(self): |
c54ea6322177f8665173ae0faa2d34d37a70dea6 | setup.py | setup.py | from distutils.core import setup
import skyfield # safe, because __init__.py contains no import statements
setup(
name='skyfield',
version=skyfield.__version__,
description=skyfield.__doc__.split('\n', 1)[0],
long_description=open('README.rst', 'rb').read().decode('utf-8'),
license='MIT',
auth... | from distutils.core import setup
import skyfield # safe, because __init__.py contains no import statements
setup(
name='skyfield',
version=skyfield.__version__,
description=skyfield.__doc__.split('\n', 1)[0],
long_description=open('README.rst', 'rb').read().decode('utf-8'),
license='MIT',
auth... | Add pytz as a test requirement | Add pytz as a test requirement
| Python | mit | skyfielders/python-skyfield,skyfielders/python-skyfield | ---
+++
@@ -36,4 +36,8 @@
'jplephem>=2.3',
'numpy',
'sgp4>=1.4',
- ])
+ ],
+ test_requires=[
+ 'pytz',
+ ],
+) |
3581c3c71bdf3ff84961df4b328f0bfc2adf0bc7 | apps/provider/urls.py | apps/provider/urls.py | from __future__ import absolute_import
from __future__ import unicode_literals
from django.conf.urls import patterns, include, url
from .views import *
urlpatterns = patterns('',
url(r'^pjson/push$', pjson_provider_push, name="pjson_provider_push"),
url(r'^fhir/practitioner/push$', fhir_practitioner_push, ... | from __future__ import absolute_import
from __future__ import unicode_literals
from django.conf.urls import patterns, include, url
from .views import *
urlpatterns = patterns('',
url(r'^pjson/push$', pjson_provider_push, name="pjson_provider_push"),
url(r'^fhir/practitioner/push$', fhir_practitioner_push, ... | Add url for update vs. push for pract and org | Add url for update vs. push for pract and org
| Python | apache-2.0 | TransparentHealth/hhs_oauth_client,TransparentHealth/hhs_oauth_client,TransparentHealth/hhs_oauth_client,TransparentHealth/hhs_oauth_client | ---
+++
@@ -10,5 +10,7 @@
url(r'^pjson/push$', pjson_provider_push, name="pjson_provider_push"),
url(r'^fhir/practitioner/push$', fhir_practitioner_push, name="fhir_practitioner_push"),
url(r'^fhir/organization/push$', fhir_organization_push, name="fhir_organization_push"),
+ url(r'^fhir/practiti... |
148866c1c2b18afcc6da5c55632d20bfdec4004a | setup.py | setup.py | #!/usr/bin/env python
"""
A light wrapper for Cybersource SOAP Toolkit API
"""
from setuptools import setup
import pycybersource
setup(
name='pycybersource',
version=pycybersource.__version__,
description='A light wrapper for Cybersource SOAP Toolkit API',
author='Eric Bartels',
author_email='ebart... | #!/usr/bin/env python
"""
A light wrapper for Cybersource SOAP Toolkit API
"""
from setuptools import setup
setup(
name='pycybersource',
version='0.1.2alpha',
description='A light wrapper for Cybersource SOAP Toolkit API',
author='Eric Bartels',
author_email='ebartels@gmail.com',
url='',
pa... | Fix for installing with PIP | Fix for installing with PIP | Python | bsd-3-clause | SideStudios/pycybersource | ---
+++
@@ -3,11 +3,10 @@
A light wrapper for Cybersource SOAP Toolkit API
"""
from setuptools import setup
-import pycybersource
setup(
name='pycybersource',
- version=pycybersource.__version__,
+ version='0.1.2alpha',
description='A light wrapper for Cybersource SOAP Toolkit API',
author=... |
f13f80db99ed43479336b116e38512e3566e4623 | setup.py | setup.py | import subprocess
import sys
from setuptools import Command, setup
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call([sys.executable, '-m', 'unittest', 'parserutils.tests.tes... | import subprocess
import sys
from setuptools import Command, setup
class RunTests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
errno = subprocess.call([sys.executable, '-m', 'unittest', 'parserutils.tests.tes... | Enable markdown for PyPI README | Enable markdown for PyPI README | Python | bsd-3-clause | consbio/parserutils | ---
+++
@@ -26,8 +26,9 @@
name='parserutils',
description='A collection of performant parsing utilities',
long_description=long_description,
+ long_description_content_type='text/markdown',
keywords='parser,parsing,utils,utilities,collections,dates,elements,numbers,strings,url,xml',
- versio... |
b7da1cac55665b71678abbda144c9f589e6c8b11 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
version = '1.3'
long_desc = """
nose-perfdump is a Nose plugin that collects per-test performance metrics into an
SQLite3 database and reports the slowest tests, test files, and total time
spent in tests. It is designed to make profiling tests to im... | #!/usr/bin/env python
from setuptools import setup, find_packages
version = '1.3'
long_desc = """
nose-perfdump is a Nose plugin that collects per-test performance metrics into an
SQLite3 database and reports the slowest tests, test files, and total time
spent in tests. It is designed to make profiling tests to im... | Add Additional Dependencies To Setup | Add Additional Dependencies To Setup
| Python | bsd-3-clause | etscrivner/nose-perfdump | ---
+++
@@ -23,7 +23,7 @@
long_description=long_desc,
author='Eric Scrivner',
keywords='nose,nose plugin,profiler,profiling,tests,unittest',
- install_requires=['nose'],
+ install_requires=['nose', 'pyparsing'],
author_email='eric.t.scrivner@gmail.com',
url='https://github.com/etscrivne... |
d04d3ac7eefce9d37e2c62d68a856fafd41d3877 | setup.py | setup.py | from setuptools import setup
setup(
name='djangorestframework-httpsignature',
version='0.2.1',
url='https://github.com/etoccalino/django-rest-framework-httpsignature',
license='LICENSE.txt',
description='HTTP Signature support for Django REST framework',
long_description=open('README.rst').re... | from setuptools import setup
setup(
name='djangorestframework-httpsignature',
version='0.2.1',
url='https://github.com/etoccalino/django-rest-framework-httpsignature',
license='LICENSE.txt',
description='HTTP Signature support for Django REST framework',
long_description=open('README.rst').re... | Remove duplicate dependency specifications from install_requires | Remove duplicate dependency specifications from install_requires | Python | mit | pombredanne/django-rest-framework-httpsignature,etoccalino/django-rest-framework-httpsignature,etoccalino/django-rest-framework-httpsignature,pombredanne/django-rest-framework-httpsignature | ---
+++
@@ -13,8 +13,6 @@
install_requires=[
'Django>=1.6.2,<1.8',
'djangorestframework>=2.3.14,<2.4',
- 'Django>=1.6.2',
- 'djangorestframework>=2.3.12',
'pycrypto>=2.6.1',
'httpsig',
], |
13e1fc4ca4ed80f24b6b1532d162197af8df55f2 | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='pyaavso',
version=__import__('pyaavso').__version__,
description='A Python library for working with AAVSO data.',
long_description=read('README.rst... | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='pyaavso',
version=__import__('pyaavso').__version__,
description='A Python library for working with AAVSO data.',
long_description=read('README.rst... | Mark compatibility with Python 3.6 | Mark compatibility with Python 3.6
| Python | mit | zsiciarz/pyaavso | ---
+++
@@ -31,6 +31,7 @@
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Utilities'
... |
8da94ee88cf4bf768e16e21ad8b3626970692e27 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.11',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.12',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | Update the PyPI version to 7.0.12. | Update the PyPI version to 7.0.12.
| Python | mit | Doist/todoist-python | ---
+++
@@ -10,7 +10,7 @@
setup(
name='todoist-python',
- version='7.0.11',
+ version='7.0.12',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com', |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.