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 |
|---|---|---|---|---|---|---|---|---|---|---|
bfd1ef748e9d29cf4abccac03098d1d369e6be12 | spyder_memory_profiler/__init__.py | spyder_memory_profiler/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright © 2013 Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
__version__ = '0.2.1.dev0'
# =============================================================================
# The following statements are required to register this 3rd... | # -*- coding: utf-8 -*-
#
# Copyright © 2013 Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
__version__ = '0.2.1'
# =============================================================================
# The following statements are required to register this 3rd part... | Change version number to 0.2.1 | Change version number to 0.2.1
| Python | mit | spyder-ide/spyder.memory_profiler | ---
+++
@@ -4,7 +4,7 @@
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
-__version__ = '0.2.1.dev0'
+__version__ = '0.2.1'
# =============================================================================
# The following statements are required to register this 3rd party plugin: |
ac5ceee751b0c374ffcf1bd0e52ce085e8d7295c | nyucal/cli.py | nyucal/cli.py | # -*- coding: utf-8 -*-
"""Console script for nyucal.
See click documentation at http://click.pocoo.org/
"""
import io
import click
from nyucal import nyucal
import requests
@click.group()
def main(args=None):
"""Console script for nyucal."""
click.echo("cli for nyucal")
@main.command()
def list(source... | # -*- coding: utf-8 -*-
"""Console script for nyucal.
See click documentation at http://click.pocoo.org/
"""
import io
import click
from nyucal import nyucal
import requests
@click.group()
def main(args=None):
"""Console script for nyucal."""
pass
@main.command()
@click.option('--source', '-s', default... | Add the `get` command to the CLI. | Add the `get` command to the CLI.
| Python | mit | nyumathclinic/nyucal,nyumathclinic/nyucal | ---
+++
@@ -16,18 +16,51 @@
@click.group()
def main(args=None):
"""Console script for nyucal."""
- click.echo("cli for nyucal")
+ pass
@main.command()
-def list(source=None):
- """List the available calendars in the calendar source"""
- if source is None:
- source = nyucal.SOURCE_URL #... |
019bca440c46039954a6228bbd22f79a5449aecd | custom/fri/management/commands/dump_fri_message_bank.py | custom/fri/management/commands/dump_fri_message_bank.py | from __future__ import absolute_import
from __future__ import unicode_literals
from couchexport.export import export_raw
from custom.fri.models import FRIMessageBankMessage, FRIRandomizedMessage, FRIExtraMessage
from django.core.management.base import BaseCommand
from io import open
class Command(BaseCommand):
d... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from custom.fri.models import FRIMessageBankMessage, FRIRandomizedMessage, FRIExtraMessage
from django.core.management.base import BaseCommand
from six import moves
class Command(BaseCommand):
def... | Update fri dump script to delete docs | Update fri dump script to delete docs
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | ---
+++
@@ -1,42 +1,43 @@
from __future__ import absolute_import
+from __future__ import print_function
from __future__ import unicode_literals
-from couchexport.export import export_raw
from custom.fri.models import FRIMessageBankMessage, FRIRandomizedMessage, FRIExtraMessage
from django.core.management.base imp... |
be82f1beac54f46fe9458c3ca26b8e3b786bc9f5 | web/impact/impact/views/general_view_set.py | web/impact/impact/views/general_view_set.py | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from django.apps import apps
from rest_framework import viewsets
from rest_framework import permissions
from rest_framework_tracking.mixins import LoggingMixin
from impact.models.utils import snake_to_camel_case
from impact.permissions import DynamicModelPermissi... | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from django.apps import apps
from rest_framework import viewsets
from rest_framework import permissions
from rest_framework_tracking.mixins import LoggingMixin
from impact.models.utils import snake_to_camel_case
from impact.permissions import DynamicModelPermissi... | Create List of Model Attribute API Calls That Require Snake Case | [AC-5010] Create List of Model Attribute API Calls That Require Snake Case
This commit creates a list of models that use attributes. Those calls have snake case in their model definition, and were breaking when converted back to camel case. This may not be the most efficient way to do this, but it is currently worki... | Python | mit | masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api | ---
+++
@@ -11,6 +11,21 @@
from impact.serializers import GeneralSerializer
+model_attribute_calls = [
+ 'Startup_additional_industries',
+ 'Startup_recommendation_tags',
+ 'StartupLabel_startups',
+ 'RefundCode_programs',
+ 'UserLabel_users',
+ 'Observer_newsletter_cc_roles',
+ 'ExpertProfi... |
81b5c5c29747d7f8622828c0036504a4a5023794 | parse-demo.py | parse-demo.py | #!/usr/bin/python3
import sys, os
import nltk
if len(sys.argv) < 2:
print("Please supply a filename.")
sys.exit(1)
filename = sys.argv[1]
with open(filename, 'r') as f:
data = f.read()
# Break the input down into sentences, then into words, and position tag
# those words.
sentences = [nltk.pos_tag(nltk... | #!/usr/bin/python3
import sys, os
import nltk
if len(sys.argv) < 2:
print("Please supply a filename.")
sys.exit(1)
filename = sys.argv[1]
with open(filename, 'r') as f:
data = f.read()
# Break the input down into sentences, then into words, and position tag
# those words.
raw_sentences = nltk.sent_toke... | Develop the Regex grammar slightly further | Develop the Regex grammar slightly further
| Python | mit | alexander-bauer/syllabus-summary | ---
+++
@@ -14,15 +14,17 @@
# Break the input down into sentences, then into words, and position tag
# those words.
+raw_sentences = nltk.sent_tokenize(data)
sentences = [nltk.pos_tag(nltk.word_tokenize(sentence)) \
- for sentence in nltk.sent_tokenize(data)]
+ for sentence in raw_sentences]
# Define a ... |
ac14efc0a8facbfe2fe7288734c86b27eb9b2770 | openprocurement/tender/openeu/adapters.py | openprocurement/tender/openeu/adapters.py | # -*- coding: utf-8 -*-
from openprocurement.tender.core.adapters import TenderConfigurator
from openprocurement.tender.openeu.models import Tender
from openprocurement.tender.openua.constants import (
TENDERING_EXTRA_PERIOD
)
from openprocurement.tender.openeu.constants import (
TENDERING_DURATION, PREQUALIFIC... | # -*- coding: utf-8 -*-
from openprocurement.tender.core.adapters import TenderConfigurator
from openprocurement.tender.openeu.models import Tender
from openprocurement.tender.openua.constants import (
TENDERING_EXTRA_PERIOD, STATUS4ROLE
)
from openprocurement.tender.openeu.constants import (
TENDERING_DURATION... | Add constant for complaint documents | Add constant for complaint documents
| Python | apache-2.0 | openprocurement/openprocurement.tender.openeu | ---
+++
@@ -2,7 +2,7 @@
from openprocurement.tender.core.adapters import TenderConfigurator
from openprocurement.tender.openeu.models import Tender
from openprocurement.tender.openua.constants import (
- TENDERING_EXTRA_PERIOD
+ TENDERING_EXTRA_PERIOD, STATUS4ROLE
)
from openprocurement.tender.openeu.const... |
7bdcc30612636d2c27ea01a7d14b1839696fa7a0 | newsman/watchdog/clean_process.py | newsman/watchdog/clean_process.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
clean zombie processes
"""
# @author chengdujin
# @contact chengdujin@gmail.com
# @created Aug. 22, 2013
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
import subprocess
def clean():
"""
kill zombie processes if there is any
"""
command ... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
clean zombie processes
"""
# @author chengdujin
# @contact chengdujin@gmail.com
# @created Aug. 22, 2013
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
import subprocess
def clean():
"""
kill zombie processes if there is any
"""
command ... | Add code to remove defunct python processes | Add code to remove defunct python processes
| Python | agpl-3.0 | chengdujin/newsman,chengdujin/newsman,chengdujin/newsman | ---
+++
@@ -23,6 +23,9 @@
command = "kill -HUP `ps -A -ostat,ppid | grep -e '^[Zz]' | awk '{print $2}'`"
subprocess.Popen(command, stderr=subprocess.PIPE, shell=True)
+ command = "ps -xal | grep p[y]thon | grep '<defunct>' | awk '{print $4}' | xargs kill -9"
+ subprocess.Popen(command, stderr=subpro... |
b5e7cb7946d87fa39c2a006808a0c07975f9c4d4 | endymion/box.py | endymion/box.py | from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vag... | from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vag... | Index the Atlas data by version and provider | Index the Atlas data by version and provider
| Python | mit | lpancescu/atlas-lint | ---
+++
@@ -18,21 +18,26 @@
{'Accept': 'application/json'})
json_file = urllib2.urlopen(request)
self._data = json.loads(json_file.read())
+ # We need to preserve the order of the versions
+ self._versions = tuple(v['version'] for v in self._data['ver... |
9a0f7e8b9da174008b33dd1d757b2e186b70e9f4 | examples/network_correlations.py | examples/network_correlations.py | """
Cortical networks correlation matrix
====================================
"""
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(context="paper", font="monospace")
df = sns.load_dataset("brain_networks", header=[0, 1, 2], index_col=0)
corrmat = df.corr()
f, ax = plt.subplots(figsize=(12, 9))
sns.heatm... | """
Cortical networks correlation matrix
====================================
"""
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(context="paper", font="monospace")
df = sns.load_dataset("brain_networks", header=[0, 1, 2], index_col=0)
corrmat = df.corr()
f, ax = plt.subplots(figsize=(12, 9))
sns.heatm... | Improve networks heatmap gallery example | Improve networks heatmap gallery example
| Python | bsd-3-clause | lukauskas/seaborn,mwaskom/seaborn,phobson/seaborn,parantapa/seaborn,drewokane/seaborn,cwu2011/seaborn,aashish24/seaborn,arokem/seaborn,bsipocz/seaborn,gef756/seaborn,mia1rab/seaborn,dimarkov/seaborn,muku42/seaborn,ebothmann/seaborn,petebachant/seaborn,anntzer/seaborn,lukauskas/seaborn,JWarmenhoven/seaborn,phobson/seabo... | ---
+++
@@ -13,18 +13,10 @@
f, ax = plt.subplots(figsize=(12, 9))
sns.heatmap(corrmat, vmax=.8, linewidths=0, square=True)
-
-networks = corrmat.columns.get_level_values("network").astype(int).values
-
-start, end = ax.get_ylim()
-rect_kws = dict(facecolor="none", edgecolor=".2",
- linewidth=1.5, c... |
393a2f5f0ccfedc1c5ebd7de987c870419ca2d89 | scripts/calculate_lqr_gain.py | scripts/calculate_lqr_gain.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import scipy
import control
from dtk.bicycle import benchmark_state_space_vs_speed, benchmark_matrices
def compute_whipple_lqr_gain(velocity):
_, A, B = benchmark_state_space_vs_speed(*benchmark_matrices(), velocity)
Q = np.diag([1e5, 1e3, 1e3, ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import scipy
import control
from dtk.bicycle import benchmark_state_space_vs_speed, benchmark_matrices
def compute_whipple_lqr_gain(velocity):
_, A, B = benchmark_state_space_vs_speed(*benchmark_matrices(), velocity)
Q = np.diag([1e5, 1e3, 1e3, ... | Change LQR gain element printing | Change LQR gain element printing
Change printing of LQR gain elements for easier copying.
| Python | bsd-2-clause | oliverlee/phobos,oliverlee/phobos,oliverlee/phobos,oliverlee/phobos | ---
+++
@@ -29,5 +29,10 @@
for v, K in zip(velocities, gains):
print('computed LQR controller feedback gain for v = {}'.format(v))
- print(-K)
+ K = -K
+ for r in range(K.shape[0]):
+ row = ', '.join(str(elem) for elem in K[r, :])
+ if r != K.shape[0] - 1:
+ ... |
f2506c07caf66b3ad42f6f1c09325097edd2e169 | src/django_healthchecks/contrib.py | src/django_healthchecks/contrib.py | import uuid
from django.core.cache import cache
from django.db import connection
def check_database():
"""Check if the application can perform a dummy sql query"""
cursor = connection.cursor()
cursor.execute('SELECT 1; -- Healthcheck')
row = cursor.fetchone()
return row[0] == 1
def check_cache_... | import uuid
from django.core.cache import cache
from django.db import connection
def check_database():
"""Check if the application can perform a dummy sql query"""
with connection.cursor() as cursor:
cursor.execute('SELECT 1; -- Healthcheck')
row = cursor.fetchone()
return row[0] == 1
d... | Make sure the cursor is properly closed after usage | Make sure the cursor is properly closed after usage
| Python | mit | mvantellingen/django-healthchecks | ---
+++
@@ -6,9 +6,9 @@
def check_database():
"""Check if the application can perform a dummy sql query"""
- cursor = connection.cursor()
- cursor.execute('SELECT 1; -- Healthcheck')
- row = cursor.fetchone()
+ with connection.cursor() as cursor:
+ cursor.execute('SELECT 1; -- Healthcheck')... |
667fad716121d5675d5c66d42213965399d9b13d | clowder_server/views.py | clowder_server/views.py | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('name')
... | from braces.views import CsrfExemptMixin
from django.core.mail import send_mail
from django.http import HttpResponse
from django.views.generic import TemplateView, View
from clowder_server.models import Ping
class APIView(CsrfExemptMixin, View):
def post(self, request):
name = request.POST.get('name')
... | Add quotes to order by | Add quotes to order by
| Python | agpl-3.0 | keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,framewr/clowder_server | ---
+++
@@ -28,5 +28,5 @@
template_name = "dashboard.html"
def get_context_data(self, **context):
- context['pings'] = Ping.objects.all().order_by(name)
+ context['pings'] = Ping.objects.all().order_by('name')
return context |
82c86350f62aefa3b732d5273216b0cb937758db | site/api/migrations/0009_load_pos_fixture_data.py | site/api/migrations/0009_load_pos_fixture_data.py | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.core.management import call_command
app_name = 'api'
fixture = model_name = 'PartOfSpeech'
def load_fixture(apps, schema_editor):
call_command('loaddata', fixture, app_label=app_name)
def unload_fixture(apps, schema_editor):
"Dele... | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.core.management import call_command
app_name = 'api'
fixture = model_name = 'PartOfSpeech'
def load_fixture(apps, schema_editor):
call_command('loaddata', fixture, app_label=app_name)
def unload_fixture(apps, schema_editor):
"Dele... | Fix bug in unload_fixture method | Fix bug in unload_fixture method | Python | mit | LitPalimpsest/parser-api-search,LitPalimpsest/parser-api-search,LitPalimpsest/parser-api-search | ---
+++
@@ -13,7 +13,7 @@
def unload_fixture(apps, schema_editor):
"Deleting all entries for this model"
- PartOfSpeech = apps.get_model(api, model_name)
+ PartOfSpeech = apps.get_model(app_name, model_name)
PartOfSpeech.objects.all().delete()
|
4979be89083fcdee5a9d4328ce6c9ac64d853b0b | src/satosa/logging_util.py | src/satosa/logging_util.py | from uuid import uuid4
# The state key for saving the session id in the state
LOGGER_STATE_KEY = "SESSION_ID"
LOG_FMT = "[{id}] {message}"
def get_session_id(state):
session_id = (
"UNKNOWN"
if state is None
else state.get(LOGGER_STATE_KEY, uuid4().urn)
)
return session_id
def ... | from uuid import uuid4
# The state key for saving the session id in the state
LOGGER_STATE_KEY = "SESSION_ID"
LOG_FMT = "[{id}] {message}"
def get_session_id(state):
session_id = (
"UNKNOWN"
if state is None
else state.get(LOGGER_STATE_KEY, uuid4().urn)
)
return session_id
def ... | Set the session-id in state | Set the session-id in state
This fixes the logger that kept getting a new uuid4 as a session-id for
each log call.
Signed-off-by: Ivan Kanakarakis <f60d6943d72436645c4304926eeeac2718a1142c@gmail.com>
| Python | apache-2.0 | SUNET/SATOSA,SUNET/SATOSA,its-dirg/SATOSA | ---
+++
@@ -30,6 +30,6 @@
:param state: The current state
:param kwargs: set exc_info=True to get an exception stack trace in the log
"""
- session_id = get_session_id(state)
+ state[LOGGER_STATE_KEY] = session_id = get_session_id(state)
logline = LOG_FMT.format(id=session_id, message=messag... |
734891812ded9339180dc59f0d6e500b3d415512 | hc2002/plugin/symbolic_values.py | hc2002/plugin/symbolic_values.py | import hc2002.plugin as plugin
import hc2002.config as config
plugin.register_for_resource(__name__, 'hc2002.resource.instance')
_prefixes = ('availability-zone:', 'image:', 'kernel:', 'key:',
'load-balancers:', 'ramdisk:', 'security-groups:', 'spot-price:',
'subnet:')
def apply(instance):
def re... | import hc2002.plugin as plugin
import hc2002.config as config
plugin.register_for_resource(__name__, 'hc2002.resource.instance')
_prefixes = ('availability-zone:', 'image:', 'kernel:', 'key:',
'load-balancers:', 'ramdisk:', 'security-groups:', 'spot-price:',
'subnet:', 'vpc:')
def apply(instance):
... | Allow symbolic values for vpc | Allow symbolic values for vpc
| Python | apache-2.0 | biochimia/hc2000 | ---
+++
@@ -5,7 +5,7 @@
_prefixes = ('availability-zone:', 'image:', 'kernel:', 'key:',
'load-balancers:', 'ramdisk:', 'security-groups:', 'spot-price:',
- 'subnet:')
+ 'subnet:', 'vpc:')
def apply(instance):
def resolve_symbol(original_value): |
2518dbc9dde39b58bf2a6d33975960059f39e3b0 | {{cookiecutter.repo_name}}/setup.py | {{cookiecutter.repo_name}}/setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='{{ cookiecutter.repo_name }}',
version="0.0.0",
url='https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name',
author="{{ cookiecutter.author_name }}",
author_email="{{ cookiecutter.email }}",
desc... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='{{ cookiecutter.repo_name }}',
version="0.0.0",
url='https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}',
author="{{ cookiecutter.author_name }}",
author_email="{{ cookiecutter.email }}",
d... | Fix issue with template rendering | Fix issue with template rendering
| Python | bsd-3-clause | elbaschid/cc-django-app,elbaschid/cc-django-app | ---
+++
@@ -4,7 +4,7 @@
setup(
name='{{ cookiecutter.repo_name }}',
version="0.0.0",
- url='https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name',
+ url='https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}',
author="{{ cookiecutter.author_name }}",... |
1947acc37d4f45a6b1969edfe3f7f10065e647b2 | src/layeredconfig/strategy.py | src/layeredconfig/strategy.py | # -*- coding: utf-8 -*-
def add(new, previous=None):
if previous is None:
return new
return previous + new
def collect(new, previous=None):
if previous is None:
return [new]
return previous + [new]
def merge(new, previous=None):
return add(new, previous)
| # -*- coding: utf-8 -*-
def add(next_, previous=None):
if previous is None:
return next_
return previous + next_
def collect(next_, previous=None):
if previous is None:
return [next_]
return previous + [next_]
def merge(next_, previous=None):
return add(next_, previous)
| Rename misleading new to next | Rename misleading new to next
| Python | bsd-3-clause | hakkeroid/lcconcept | ---
+++
@@ -1,16 +1,16 @@
# -*- coding: utf-8 -*-
-def add(new, previous=None):
+def add(next_, previous=None):
if previous is None:
- return new
- return previous + new
+ return next_
+ return previous + next_
-def collect(new, previous=None):
+def collect(next_, previous=None):
... |
bba433a582a96f5acd59eedb3286e284d81f431d | src/nodeconductor_openstack/tests/test_backend.py | src/nodeconductor_openstack/tests/test_backend.py | import mock
from rest_framework import test
class MockedSession(mock.MagicMock):
auth_ref = 'AUTH_REF'
class BaseBackendTestCase(test.APITransactionTestCase):
def setUp(self):
self.session_patcher = mock.patch('keystoneauth1.session.Session', MockedSession)
self.session_patcher.start()
... | import mock
from rest_framework import test
class MockedSession(mock.MagicMock):
auth_ref = 'AUTH_REF'
class BaseBackendTestCase(test.APITransactionTestCase):
def setUp(self):
self.session_patcher = mock.patch('keystoneauth1.session.Session', MockedSession)
self.session_patcher.start()
... | Stop patcher in tear down | Stop patcher in tear down
- itacloud-7198
| Python | mit | opennode/nodeconductor-openstack | ---
+++
@@ -26,6 +26,7 @@
def tearDown(self):
super(BaseBackendTestCase, self).tearDown()
self.session_patcher.stop()
+ self.session_recover_patcher.stop()
self.keystone_patcher.stop()
self.nova_patcher.stop()
self.cinder_patcher.stop() |
3b21631f8c0d3820359c1163e7e5340f153c3938 | twitter_bot.py | twitter_bot.py | # Import json parsing library
import json
# Import the necessary methods from "twitter" library
from twitter import Twitter, OAuth, TwitterHTTPError, TwitterStream
# Import "ConfigParser" library to load settings ("configparser" in python 3)
from ConfigParser import SafeConfigParser
# Load API variables from setting... | # Import json parsing library
import json
# Import the necessary methods from "twitter" library
from twitter import Twitter, OAuth, TwitterHTTPError, TwitterStream
# Import "ConfigParser" library to load settings ("configparser" in python 3)
from ConfigParser import SafeConfigParser
# Load API variables from setting... | Add initial tweet extraction / load query term from config file | Add initial tweet extraction / load query term from config file
| Python | mit | benhoyle/social-media-bot | ---
+++
@@ -17,6 +17,17 @@
# Initiate the connection to Twitter REST API
twitter = Twitter(auth=oauth)
-
+
+# Load query term from configuration file
+query_term = parser.get('query_settings','query_term')
+
# Search for latest tweets about query term
-print twitter.search.tweets(q='satan')
+# Twe... |
efbab142afc824f9b2ba4968ffe102c20e0ad7c3 | rpp/encoder.py | rpp/encoder.py | from uuid import UUID
from scanner import Symbol
def tostr(value):
if isinstance(value, Symbol):
return str(value)
elif isinstance(value, str):
return '"%s"' % value
elif isinstance(value, UUID):
return '{%s}' % value
elif value is None:
return '-'
else:
retu... | from uuid import UUID
from scanner import Symbol
def tostr(value):
if isinstance(value, Symbol):
return str(value)
elif isinstance(value, str):
return '"%s"' % value
elif isinstance(value, float):
return '%.14f' % value
elif isinstance(value, UUID):
return '{%s}' % str(v... | Correct representation of floats and uuids | Correct representation of floats and uuids
| Python | bsd-3-clause | Perlence/rpp | ---
+++
@@ -6,18 +6,22 @@
return str(value)
elif isinstance(value, str):
return '"%s"' % value
+ elif isinstance(value, float):
+ return '%.14f' % value
elif isinstance(value, UUID):
- return '{%s}' % value
+ return '{%s}' % str(value).upper()
elif value is Non... |
219afd2350d2b3aecd6362a1bd7a68291d3021e1 | tests/test_vendpageparser.py | tests/test_vendpageparser.py | import unittest
from vendcrawler.scripts.vendpageparser import VendPageParser
class TestVendPageParserMethods(unittest.TestCase):
def test_feed(self):
with open('test_vendcrawler.html', 'r') as f:
data = f.read()
vendpageparser = VendPageParser()
vendpageparser.feed(str(data))... | import unittest
from vendcrawler.scripts.vendpageparser import VendPageParser
class TestVendPageParserMethods(unittest.TestCase):
def test_feed(self):
with open('test_vendcrawler.html', 'r') as f:
data = f.read()
vendpageparser = VendPageParser()
vendpageparser.feed(str(data))... | Change vendor key to vendor_id. | Change vendor key to vendor_id.
| Python | mit | josetaas/vendcrawler,josetaas/vendcrawler,josetaas/vendcrawler | ---
+++
@@ -12,7 +12,7 @@
self.assertEqual(vendpageparser.items[0]['id'], '2221')
self.assertEqual(vendpageparser.items[1]['name'], 'Buckler [1]')
self.assertEqual(vendpageparser.items[3]['amount'], '12')
- self.assertEqual(vendpageparser.items[4]['vendor'], '186612')
+ self.a... |
fad97c21e2643e5df9759ebf260881b26e918d7c | api/api/views/hacker/get/csv/resume_links.py | api/api/views/hacker/get/csv/resume_links.py | """
Generates a CSV containing approved hackers' resumes
"""
from hackfsu_com.views.generic import StreamedCsvView
from hackfsu_com.util import acl, files
from django.conf import settings
from api.models import Hackathon, HackerInfo
class ResumeLinksCsv(StreamedCsvView):
access_manager = acl.AccessManager(ac... | """
Generates a CSV containing approved hackers' resumes
"""
from hackfsu_com.views.generic import StreamedCsvView
from hackfsu_com.util import acl, files
from django.conf import settings
from api.models import Hackathon, HackerInfo, UserInfo
class ResumeLinksCsv(StreamedCsvView):
access_manager = acl.Access... | Add Github+LinkedIn to Hacker Data export | Add Github+LinkedIn to Hacker Data export
| Python | apache-2.0 | andrewsosa/hackfsu_com,andrewsosa/hackfsu_com,andrewsosa/hackfsu_com,andrewsosa/hackfsu_com | ---
+++
@@ -5,7 +5,7 @@
from hackfsu_com.views.generic import StreamedCsvView
from hackfsu_com.util import acl, files
from django.conf import settings
-from api.models import Hackathon, HackerInfo
+from api.models import Hackathon, HackerInfo, UserInfo
class ResumeLinksCsv(StreamedCsvView):
@@ -21,6 +21,8 @@
... |
c23553f48652ed3ed65e473c79732dddc6c5341b | sample_code.py | sample_code.py | @commands.command
async def my_cmd():
await client.say('hi') | import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!test'):
counter = 0
tmp = aw... | Set sample code to discord.py basic example | Set sample code to discord.py basic example
| Python | mit | TheTrain2000/async2rewrite | ---
+++
@@ -1,3 +1,27 @@
-@commands.command
-async def my_cmd():
- await client.say('hi')
+import discord
+import asyncio
+
+client = discord.Client()
+
+@client.event
+async def on_ready():
+ print('Logged in as')
+ print(client.user.name)
+ print(client.user.id)
+ print('------')
+
+@client.event
+as... |
d63302f10bf9972680c189a25f995b713e72562f | demo/apps/catalogue/models.py | demo/apps/catalogue/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailcore.models import Page
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
class Category(Page):
"""
The Oscars Category as a Wagtai... | from django.db import models
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailcore.models import Page
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
class Category(Page):
"""
The Oscars Category as a Wagtai... | Set name field on save | Set name field on save
| Python | mit | pgovers/oscar-wagtail-demo,pgovers/oscar-wagtail-demo | ---
+++
@@ -21,9 +21,12 @@
)
content_panels = Page.content_panels + [
- FieldPanel('name', classname='full'),
FieldPanel('description', classname='full'),
ImageChooserPanel('image')
]
+ def save(self, *args, **kwargs):
+ self.name = self.title
+ super(Categ... |
6f1ece1571c0dafd386b27d8692433bf8b2180e7 | test/flask_ssl_skeleton_test.py | test/flask_ssl_skeleton_test.py | import unittest
import flask_ssl_skeleton
class SkeletonTestCase(unittest.TestCase):
def setUp(self):
self.app = flask_ssl_skeleton.app
self.app.secret_key = "Unit secret"
self.client = self.app.test_client()
def test_root_returns_form_when_not_logged_on(self):
rv = self.clie... | import unittest
import flask_ssl_skeleton
class SkeletonTestCase(unittest.TestCase):
def setUp(self):
self.app = flask_ssl_skeleton.app
self.app.secret_key = "Unit secret"
self.client = self.app.test_client()
def test_root_returns_form_when_not_logged_on(self):
rv = self.clie... | Fix unit test for redirecting unauthed user to index | Fix unit test for redirecting unauthed user to index
| Python | apache-2.0 | krujos/flask_ssl_skeleton | ---
+++
@@ -18,7 +18,6 @@
self.assertEqual(302, rv.status_code)
self.assertTrue(rv.headers['Location'].endswith('/'))
-
def test_root_redirects_when_logged_in(self):
rv = self.client.post('/', data=dict(username='admin', password='password'))
self.assertEquals(302, rv.status... |
50b6778ae43b8945b2073630e351ab759b007a3e | tests/social/youtube/test_tasks.py | tests/social/youtube/test_tasks.py | # -*- coding: utf-8 -*-
import pytest
from components.social.youtube.factories import ChannelFactory
from components.social.youtube.models import Video
from components.social.youtube.tasks import (fetch_all_videos,
fetch_latest_videos)
pytestmark = pytest.mark.django_db
def test_fetch_all_videos():
channel ... | # -*- coding: utf-8 -*-
import pytest
from components.social.youtube.factories import ChannelFactory
from components.social.youtube.models import Video
from components.social.youtube.tasks import (fetch_all_videos,
fetch_latest_videos)
pytestmark = pytest.mark.django_db
def test_fetch_all_videos():
channel ... | Switch to Jen's channel to (hopefully) make these tests faster. | Switch to Jen's channel to (hopefully) make these tests faster.
| Python | apache-2.0 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | ---
+++
@@ -10,7 +10,7 @@
def test_fetch_all_videos():
- channel = ChannelFactory(username='revyver')
+ channel = ChannelFactory(username='iceymoon')
fetch_all_videos(channel)
assert channel.videos.count() > 0
for video in channel.videos.all():
@@ -18,7 +18,7 @@
def test_fetch_latest_vi... |
6666351757c2c2083a88158a132f446112109b9d | tests/test_redshift/test_server.py | tests/test_redshift/test_server.py | from __future__ import unicode_literals
import json
import sure # noqa
import moto.server as server
from moto import mock_redshift
'''
Test the different server responses
'''
@mock_redshift
def test_describe_clusters():
backend = server.create_backend_app("redshift")
test_client = backend.test_client()
... | from __future__ import unicode_literals
import json
import sure # noqa
import moto.server as server
from moto import mock_redshift
'''
Test the different server responses
'''
@mock_redshift
def test_describe_clusters():
backend = server.create_backend_app("redshift")
test_client = backend.test_client()
... | Fix redshift server to default to xml. | Fix redshift server to default to xml.
| Python | apache-2.0 | heddle317/moto,kefo/moto,botify-labs/moto,kefo/moto,Affirm/moto,ZuluPro/moto,Affirm/moto,Brett55/moto,2rs2ts/moto,dbfr3qs/moto,dbfr3qs/moto,okomestudio/moto,heddle317/moto,heddle317/moto,ZuluPro/moto,okomestudio/moto,botify-labs/moto,whummer/moto,william-richard/moto,gjtempleton/moto,dbfr3qs/moto,heddle317/moto,rocky45... | ---
+++
@@ -18,7 +18,5 @@
res = test_client.get('/?Action=DescribeClusters')
- json_data = json.loads(res.data.decode("utf-8"))
- clusters = json_data['DescribeClustersResponse'][
- 'DescribeClustersResult']['Clusters']
- list(clusters).should.equal([])
+ result = res.data.decode("utf-8")
... |
f7059eb02ee93bdd0f998acde385a04ac91c63df | sparrow.py | sparrow.py | #!/usr/bin/env python
from ConfigParser import SafeConfigParser
from twython import Twython
#These values are all pulled from a file called 'config.ini'
#You can call yours myawesomebotconfig.ini or whatever else!
#Just remember to change it here
config_file_name = 'config.ini'
#SECURE YOUR CONFIG FILE - Don't put ... | #!/usr/bin/env python
import json
from twython import Twython
#These values are all pulled from a file called 'config.ini'
#You can call yours myawesomebotconfig.ini or whatever else!
#Just remember to change it here
with open('creds.json') as f:
credentials = json.loads(f.read())
#SECURE YOUR CONFIG FILE - Don'... | Update method of loading creds | Update method of loading creds
Changed the way of loading credentials from config.ini file to a json credentials file. | Python | mit | fmcorey/sparrow,fmcorey/sparrow | ---
+++
@@ -1,26 +1,20 @@
#!/usr/bin/env python
-
-from ConfigParser import SafeConfigParser
+import json
from twython import Twython
#These values are all pulled from a file called 'config.ini'
#You can call yours myawesomebotconfig.ini or whatever else!
#Just remember to change it here
-config_file_name = ... |
c5d656cff3e7ac218cc41805dfb8c19f63cd4250 | run_server.py | run_server.py | #!/usr/bin/env python3
from shorter.web import app
if __name__ == "__main__":
app.run()
| #!/usr/bin/env python3
from shorter.database import (
User,
db_session,
)
from shorter.web import app
if __name__ == "__main__":
# makes testing easier
test_user_created = db_session.query(User).filter_by(
username='jimmy').one_or_none()
if not test_user_created:
db_session.add(
... | Create a testing user on starting the server | Create a testing user on starting the server
| Python | agpl-3.0 | mapleoin/shorter | ---
+++
@@ -1,6 +1,18 @@
#!/usr/bin/env python3
+from shorter.database import (
+ User,
+ db_session,
+)
from shorter.web import app
if __name__ == "__main__":
+ # makes testing easier
+ test_user_created = db_session.query(User).filter_by(
+ username='jimmy').one_or_none()
+ if not test_... |
393f65b78e5808c9d71b38a108cb85f6d31886c1 | helpers/text.py | helpers/text.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag(self, tag):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from html.parser import HTMLParser
class HTMLStripper(HTMLParser):
def __init__(self):
super(HTMLStripper, self).__init__()
self.reset()
self.fed = []
def handle_starttag(self, tag, attrs):
pass
def handle_endtag(self, tag):
... | Rename function from urlify to slugify | Rename function from urlify to slugify
| Python | mit | finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is | ---
+++
@@ -23,7 +23,7 @@
def get_data(self):
return ''.join(self.fed)
-def urlify(string):
+def slugify(string):
string = string.replace('æ', 'ae').replace('ð','d').replace('þ','th')
return unicodedata.normalize('NFKD', string)\
.lower().replace(' ', '-').encode('ascii', 'ignore') |
108c696d032462ac3cdc00e45ead09136e80634a | tests/foomodulegen-auto.py | tests/foomodulegen-auto.py | #! /usr/bin/env python
import sys
import re
import pybindgen
from pybindgen.typehandlers import base as typehandlers
from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink)
from pybindgen import (CppMethod, CppConstructor, CppClass, Enum)
from pybindgen.gccxmlparser import ModuleParser
from pyb... | #! /usr/bin/env python
import sys
import re
import pybindgen
from pybindgen.typehandlers import base as typehandlers
from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink)
from pybindgen import (CppMethod, CppConstructor, CppClass, Enum)
from pybindgen.gccxmlparser import ModuleParser
from pyb... | Add a debug switch (-d) to enable debugger | Add a debug switch (-d) to enable debugger | Python | lgpl-2.1 | gjcarneiro/pybindgen,cawka/pybindgen-old,ftalbrecht/pybindgen,gjcarneiro/pybindgen,cawka/pybindgen-old,ftalbrecht/pybindgen,gjcarneiro/pybindgen,ftalbrecht/pybindgen,cawka/pybindgen-old,gjcarneiro/pybindgen,ftalbrecht/pybindgen,cawka/pybindgen-old | ---
+++
@@ -25,12 +25,21 @@
module.generate(out)
-if __name__ == '__main__':
- try:
- import cProfile as profile
- except ImportError:
+def main():
+ if sys.argv[1] == '-d':
+ del sys.argv[1]
+ import pdb
+ pdb.set_trace()
my_module_gen()
else:
- prin... |
c7f0534554236b7336cfb79b2ec2badb6780706e | bucketeer/test/test_commit.py | bucketeer/test/test_commit.py | import unittest, boto, os
from bucketeer import commit
class BuckeeterTest(unittest.TestCase):
# Constants - TODO move to config file
global existing_bucket, test_dir, test_file
existing_bucket = 'bucket.exists'
test_dir = 'bucketeer_test_dir'
test_file = 'bucketeer_test_file'
def setUp(self):
connec... | import unittest, boto, os
from bucketeer import commit
class BuckeeterTest(unittest.TestCase):
# Constants - TODO move to config file
global existing_bucket, test_dir, test_file
existing_bucket = 'bucket.exists'
test_dir = 'bucketeer_test_dir'
test_file = 'bucketeer_test_file'
def setUp(self):
connec... | Add suppression of tested code stdout in tests | Add suppression of tested code stdout in tests
Add `buffer = True` option to unittest main method call, which
suppresses any printing the code being tested has. This makes for
cleaner test suite output.
| Python | mit | mgarbacz/bucketeer | ---
+++
@@ -50,4 +50,4 @@
self.assertTrue(result)
if __name__ == '__main__':
- unittest.main()
+ unittest.main(buffer = True) |
aaafd23df800d41e4b16fd399015991b2e426dc5 | tests/setup.py | tests/setup.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Advance system test ducktape dependency from 0.3.10 to 0.4.0 | MINOR: Advance system test ducktape dependency from 0.3.10 to 0.4.0
Previous version of ducktape was found to have a memory leak which caused occasional failures in nightly runs.
Author: Geoff Anderson <geoff@confluent.io>
Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>
Closes #1165 from granders/minor-advance... | Python | apache-2.0 | gf53520/kafka,MyPureCloud/kafka,geeag/kafka,lindong28/kafka,geeag/kafka,Ishiihara/kafka,Ishiihara/kafka,lindong28/kafka,rhauch/kafka,geeag/kafka,noslowerdna/kafka,rhauch/kafka,MyPureCloud/kafka,mihbor/kafka,airbnb/kafka,eribeiro/kafka,eribeiro/kafka,mihbor/kafka,Esquive/kafka,airbnb/kafka,guozhangwang/kafka,apache/kafk... | ---
+++
@@ -30,5 +30,5 @@
license="apache2.0",
packages=find_packages(),
include_package_data=True,
- install_requires=["ducktape==0.3.10", "requests>=2.5.0"]
+ install_requires=["ducktape==0.4.0", "requests>=2.5.0"]
) |
e50a3078c4feb8222e0f3b35ad19e9e9585d7ebd | sc2/bot_ai.py | sc2/bot_ai.py | from functools import partial
from .data import ActionResult
class BotAI(object):
def _prepare_start(self, client, game_info, game_data):
self._client = client
self._game_info = game_info
self._game_data = game_data
self.do = partial(self._client.actions, game_data=game_data)
... | from functools import partial
from .data import ActionResult
class BotAI(object):
def _prepare_start(self, client, game_info, game_data):
self._client = client
self._game_info = game_info
self._game_data = game_data
self.do = partial(self._client.actions, game_data=game_data)
... | Prepare with vespenen gas count too | Prepare with vespenen gas count too
| Python | mit | Dentosal/python-sc2 | ---
+++
@@ -31,7 +31,7 @@
def _prepare_step(self, state):
self.units = state.units.owned
self.minerals = state.common.minerals
- self.vespnene = state.common.vespene
+ self.vespene = state.common.vespene
def on_start(self):
pass |
fa936770448e896211b592b742eee350633804e7 | server/app.py | server/app.py | from flask import Flask, request
from werkzeug import secure_filename
import os
app = Flask(__name__)
UPLOAD_FOLDER = 'uploads/'
@app.route("/")
def hello():
return "Hello World!"
@app.route("/upload", methods=['POST'])
def upload_file():
file = request.files['sound']
print file.filename
if file:
... | from flask import Flask, request
from werkzeug import secure_filename
import os
app = Flask(__name__)
UPLOAD_FOLDER = 'uploads/'
@app.route("/")
def hello():
return "Hello World!"
@app.route("/upload", methods=['POST'])
def upload_file():
file = request.files['sound']
if file:
if not os.path.isdir... | Check if uploads folder exists | Check if uploads folder exists
| Python | mit | spb201/turbulent-octo-rutabaga-api,spb201/turbulent-octo-rutabaga-api,spb201/turbulent-octo-rutabaga-api | ---
+++
@@ -11,8 +11,9 @@
@app.route("/upload", methods=['POST'])
def upload_file():
file = request.files['sound']
- print file.filename
if file:
+ if not os.path.isdir(UPLOAD_FOLDER):
+ os.mkdir(UPLOAD_FOLDER)
filename = secure_filename(file.filename)
file.save(os.p... |
209a0c8ab878d9f455d117314b8945cfdd367857 | test/scripts/run_all_tests.py | test/scripts/run_all_tests.py | """Runs the PyExtTest project against all installed python instances."""
import sys, subprocess, python_installations
if __name__ == '__main__':
num_failed_tests = 0
for installation in python_installations.get_python_installations():
# Only test against official CPython installations.
if insta... | """Runs the PyExtTest project against all installed python instances."""
import sys, subprocess, python_installations
if __name__ == '__main__':
num_failed_tests = 0
for installation in python_installations.get_python_installations():
# Skip versions with no executable.
if installation.exec_pa... | Make the test runner more resilient to weird registry configurations. | Make the test runner more resilient to weird registry configurations.
| Python | mit | SeanCline/PyExt,SeanCline/PyExt,SeanCline/PyExt | ---
+++
@@ -4,17 +4,22 @@
if __name__ == '__main__':
num_failed_tests = 0
for installation in python_installations.get_python_installations():
+ # Skip versions with no executable.
+ if installation.exec_path == None:
+ print("Skipping (no executable)", installation, end="\n\n", f... |
4387a8a38664abe86f0ff9d531ab3ba937f9adf7 | tests/unit/test_main_views.py | tests/unit/test_main_views.py | import pytest
from flask import url_for
from pytest_flask import fixtures
from mdt_app.models import *
@pytest.mark.usefixtures('client_class')
class TestIndex:
def test_page_load(self):
assert self.client.get(url_for('main.index')).status_code == 200
@pytest.mark.usefixtures('client_class')
class Test... | import pytest
from flask import url_for
from pytest_flask import fixtures
from mdt_app.models import *
@pytest.mark.usefixtures('client_class')
class TestIndex:
def test_page_load(self):
assert self.client.get(url_for('main.index')).status_code == 200
@pytest.mark.usefixtures('client_class')
class Test... | Add Unit tests for views | Add Unit tests for views
| Python | mit | stefpiatek/mdt-flask-app,stefpiatek/mdt-flask-app | ---
+++
@@ -13,18 +13,26 @@
@pytest.mark.usefixtures('client_class')
class TestCaseCreate:
+ def test_setup(self, db_session):
+ patient1 = Patient(id=1, hospital_number=12345678,
+ first_name='test1', last_name='patient',
+ date_of_birth='1988-10-09',... |
a7a1d513003a65c5c9772ba75631247decff444d | utils/utils.py | utils/utils.py | from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.contrib.syndication.views import add_domain
from django.contrib.sites.models import get_current_site
def get_site_url(request, path):
current_site = get_current_site(request)
return add_domain(current_site.domain, path, request.i... | from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.contrib.syndication.views import add_domain
from django.contrib.sites.models import get_current_site
def get_site_url(request, path):
"""Retrieve current site site
Always returns as http (never https)
"""
current_site = g... | Make site url be http, not https | Make site url be http, not https
| Python | bsd-3-clause | uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam | ---
+++
@@ -4,9 +4,14 @@
def get_site_url(request, path):
+ """Retrieve current site site
+ Always returns as http (never https)
+ """
current_site = get_current_site(request)
- return add_domain(current_site.domain, path, request.is_secure())
+ site_url = add_domain(current_site.domain, pa... |
bf82a1437d89f82d417b72cca6274dc35ac7d147 | example/urls.py | example/urls.py | from django.conf import settings
from django.conf.urls import static
from django.contrib import admin
from django.urls import path
admin.autodiscover()
urlpatterns = [
path('admin/', admin.site.urls),
]
urlpatterns += static.static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
| from django.conf import settings
from django.conf.urls import static
from django.contrib import admin
from django.urls import path
admin.autodiscover()
urlpatterns = [
path("admin/", admin.site.urls),
]
urlpatterns += static.static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
| Fix correction to comply with black | Fix correction to comply with black
| Python | bsd-3-clause | jonasundderwolf/django-localizedfields,jonasundderwolf/django-localizedfields | ---
+++
@@ -6,6 +6,6 @@
admin.autodiscover()
urlpatterns = [
- path('admin/', admin.site.urls),
+ path("admin/", admin.site.urls),
]
urlpatterns += static.static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
6d635a94121a9038c7c5b80b9851a086e69728b6 | scripts/wiggle_to_binned_array.py | scripts/wiggle_to_binned_array.py | #!/usr/bin/env python
"""
usage: %prog score_file out_file
"""
from __future__ import division
import sys
import psyco_full
import bx.wiggle
from bx.binned_array import BinnedArray
from fpconst import isNaN
import cookbook.doc_optparse
import misc
def read_scores( f ):
scores_by_chrom = dict()
return score... | #!/usr/bin/env python
"""
usage: %prog score_file out_file
-c, --comp=type: compression type (none, zlib, lzo)
"""
from __future__ import division
import sys
import psyco_full
import bx.wiggle
from bx.binned_array import BinnedArray
from fpconst import isNaN
import cookbook.doc_optparse
import misc
def main():
... | Allow specifying compression type on command line. | Allow specifying compression type on command line.
| Python | mit | uhjish/bx-python,uhjish/bx-python,uhjish/bx-python | ---
+++
@@ -2,6 +2,7 @@
"""
usage: %prog score_file out_file
+ -c, --comp=type: compression type (none, zlib, lzo)
"""
from __future__ import division
@@ -14,22 +15,22 @@
import cookbook.doc_optparse
import misc
-def read_scores( f ):
- scores_by_chrom = dict()
-
- return scores_by_chrom
-
def m... |
c3958b4aa7aca75f00f4de20e612f918a176ec96 | extraction/api/validation.py | extraction/api/validation.py | from yapsy import IPlugin
from postprocessing import PostProcessedDataItem
__author__ = 'aj@springlab.co'
class ValidatedDataItem(PostProcessedDataItem):
"""
Overrides the PostProcessedDataItem class to provide an indication that a
PostProcessedDataItem instance has undergone validation
"""
def _... | from yapsy import IPlugin
from postprocessing import PostProcessedDataItem
__author__ = 'aj@springlab.co'
class ValidatedDataItem(PostProcessedDataItem):
"""
Overrides the PostProcessedDataItem class to provide an indication that a
PostProcessedDataItem instance has undergone validation
"""
def _... | Set default state of ValidatedDateItem to valid. | Set default state of ValidatedDateItem to valid.
| Python | mit | slventures/jormungand | ---
+++
@@ -10,7 +10,7 @@
PostProcessedDataItem instance has undergone validation
"""
def __init__(self, seq=None, **kwargs):
- self.valid = False
+ self.valid = True
super(ValidatedDataItem, self).__init__(seq, **kwargs)
|
93550cafa9ea38b663166cd5b1ae1fcf0e42f1d0 | ukechord.py | ukechord.py | #!/usr/bin/python2
"""Generate Ukulele song sheets with chords.
Input files are in ChordPro-ish format, output files in PDF format.
"""
import argparse
import sys
from reportlab.lib import pagesizes
import chordpro
import pdfwriter
def _parse_options(args):
"""Return (options, args)."""
parser = argparse.Argu... | #!/usr/bin/python2
"""Generate Ukulele song sheets with chords.
Input files are in ChordPro-ish format, output files in PDF format.
"""
import argparse
import sys
from reportlab.lib import pagesizes
import chordpro
import pdfwriter
def _parse_options(args):
"""Return (options, args)."""
parser = argparse.Argu... | Work around issue writing to sys.stdout in binary mode (Python3). | Work around issue writing to sys.stdout in binary mode (Python3).
For details, see:
https://mail.python.org/pipermail/stdlib-sig/2012-June/000953.html
| Python | apache-2.0 | gnoack/ukechord,gnoack/ukechord | ---
+++
@@ -32,6 +32,10 @@
args = _parse_options(args)
with args.outfile as outfile:
+ if outfile == sys.stdout:
+ # TODO: This is a terrible hack to use sys.stdout in binary mode.
+ outfile = getattr(outfile, 'buffer', outfile)
+
with args.infile as infile:
pdf_writer = pdfwriter.Pdf... |
dc981dbd1b29d9586453f325f99b1c413c494800 | account/managers.py | account/managers.py | from __future__ import unicode_literals
from django.db import models
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
email_address = self.create(user=user, email=email, **kwargs)
if confirm and not email_addres... | from __future__ import unicode_literals
from django.db import models
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
email_address, __ = self.get_or_create(user=user, email=email, default=kwargs)
if confirm and... | Use get_or_create instead of just create | Use get_or_create instead of just create
| Python | mit | gem/geonode-user-accounts,gem/geonode-user-accounts,gem/geonode-user-accounts | ---
+++
@@ -7,7 +7,7 @@
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
- email_address = self.create(user=user, email=email, **kwargs)
+ email_address, __ = self.get_or_create(user=user, email=email, default=kwargs)
if confirm and not email_ad... |
80df385acb9f39d0a5f01dc41954b7035ecafb2d | upnp_inspector/__init__.py | upnp_inspector/__init__.py | # -*- coding: utf-8 -*-
__version_info__ = (0, 2, 3)
__version__ = '%d.%d.%d' % __version_info__[:3]
| # -*- coding: utf-8 -*-
__version__ = "0.3.dev0"
| Switch to PEP 440 compliant version string and update to 0.3.dev0. | Switch to PEP 440 compliant version string and update to 0.3.dev0.
Update to 0.3.dev0 since this is the version already stated in the
NEWS file.
| Python | mit | coherence-project/UPnP-Inspector | ---
+++
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
-__version_info__ = (0, 2, 3)
-__version__ = '%d.%d.%d' % __version_info__[:3]
+__version__ = "0.3.dev0" |
16c1352ecf8583615e482c431ec5183fdb718f67 | split_file.py | split_file.py | from strip_comments import strip_comments
import re
__all__ = ["split_coq_file_contents"]
def split_coq_file_contents(contents):
"""Splits the contents of a coq file into multiple statements.
This is done by finding one or three periods followed by
whitespace. This is a dumb algorithm, but it seems to b... | from strip_comments import strip_comments
import re
__all__ = ["split_coq_file_contents"]
def merge_quotations(statements):
"""If there are an odd number of "s in a statement, assume that we
broke the middle of a string. We recombine that string."""
cur = None
for i in statements:
if i.count... | Make splitting more robust to periods in strings | Make splitting more robust to periods in strings
| Python | mit | JasonGross/coq-tools,JasonGross/coq-tools | ---
+++
@@ -2,11 +2,30 @@
import re
__all__ = ["split_coq_file_contents"]
+
+def merge_quotations(statements):
+ """If there are an odd number of "s in a statement, assume that we
+ broke the middle of a string. We recombine that string."""
+
+ cur = None
+ for i in statements:
+ if i.count('"... |
5f49fb8c7c0f9e7a05d4f9b730d7f3e872229d60 | test/completion/definition.py | test/completion/definition.py | """
Fallback to callee definition when definition not found.
- https://github.com/davidhalter/jedi/issues/131
- https://github.com/davidhalter/jedi/pull/149
"""
#? isinstance
isinstance(
)
#? isinstance
isinstance(None,
)
#? isinstance
isinstance(None,
)
| """
Fallback to callee definition when definition not found.
- https://github.com/davidhalter/jedi/issues/131
- https://github.com/davidhalter/jedi/pull/149
"""
#? isinstance
isinstance(
)
#? isinstance
isinstance(None,
)
#? isinstance
isinstance(None,
)
# Note: len('isinstance(') == 11
#? 11 isinstance
isinstance... | Add blackbox tests using column number | Add blackbox tests using column number
| Python | mit | flurischt/jedi,WoLpH/jedi,mfussenegger/jedi,dwillmer/jedi,tjwei/jedi,jonashaag/jedi,jonashaag/jedi,tjwei/jedi,flurischt/jedi,dwillmer/jedi,mfussenegger/jedi,WoLpH/jedi | ---
+++
@@ -15,3 +15,23 @@
#? isinstance
isinstance(None,
)
+
+# Note: len('isinstance(') == 11
+#? 11 isinstance
+isinstance()
+
+# Note: len('isinstance(None,') == 16
+##? 16 isinstance
+isinstance(None,)
+
+# Note: len('isinstance(None,') == 16
+##? 16 isinstance
+isinstance(None, )
+
+# Note: len('isinstance(... |
192e24cdafff2bb780ef9cc87853c48e9e41cb4a | stationspinner/accounting/management/commands/characters.py | stationspinner/accounting/management/commands/characters.py | from django.core.management.base import BaseCommand, CommandError
from stationspinner.character.models import CharacterSheet
class Command(BaseCommand):
help = 'Lists all enabled characterIDs with their APIKey PKs. Handy for sending tasks'
def handle(self, *args, **options):
characters = CharacterShee... | from django.core.management.base import BaseCommand, CommandError
from stationspinner.character.models import CharacterSheet
class Command(BaseCommand):
help = 'Lists all enabled characterIDs with their APIKey PKs. Handy for sending tasks'
def handle(self, *args, **options):
characters = CharacterShee... | Simplify the output for copypaste | Simplify the output for copypaste
| Python | agpl-3.0 | kriberg/stationspinner,kriberg/stationspinner | ---
+++
@@ -7,4 +7,6 @@
def handle(self, *args, **options):
characters = CharacterSheet.objects.filter(enabled=True)
for char in characters:
- self.stdout.write('CharacterID\t\t {0} APIKey\t\t {1}'.format(char.pk, char.owner_key.pk))
+ self.stdout.write('{0}\t\tCharacterID... |
e0de6546fb58af113d18cf7e836407e3f8a1a985 | contrib/bosco/bosco-cluster-remote-hosts.py | contrib/bosco/bosco-cluster-remote-hosts.py | #!/usr/bin/python3
import os
import subprocess
import sys
try:
import classad
import htcondor
except ImportError:
sys.exit("ERROR: Could not load HTCondor Python bindings. "
"Ensure the 'htcondor' and 'classad' are in PYTHONPATH")
jre = classad.parseAds('JOB_ROUTER_ENTRIES')
grs = ( x[... | #!/usr/bin/python3
import os
import subprocess
import sys
try:
import classad
except ImportError:
sys.exit("ERROR: Could not load HTCondor Python bindings. "
"Ensure the 'htcondor' and 'classad' are in PYTHONPATH")
jre = classad.parseAds('JOB_ROUTER_ENTRIES')
grs = ( x["GridResource"] for ... | Delete unused import htcondor (SOFTWARE-4687) | Delete unused import htcondor (SOFTWARE-4687)
| Python | apache-2.0 | brianhlin/htcondor-ce,matyasselmeci/htcondor-ce,matyasselmeci/htcondor-ce,brianhlin/htcondor-ce,matyasselmeci/htcondor-ce,brianhlin/htcondor-ce | ---
+++
@@ -6,7 +6,6 @@
try:
import classad
- import htcondor
except ImportError:
sys.exit("ERROR: Could not load HTCondor Python bindings. "
"Ensure the 'htcondor' and 'classad' are in PYTHONPATH") |
ded6f27721e54f2c7dab3016209927678d85b90d | aldryn_faq/forms.py | aldryn_faq/forms.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from parler.forms import TranslatableModelForm
from sortedm2m.forms import SortedMultipleChoiceField
from .models import Category, QuestionListPlugin, Question
class CategoryAdminForm(TranslatableModelForm):
class Meta:... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from parler.forms import TranslatableModelForm
from sortedm2m.forms import SortedMultipleChoiceField
from .models import Category, QuestionListPlugin, Question
class CategoryAdminForm(TranslatableModelForm):
class Meta:... | Remove no longer used code | Remove no longer used code
| Python | bsd-3-clause | czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq | ---
+++
@@ -16,20 +16,20 @@
class Meta:
model = Category
- def clean_slug(self):
- slug = self.cleaned_data['slug']
- translations_model = Category._meta.translations_model
- categories_with_slug = translations_model.objects.filter(slug=slug)
+ # def clean_slug(self):
+ #... |
db134f36ae54ef135037d0c912068fc678df54cf | examples/controllers.py | examples/controllers.py | #!/usr/bin/python
"""
Create a network where different switches are connected to
different controllers, by creating a custom Switch() subclass.
"""
from mininet.net import Mininet
from mininet.node import OVSSwitch, Controller, RemoteController
from mininet.topolib import TreeTopo
from mininet.log import setLogLevel
... | #!/usr/bin/python
"""
Create a network where different switches are connected to
different controllers, by creating a custom Switch() subclass.
"""
from mininet.net import Mininet
from mininet.node import OVSSwitch, Controller, RemoteController
from mininet.topolib import TreeTopo
from mininet.log import setLogLevel
... | Allow RemoteController to connect to correct port. | Allow RemoteController to connect to correct port.
Fixes #584
| Python | bsd-3-clause | mininet/mininet,mininet/mininet,mininet/mininet | ---
+++
@@ -17,7 +17,7 @@
# Ignore the warning message that the remote isn't (yet) running
c0 = Controller( 'c0', port=6633 )
c1 = Controller( 'c1', port=6634 )
-c2 = RemoteController( 'c2', ip='127.0.0.1' )
+c2 = RemoteController( 'c2', ip='127.0.0.1', port=6633 )
cmap = { 's1': c0, 's2': c1, 's3': c2 }
|
d9db4735a1c879e967af5fff30c8322ea3f5121a | hackfmi/urls.py | hackfmi/urls.py | from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from members import views
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', views.homepage, name='homepage'),
# Examples:
# ... | from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from members import views
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', views.homepage, name='homepage'),
# Examples:
# ... | Add url for searching user by name | Add url for searching user by name
| Python | mit | Hackfmi/Diaphanum,Hackfmi/Diaphanum | ---
+++
@@ -20,6 +20,7 @@
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
+ url(r'^search/(?P<name>\w+)/$', 'members.views.search', name='search'),
url(r'^protocols/add/$', 'protocols.views.add', name='add-protocol'),
url(r'^projects/add/$', 'projects... |
9dab9c08c57ab0548beaa32765a2f064d2ec6544 | tests/app/test_application.py | tests/app/test_application.py | """
Tests for the application infrastructure
"""
from flask import json
from nose.tools import assert_equal
from .helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def test_index(self):
response = self.client.get('/')
assert 200 == response.status_code
assert ... | """
Tests for the application infrastructure
"""
import mock
import pytest
from flask import json
from elasticsearch.exceptions import ConnectionError
from nose.tools import assert_equal
from .helpers import BaseApplicationTest
class TestApplication(BaseApplicationTest):
def test_index(self):
response =... | Add a test to indicate/ ensure that flask is performing retries … | Add a test to indicate/ ensure that flask is performing retries …
The retry functionality is buried in the elasticsearch.transport.Transport class and
can be effected by passing max_retries to the elasticsearch.client.ElasticSearch object
(https://github.com/elastic/elasticsearch-py/blob/master/elasticsearch/client/_... | Python | mit | alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api | ---
+++
@@ -1,7 +1,11 @@
"""
Tests for the application infrastructure
"""
+import mock
+import pytest
+
from flask import json
+from elasticsearch.exceptions import ConnectionError
from nose.tools import assert_equal
from .helpers import BaseApplicationTest
@@ -33,3 +37,14 @@
def test_ttl_is_not_set(self... |
a2b4b732c15c3cfefb345354bca8fc6de47d4820 | appengine_config.py | appengine_config.py | """`appengine_config` gets loaded when starting a new application instance."""
import vendor
# insert `lib` as a site directory so our `main` module can load
# third-party libraries, and override built-ins with newer
# versions.
vendor.add('lib') | """`appengine_config` gets loaded when starting a new application instance."""
import vendor
# insert `lib` as a site directory so our `main` module can load
# third-party libraries, and override built-ins with newer
# versions.
vendor.add('lib')
import os
# Called only if the current namespace is not set.
def namespa... | Enable NDB Shared memory namespace partioning using engine Version ID | Enable NDB Shared memory namespace partioning using engine Version ID
| Python | apache-2.0 | dbs/schemaorg,vholland/schemaorg,schemaorg/schemaorg,vholland/schemaorg,tfrancart/schemaorg,schemaorg/schemaorg,unor/schemaorg,schemaorg/schemaorg,dbs/schemaorg,vholland/schemaorg,dbs/schemaorg,tfrancart/schemaorg,tfrancart/schemaorg,vholland/schemaorg,schemaorg/schemaorg,dbs/schemaorg,tfrancart/schemaorg,unor/schemaor... | ---
+++
@@ -4,3 +4,12 @@
# third-party libraries, and override built-ins with newer
# versions.
vendor.add('lib')
+
+import os
+# Called only if the current namespace is not set.
+def namespace_manager_default_namespace_for_request():
+ # The returned string will be used as the Google Apps domain.
+ applicat... |
ed6146566d57105af88855c6b8668b4f76e98dbf | xmanager/xm_local/__init__.py | xmanager/xm_local/__init__.py | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | Make `DockerOptions` part of the `xm_local` module | Make `DockerOptions` part of the `xm_local` module
PiperOrigin-RevId: 376139511
Change-Id: Ia0ec1337b9ef2c175dea6b0c45e0a99b285d2b31
GitOrigin-RevId: 799d3ef6a98a6e4922b0b60c190c0d82cd538548
| Python | apache-2.0 | deepmind/xmanager,deepmind/xmanager | ---
+++
@@ -14,9 +14,6 @@
"""Implementation of the XManager Launch API within the local scheduler."""
from xmanager.xm_local import experiment
-from xmanager.xm_local.executors import Caip
-from xmanager.xm_local.executors import Kubernetes
-from xmanager.xm_local.executors import Local
-from xmanager.xm_local.ex... |
55bc355fc97eb5e034e86e7c55919d8cca0edb2b | feincms/context_processors.py | feincms/context_processors.py | from feincms.module.page.models import Page
def add_page_if_missing(request):
"""
If this attribute exists, then a page object has been registered already
by some other part of the code. We let it decide which page object it
wants to pass into the template
"""
if hasattr(request, '_feincms_pa... | from feincms.module.page.models import Page
def add_page_if_missing(request):
"""
If this attribute exists, then a page object has been registered already
by some other part of the code. We let it decide which page object it
wants to pass into the template
"""
if hasattr(request, '_feincms_pa... | Remove deprecated appcontent_parameters context processor | Remove deprecated appcontent_parameters context processor
It did nothing for some time anyway.
| Python | bsd-3-clause | matthiask/feincms2-content,mjl/feincms,feincms/feincms,joshuajonah/feincms,matthiask/feincms2-content,matthiask/feincms2-content,joshuajonah/feincms,matthiask/django-content-editor,michaelkuty/feincms,pjdelport/feincms,nickburlett/feincms,michaelkuty/feincms,michaelkuty/feincms,feincms/feincms,feincms/feincms,matthiask... | ---
+++
@@ -17,8 +17,3 @@
}
except Page.DoesNotExist:
return {}
-
-
-def appcontent_parameters(request):
- # Remove in FeinCMS 1.4.
- return {} |
e96c1e6fc5cc64ccc9e8ba8c91285ce4feb90a7c | workflow-RNA-Seq_Salmon.py | workflow-RNA-Seq_Salmon.py | #!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import pipeline
from ddb_ngsflow.rna import salmon
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_a... | #!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import pipeline
from ddb_ngsflow.rna import salmon
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_a... | Update script for explicit call to EM algorithm optimization | Update script for explicit call to EM algorithm optimization
| Python | mit | dgaston/ddb-ngsflow-scripts,GastonLab/ddb-scripts,dgaston/ddb-scripts | ---
+++
@@ -33,7 +33,7 @@
# Per sample jobs
for sample in samples:
# Alignment and Refinement Stages
- align_job = Job.wrapJobFn(salmon.salmon_paired, config, sample, samples,
+ align_job = Job.wrapJobFn(salmon.salmonEM_paired, config, sample, samples,
... |
3170407aaaeffbc76e31e5fc78d4dacd008e27d2 | backbone_calendar/ajax/mixins.py | backbone_calendar/ajax/mixins.py | from django import http
from django.utils import simplejson as json
class JSONResponseMixin(object):
context_variable = 'object_list'
def render_to_response(self, context):
"Returns a JSON response containing 'context' as payload"
return self.get_json_response(self.convert_context_to_json(con... | import json
from django import http
class JSONResponseMixin(object):
context_variable = 'object_list'
def render_to_response(self, context):
"Returns a JSON response containing 'context' as payload"
return self.get_json_response(self.convert_context_to_json(context))
def dispatch(self, ... | Use json and not simplejson | Use json and not simplejson
| Python | agpl-3.0 | rezometz/django-backbone-calendar,rezometz/django-backbone-calendar,rezometz/django-backbone-calendar | ---
+++
@@ -1,5 +1,6 @@
+import json
+
from django import http
-from django.utils import simplejson as json
class JSONResponseMixin(object): |
52fddb061bf5f282da75df4462dd735d9fdc041a | sgfs/actions/create_structure.py | sgfs/actions/create_structure.py | from sgfs import SGFS
from sgactions.utils import notify
def run_create(**kwargs):
_run(False, **kwargs)
def run_preview(**kwargs):
_run(True, **kwargs)
def _run(dry_run, entity_type, selected_ids, **kwargs):
sgfs = SGFS()
entities = sgfs.session.merge([dict(type=entity_type, id=id_) for ... | from sgfs import SGFS
from sgactions.utils import notify, progress
def run_create(**kwargs):
_run(False, **kwargs)
def run_preview(**kwargs):
_run(True, **kwargs)
def _run(dry_run, entity_type, selected_ids, **kwargs):
title='Preview Folders' if dry_run else 'Creating Folders'
progress(title=t... | Use new sgactions progress dialog | Use new sgactions progress dialog
| Python | bsd-3-clause | westernx/sgfs,westernx/sgfs | ---
+++
@@ -1,6 +1,6 @@
from sgfs import SGFS
-from sgactions.utils import notify
+from sgactions.utils import notify, progress
def run_create(**kwargs):
@@ -11,6 +11,9 @@
def _run(dry_run, entity_type, selected_ids, **kwargs):
+ title='Preview Folders' if dry_run else 'Creating Folders'
+ prog... |
3b15911c669d072bee1a171696636162d23bd07e | spec/openpassword/config_spec.py | spec/openpassword/config_spec.py | from nose.tools import assert_equals
from openpassword.config import Config
class ConfigSpec:
def it_sets_the_path_to_the_keychain(self):
cfg = Config()
cfg.set_path("path/to/keychain")
assert_equals(cfg.get_path(), "path/to/keychain")
| from nose.tools import *
from openpassword.config import Config
class ConfigSpec:
def it_sets_the_path_to_the_keychain(self):
cfg = Config()
cfg.set_path("path/to/keychain")
eq_(cfg.get_path(), "path/to/keychain")
| Update config test to use eq_ matcher | Update config test to use eq_ matcher
| Python | mit | openpassword/blimey,openpassword/blimey | ---
+++
@@ -1,4 +1,4 @@
-from nose.tools import assert_equals
+from nose.tools import *
from openpassword.config import Config
class ConfigSpec:
@@ -6,5 +6,5 @@
def it_sets_the_path_to_the_keychain(self):
cfg = Config()
cfg.set_path("path/to/keychain")
- assert_equals(cfg.get_path(),... |
c073131ac4b951affdac454824bb3eed913cd931 | huxley/api/tests/committee.py | huxley/api/tests/committee.py | import json
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import Client
from huxley.utils.test import TestCommittees
class CommitteeDetailGetTestCase(TestCase):
def setUp(self):
self.client = Client()
def get_url(self, committee_id):
r... | # Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
import json
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import Client
from huxley.utils.test import TestCommitt... | Add copyright header to CommitteeDetailGetTestCase. | Add copyright header to CommitteeDetailGetTestCase.
| Python | bsd-3-clause | bmun/huxley,ctmunwebmaster/huxley,nathanielparke/huxley,ctmunwebmaster/huxley,bmun/huxley,bmun/huxley,ctmunwebmaster/huxley,nathanielparke/huxley,bmun/huxley,nathanielparke/huxley,nathanielparke/huxley,ctmunwebmaster/huxley | ---
+++
@@ -1,3 +1,6 @@
+# Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
+# Use of this source code is governed by a BSD License (see LICENSE).
+
import json
from django.core.urlresolvers import reverse |
2a68505e36358900e045f74a8b2885486f6a302e | framework/guid/model.py | framework/guid/model.py | from framework import StoredObject, fields
class Guid(StoredObject):
_id = fields.StringField()
referent = fields.AbstractForeignField(backref='guid')
_meta = {
'optimistic': True
}
class GuidStoredObject(StoredObject):
# Redirect to content using URL redirect by default
redirect_... | from framework import StoredObject, fields
class Guid(StoredObject):
_id = fields.StringField()
referent = fields.AbstractForeignField()
_meta = {
'optimistic': True,
}
class GuidStoredObject(StoredObject):
# Redirect to content using URL redirect by default
redirect_mode = 'redir... | Remove backref on GUID; factor out _ensure_guid | Remove backref on GUID; factor out _ensure_guid
| Python | apache-2.0 | arpitar/osf.io,rdhyee/osf.io,lyndsysimon/osf.io,ZobairAlijan/osf.io,caseyrygt/osf.io,abought/osf.io,CenterForOpenScience/osf.io,asanfilippo7/osf.io,emetsger/osf.io,kwierman/osf.io,barbour-em/osf.io,icereval/osf.io,Johnetordoff/osf.io,jolene-esposito/osf.io,RomanZWang/osf.io,haoyuchen1992/osf.io,barbour-em/osf.io,binocu... | ---
+++
@@ -4,10 +4,10 @@
class Guid(StoredObject):
_id = fields.StringField()
- referent = fields.AbstractForeignField(backref='guid')
+ referent = fields.AbstractForeignField()
_meta = {
- 'optimistic': True
+ 'optimistic': True,
}
@@ -16,20 +16,11 @@
# Redirect to c... |
21b022362a09c4e408b9375a38505975e8c7f965 | comet/utility/test/test_whitelist.py | comet/utility/test/test_whitelist.py | from ipaddr import IPNetwork
from twisted.internet.protocol import Protocol
from twisted.internet.address import IPv4Address
from twisted.trial import unittest
from ...test.support import DummyEvent
from ..whitelist import WhitelistingFactory
WhitelistingFactory.protocol = Protocol
class WhitelistingFactoryTestCase... | from ipaddr import IPNetwork
from twisted.internet.protocol import Protocol
from twisted.internet.address import IPv4Address
from twisted.trial import unittest
from ...test.support import DummyEvent
from ..whitelist import WhitelistingFactory
WhitelistingFactory.protocol = Protocol
class WhitelistingFactoryTestCase... | Remove assertIsNone for Python 2.6 compatibility | Remove assertIsNone for Python 2.6 compatibility
| Python | bsd-2-clause | jdswinbank/Comet,jdswinbank/Comet | ---
+++
@@ -13,8 +13,9 @@
def test_empty_whitelist(self):
# All connections should be denied
factory = WhitelistingFactory([])
- self.assertIsNone(
- factory.buildProtocol(IPv4Address('TCP', '127.0.0.1', 0))
+ self.assertEqual(
+ factory.buildProtocol(IPv4Add... |
40616138673205b3b4f3150a659ab02830b2bbc0 | tests/test_player_creation.py | tests/test_player_creation.py | from webtest import TestApp
import dropshot
def test_create_player():
app = TestApp(dropshot.app)
params = {'username': 'chapmang',
'password': 'deadparrot',
'email': 'chapmang@dropshot.com'}
expected = {'count': 1,
'offset': 0,
'players': [
... | from webtest import TestApp
import dropshot
def test_create_player():
app = TestApp(dropshot.app)
params = {'username': 'chapmang',
'password': 'deadparrot',
'email': 'chapmang@dropshot.com'}
expected = {'count': 1,
'offset': 0,
'players': [
... | Update player creation test to verify POST status code. | Update player creation test to verify POST status code.
| Python | mit | dropshot/dropshot-server | ---
+++
@@ -16,10 +16,10 @@
'username': 'chapmang'}
]}
- app.post('/players', params)
+ post_response = app.post('/players', params)
+ assert post_response.status_int == 201
- res = app.get('/players')
-
- assert res.status_int == 200
- assert res.content_t... |
4921d58775faa65423fac321ef68f065b2499813 | experiments/hydrotrend-uq-1/plot_results.py | experiments/hydrotrend-uq-1/plot_results.py | #!/usr/bin/env python
# Makes a standard set of plots from Dakota output.
# Mark Piper (mark.piper@colorado.edu)
# Note that these imports are from the installed version of dakota_utils.
from dakota_utils.read import read_tabular
from dakota_utils.plot import plot_samples, plot_irregular_surface
tab_file = 'dakota.da... | #!/usr/bin/env python
# Makes a standard set of plots from Dakota output.
# Mark Piper (mark.piper@colorado.edu)
# Note that these imports are from the installed version of dakota_utils.
from dakota_utils.read import read_tabular
from dakota_utils.plot import plot_samples, plot_irregular_surface
from dakota_utils.conv... | Update script for Dakota 6.1 tabular output file | Update script for Dakota 6.1 tabular output file
| Python | mit | mcflugen/dakota-experiments,mdpiper/dakota-experiments,mdpiper/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments | ---
+++
@@ -5,17 +5,20 @@
# Note that these imports are from the installed version of dakota_utils.
from dakota_utils.read import read_tabular
from dakota_utils.plot import plot_samples, plot_irregular_surface
+from dakota_utils.convert import has_interface_column, strip_interface_column
tab_file = 'dakota.dat'... |
a263926614a2f9c0c5c41d19282db79ac5e79e7e | gittip/orm/__init__.py | gittip/orm/__init__.py | from __future__ import unicode_literals
import os
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class SQLAlchemy(object):
def __init__(self):
self.session = self.create_session()
@property... | from __future__ import unicode_literals
import os
import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
class Model(object):
def __repr__(self):
cols = self.__mapper__.c.keys()
class... | Remove the convenience functions, reorganize around the SQLAlchemy class | Remove the convenience functions, reorganize around the SQLAlchemy class
| Python | mit | eXcomm/gratipay.com,gratipay/gratipay.com,studio666/gratipay.com,mccolgst/www.gittip.com,bountysource/www.gittip.com,MikeFair/www.gittip.com,eXcomm/gratipay.com,eXcomm/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,studio666/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,bountysource/www.gittip.com,... | ---
+++
@@ -1,25 +1,10 @@
from __future__ import unicode_literals
import os
+import pdb
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
-
-class SQLAlchemy(object):
- def __init__(self):
- s... |
766735563fe327363e87a103fd70f88a896bf9a8 | version.py | version.py | major = 0
minor=0
patch=22
branch="master"
timestamp=1376526477.22 | major = 0
minor=0
patch=23
branch="master"
timestamp=1376526646.52 | Tag commit for v0.0.23-master generated by gitmake.py | Tag commit for v0.0.23-master generated by gitmake.py
| Python | mit | ryansturmer/gitmake | ---
+++
@@ -1,5 +1,5 @@
major = 0
minor=0
-patch=22
+patch=23
branch="master"
-timestamp=1376526477.22
+timestamp=1376526646.52 |
0e4b717389f032bef856d646afe0912a76519738 | setup.py | setup.py | #! /usr/bin/env python
"""Setup information of demandlib.
"""
from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='demandlib',
version='0.1.7',
author='oemof developer group',
url='https://oemof.... | #! /usr/bin/env python
"""Setup information of demandlib.
"""
from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='demandlib',
version='0.1.7',
author='oemof developer group',
url='https://oemof.... | Set content type of package desription | Set content type of package desription
| Python | mit | oemof/demandlib | ---
+++
@@ -19,6 +19,7 @@
author_email='contact@oemof.org',
description='Demandlib of the open energy modelling framework',
long_description=read('README.rst'),
+ long_description_content_type='text/x-rst',
packages=find_packages(),
install_requires=['numpy >= 1.17.0',
... |
584e78390e61833cede3865ad205a51b561818e2 | setup.py | setup.py | """\
Grip
----
Render local readme files before sending off to Github.
Grip is easy to set up
``````````````````````
::
$ pip install grip
$ cd myproject
$ grip
* Running on http://localhost:5000/
Links
`````
* `Website <http://github.com/joeyespo/grip>`_
"""
import os
import sys
from setupto... | """\
Grip
----
Render local readme files before sending off to Github.
Grip is easy to set up
``````````````````````
::
$ pip install grip
$ cd myproject
$ grip
* Running on http://localhost:5000/
Links
`````
* `Website <http://github.com/joeyespo/grip>`_
"""
import os
import sys
from setupto... | Add LICENSE and static/ back to package data. | Add LICENSE and static/ back to package data.
Adding the static/ just in case there's ever any static
files later on, since it's a standard Flask folder.
Also, adding all files in templates/ so there's
no surprises later on in development.
| Python | mit | jbarreras/grip,joeyespo/grip,ssundarraj/grip,joeyespo/grip,mgoddard-pivotal/grip,ssundarraj/grip,mgoddard-pivotal/grip,jbarreras/grip | ---
+++
@@ -48,7 +48,7 @@
license='MIT',
platforms='any',
packages=find_packages(),
- package_data={'grip': ['templates/*.html']},
+ package_data={'': ['LICENSE'], 'grip': ['static/*', 'templates/*']},
install_requires=read('requirements.txt'),
zip_safe=False,
entry_points={'consol... |
9181085fb10b3c2281fbfbb69c9bb2b89a7990dd | setup.py | setup.py | __author__ = 'katharine'
import os
import sys
from setuptools import setup, find_packages
requirements_path = os.path.join(os.path.dirname(__file__), 'requirements.txt')
with open(requirements_path) as requirements_file:
requirements = [line.strip() for line in requirements_file.readlines()]
setup(name='pypkjs',
... | __author__ = 'katharine'
import os
import sys
from setuptools import setup, find_packages
requirements_path = os.path.join(os.path.dirname(__file__), 'requirements.txt')
with open(requirements_path) as requirements_file:
requirements = [line.strip() for line in requirements_file.readlines()]
setup(name='pypkjs',
... | Package data requires a list... | Package data requires a list...
| Python | mit | pebble/pypkjs | ---
+++
@@ -19,7 +19,7 @@
packages=find_packages(),
install_requires=requirements,
package_data={
- 'javascript.navigator': 'GeoLiteCity.dat'
+ 'javascript.navigator': ['GeoLiteCity.dat']
},
entry_points={
'console_scripts': [ |
fc48e79059fd1ad667aa30690cb136c027fd9314 | setup.py | setup.py | import os
from setuptools import find_packages, setup
import sys
PY2 = sys.version_info[0] == 2
# Get version
with open(os.path.join('tilezilla', 'version.py')) as f:
for line in f:
if line.find('__version__') >= 0:
version = line.split("=")[1].strip()
version = version.strip('"')... | import os
from setuptools import find_packages, setup
import sys
PY2 = sys.version_info[0] == 2
# Get version
with open(os.path.join('tilezilla', 'version.py')) as f:
for line in f:
if line.find('__version__') >= 0:
version = line.split("=")[1].strip()
version = version.strip('"')... | Remove shapes command until it's ready | Remove shapes command until it's ready
| Python | bsd-3-clause | ceholden/landsat_tile,ceholden/landsat_tiles,ceholden/landsat_tile,ceholden/tilezilla,ceholden/landsat_tiles | ---
+++
@@ -38,7 +38,6 @@
[tilez.commands]
ingest=tilezilla.cli.ingest:ingest
spew=tilezilla.cli.spew:spew
- shapes=tilezilla.cli.info:shapes
db=tilezilla.cli.db:db
'''
|
b78a5649104380499eba6f13d8da4c04ef50a66d | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='libmfrc522',
description='A library for communicating with the MFRC522 RFID module',
version='1.0',
url='https://github.com/fmfi-svt-gate/libmfrc522.py',
license='MIT',
packages=find_packages(),
install_r... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='libmfrc522',
description='A library for communicating with the MFRC522 RFID module',
version='0.1',
url='https://github.com/fmfi-svt-gate/libmfrc522.py',
license='MIT',
packages=find_packages(),
install_r... | Change version to a more descriptive number | Change version to a more descriptive number
| Python | mit | fmfi-svt-deadlock/libmfrc522.py | ---
+++
@@ -4,7 +4,7 @@
setup(name='libmfrc522',
description='A library for communicating with the MFRC522 RFID module',
- version='1.0',
+ version='0.1',
url='https://github.com/fmfi-svt-gate/libmfrc522.py',
license='MIT',
packages=find_packages(), |
c8779edcb4078c799b7112625b5495f63a00e428 | l10n_ro_partner_unique/models/res_partner.py | l10n_ro_partner_unique/models/res_partner.py | # Copyright (C) 2015 Forest and Biomass Romania
# Copyright (C) 2020 NextERP Romania
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, models
from odoo.exceptions import ValidationError
class ResPartner(models.Model):
_inherit = "res.partner"
@api.model
def _g... | # Copyright (C) 2015 Forest and Biomass Romania
# Copyright (C) 2020 NextERP Romania
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, models
from odoo.exceptions import ValidationError
class ResPartner(models.Model):
_inherit = "res.partner"
@api.model
def _g... | Add vat unique per comapny | Add vat unique per comapny
| Python | agpl-3.0 | OCA/l10n-romania,OCA/l10n-romania | ---
+++
@@ -12,7 +12,7 @@
@api.model
def _get_vat_nrc_constrain_domain(self):
domain = [
- ("company_id", "=", self.company_id),
+ ("company_id", "=", self.company_id.id if self.company_id else False),
("parent_id", "=", False),
("vat", "=", self.vat)... |
158dc9e77a2f8ca6bd0a124b80f2dd10b5858731 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = 'openarticlegauge',
version = '0.0.1',
packages = find_packages(),
install_requires = [
"Flask==0.9",
"Jinja2==2.6",
"Werkzeug==0.8.3",
"amqp==1.0.6",
"anyjson==0.3.3",
"argparse==1.2.1",
"... | from setuptools import setup, find_packages
setup(
name = 'openarticlegauge',
version = '0.0.1',
packages = find_packages(),
install_requires = [
"Flask==0.9",
"Jinja2==2.6",
"Werkzeug==0.8.3",
"amqp==1.0.6",
"anyjson==0.3.3",
"argparse==1.2.1",
"... | Revert "remove beautifulsoup4 from requirements" | Revert "remove beautifulsoup4 from requirements"
This reverts commit e096c4d50a1fcc81a4f63b24d82f8f1dba9c493d.
Turns out we were actually using Beautiful Soup somewhere. Oops.
| Python | bsd-3-clause | CottageLabs/OpenArticleGauge,CottageLabs/OpenArticleGauge,CottageLabs/OpenArticleGauge | ---
+++
@@ -20,6 +20,7 @@
"requests==1.1.0",
"redis",
"lxml",
+ "beautifulsoup4"
]
)
|
aadd0dbfcd271120ddc02354d51ba111653d87f0 | setup.py | setup.py | import io
import os
from setuptools import setup
version_txt = os.path.join(os.path.dirname(__file__), 'aghasher', 'version.txt')
with open(version_txt, 'r') as f:
version = f.read().strip()
setup(
author='Daniel Steinberg',
author_email='ds@dannyadam.com',
classifiers=[
'Development Status ::... | import io
import os
from setuptools import setup
version_txt = os.path.join(os.path.dirname(__file__), 'aghasher', 'version.txt')
with open(version_txt, 'r') as f:
version = f.read().strip()
with io.open('README.md', encoding='utf8') as f:
long_description = f.read()
setup(
author='Daniel Steinberg',
... | Use a context manager for reading README.md. | Use a context manager for reading README.md.
| Python | mit | dstein64/PyAnchorGraphHasher | ---
+++
@@ -5,6 +5,9 @@
version_txt = os.path.join(os.path.dirname(__file__), 'aghasher', 'version.txt')
with open(version_txt, 'r') as f:
version = f.read().strip()
+
+with io.open('README.md', encoding='utf8') as f:
+ long_description = f.read()
setup(
author='Daniel Steinberg',
@@ -28,7 +31,7 @@
... |
9e27d60ecd18a1b7bda8867cc1e064b5deec0370 | setup.py | setup.py | from setuptools import setup, find_packages
import sys, os
version = '0.1.4'
setup(name='pam',
version=version,
description="PAM interface using ctypes",
long_description="""\
An interface to the Pluggable Authentication Modules (PAM) library on linux, written in pure python (using ctypes)""",
... | from setuptools import setup, find_packages
import sys, os
version = '1.0'
setup(name='pam2',
version=version,
description="PAM interface using ctypes",
long_description="""\
An interface to the Pluggable Authentication Modules (PAM) library on linux, written in pure python (using ctypes)""",
... | Rename to pam2 as we're breaking the API, bump version | Rename to pam2 as we're breaking the API, bump version
| Python | mit | rgbkrk/pamela | ---
+++
@@ -1,9 +1,9 @@
from setuptools import setup, find_packages
import sys, os
-version = '0.1.4'
+version = '1.0'
-setup(name='pam',
+setup(name='pam2',
version=version,
description="PAM interface using ctypes",
long_description="""\
@@ -18,10 +18,10 @@
"Topic :: System :: S... |
d420f45071ab7ad049c412b456fe890d94cd47bd | setup.py | setup.py | """
Flask-Mustache
--------------
Flask mustache integration.
Links
`````
* `development version
<http://github.com/ahri/flask-mustache>`_
"""
from setuptools import setup
setup(
name='Flask-Mustache',
version='0.1',
url='http://github.com/ahri/flask-mustache',
license='AGPLv3',
author='Adam ... | """
Flask-Mustache
--------------
Flask mustache integration.
Links
`````
* `development version
<http://github.com/ahri/flask-mustache>`_
"""
from setuptools import setup
setup(
name='Flask-Mustache',
version='0.1.1',
url='http://github.com/ahri/flask-mustache',
license='AGPLv3',
author='Ada... | Remove requirement on pystache (since nestache is now a viable alternative). | Remove requirement on pystache (since nestache is now a viable alternative).
| Python | mit | ahri/flask-mustache | ---
+++
@@ -15,7 +15,7 @@
setup(
name='Flask-Mustache',
- version='0.1',
+ version='0.1.1',
url='http://github.com/ahri/flask-mustache',
license='AGPLv3',
author='Adam Piper',
@@ -29,10 +29,10 @@
platforms='any',
install_requires=[
'Flask>=0.8',
- 'pystache>=0.3.... |
693a7ecb45758676c3689f0294741acfc31e8e7c | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup
def read(fname):
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), fname), 'r') as infile:
content = infile.read()
return content
setup(
name='marshmallow-polyfield',
version=5.0,
description='An unofficial ext... | #!/usr/bin/env python
import os
from setuptools import setup
def read(fname):
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), fname), 'r') as infile:
content = infile.read()
return content
setup(
name='marshmallow-polyfield',
version=5.0,
description='An unofficial ext... | Add version constraint for marshmallow | Add version constraint for marshmallow
| Python | apache-2.0 | Bachmann1234/marshmallow-polyfield | ---
+++
@@ -21,7 +21,7 @@
license=read('LICENSE'),
keywords=('serialization', 'rest', 'json', 'api', 'marshal',
'marshalling', 'deserialization', 'validation', 'schema'),
- install_requires=['marshmallow', 'six'],
+ install_requires=['marshmallow>=3.0.0b10', 'six'],
classifiers=[
... |
4685b04c3913450ef34f7e4e848d6021097fed21 | setup.py | setup.py | import sys
from setuptools import setup
extra = {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
setup(name='marathon',
version="0.2.8",
description='Marathon Client Library',
long_description="""Python interface to the Marathon REST API.""",
author='Mike Babineau',
author_em... | import sys
from setuptools import setup
extra = {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
setup(name='marathon',
version="0.2.8",
description='Marathon Client Library',
long_description="""Python interface to the Mesos Marathon REST API.""",
author='Mike Babineau',
aut... | Clarify this is Mesos-related in PyPI description | Clarify this is Mesos-related in PyPI description
| Python | mit | elyast/marathon-python,burakbostancioglu/marathon-python,thefactory/marathon-python,Rob-Johnson/marathon-python,mattrobenolt/marathon-python,mattrobenolt/marathon-python,Carles-Figuerola/marathon-python,drewrobb/marathon-python,Rob-Johnson/marathon-python,thefactory/marathon-python,mesosphere/marathon-python,Yelp/marat... | ---
+++
@@ -8,7 +8,7 @@
setup(name='marathon',
version="0.2.8",
description='Marathon Client Library',
- long_description="""Python interface to the Marathon REST API.""",
+ long_description="""Python interface to the Mesos Marathon REST API.""",
author='Mike Babineau',
author_e... |
5d8ca3498d794ab264377b1bc31f52fcd97210ba | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
setuptools.setup(
name="jack-select",
version="0.1",
url="https://github.com/SpotlightKid/jack-select",
author="Christopher Arndt",
author_email="chris@chrisarndt.de",
description="A systray app to set the JACK configuration from... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
setuptools.setup(
name="jack-select",
version="0.1b1",
url="https://github.com/SpotlightKid/jack-select",
author="Christopher Arndt",
author_email="chris@chrisarndt.de",
description="A systray app to set the JACK configuration fr... | Add b1 to version number; add more keywords | Add b1 to version number; add more keywords
| Python | mit | SpotlightKid/jack-select,SpotlightKid/jack-select | ---
+++
@@ -6,13 +6,13 @@
setuptools.setup(
name="jack-select",
- version="0.1",
+ version="0.1b1",
url="https://github.com/SpotlightKid/jack-select",
author="Christopher Arndt",
author_email="chris@chrisarndt.de",
description="A systray app to set the JACK configuration from QJackCt... |
548cfea821bf1b0b92ce09c54405554d264b5395 | tests/integration/session/test_timeout.py | tests/integration/session/test_timeout.py | import time
from app import settings
from tests.integration.integration_test_case import IntegrationTestCase
class TestTimeout(IntegrationTestCase):
def setUp(self):
settings.EQ_SESSION_TIMEOUT_SECONDS = 1
settings.EQ_SESSION_TIMEOUT_GRACE_PERIOD_SECONDS = 0
super().setUp()
def test... | import time
from app import settings
from tests.integration.integration_test_case import IntegrationTestCase
class TestTimeout(IntegrationTestCase):
def setUp(self):
settings.EQ_SESSION_TIMEOUT_SECONDS = 1
settings.EQ_SESSION_TIMEOUT_GRACE_PERIOD_SECONDS = 0
super().setUp()
def tear... | Fix CSRF missing errors that happen occasionally in tests | Fix CSRF missing errors that happen occasionally in tests
| Python | mit | ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner | ---
+++
@@ -10,6 +10,11 @@
settings.EQ_SESSION_TIMEOUT_SECONDS = 1
settings.EQ_SESSION_TIMEOUT_GRACE_PERIOD_SECONDS = 0
super().setUp()
+
+ def tearDown(self):
+ settings.EQ_SESSION_TIMEOUT_SECONDS = 45 * 60
+ settings.EQ_SESSION_TIMEOUT_GRACE_PERIOD_SECONDS = 30
+ s... |
a642a4f98016e2fa796c69bd74c36008601e4e5f | tools/wcloud/wcloud/deploymentsettings.py | tools/wcloud/wcloud/deploymentsettings.py | from weblab.admin.script import Creation
APACHE_CONF_NAME = 'apache.conf'
MIN_PORT = 10000
DEFAULT_DEPLOYMENT_SETTINGS = {
Creation.COORD_ENGINE: 'redis',
Creation.COORD_REDIS_DB: 0,
Creation.COORD_REDIS_PORT: 6379,
Creation.DB_ENGINE: 'mysql',
Creation.ADMIN_USER: 'CHANGE_ME', # --admin-user=admi... | from weblab.admin.script import Creation
APACHE_CONF_NAME = 'apache.conf'
MIN_PORT = 14000
DEFAULT_DEPLOYMENT_SETTINGS = {
Creation.COORD_ENGINE: 'redis',
Creation.COORD_REDIS_DB: 0,
Creation.COORD_REDIS_PORT: 6379,
Creation.DB_ENGINE: 'mysql',
Creation.ADMIN_USER: 'CHANGE_ME', # --admin-user=admi... | Establish different settings for minimal port | Establish different settings for minimal port
| Python | bsd-2-clause | weblabdeusto/weblabdeusto,porduna/weblabdeusto,porduna/weblabdeusto,zstars/weblabdeusto,porduna/weblabdeusto,zstars/weblabdeusto,porduna/weblabdeusto,zstars/weblabdeusto,morelab/weblabdeusto,porduna/weblabdeusto,weblabdeusto/weblabdeusto,zstars/weblabdeusto,weblabdeusto/weblabdeusto,porduna/weblabdeusto,morelab/weblabd... | ---
+++
@@ -1,7 +1,7 @@
from weblab.admin.script import Creation
APACHE_CONF_NAME = 'apache.conf'
-MIN_PORT = 10000
+MIN_PORT = 14000
DEFAULT_DEPLOYMENT_SETTINGS = {
Creation.COORD_ENGINE: 'redis', |
89b5f2a7afaa5d8533500ab35dd418e996bd305d | setup.py | setup.py | from setuptools import setup
cli_tools = ["spritemapper = spritecss.main:main"]
setup(name="spritemapper", version="0.5", url="http://yostudios.github.com/Spritemapper/",
author="Yo Studios AB", author_email="opensource@yostudios.se",
description="A suite for merging multiple images and generate correspon... | from setuptools import setup
readme_text = open("README.rst", "U").read()
cli_tools = ["spritemapper = spritecss.main:main"]
setup(name="spritemapper", version="0.5",
url="http://yostudios.github.com/Spritemapper/",
author="Yo Studios AB", author_email="opensource@yostudios.se",
description="A suit... | Add long description and fix 80w | Add long description and fix 80w
| Python | mit | wpj-cz/Spritemapper,yostudios/Spritemapper,wpj-cz/Spritemapper,wpj-cz/Spritemapper,yostudios/Spritemapper,yostudios/Spritemapper,wpj-cz/Spritemapper | ---
+++
@@ -1,10 +1,15 @@
from setuptools import setup
+
+readme_text = open("README.rst", "U").read()
cli_tools = ["spritemapper = spritecss.main:main"]
-setup(name="spritemapper", version="0.5", url="http://yostudios.github.com/Spritemapper/",
+setup(name="spritemapper", version="0.5",
+ url="http://yost... |
5a8963c7be6bb328346d21f2b4afdc7256c7cd96 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="crust",
version="0.1",
description="Framework for Tastypie API Clients",
long_description=open("README.rst").read(),
url="https://github.com/dstufft/crust/",
license=open("LICENSE").read(),
author="Donald Stuf... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="crust",
version="0.1.dev1",
description="Framework for Tastypie API Clients",
long_description=open("README.rst").read(),
url="https://github.com/dstufft/crust/",
license=open("LICENSE").read(),
author="Donald... | Make version a dev version | Make version a dev version
| Python | bsd-2-clause | dstufft/crust | ---
+++
@@ -4,7 +4,7 @@
setup(
name="crust",
- version="0.1",
+ version="0.1.dev1",
description="Framework for Tastypie API Clients",
long_description=open("README.rst").read(), |
36c2e7449b7817a66b60eaff4c8518ae6d4f4a01 | categories/tests.py | categories/tests.py | from .models import Category
from .serializers import CategorySerializer
from employees.models import Employee
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
class CategoryTestCase(APITestCase):
def setUp(self):
Category.objects.c... | from .models import Category
from .serializers import CategorySerializer
from employees.models import Employee
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
class CategoryTestCase(APITestCase):
def setUp(self):
Category.objects.c... | Remove categoy_list test until urls will fixed. | Remove categoy_list test until urls will fixed.
| Python | apache-2.0 | belatrix/BackendAllStars | ---
+++
@@ -19,11 +19,3 @@
category2 = Category.objects.get(name='Category2')
self.assertEqual(category1.weight, 2)
self.assertEqual(category2.weight, 1)
-
- def test_category_list(self):
- categories = Category.objects.all()
- response_data = CategorySerializer(categories,... |
1f1b6757f82ef2ad384c2360f22935abbbc09531 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='Certificator',
version='0.1.0',
long_description=__doc__,
packages=['certificator'],
include_package_data=True,
zip_safe=False,
setup_requires=[
'nose>=1.0'
],
tests_require=[
'nose>=1.2.1',
... | #!/usr/bin/env python
from setuptools import setup
setup(
name='Certificator',
version='0.1.0',
long_description=__doc__,
packages=['certificator'],
include_package_data=True,
zip_safe=False,
setup_requires=[
'nose>=1.0'
],
tests_require=[
'nose>=1.2.1',
... | Use my own fork of flask-browserid until it gets merged | Use my own fork of flask-browserid until it gets merged
| Python | agpl-3.0 | cnelsonsic/Certificator | ---
+++
@@ -21,8 +21,8 @@
'Flask-Login==0.2.5',
'Flask-SQLAlchemy==0.16',
'Flask-Script==0.5.3',
- 'Flask-BrowserId==0.0.1',
- 'Jinja2==2.6',
+ 'Flask-BrowserId==0.0.2',
+ 'Jinja2==2.7',
'MarkupSafe==0.18',
'SQLAlchemy==0.8.1',
'Werkzeu... |
fdf82d36b86dff35943bb00f73b915240f5bd68c | setup.py | setup.py | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="energenie",
version="1.0.1",
author="Ben Nuttall",
author_email="ben@raspberrypi.org",
description="Remotely control power sockets from the Raspberry Pi",
... | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="energenie",
version="1.0.1",
author="Ben Nuttall",
author_email="ben@raspberrypi.org",
description="Remotely control power sockets from the Raspberry Pi",
... | Change from beta -> stable for v1.0.x | Change from beta -> stable for v1.0.x
| Python | bsd-3-clause | bennuttall/energenie,RPi-Distro/python-energenie,rjw57/energenie | ---
+++
@@ -25,7 +25,7 @@
],
long_description=read('README.rst'),
classifiers=[
- "Development Status :: 4 - Beta",
+ "Development Status :: 5 - Production/Stable",
"Topic :: Home Automation",
"License :: OSI Approved :: BSD License",
], |
cf671f70974348ac202f613c6b090f05d4f2543b | setup.py | setup.py | try:
# Try using ez_setup to install setuptools if not already installed.
from ez_setup import use_setuptools
use_setuptools()
except ImportError:
# Ignore import error and assume Python 3 which already has setuptools.
pass
from setuptools import setup
DESC = ('This Python library for Raspberry Pi... | try:
# Try using ez_setup to install setuptools if not already installed.
from ez_setup import use_setuptools
use_setuptools()
except ImportError:
# Ignore import error and assume Python 3 which already has setuptools.
pass
from setuptools import setup
DESC = ('This Python library for Raspberry Pi... | Increment version in preperation for release of version 1.2.0 | Increment version in preperation for release of version 1.2.0
| Python | mit | chrisb2/pi_ina219 | ---
+++
@@ -33,7 +33,7 @@
setup(name='pi-ina219',
- version='1.1.0',
+ version='1.2.0',
author='Chris Borrill',
author_email='chris.borrill@gmail.com',
description=DESC, |
40958981df401a898a39ddad45c2b48669a44ee7 | setup.py | setup.py | #!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='mammoth',
version='0.1.1',
description='Convert Word documents to simple and clean HTML',
long_description=read("README"),
author='... | #!/usr/bin/env python
import os
import sys
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
_install_requires = [
"parsimonious>=0.5,<0.6",
]
if sys.version_info[:2] <= (2, 6):
_install_requires.append("argparse==1.2.1")
setup(
na... | Support CLI on Python 2.6 | Support CLI on Python 2.6
| Python | bsd-2-clause | mwilliamson/python-mammoth,JoshBarr/python-mammoth | ---
+++
@@ -1,10 +1,19 @@
#!/usr/bin/env python
import os
+import sys
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
+
+_install_requires = [
+ "parsimonious>=0.5,<0.6",
+]
+
+if sys.version_info[:2] <= (2, 6):
+ _install_requi... |
139d09ecd83694dd92d393b64d1d9b0ad05e9f4c | setup.py | setup.py | import distutils.core
# Uploading to PyPI
# =================
# $ python setup.py register -r pypi
# $ python setup.py sdist upload -r pypi
version = '1.0'
distutils.core.setup(
name='nonstdlib',
version=version,
author='Kale Kundert',
author='kale@thekunderts.net',
url='https:... | import distutils.core
# Uploading to PyPI
# =================
# The first time only:
# $ python setup.py register -r pypi
#
# Every version bump:
# $ git tag <version>; git push
# $ python setup.py sdist upload -r pypi
version = '1.0'
distutils.core.setup(
name='nonstdlib',
version=version,
au... | Add instructions for bumping the version. | Add instructions for bumping the version.
| Python | mit | kalekundert/nonstdlib,KenKundert/nonstdlib,kalekundert/nonstdlib,KenKundert/nonstdlib | ---
+++
@@ -2,7 +2,11 @@
# Uploading to PyPI
# =================
+# The first time only:
# $ python setup.py register -r pypi
+#
+# Every version bump:
+# $ git tag <version>; git push
# $ python setup.py sdist upload -r pypi
version = '1.0' |
783ee7a17fb3bc930618dc5788ec727a3d8f1a1b | setup.py | setup.py | import re
import os
from setuptools import setup, find_packages
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
with open('abakus/__init__.py', 'r') as fd:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE
).group(1)
setup(
name="djan... | import re
import os
from setuptools import setup, find_packages
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
with open('abakus/__init__.py', 'r') as fd:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE
).group(1)
setup(
name="djan... | Upgrade dependency requests to ==2.10.0 | Upgrade dependency requests to ==2.10.0
| Python | mit | webkom/django-auth-abakus | ---
+++
@@ -26,7 +26,7 @@
],
tests_require=[
'django>=1.4',
- 'requests==2.7.0',
+ 'requests==2.10.0',
'responses'
],
license='MIT', |
04ff7acc10dc722d372db19aaf04296f2a2c63cc | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup
def readreq(filename):
result = []
with open(filename) as f:
for req in f:
req = req.lstrip()
if req.startswith('-e ') or req.startswith('http:'):
idx = req.find('#egg=')
if idx >= 0:... | #!/usr/bin/env python
import os
from setuptools import setup
def readreq(filename):
result = []
with open(filename) as f:
for req in f:
req = req.lstrip()
if req.startswith('-e ') or req.startswith('http:'):
idx = req.find('#egg=')
if idx >= 0:... | Create the console script entrypoint. | Create the console script entrypoint.
| Python | apache-2.0 | klmitch/train | ---
+++
@@ -51,6 +51,7 @@
tests_require=readreq('.test-requires'),
entry_points={
'console_scripts': [
+ 'train = train.runner:train.console',
],
},
) |
2ed7e3af5f6ab586dbad33e566f61a0a3c3ff61b | setup.py | setup.py | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
try:
README = open("README.rst").read()
CHANGELOG = open("CHANGELOG.rst").read()
except IOError:
DESCRIPTION = "<placeholder>"
else:
DESCRIPTION = README + '\n' + CHANGELOG
s... | #!/usr/bin/env python
"""Setup script for PythonTemplateDemo."""
import setuptools
from demo import __project__, __version__
try:
README = open("README.rst").read()
CHANGELOG = open("CHANGELOG.rst").read()
except IOError:
LONG_DESCRIPTION = "Coming soon..."
else:
LONG_DESCRIPTION = README + '\n' + C... | Deploy Travis CI build 715 to GitHub | Deploy Travis CI build 715 to GitHub
| Python | mit | jacebrowning/template-python-demo | ---
+++
@@ -10,9 +10,9 @@
README = open("README.rst").read()
CHANGELOG = open("CHANGELOG.rst").read()
except IOError:
- DESCRIPTION = "<placeholder>"
+ LONG_DESCRIPTION = "Coming soon..."
else:
- DESCRIPTION = README + '\n' + CHANGELOG
+ LONG_DESCRIPTION = README + '\n' + CHANGELOG
setuptoo... |
c03fb3e27b4d526916192739ac6879f186f4d749 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup, find_packages
setup(
name="jawa",
packages=find_packages(),
version="1.0",
description="Doing fun stuff with JVM ClassFiles.",
author="Tyler Kennedy",
author_email="tk@tkte.ch",
url="http://github.com/TkTech/Jawa",
... | #!/usr/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup, find_packages
setup(
name="jawa",
packages=find_packages(),
version="1.0",
description="Doing fun stuff with JVM ClassFiles.",
author="Tyler Kennedy",
author_email="tk@tkte.ch",
url="http://github.com/TkTech/Jawa",
... | Add the py.test coverage plugin package (pytest-cov) as an extra dependency. | Add the py.test coverage plugin package (pytest-cov) as an extra
dependency.
| Python | mit | TkTech/Jawa,TkTech/Jawa | ---
+++
@@ -21,7 +21,8 @@
],
extras_require={
'dev': [
- 'pytest'
+ 'pytest',
+ 'pytest-cov'
]
}
) |
af406d09ded10dbdfcc1d752f1cfe1d4bfe8f7d5 | setup.py | setup.py |
from setuptools import setup
setup(name = 'OWSLib',
version = '0.1.0',
description = 'OGC Web Service utility library',
license = 'GPL',
keywords = 'gis ogc ows wfs wms capabilities metadata',
author = 'Sean Gillies',
author_email = 'sgillies@fri... |
from setuptools import setup
setup(name = 'OWSLib',
version = '0.2.0',
description = 'OGC Web Service utility library',
license = 'BSD',
keywords = 'gis ogc ows wfs wms capabilities metadata',
author = 'Sean Gillies',
author_email = 'sgillies@fri... | Change version and license for 0.2 | Change version and license for 0.2
git-svn-id: 150a648d6f30c8fc6b9d405c0558dface314bbdd@617 b426a367-1105-0410-b9ff-cdf4ab011145
| Python | bsd-3-clause | daf/OWSLib,datagovuk/OWSLib,kalxas/OWSLib,bird-house/OWSLib,kwilcox/OWSLib,datagovuk/OWSLib,KeyproOy/OWSLib,Jenselme/OWSLib,b-cube/OWSLib,QuLogic/OWSLib,robmcmullen/OWSLib,geopython/OWSLib,daf/OWSLib,jaygoldfinch/OWSLib,mbertrand/OWSLib,ocefpaf/OWSLib,tomkralidis/OWSLib,dblodgett-usgs/OWSLib,JuergenWeichand/OWSLib,daf/... | ---
+++
@@ -2,9 +2,9 @@
from setuptools import setup
setup(name = 'OWSLib',
- version = '0.1.0',
+ version = '0.2.0',
description = 'OGC Web Service utility library',
- license = 'GPL',
+ license = 'BSD',
keywords = 'gis ogc ows wfs wms cap... |
9c9a2a36a5abbd166b9f67a6927447c14d2264ca | setup.py | setup.py | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
import multilingual_survey
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
n... | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
import multilingual_survey
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
n... | Fix django-hvad version in requirements | Fix django-hvad version in requirements
| Python | bsd-3-clause | diadzine/django-simple-multilingual-survey,diadzine/django-simple-multilingual-survey | ---
+++
@@ -21,8 +21,8 @@
author='Aymeric Bringard',
author_email='diadzine@gmail.com',
install_requires=[
- 'Django<1.8',
- 'django-hvad',
+ 'Django',
+ 'django-hvad<=1.0.0',
],
classifiers=[
'Environment :: Web Environment', |
1f9bc1b6f9a796458d104c01b9a344cbb0c84a9b | Lib/fontParts/fontshell/groups.py | Lib/fontParts/fontshell/groups.py | import defcon
from fontParts.base import BaseGroups
from fontParts.fontshell.base import RBaseObject
class RGroups(RBaseObject, BaseGroups):
wrapClass = defcon.Groups
def _items(self):
return self.naked().items()
def _contains(self, key):
return key in self.naked()
def _setItem(sel... | import defcon
from fontParts.base import BaseGroups
from fontParts.fontshell.base import RBaseObject
class RGroups(RBaseObject, BaseGroups):
wrapClass = defcon.Groups
def _get_base_side1KerningGroups(self):
return self.naked().getRepresentation("defcon.groups.kerningSide1Groups")
def _get_base_... | Add defcon implementation of group lookup methods. | Add defcon implementation of group lookup methods.
| Python | mit | robofab-developers/fontParts,robofab-developers/fontParts | ---
+++
@@ -6,6 +6,12 @@
class RGroups(RBaseObject, BaseGroups):
wrapClass = defcon.Groups
+
+ def _get_base_side1KerningGroups(self):
+ return self.naked().getRepresentation("defcon.groups.kerningSide1Groups")
+
+ def _get_base_side2KerningGroups(self):
+ return self.naked().getRepresenta... |
98fdc28d0c506e7fb44648256a56e7978d111073 | tests/base.py | tests/base.py | import sys
import unittest
#sys.path.insert(0, os.path.abspath('..'))
import github3
class BaseTest(unittest.TestCase):
api = 'https://api.github.com/'
kr = 'kennethreitz'
sigm = 'sigmavirus24'
todo = 'Todo.txt-python'
gh3py = 'github3py'
def setUp(self):
super(BaseTest, self).setUp()... | import sys
import unittest
#sys.path.insert(0, os.path.abspath('..'))
import github3
class BaseTest(unittest.TestCase):
api = 'https://api.github.com/'
kr = 'kennethreitz'
sigm = 'sigmavirus24'
todo = 'Todo.txt-python'
gh3py = 'github3py'
def setUp(self):
super(BaseTest, self).setUp()... | Fix exception test function for python3. | Fix exception test function for python3.
| Python | bsd-3-clause | agamdua/github3.py,christophelec/github3.py,degustaf/github3.py,jim-minter/github3.py,icio/github3.py,itsmemattchung/github3.py,balloob/github3.py,sigmavirus24/github3.py,h4ck3rm1k3/github3.py,wbrefvem/github3.py,krxsky/github3.py,ueg1990/github3.py | ---
+++
@@ -26,7 +26,7 @@
func(*args, **kwargs)
except github3.Error:
pass
- except Exception, e:
+ except Exception as e:
self.fail('{0}({1}, {2}) raises unexpected exception: {3}'.format(
str(func), str(args), str(kwargs), str(e)))
|
fbfd656d0c11bfbc6500fcdffdfae422ab50a08f | lancet/contrib/dploi.py | lancet/contrib/dploi.py | import click
@click.command()
@click.argument('environment')
@click.pass_obj
def ssh(lancet, environment):
"""
SSH into the given environment, based on the dploi configuration.
"""
namespace = {}
with open('deployment.py') as fh:
code = compile(fh.read(), 'deployment.py', 'exec')
... | from shlex import quote
import click
@click.command()
@click.option('-p', '--print/--exec', 'print_cmd', default=False,
help='Print the command instead of executing it.')
@click.argument('environment')
@click.pass_obj
def ssh(lancet, print_cmd, environment):
"""
SSH into the given environment, ... | Allow to print the ssh command | Allow to print the ssh command
| Python | mit | GaretJax/lancet,GaretJax/lancet | ---
+++
@@ -1,10 +1,14 @@
+from shlex import quote
+
import click
@click.command()
+@click.option('-p', '--print/--exec', 'print_cmd', default=False,
+ help='Print the command instead of executing it.')
@click.argument('environment')
@click.pass_obj
-def ssh(lancet, environment):
+def ssh(lancet,... |
d03657217cfd019bb55a4895a4cc6b0a80068ff0 | bluebottle/bb_projects/migrations/0003_auto_20160815_1658.py | bluebottle/bb_projects/migrations/0003_auto_20160815_1658.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-15 14:58
from __future__ import unicode_literals
from django.db import migrations
def update_status_names(apps, schema_editor):
ProjectPhase = apps.get_model('bb_projects', 'ProjectPhase')
updates = {
'plan-new': 'Plan - Draft',
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-15 14:58
from __future__ import unicode_literals
from django.db import migrations
def update_status_names(apps, schema_editor):
ProjectPhase = apps.get_model('bb_projects', 'ProjectPhase')
updates = {
'plan-new': 'Plan - Draft',
... | Make the status data migration optional | Make the status data migration optional
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | ---
+++
@@ -18,10 +18,13 @@
}
for slug, new_name in updates.items():
- phase = ProjectPhase.objects.get(slug=slug)
- phase.name = new_name
+ try:
+ phase = ProjectPhase.objects.get(slug=slug)
+ phase.name = new_name
- phase.save()
+ phase.save... |
12c833b1097579ca4a0162dca0d789b787f7d237 | oscar/core/compat.py | oscar/core/compat.py | from django.conf import settings
from django.contrib.auth.models import User
def get_user_model():
"""
Return the User model
Using this function instead of Django 1.5's get_user_model allows backwards
compatibility with Django 1.4.
"""
try:
# Django 1.5+
from django.contrib.au... | from django.conf import settings
from django.contrib.auth.models import User
def get_user_model():
"""
Return the User model
Using this function instead of Django 1.5's get_user_model allows backwards
compatibility with Django 1.4.
"""
try:
# Django 1.5+
from django.contrib.au... | Add two settings related to custom user model | Add two settings related to custom user model
| Python | bsd-3-clause | josesanch/django-oscar,binarydud/django-oscar,Idematica/django-oscar,QLGu/django-oscar,dongguangming/django-oscar,kapari/django-oscar,jmt4/django-oscar,amirrpp/django-oscar,WadeYuChen/django-oscar,rocopartners/django-oscar,rocopartners/django-oscar,amirrpp/django-oscar,ka7eh/django-oscar,ahmetdaglarbas/e-commerce,jinny... | ---
+++
@@ -29,5 +29,8 @@
return model
-# A setting that can be used in forieng key declarations
+# A setting that can be used in foreign key declarations
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
+# Two additional settings that are useful in South migrations when
+# specifying the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.