commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
210be14772b403e8fb5938e4e2cd391d43275ab1 | tests/test_ot_propagators.py | tests/test_ot_propagators.py | import instana.http_propagator as ihp
import opentracing as ot
from instana import tracer, options, util
from nose.tools import assert_equals
import inspect
def test_basics():
inspect.isclass(ihp.HTTPPropagator)
inject_func = getattr(ihp.HTTPPropagator, "inject", None)
assert inject_func
assert inspe... | import instana.http_propagator as ihp
import opentracing as ot
from instana import tracer, options, util
from nose.tools import assert_equals
import inspect
def test_basics():
inspect.isclass(ihp.HTTPPropagator)
inject_func = getattr(ihp.HTTPPropagator, "inject", None)
assert inject_func
assert calla... | Fix function test to work on both Py 2 + 3 | Fix function test to work on both Py 2 + 3
| Python | mit | instana/python-sensor,instana/python-sensor |
ef94948a8ce16d9d80fb69950381e0936a462bb0 | tests/config_tests.py | tests/config_tests.py | from nose.tools import assert_equal
from wunderapi.config import Config
def setup():
return Config(config_file="tests/resources/test_config")
def test_parse_config_with_correct_parms():
pass
def test_parse_config_with_incorrect_parms():
pass
def test_config_created_with_default_parms():
config =... | from nose.tools import assert_equal
from wunderapi.config import Config
def setup():
return Config(config_file="tests/resources/test_config")
def test_parse_config_with_correct_parms():
pass
def test_parse_config_with_incorrect_parms():
pass
def test_config_created_with_default_parms():
config =... | Update test to get api_key from environment | Update test to get api_key from environment
| Python | mit | paris3200/Weather,paris3200/wunderapi |
0529c392c8c3e75a03aa312e4fc7b367008fdf27 | tests/test_20_main.py | tests/test_20_main.py |
import click.testing
import pytest
from cfgrib import __main__
def test_main():
runner = click.testing.CliRunner()
res = runner.invoke(__main__.cfgrib_cli, ['selfcheck'])
assert res.exit_code == 0
assert 'Your system is ready.' in res.output
res = runner.invoke(__main__.cfgrib_cli, ['non-exis... |
import click.testing
from cfgrib import __main__
def test_main():
runner = click.testing.CliRunner()
res = runner.invoke(__main__.cfgrib_cli, ['selfcheck'])
assert res.exit_code == 0
assert 'Your system is ready.' in res.output
res = runner.invoke(__main__.cfgrib_cli, ['non-existent-command']... | Fix docs and CLI tests. | Fix docs and CLI tests.
| Python | apache-2.0 | ecmwf/cfgrib |
c5a0d0c5bf578a2221322c068a41ce6331b84c9b | tests/test_cattery.py | tests/test_cattery.py | import pytest
from catinabox import cattery
class TestCattery(object):
###########################################################################
# add_cats
###########################################################################
def test__add_cats__succeeds(self):
c = cattery.Cattery()... | import pytest
from catinabox import cattery, mccattery
@pytest.fixture(params=[
cattery.Cattery,
mccattery.McCattery
])
def cattery_fixture(request):
return request.param()
###########################################################################
# add_cats
###########################################... | Add full tests for mccattery and cattery | Add full tests for mccattery and cattery
| Python | mit | keeppythonweird/catinabox,indexOutOfBound5/catinabox |
e79f87121a955847af92d93fad3e2687fc4f472f | tests/test_gen_sql.py | tests/test_gen_sql.py | #!/usr/bin/env python
class TestGenSql:
def test_gen_drop_statement(self):
pass
def test_create_statement(self):
pass
| #!/usr/bin/env python
import sys
from io import StringIO
from pg_bawler import gen_sql
def test_simple_main(monkeypatch):
stdout = StringIO()
monkeypatch.setattr(sys, 'stdout', stdout)
class Args:
tablename = 'foo'
gen_sql.main(*[Args.tablename])
sql = stdout.getvalue()
assert gen_... | Add simple test for sql full sql generation with only tablename | Add simple test for sql full sql generation with only tablename
| Python | bsd-3-clause | beezz/pg_bawler,beezz/pg_bawler |
d60116aecbb6935fae508c94905a335fdb0603bb | tests/test_xgboost.py | tests/test_xgboost.py | import unittest
from sklearn import datasets
from xgboost import XGBClassifier
class TestXGBoost(unittest.TestCase):
def test_classifier(self):
boston = datasets.load_boston()
X, y = boston.data, boston.target
xgb1 = XGBClassifier(n_estimators=3)
xgb1.fit(X[0:70],y[0:70])
| import unittest
import xgboost
from distutils.version import StrictVersion
from sklearn import datasets
from xgboost import XGBClassifier
class TestXGBoost(unittest.TestCase):
def test_version(self):
# b/175051617 prevent xgboost version downgrade.
self.assertGreaterEqual(StrictVersion(xgboost.__... | Add xgboost version regression test. | Add xgboost version regression test.
BUG=175051617
| Python | apache-2.0 | Kaggle/docker-python,Kaggle/docker-python |
a57e40ea7b0cc55ec67664d9f32658085c24900f | tools/project/check_style.py | tools/project/check_style.py | import subprocess
import sys
git_diff_output = subprocess.check_output(
"git diff --name-only --diff-filter=ACM", universal_newlines=True)
git_diff_lines = git_diff_output.split("\n")
for file_name in git_diff_lines:
if not file_name:
continue
print "Checking style for %s" %file_name
ret_value = subprocess.call... | import subprocess
import sys
git_diff_output = subprocess.check_output(
"git diff --name-only --diff-filter=ACM", universal_newlines=True)
git_diff_lines = git_diff_output.split("\n")
for file_name in git_diff_lines:
if not file_name:
continue
print "Checking style for %s" %file_name
ret_value = subprocess.call... | Update style checker options to ignore copyright. | Update style checker options to ignore copyright.
| Python | mit | damlaren/ogle,damlaren/ogle,damlaren/ogle |
800706f5835293ee20dd9505d1d11c28eb38bbb2 | tests/shipane_sdk/matchers/dataframe_matchers.py | tests/shipane_sdk/matchers/dataframe_matchers.py | # -*- coding: utf-8 -*-
import re
from hamcrest.core.base_matcher import BaseMatcher
class HasColumn(BaseMatcher):
def __init__(self, column):
self._column = column
def _matches(self, df):
return self._column in df.columns
def describe_to(self, description):
description.append_... | # -*- coding: utf-8 -*-
import re
from hamcrest.core.base_matcher import BaseMatcher
class HasColumn(BaseMatcher):
def __init__(self, column):
self._column = column
def _matches(self, df):
return self._column in df.columns
def describe_to(self, description):
description.append_... | Fix HasColumn matcher for dataframe with duplicated columns | Fix HasColumn matcher for dataframe with duplicated columns
| Python | mit | sinall/ShiPanE-Python-SDK,sinall/ShiPanE-Python-SDK |
f85425a2c74cf15555bbed233287ddbd7ab8b24e | flexget/ui/plugins/log/log.py | flexget/ui/plugins/log/log.py | from __future__ import unicode_literals, division, absolute_import
from flexget.ui import register_plugin, Blueprint, register_menu
log = Blueprint('log', __name__)
register_plugin(log)
log.register_angular_route(
'',
url=log.url_prefix,
template_url='index.html',
controller='LogViewCtrl'
)
log.reg... | from __future__ import unicode_literals, division, absolute_import
from flexget.ui import register_plugin, Blueprint, register_menu
log = Blueprint('log', __name__)
register_plugin(log)
log.register_angular_route(
'',
url=log.url_prefix,
template_url='index.html',
controller='LogViewCtrl'
)
log.reg... | Rename libs to keep with standard | Rename libs to keep with standard
| Python | mit | LynxyssCZ/Flexget,qvazzler/Flexget,tobinjt/Flexget,malkavi/Flexget,ZefQ/Flexget,qk4l/Flexget,Flexget/Flexget,tsnoam/Flexget,ianstalk/Flexget,grrr2/Flexget,jacobmetrick/Flexget,qvazzler/Flexget,crawln45/Flexget,poulpito/Flexget,JorisDeRieck/Flexget,gazpachoking/Flexget,tobinjt/Flexget,oxc/Flexget,dsemi/Flexget,jawilson/... |
8eb47d151868c8e5906af054749993cd46a73b2d | capstone/player/kerasplayer.py | capstone/player/kerasplayer.py | from keras.models import load_model
from . import Player
from ..utils import normalize_board, utility
class KerasPlayer(Player):
'''
Takes moves based on a Keras neural network model.
'''
name = 'Keras'
def __init__(self, filepath):
self.model = load_model(filepath)
def __str__(self... | from keras.models import load_model
from . import Player
from ..utils import normalize_board, utility
class KerasPlayer(Player):
'''
Takes moves based on a Keras neural network model.
'''
name = 'Keras'
def __init__(self, filepath):
self.model = load_model(filepath)
def __str__(self... | Rename state to game in KerasPlayer | Rename state to game in KerasPlayer
| Python | mit | davidrobles/mlnd-capstone-code |
9b032e06156aa011e5d78d0d9ea297420cb33c2e | form_designer/contrib/cms_plugins/form_designer_form/migrations/0001_initial.py | form_designer/contrib/cms_plugins/form_designer_form/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import cms
from django.db import migrations, models
from pkg_resources import parse_version as V
# Django CMS 3.3.1 is oldest release where the change affects.
# Refs https://github.com/divio/django-cms/commit/871a164
if V(cms.__version__) >= V('3.3.1'):... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import cms
from django.db import migrations, models
from pkg_resources import parse_version as V
# Django CMS 3.3.1 is oldest release where the change affects.
# Refs https://github.com/divio/django-cms/commit/871a164
if V(cms.__version__) >= V('3.3.1'):... | Add on_delete args to CMS plugin migration for Django 2 support | Add on_delete args to CMS plugin migration for Django 2 support
| Python | bsd-3-clause | kcsry/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer,andersinno/django-form-designer-ai,andersinno/django-form-designer-ai,andersinno/django-form-designer |
d6787523cb8b58c51fe32d4524389a500e3b7b21 | foliant/cli.py | foliant/cli.py | """Foliant: Markdown to PDF, Docx, and LaTeX generator powered by Pandoc.
Usage:
foliant (build | make) <target> [--path=<project-path>]
foliant (upload | up) <document> [--secret=<client_secret*.json>]
foliant (-h | --help)
foliant --version
Options:
-h --help Show this screen.
-... | """Foliant: Markdown to PDF, Docx, and LaTeX generator powered by Pandoc.
Usage:
foliant (build | make) <target> [--path=<project-path>]
foliant (upload | up) <document> [--secret=<client_secret*.json>]
foliant (-h | --help)
foliant --version
Options:
-h --help Show this screen.
-... | Replace hardcoded package name with ".". | CLI: Replace hardcoded package name with ".".
| Python | mit | foliant-docs/foliant |
dd02861cd9fb5b06d42f7a6413b371c52c167ba8 | gcmconsumer.py | gcmconsumer.py | import sys
import fedmsg.consumers
import yaml
class GCMConsumer(fedmsg.consumers.FedmsgConsumer):
topic = 'org.fedoraproject.prod.*'
config_key = 'gcmconsumer'
def __init__(self, *args, **kw):
super(GCMConsumer, self).__init__(*args, **kw)
def get_registration_ids_for_topic(self, topic):
... | import fedmsg.consumers
import json
import requests
import sys
import yaml
class GCMConsumer(fedmsg.consumers.FedmsgConsumer):
topic = 'org.fedoraproject.prod.*'
config_key = 'gcmconsumer'
def __init__(self, *args, **kw):
self.config_file = '/home/ricky/devel/fedora/fedmsg-gcm-demo/config.yaml'
... | Handle actually sending out notifications | Handle actually sending out notifications
| Python | apache-2.0 | fedora-infra/fedmsg-gcm-demo |
019c91a8cd32fe1a4034837ed75dcc849d9033e5 | format_json.py | format_json.py | #! /usr/bin/env python3
import sys
import json
for filepath in sys.argv[1:]:
with open(filepath) as f:
try:
oyster = json.load(f)
except ValueError:
sys.stderr.write("In file: {}\n".format(filepath))
raise
with open(filepath, 'w') as f:
json.dump(oys... | #! /usr/bin/env python3
import sys
import json
import argparse
def format_json(fp):
try:
data = json.load(fp)
except ValueError:
sys.stderr.write("In file: {}\n".format(fp.name))
raise
# Jump back to the beginning of the file before overwriting it.
fp.seek(0)
json.dump(data... | Make this a proper argparse script. | Make this a proper argparse script.
| Python | mit | nbeaver/cmd-oysters,nbeaver/cmd-oysters |
2a242bb6984fae5e32f117fa5ae68118621f3c95 | pycroft/model/alembic/versions/fb8d553a7268_add_account_pattern.py | pycroft/model/alembic/versions/fb8d553a7268_add_account_pattern.py | """add account_pattern
Revision ID: fb8d553a7268
Revises: 28e56bf6f62c
Create Date: 2021-04-26 22:16:41.772282
"""
from alembic import op
import sqlalchemy as sa
import pycroft
# revision identifiers, used by Alembic.
revision = 'fb8d553a7268'
down_revision = '0b69e80a9388'
branch_labels = None
depends_on = None
... | """add account_pattern
Revision ID: fb8d553a7268
Revises: 28e56bf6f62c
Create Date: 2021-04-26 22:16:41.772282
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'fb8d553a7268'
down_revision = '0b69e80a9388'
branch_labels = None
depends_on = None
def upgrade():
... | Remove unnecessary pycroft import in migration | Remove unnecessary pycroft import in migration
| Python | apache-2.0 | agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft |
569e180b99be2ec67f360a7081bbd54020d78a25 | grum/models.py | grum/models.py | import bcrypt
from grum import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(64), unique=True)
password = db.Column(db.String(128))
display_name = db.Column(db.String(128))
def __init__(self, username=None, password=None):
if username... | import bcrypt
from grum import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(64), unique=True)
password = db.Column(db.String(128))
display_name = db.Column(db.String(128))
def __init__(self, username=None, display_name=None, password=None):
... | Add display name to the constructor for User | Add display name to the constructor for User
| Python | mit | Grum-Hackdee/grum-web,Grum-Hackdee/grum-web,Grum-Hackdee/grum-web,Grum-Hackdee/grum-web |
94861438189537b88deaf8d04cc9942192038d8c | user_messages/views.py | user_messages/views.py | from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from user_messages.models import Thread, Message
@login_required
def inbox(request, template_name='user_messages/inbox.html'):
threads ... | from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from user_messages.models import Thread, Message
@login_required
def inbox(request, template_name='user_messages/inbox.html'):
threads ... | Update the read status of a thread when it's viewed | Update the read status of a thread when it's viewed
| Python | mit | eldarion/user_messages,eldarion/user_messages,pinax/pinax-messages,arthur-wsw/pinax-messages,pinax/pinax-messages,arthur-wsw/pinax-messages |
64f9ef6fcc71ef09e113161711369fe4d9781a18 | shorpypaper.py | shorpypaper.py | #!/usr/bin/python
from pyquery import PyQuery as pq
import requests
import subprocess
APPLESCRIPT = """/usr/bin/osascript<<END
tell application "Finder"
set desktop picture to POSIX file "%s"
end tell
END"""
def main():
# Load main site.
root = 'http://www.shorpy.com'
r = requests.get(root)
j = pq(r.... | #!/usr/bin/python
from pyquery import PyQuery as pq
import requests
import subprocess
APPLESCRIPT = """/usr/bin/osascript<<END
tell application "Finder"
set desktop picture to POSIX file "%s"
end tell
END"""
def main():
# Load main site.
root = 'http://www.shorpy.com'
r = requests.get(root)
j = pq(r.... | Use a grey solid instead of the damn frog. | Use a grey solid instead of the damn frog.
| Python | mit | nicksergeant/shorpypaper |
9f6d6509b1f3f4a5f3fd20919bcc465475fc1ce3 | app/composer.py | app/composer.py | import os
from app.configuration import get_value
from app.helper import php
def initialization():
checker_dir = get_value('checker-dir')
if not os.path.isfile(checker_dir+'bin/composer'):
download(checker_dir)
if not os.path.isfile(checker_dir+'bin/phpcs'):
php('bin/composer install')
... | import os
from app.configuration import get_value
from app.helper import php
def initialization():
checker_dir = get_value('checker-dir')
if not os.path.isfile(checker_dir+'bin/composer'):
download(checker_dir)
if not os.path.isfile(checker_dir+'bin/phpcs'):
composer('install')
def down... | Add execution path for internal update | Add execution path for internal update
| Python | mit | mi-schi/php-code-checker |
618245ab759cbf47fb53946b4c6149efdca7e1e0 | troposphere/sqs.py | troposphere/sqs.py | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject
from .validators import integer
try:
from awacs.aws import Policy
policytypes = (dict, Policy)
except ImportError:
policytypes = dict,
class Queue(AWSObject):
typ... | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import integer
try:
from awacs.aws import Policy
policytypes = (dict, Policy)
except ImportError:
policytypes = dict,
class RedrivePolic... | Add SQS dead letter queue from CloudFormation release 2014-01-29 | Add SQS dead letter queue from CloudFormation release 2014-01-29
| Python | bsd-2-clause | cloudtools/troposphere,mhahn/troposphere,johnctitus/troposphere,ikben/troposphere,ikben/troposphere,garnaat/troposphere,pas256/troposphere,alonsodomin/troposphere,Yipit/troposphere,ptoraskar/troposphere,mannytoledo/troposphere,dmm92/troposphere,craigbruce/troposphere,jantman/troposphere,micahhausler/troposphere,jdc0589... |
1026581107668e15db91912302ae3fd577140008 | builder.py | builder.py | import ratebeer
import string
def strip_brewery_name(brewery_name, beer_name):
brewery_word_list = brewery_name.split()
for word in brewery_word_list:
beer_name = beer_name.replace(word, "")
return beer_name.strip()
categories = []
categories.append("0-9")
for letter in string.ascii_uppercase:
... | import ratebeer
import string
import csv
from io import BytesIO
def strip_brewery_name(brewery_name, beer_name):
brewery_word_list = brewery_name.split()
for word in brewery_word_list:
beer_name = beer_name.replace(word, "")
return beer_name.strip()
def brewery_name_field(brewery):
val = getat... | Add a csv export for caching the list of beers for display in the app | Add a csv export for caching the list of beers for display in the app
| Python | mit | jwrubel/initial_dictionary |
054b0bf9cacef4e55fb8167fb5f2611e2ce39b43 | hw3/hw3_2a.py | hw3/hw3_2a.py | import sympy
x1, x2 = sympy.symbols('x1 x2')
f = 100*(x2 - x1**2)**2 + (1-x1)**2
df_dx1 = sympy.diff(f,x1)
df_dx2 = sympy.diff(f,x2)
H = sympy.hessian(f, (x1, x2))
xs = sympy.solve([df_dx1, df_dx2], [x1, x2])
H_xs = H.subs([(x1,xs[0][0]), (x2,xs[0][1])])
flag = True
for i in H_xs.eigenvals().keys():
if i.evalf... | import sympy
x1, x2 = sympy.symbols('x1 x2')
f = 100*(x2 - x1**2)**2 + (1-x1)**2
df_dx1 = sympy.diff(f,x1)
df_dx2 = sympy.diff(f,x2)
H = sympy.hessian(f, (x1, x2))
xs = sympy.solve([df_dx1, df_dx2], [x1, x2])
H_xs = H.subs([(x1,xs[0][0]), (x2,xs[0][1])])
lambda_xs = H_xs.eigenvals()
count = 0
for i in lambda_xs.ke... | Fix decision about minima, maxima and saddle point | Fix decision about minima, maxima and saddle point
| Python | bsd-2-clause | escorciav/amcs211,escorciav/amcs211 |
ddbcd88bb086d1978c9196833d126ded18db97f8 | airflow/migrations/versions/211e584da130_add_ti_state_index.py | airflow/migrations/versions/211e584da130_add_ti_state_index.py | """add TI state index
Revision ID: 211e584da130
Revises: 2e82aab8ef20
Create Date: 2016-06-30 10:54:24.323588
"""
# revision identifiers, used by Alembic.
revision = '211e584da130'
down_revision = '2e82aab8ef20'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
... | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | Add license to migration file | Add license to migration file
| Python | apache-2.0 | dhuang/incubator-airflow,Twistbioscience/incubator-airflow,kerzhner/airflow,vineet-rh/incubator-airflow,zodiac/incubator-airflow,cademarkegard/airflow,MetrodataTeam/incubator-airflow,sekikn/incubator-airflow,sergiohgz/incubator-airflow,wooga/airflow,RealImpactAnalytics/airflow,CloverHealth/airflow,apache/incubator-airf... |
0469f8f707ba542b0e1af2915d8a46a0107d9d62 | calexicon/tests/test_dates.py | calexicon/tests/test_dates.py | import unittest
from datetime import date
from calexicon.dates import DateWithCalendar
class TestDateWithCalendar(unittest.TestCase):
def setUp(self):
date_dt = date(2010, 8, 1)
self.date_wc = DateWithCalendar(None, date_dt)
def test_comparisons(self):
self.assertTrue(self.date_wc <... | import unittest
from datetime import date, timedelta
from calexicon.dates import DateWithCalendar
class TestDateWithCalendar(unittest.TestCase):
def setUp(self):
date_dt = date(2010, 8, 1)
self.date_wc = DateWithCalendar(None, date_dt)
def test_comparisons(self):
self.assertTrue(sel... | Add a test for __sub__ between a DateWith and a vanilla date. | Add a test for __sub__ between a DateWith and a vanilla date.
| Python | apache-2.0 | jwg4/calexicon,jwg4/qual |
f3e6bc366ea77468772905c0094c9b4305c49fed | jsonpickle/handlers.py | jsonpickle/handlers.py |
class TypeRegistered(type):
"""
As classes of this metaclass are created, they keep a registry in the
base class of all handler referenced by the keys in cls._handles.
"""
def __init__(cls, name, bases, namespace):
super(TypeRegistered, cls).__init__(name, bases, namespace)
if not h... |
class TypeRegistered(type):
"""
As classes of this metaclass are created, they keep a registry in the
base class of all handler referenced by the keys in cls._handles.
"""
def __init__(cls, name, bases, namespace):
super(TypeRegistered, cls).__init__(name, bases, namespace)
if not h... | Add a backward-compatibility shim to lessen the burden upgrading from 0.4 to 0.5 | Add a backward-compatibility shim to lessen the burden upgrading from 0.4 to 0.5
| Python | bsd-3-clause | mandx/jsonpickle,dongguangming/jsonpickle,mandx/jsonpickle,mandx/jsonpickle,dongguangming/jsonpickle,dongguangming/jsonpickle,mandx/jsonpickle,dongguangming/jsonpickle |
08eb1f9e510b85e77d401ca4e13b7ad5354f4ecf | ingestors/email/outlookpst.py | ingestors/email/outlookpst.py | import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.temp import TempFileSupport
from ingestors.support.shell import ShellSupport
from ingestors.support.ole import OLESupport
from ingestors.directory import DirectoryIngestor
log = logging.getLogger(__name__)
... | import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.temp import TempFileSupport
from ingestors.support.shell import ShellSupport
from ingestors.support.ole import OLESupport
from ingestors.directory import DirectoryIngestor
log = logging.getLogger(__name__)
... | Make outlook emit single files | Make outlook emit single files
| Python | mit | alephdata/ingestors |
a2c8ade4d73b6756fef2829c0e656acbe60f2b03 | fabfile.py | fabfile.py | from fabric.api import local
from fabric.api import warn_only
CMD_MANAGE = "python manage.py "
def auto_schema():
with warn_only():
schema('rockit.foundation.core')
schema('rockit.plugins.mailout')
schema('rockit.plugins.razberry')
def build():
migrate('rockit.foundation.core')
mi... | from fabric.api import local
CMD_MANAGE = "python manage.py "
def auto_schema():
schema('rockit.foundation.core')
schema('rockit.plugins.mailout')
schema('rockit.plugins.razberry')
def build():
migrate('rockit.foundation.core')
migrate('rockit.plugins.mailout')
migrate('rockit.plugins.razberr... | Remove warn only from fabric file | Remove warn only from fabric file
| Python | mit | acreations/rockit-server,acreations/rockit-server,acreations/rockit-server,acreations/rockit-server |
5847e9db8f316fdee6493fefc9cbc64a1e6a28de | km_api/know_me/serializers/subscription_serializers.py | km_api/know_me/serializers/subscription_serializers.py | import hashlib
import logging
from django.utils.translation import ugettext
from rest_framework import serializers
from know_me import models, subscriptions
logger = logging.getLogger(__name__)
class AppleSubscriptionSerializer(serializers.ModelSerializer):
"""
Serializer for an Apple subscription.
""... | import hashlib
import logging
from django.utils.translation import ugettext
from rest_framework import serializers
from know_me import models, subscriptions
logger = logging.getLogger(__name__)
class AppleSubscriptionSerializer(serializers.ModelSerializer):
"""
Serializer for an Apple subscription.
""... | Mark apple receipt expiration time as read only. | Mark apple receipt expiration time as read only.
| Python | apache-2.0 | knowmetools/km-api,knowmetools/km-api,knowmetools/km-api,knowmetools/km-api |
fa279ca1f8e4c8e6b4094840d3ab40c0ac637eff | ocradmin/ocrpresets/models.py | ocradmin/ocrpresets/models.py | from django.db import models
from django.contrib.auth.models import User
from picklefield import fields
from tagging.fields import TagField
import tagging
class OcrPreset(models.Model):
user = models.ForeignKey(User)
tags = TagField()
name = models.CharField(max_length=100, unique=True)
description = m... | from django.db import models
from django.contrib.auth.models import User
from picklefield import fields
from tagging.fields import TagField
import tagging
class OcrPreset(models.Model):
user = models.ForeignKey(User)
tags = TagField()
name = models.CharField(max_length=100, unique=True)
description = m... | Improve unicode method. Whitespace cleanup | Improve unicode method. Whitespace cleanup
| Python | apache-2.0 | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium |
ebdc3a1d00ddd8c15aaa64c436e43f3815317923 | pythainlp/segment/pyicu.py | pythainlp/segment/pyicu.py | from __future__ import absolute_import,print_function
from itertools import groupby
import PyICU
import six
# ตัดคำภาษาไทย
def segment(txt):
"""รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU"""
bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th"))
bd.setText(six.u(txt))
bre... | from __future__ import absolute_import,print_function
from itertools import groupby
import PyICU
# ตัดคำภาษาไทย
def segment(txt):
"""รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU"""
bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th"))
bd.setText(six.u(txt))
breaks = list(... | Revert "fix bug import six" | Revert "fix bug import six"
This reverts commit a80c1d7c80d68f72d435dbb7ac5c48a6114716fb.
| Python | apache-2.0 | PyThaiNLP/pythainlp |
c7455da1b0092e926ed9dafe5ac5ae1335401dba | admin.py | admin.py | from django.contrib import admin
from django.contrib.sites.models import Site
from .models import Church
admin.site.site_header = "Churches of Bridlington Administration"
admin.site.register(Church)
admin.site.unregister(Site)
| from django.contrib import admin
from django.contrib.sites.models import Site
from .models import Church
admin.site.site_header = "Churches of Bridlington Administration"
admin.site.register(Church)
| Undo deregistration of Site object | Undo deregistration of Site object
This will now be controlled by restricting permissions in the
admin.
| Python | mit | bm424/churchmanager,bm424/churchmanager |
dee0b3764259ee7f4916e8e5e303c48afb3e5edd | api/base/urls.py | api/base/urls.py | from django.conf import settings
from django.conf.urls import include, url
# from django.contrib import admin
from django.conf.urls.static import static
from . import views
urlpatterns = [
### API ###
url(r'^$', views.root),
url(r'^nodes/', include('api.nodes.urls', namespace='nodes')),
url(r'^users... | from django.conf import settings
from django.conf.urls import include, url, patterns
# from django.contrib import admin
from django.conf.urls.static import static
from . import views
urlpatterns = [
### API ###
url(r'^v2/', include(patterns('',
url(r'^$', views.root),
url(r'^nodes/', include... | Change API url prefix to 'v2' | Change API url prefix to 'v2'
| Python | apache-2.0 | laurenrevere/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,cosenal/osf.io,reinaH/osf.io,binoculars/osf.io,CenterForOpenScience/osf.io,mluo613/osf.io,aaxelb/osf.io,MerlinZhang/osf.io,TomHeatwole/osf.io,felliott/osf.io,sloria/osf.io,dplorimer/osf,wearpants/osf.io,chrisseto/osf.io,zamattiac/osf.io,wearpants/osf.i... |
f70574c38140c9a5493981f5baf72bab82be8c60 | opps/articles/tests/models.py | opps/articles/tests/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from opps.articles.models import Post
class PostModelTest(TestCase):
fixtures = ['tests/initial_data.json']
def setUP(self):
self.post = Post.objects.get(id=1)
def test_basic_post_exist(self):
post = Post.ob... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from opps.articles.models import Post
class PostModelTest(TestCase):
fixtures = ['tests/initial_data.json']
def setUp(self):
self.post = Post.objects.get(id=1)
def test_basic_post_exist(self):
post = Post.ob... | Add test articles, post get absolute url | Add test articles, post get absolute url
| Python | mit | YACOWS/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,williamroot/opps,jeanmask/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps |
dcc810f3181ebe358481c30c2248d25511aab26c | npz_to_my5c.py | npz_to_my5c.py | import numpy as np
import argparse
import sys
import pandas as pd
parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.')
parser.add_argument('-n', '--npz_frequencies_file', required=True, help='An npz file containing co-segregation frequencies to convert... | import numpy as np
import argparse
import sys
import pandas as pd
parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.')
parser.add_argument('-n', '--npz_frequencies_file', required=True, help='An npz file containing co-segregation frequencies to convert... | Handle NaNs properly when flattening matrices. | Handle NaNs properly when flattening matrices.
| Python | apache-2.0 | pombo-lab/gamtools,pombo-lab/gamtools |
8ad95ada5e57ad941b1333cea8f8b81ce739a245 | knights/defaultfilters.py | knights/defaultfilters.py |
from .library import Library
from .filters import Filter
register = Library()
@register.filter(name='title')
class TitleFilter(Filter):
def __rshift__(self, other):
return str(other).title()
|
from .library import Library
register = Library()
@register.filter
def title(val):
return str(val).title()
| Convert to new style filter | Convert to new style filter
| Python | mit | funkybob/knights-templater,funkybob/knights-templater |
0512534c4067b6c36d68241d1ccc7de349a3bbe8 | betfairlightweight/__init__.py | betfairlightweight/__init__.py | from .apiclient import APIClient
from .exceptions import BetfairError
from .streaming import StreamListener
from .filters import MarketFilter, StreamingMarketFilter, StreamingMarketDataFilter
__title__ = 'betfairlightweight'
__version__ = '0.9.9'
__author__ = 'Liam Pauling'
| import logging
from .apiclient import APIClient
from .exceptions import BetfairError
from .filters import MarketFilter, StreamingMarketFilter, StreamingMarketDataFilter
from .streaming import StreamListener
__title__ = 'betfairlightweight'
__version__ = '0.9.9'
__author__ = 'Liam Pauling'
# Set default logging hand... | Add NullHandler to top level package logger | Add NullHandler to top level package logger
| Python | mit | liampauling/betfair,liampauling/betfairlightweight |
9be232ab83a4c482eaf56ea99f7b1be81412c517 | Bookie/fabfile/development.py | Bookie/fabfile/development.py | """Fabric commands useful for working on developing Bookie are loaded here"""
from fabric.api import hosts
from fabric.api import local
from fabric.contrib.project import rsync_project
bootstrap_host = 'ubuntu@bmark'
bootstrap_server = '/var/www/bootstrap.py'
bootstrap_local = 'scripts/bootstrap/bootstrap.py'
def ge... | """Fabric commands useful for working on developing Bookie are loaded here"""
import os
from fabric.api import hosts
from fabric.api import local
from fabric.contrib.project import rsync_project
bootstrap_host = 'ubuntu@bmark'
bootstrap_server = '/var/www/bootstrap.py'
bootstrap_local = 'scripts/bootstrap/bootstrap.p... | Add a fab command to run jstests | Add a fab command to run jstests
| Python | agpl-3.0 | adamlincoln/Bookie,skmezanul/Bookie,charany1/Bookie,charany1/Bookie,adamlincoln/Bookie,bookieio/Bookie,wangjun/Bookie,teodesson/Bookie,GreenLunar/Bookie,wangjun/Bookie,teodesson/Bookie,GreenLunar/Bookie,pombredanne/Bookie,pombredanne/Bookie,charany1/Bookie,GreenLunar/Bookie,skmezanul/Bookie,teodesson/Bookie,wangjun/Boo... |
7197f1578335b38eb2037e8d82f15a27d786d5c1 | var/spack/repos/builtin/packages/py-setuptools/package.py | var/spack/repos/builtin/packages/py-setuptools/package.py | from spack import *
class PySetuptools(Package):
"""Easily download, build, install, upgrade, and uninstall Python packages."""
homepage = "https://pypi.python.org/pypi/setuptools"
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz"
version('11.3.1', '01f69212e019a... | from spack import *
class PySetuptools(Package):
"""Easily download, build, install, upgrade, and uninstall Python packages."""
homepage = "https://pypi.python.org/pypi/setuptools"
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz"
version('11.3.1', '01f69212e019a... | Add version 2.6.7 of py-setuptools | Add version 2.6.7 of py-setuptools
| Python | lgpl-2.1 | skosukhin/spack,mfherbst/spack,tmerrick1/spack,lgarren/spack,skosukhin/spack,krafczyk/spack,iulian787/spack,skosukhin/spack,tmerrick1/spack,skosukhin/spack,matthiasdiener/spack,matthiasdiener/spack,TheTimmy/spack,LLNL/spack,LLNL/spack,krafczyk/spack,mfherbst/spack,mfherbst/spack,matthiasdiener/spack,mfherbst/spack,Emre... |
90e7bc2c8313de2a5054d5290441c527f5f2c253 | gameButton.py | gameButton.py | # Game Button class for menu
# Marshall Ehlinger
import pygame
class gameButton:
GRAY = [131, 131, 131]
PINK = [255, 55, 135]
def __init__(self, label, buttonWidth, buttonHeight, importedGameFunction):
self.label = label
self.height = buttonHeight
self.width = buttonWidth
self.importedGameFunction = impo... | # Game Button class for menu
# Marshall Ehlinger
import pygame
class gameButton:
GRAY = [131, 131, 131]
PINK = [255, 55, 135]
WHITE = [255, 255, 255]
BLACK = [0, 0, 0]
def __init__(self, label, buttonWidth, buttonHeight, importedGameFunction):
self.label = label
self.height = buttonHeight
self.width = bu... | Add labels to menu buttons | Add labels to menu buttons
| Python | mit | MEhlinger/rpi_pushbutton_games |
f791354a098c32617f02f05dbbb53861b7a94139 | rapt/cmds/ingredients.py | rapt/cmds/ingredients.py | import click
from rapt.connection import get_vr
from rapt.models import query
from rapt.util import dump_yaml, load_yaml, edit_yaml
@click.command()
@click.option('--name', '-n')
def ingredients(name, verbose):
"""List builds.
"""
vr = get_vr()
q = {}
if name:
q['name'] = name
# add... | import click
from rapt.connection import get_vr
from rapt.models import query
from rapt.util import dump_yaml, load_yaml, edit_yaml
@click.command()
@click.option('--name', '-n')
def ingredients(name, verbose):
"""List builds.
"""
vr = get_vr()
q = {}
if name:
q['name'] = name
# add... | Update the ingredient or noop if there are no changes | Update the ingredient or noop if there are no changes
| Python | bsd-3-clause | yougov/rapt,yougov/rapt |
903458640ec8db1c39c822b229e466bc717efe40 | registration/__init__.py | registration/__init__.py | from django.utils.version import get_version as django_get_version
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
return django_get_version(VERSION) # pragma: no cover
| VERSION = (0, 9, 0, 'beta', 1)
def get_version():
from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover
| Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems. | Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems.
| Python | bsd-3-clause | christang/django-registration-1.5,AndrewLvov/django-registration,AndrewLvov/django-registration,fedenko/django-registration,fedenko/django-registration,christang/django-registration-1.5 |
afe90ba2a9720ffd80780e7696353510501362c7 | studygroups/management/commands/generate_reminders.py | studygroups/management/commands/generate_reminders.py | from django.core.management.base import BaseCommand, CommandError
from studygroups.tasks import gen_reminders
class Command(BaseCommand):
help = 'Generate reminders for all study groups happening in 3 days from now'
def handle(self, *args, **options):
gen_reminders()
| from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from studygroups.models import Meeting
from studygroups.models.learningcircle import generate_meeting_reminder
class Command(BaseCommand):
help = 'Transitional command to generate reminders for all meetings in the ... | Update task to generate reminders for all future meetings | Update task to generate reminders for all future meetings
| Python | mit | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles |
d1d55450db13766f51f264c9bfef1bcea74ef7b1 | convert.py | convert.py | #!/usr/bin/env python
import os, sys
import pexpect
import geom
from sfepy.fem.mesh import Mesh
try:
from site_cfg import tetgen_path
except ImportError:
tetgen_path = '/usr/bin/tetgen'
def mesh():
if len( sys.argv ) == 3:
geomFileName = sys.argv[1]
vtkFileName = sys.argv[2]
if len( sy... | #!/usr/bin/env python
import os, sys
import geom
from sfepy.fem.mesh import Mesh
try:
from site_cfg import tetgen_path
except ImportError:
tetgen_path = '/usr/bin/tetgen'
def mesh():
if len( sys.argv ) == 3:
geomFileName = sys.argv[1]
vtkFileName = sys.argv[2]
if len( sys.argv ) == 2:
... | Use os.system() instead of pexpect.run(). | Use os.system() instead of pexpect.run().
Also do not generate too dense mesh by default, so that it's faster.
| Python | bsd-3-clause | BubuLK/sfepy,sfepy/sfepy,BubuLK/sfepy,RexFuzzle/sfepy,vlukes/sfepy,sfepy/sfepy,rc/sfepy,lokik/sfepy,RexFuzzle/sfepy,BubuLK/sfepy,olivierverdier/sfepy,sfepy/sfepy,olivierverdier/sfepy,vlukes/sfepy,lokik/sfepy,vlukes/sfepy,RexFuzzle/sfepy,RexFuzzle/sfepy,olivierverdier/sfepy,lokik/sfepy,lokik/sfepy,rc/sfepy,rc/sfepy |
d178fb001b8b6869038ed6ec288acf5fb427205c | rssmailer/tasks/mail.py | rssmailer/tasks/mail.py | from celery.decorators import task
from django.core.mail import send_mail
from ..models import Email
@task(ignore_result=True, name="rssmailer.tasks.mail.send")
def send(entry, **kwargs):
logger = send.get_logger(**kwargs)
logger.info("Sending entry: %s" % entry.title)
emails_all = Email.objects.all(... | from celery.decorators import task
from django.core.mail import send_mail
from ..models import Email
@task(ignore_result=True, name="rssmailer.tasks.send")
def send(entry, **kwargs):
logger = send.get_logger(**kwargs)
logger.info("Sending entry: %s" % entry.title)
emails_all = Email.objects.all()
... | Fix naming issues with tasks | Fix naming issues with tasks
| Python | bsd-3-clause | praus/django-rssmailer |
615627cf6ea4725bed7886e822bc01c12d9fdead | nodewatcher/web/sanitize-dump.py | nodewatcher/web/sanitize-dump.py | #!/usr/bin/python
# Setup import paths, since we are using Django models
import sys, os
sys.path.append('/var/www/django')
os.environ['DJANGO_SETTINGS_MODULE'] = 'wlanlj.settings_production'
# Imports
from django.core import serializers
if len(sys.argv) != 4:
print "Usage: %s format input-file output-file" % sys.a... | #!/usr/bin/python
# Setup import paths, since we are using Django models
import sys, os
sys.path.append('/var/www/django')
os.environ['DJANGO_SETTINGS_MODULE'] = 'wlanlj.settings_production'
# Imports
from django.core import serializers
if len(sys.argv) != 4:
print "Usage: %s format input-file output-file" % sys.a... | Remove solar statistics data from dumps. | Remove solar statistics data from dumps.
| Python | agpl-3.0 | galaxor/Nodewatcher,galaxor/Nodewatcher,galaxor/Nodewatcher,galaxor/Nodewatcher |
8ca20bec63b8f8aaff55a7012c69a2644e292095 | mltsp/science_features/lomb_scargle_fast.py | mltsp/science_features/lomb_scargle_fast.py | import numpy as np
import gatspy
def lomb_scargle_fast_period(t, m, e):
"""Fits a simple sinuosidal model
y(t) = A sin(2*pi*w*t) + B cos(2*pi*w*t) + c
and returns the estimated period 1/w. Much faster than fitting the
full multi-frequency model used by `science_features.lomb_scargle`.
"""
... | import numpy as np
import gatspy
def lomb_scargle_fast_period(t, m, e):
"""Fits a simple sinuosidal model
y(t) = A sin(2*pi*w*t + phi) + c
and returns the estimated period 1/w. Much faster than fitting the
full multi-frequency model used by `science_features.lomb_scargle`.
"""
opt_args =... | Change docstring for `period_fast` feature | Change docstring for `period_fast` feature
| Python | bsd-3-clause | bnaul/mltsp,mltsp/mltsp,mltsp/mltsp,bnaul/mltsp,acrellin/mltsp,bnaul/mltsp,acrellin/mltsp,mltsp/mltsp,mltsp/mltsp,bnaul/mltsp,acrellin/mltsp,mltsp/mltsp,mltsp/mltsp,acrellin/mltsp,bnaul/mltsp,acrellin/mltsp,bnaul/mltsp,acrellin/mltsp |
4d5c8ec9c2006b78a42461af43944de8ab7bc9ea | us_ignite/common/sanitizer.py | us_ignite/common/sanitizer.py | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],
'acronym': ['title'],
}
ALLOWED_STYLES = []
def... | import bleach
ALLOWED_TAGS = [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
'p',
'br',
'h3',
'h4',
'h5',
'h6',
]
ALLOWED_ATTRIBUTES = {
'a': ['href', 'title'],
'abbr': ['title'],
'acronym':... | Allow low level titles when sanitising. | Allow low level titles when sanitising.
| Python | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite |
858bc6f152a87298f9bd3568712aed49b6e02e42 | suave/suave.py | suave/suave.py | #!/usr/bin/env python
import curses
import os
import time
from box import Box
from utils import load_yaml
def main(screen):
"""
Draws and redraws the screen.
"""
# Hide the cursor.
curses.curs_set(0)
# Load config from file.
config = load_yaml(os.path.expanduser('~/.suave/config.yml'))
... | #!/usr/bin/env python
import curses
import os
from box import Box
from utils import load_yaml
def main(screen):
"""
Draws and redraws the screen.
"""
# Hide the cursor.
curses.curs_set(0)
# Load config from file.
config = load_yaml(os.path.expanduser('~/.suave/config.yml'))
# Creat... | Use napms method from curses rather than sleep method from time | Use napms method from curses rather than sleep method from time
| Python | mit | countermeasure/suave |
d648598d669144d589ffbbb03bf56edad4050aff | connector/__manifest__.py | connector/__manifest__.py | # -*- coding: utf-8 -*-
# Copyright 2013-2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{'name': 'Connector',
'version': '10.0.1.0.0',
'author': 'Camptocamp,Openerp Connector Core Editors,'
'Odoo Community Association (OCA)',
'website': 'http://odoo-connector.com',... | # -*- coding: utf-8 -*-
# Copyright 2013-2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{'name': 'Connector',
'version': '10.0.1.0.0',
'author': 'Camptocamp,Openerp Connector Core Editors,'
'Odoo Community Association (OCA)',
'website': 'http://odoo-connector.com',... | Remove application flag, not an application | Remove application flag, not an application
| Python | agpl-3.0 | js-landoo/connector,js-landoo/connector |
15cb279724a646368066591e81467e1b26d61938 | examples/charts/file/steps.py | examples/charts/file/steps.py | from bokeh.charts import Step, show, output_file
# build a dataset where multiple columns measure the same thing
data = dict(python=[2, 3, 7, 5, 26, 221, 44, 233, 254, 265, 266, 267, 120, 111],
pypy=[12, 33, 47, 15, 126, 121, 144, 233, 254, 225, 226, 267, 110, 130],
jython=[22, 43, 10, 25, 26, ... | """ This example uses the U.S. postage rate per ounce for stamps and
postcards.
Source: https://en.wikipedia.org/wiki/History_of_United_States_postage_rates
"""
from bokeh.charts import Step, show, output_file
# build a dataset where multiple columns measure the same thing
data = dict(stamp=[
.33, .3... | Change step example to plot US postage rates | Change step example to plot US postage rates
| Python | bsd-3-clause | ptitjano/bokeh,timsnyder/bokeh,draperjames/bokeh,percyfal/bokeh,justacec/bokeh,clairetang6/bokeh,philippjfr/bokeh,ericmjl/bokeh,rs2/bokeh,azjps/bokeh,DuCorey/bokeh,clairetang6/bokeh,draperjames/bokeh,clairetang6/bokeh,DuCorey/bokeh,aavanian/bokeh,KasperPRasmussen/bokeh,justacec/bokeh,bokeh/bokeh,aiguofer/bokeh,rs2/boke... |
764256427ea7c0dbf73accf63ed05e8372f58a75 | test/pyfrontend/util.py | test/pyfrontend/util.py | import contextlib
import tempfile
import shutil
@contextlib.contextmanager
def temporary_directory():
"""Simple context manager to make a temporary directory"""
tmpdir = tempfile.mkdtemp()
yield tmpdir
shutil.rmtree(tmpdir, ignore_errors=True)
| import contextlib
import tempfile
import shutil
import saliweb.test # for python 2.6 support
@contextlib.contextmanager
def temporary_directory():
"""Simple context manager to make a temporary directory"""
tmpdir = tempfile.mkdtemp()
yield tmpdir
shutil.rmtree(tmpdir, ignore_errors=True)
| Add unittest methods to Python 2.6 | Add unittest methods to Python 2.6
| Python | lgpl-2.1 | salilab/saliweb,salilab/saliweb,salilab/saliweb,salilab/saliweb,salilab/saliweb |
46b60c5886ede34db8998d7cfd5ae36f9211a0e8 | ovp_users/tests/test_views/__init__.py | ovp_users/tests/test_views/__init__.py | from ovp_users.tests.test_views.user import UserResourceViewSetTestCase
from ovp_users.tests.test_views.auth import JWTAuthTestCase
from ovp_users.tests.test_views.password_recovery import RecoveryTokenViewSetTestCase
from ovp_users.tests.test_views.password_recovery import RecoverPasswordViewSetTestCase
| from ovp_users.tests.test_views.user import UserResourceViewSetTestCase
from ovp_users.tests.test_views.auth import JWTAuthTestCase
from ovp_users.tests.test_views.profile import ProfileTestCase
from ovp_users.tests.test_views.password_recovery import RecoveryTokenViewSetTestCase
from ovp_users.tests.test_views.passwor... | Add profile views tests to suite | Add profile views tests to suite
| Python | agpl-3.0 | OpenVolunteeringPlatform/django-ovp-users,OpenVolunteeringPlatform/django-ovp-users |
eb165c0eb929b542178daea7057c258718d1ba6a | testfixtures/snippet.py | testfixtures/snippet.py | # -*- coding: utf-8 -*-
"""
testfixtures.snippet
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.blueprints.snippet.models.snippet import \
CurrentVersionAssociation, Snippet, SnippetVersion
def create_snippet(party, name):
re... | # -*- coding: utf-8 -*-
"""
testfixtures.snippet
~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.blueprints.snippet.models.snippet import \
CurrentVersionAssociation, Snippet, SnippetVersion
def create_snippet(party, name):
re... | Set creation date via field, not via constructor | Set creation date via field, not via constructor
| Python | bsd-3-clause | m-ober/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps |
88b984a084385574bb420a0b81627914229f08e9 | nova/policies/quota_class_sets.py | nova/policies/quota_class_sets.py | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Add policy description for os-quota-classes | Add policy description for os-quota-classes
This commit adds policy doc for os-quota-classes policies.
Partial implement blueprint policy-docs
Change-Id: Ic7568b77ebfaa012e4310c3c1beac68587bd19f6
| Python | apache-2.0 | rahulunair/nova,klmitch/nova,klmitch/nova,mikalstill/nova,vmturbo/nova,jianghuaw/nova,Juniper/nova,Juniper/nova,gooddata/openstack-nova,klmitch/nova,phenoxim/nova,openstack/nova,gooddata/openstack-nova,mikalstill/nova,mahak/nova,vmturbo/nova,openstack/nova,vmturbo/nova,rajalokan/nova,jianghuaw/nova,vmturbo/nova,rahulun... |
1249c93696f9baa0eefefa373edcc8189802cce5 | script/blender_2cloud.py | script/blender_2cloud.py | import os
import sys
import bpy
# file loader per extension
loader_factory = {
'.obj': lambda file: bpy.ops.import_scene.obj(filepath=file, axis_forward='Y', axis_up='Z'),
'.wrl': lambda file: bpy.ops.import_scene.x3d(filepath=file, axis_forward='Y', axis_up='Z')
}
def convert(input_filename, output_filename):... | import os
import sys
import bpy
# file loader per extension
loader_factory = {
'.ply': lambda file: bpy.ops.import_mesh.ply(filepath=file),
'.stl': lambda file: bpy.ops.import_mesh.stl(filepath=file),
'.3ds': lambda file: bpy.ops.import_scene.autodesk_3ds(filepath=file, axis_forward='Y', axis_up='Z'),
'.obj'... | Add ply, stl and 3ds support to blendel_2cloud.py. | Add ply, stl and 3ds support to blendel_2cloud.py.
| Python | bsd-2-clause | jrl-umi3218/sch-creator,jrl-umi3218/sch-creator,jrl-umi3218/sch-creator |
a64d6f6de26302e5b8764e248c5df0a529a86343 | fireplace/cards/league/collectible.py | fireplace/cards/league/collectible.py | from ..utils import *
##
# Minions
# Obsidian Destroyer
class LOE_009:
events = OWN_TURN_END.on(Summon(CONTROLLER, "LOE_009t"))
# Sacred Trial
class LOE_027:
events = Play(OPPONENT, MINION | HERO).after(
(Count(ENEMY_MINIONS) >= 4) &
(Reveal(SELF), Destroy(Play.CARD))
)
##
# Spells
# Forgotten Torch
clas... | from ..utils import *
##
# Minions
# Obsidian Destroyer
class LOE_009:
events = OWN_TURN_END.on(Summon(CONTROLLER, "LOE_009t"))
##
# Spells
# Forgotten Torch
class LOE_002:
play = Hit(TARGET, 3), Shuffle(CONTROLLER, "LOE_002t")
class LOE_002t:
play = Hit(TARGET, 6)
# Raven Idol
class LOE_115:
choose = ("LO... | Move Sacred Trial to secret section | Move Sacred Trial to secret section
| Python | agpl-3.0 | amw2104/fireplace,jleclanche/fireplace,amw2104/fireplace,NightKev/fireplace,smallnamespace/fireplace,Ragowit/fireplace,Ragowit/fireplace,beheh/fireplace,smallnamespace/fireplace |
6a293fef25b5760d8b783ad0db1d00a3d5cf4e7f | packs/puppet/actions/lib/python_actions.py | packs/puppet/actions/lib/python_actions.py | from st2actions.runners.pythonrunner import Action
from lib.puppet_client import PuppetHTTPAPIClient
class PuppetBasePythonAction(Action):
def __init__(self):
super(PupperBasePythonAction, self).__init__()
self.client = self._get_client()
def _get_client(self):
master_config = self.c... | from st2actions.runners.pythonrunner import Action
from lib.puppet_client import PuppetHTTPAPIClient
class PuppetBasePythonAction(Action):
def __init__(self, config):
super(PuppetBasePythonAction, self).__init__(config=config)
self.client = self._get_client()
def _get_client(self):
m... | Update affected Puppet action constructor to take in "config" argument. | Update affected Puppet action constructor to take in "config" argument.
| Python | apache-2.0 | Aamir-raza-1/st2contrib,digideskio/st2contrib,dennybaa/st2contrib,armab/st2contrib,lmEshoo/st2contrib,armab/st2contrib,pearsontechnology/st2contrib,tonybaloney/st2contrib,pearsontechnology/st2contrib,jtopjian/st2contrib,digideskio/st2contrib,pidah/st2contrib,tonybaloney/st2contrib,pinterb/st2contrib,StackStorm/st2contr... |
6023fa1fdec83c0a4568529982a69ae64801ad5f | src/cli/_actions/_pool.py | src/cli/_actions/_pool.py | """
Miscellaneous pool-level actions.
"""
from __future__ import print_function
from .._errors import StratisCliValueUnimplementedError
def create_pool(dbus_thing, namespace):
"""
Create a stratis pool.
"""
if namespace.force:
raise StratisCliValueUnimplementedError(
namespace.forc... | """
Miscellaneous pool-level actions.
"""
from __future__ import print_function
from .._errors import StratisCliValueUnimplementedError
def create_pool(dbus_thing, namespace):
"""
Create a stratis pool.
"""
if namespace.force:
raise StratisCliValueUnimplementedError(
namespace.forc... | Add some extra output for create and destroy. | Add some extra output for create and destroy.
Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>
| Python | apache-2.0 | stratis-storage/stratis-cli,stratis-storage/stratis-cli |
ee9b869f2bb43e00da7c208cc2cfc9641d631b1a | examples/canvas/repeat_texture.py | examples/canvas/repeat_texture.py | '''
Demonstrate repeating textures
==============================
This was a test to fix an issue with repeating texture and window reloading.
'''
from kivy.app import App
from kivy.uix.image import Image
from kivy.properties import ObjectProperty
from kivy.lang import Builder
kv = '''
FloatLayout:
canvas.before... | '''
Demonstrate repeating textures
==============================
This was a test to fix an issue with repeating texture and window reloading.
'''
from kivy.app import App
from kivy.uix.image import Image
from kivy.uix.label import Label
from kivy.properties import ObjectProperty, ListProperty
from kivy.lang import B... | Add background color to size message. | Add background color to size message.
Added a colored background to the label because it kept getting lost in
the white ‘K’ field. Also changed the label color to cyan for
readability.
| Python | mit | jkankiewicz/kivy,bob-the-hamster/kivy,KeyWeeUsr/kivy,LogicalDash/kivy,ernstp/kivy,yoelk/kivy,jegger/kivy,LogicalDash/kivy,darkopevec/kivy,akshayaurora/kivy,gonzafirewall/kivy,rafalo1333/kivy,thezawad/kivy,bhargav2408/kivy,aron-bordin/kivy,Cheaterman/kivy,andnovar/kivy,MiyamotoAkira/kivy,youprofit/kivy,VinGarcia/kivy,el... |
bfc7a13439114313897526ea461f404539cc3fe5 | tests/test_publisher.py | tests/test_publisher.py | import gc
import sys
import warnings
import weakref
from lektor.publisher import Command
def test_Command_triggers_no_warnings():
# This excercises the issue where publishing via rsync resulted
# in ResourceWarnings about unclosed streams.
with warnings.catch_warnings():
warnings.simplefilter("e... | import gc
import os
import sys
import warnings
import weakref
import pytest
from lektor.publisher import Command
from lektor.publisher import publish
def test_Command_triggers_no_warnings():
# This excercises the issue where publishing via rsync resulted
# in ResourceWarnings about unclosed streams.
wi... | Test that local rsync publishing works (with and w/o delete option) | Test that local rsync publishing works (with and w/o delete option)
This excercises #946
| Python | bsd-3-clause | lektor/lektor,lektor/lektor,lektor/lektor,lektor/lektor |
37bb334a1c59920d92649b0cedddf62863bf6da8 | scipy/weave/tests/test_inline_tools.py | scipy/weave/tests/test_inline_tools.py | from numpy import *
from numpy.testing import *
from scipy.weave import inline_tools
class TestInline(TestCase):
""" These are long running tests...
I'd like to benchmark these things somehow.
"""
@dec.slow
def test_exceptions(self):
a = 3
code = """
if (a < 2)... | from numpy import *
from numpy.testing import *
from scipy.weave import inline_tools
class TestInline(TestCase):
""" These are long running tests...
I'd like to benchmark these things somehow.
"""
@dec.slow
def test_exceptions(self):
a = 3
code = """
if (a < 2)... | Disable weave tests that cause compilation failure, since this causes distutils to do a SystemExit, which break the test suite. | Disable weave tests that cause compilation failure, since this causes
distutils to do a SystemExit, which break the test suite.
| Python | bsd-3-clause | kalvdans/scipy,chatcannon/scipy,trankmichael/scipy,ilayn/scipy,jsilter/scipy,tylerjereddy/scipy,mikebenfield/scipy,minhlongdo/scipy,trankmichael/scipy,WillieMaddox/scipy,piyush0609/scipy,surhudm/scipy,Dapid/scipy,chatcannon/scipy,grlee77/scipy,vanpact/scipy,Kamp9/scipy,Srisai85/scipy,ilayn/scipy,dch312/scipy,chatcannon... |
10ea9d7e542807e064e36b5f9ce8bccd32990fb4 | app.py | app.py | import requests
from flask import Flask, render_template
app = Flask(__name__, instance_relative_config=True)
app.config.from_pyfile("appconfig.py")
sources = {
"bbc": "bbc-news",
"cnn": "cnn",
"hackernews": "hacker-news"
}
def create_link(source):
if source in sources.keys():
return f"https:... | import requests
from flask import Flask, render_template, request
app = Flask(__name__, instance_relative_config=True)
app.config.from_pyfile("appconfig.py")
sources = {
"bbc": "bbc-news",
"cnn": "cnn",
"hackernews": "hacker-news"
}
def create_link(source):
if source in sources.keys():
retur... | Use GET request arguments to determine the news source. | Use GET request arguments to determine the news source.
| Python | mit | alchermd/headlines,alchermd/headlines |
1ca86b0d7ca23adcc6a5cb925b00d8c8925ed8cc | app.py | app.py | import sys
import asyncio
import telepot
from telepot.delegate import per_chat_id
from telepot.async.delegate import create_open
"""
$ python3.4 countera.py <token>
Count number of messages. Start over if silent for 10 seconds.
"""
class MessageCounter(telepot.helper.ChatHandler):
def __init__(self, seed_tuple, ... | """
import sys
import time
import random
import datetime
"""
import telepot
from telepot.delegate import per_chat_id, create_open
class VeryCruel(telepot.helper.ChatHandler):
def __init__(self, seed_tuple, timeout):
super(VeryCruel, self).__init__(seed_tuple,timeout)
def reply_to_serjant(self,m):
... | Rewrite bot to answer private or public messages | Rewrite bot to answer private or public messages
| Python | mit | vasua/verycruelbot |
0de818d8ff2aa77fc172199226aea3abffa7f3b1 | bot.py | bot.py | from discord.ext.commands import Bot
from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument
class BeattieBot(Bot):
async def reply(self, ctx, message):
return await ctx.send(f'{ctx.message.author.mention}\n{message}')
async def handle_error(self, exception, ctx):
... | from discord.ext.commands import Bot, CommandInvokeError
from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument
class BeattieBot(Bot):
async def reply(self, ctx, message):
return await ctx.send(f'{ctx.message.author.mention}\n{message}')
async def handle_error(self, ex... | Change hasattr check to isinstance check because it's faster. | Change hasattr check to isinstance check because it's faster.
| Python | mit | BeatButton/beattie,BeatButton/beattie-bot |
60fc1add06ffb54aff2b0bf1c28d0cb476d35aae | polling_stations/settings/local.example.py | polling_stations/settings/local.example.py | DATABASES = {
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"NAME": "polling_stations",
"USER": "postgres",
"PASSWORD": "",
"HOST": "", # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
"PORT": "", # Set to emp... | DATABASES = {
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"NAME": "polling_stations",
"USER": "postgres",
"PASSWORD": "",
"HOST": "", # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
"PORT": "", # Set to emp... | Send email to console as local default | Send email to console as local default
| Python | bsd-3-clause | DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations |
9f83315c1be0268836a3a10fade9ba832d614e79 | regserver/regulations/tests/views_sidebar_tests.py | regserver/regulations/tests/views_sidebar_tests.py | import re
from unittest import TestCase
from mock import patch
from django.test.client import Client
class ViewsSideBarViewTest(TestCase):
"""Integration tests for the sidebar"""
@patch('regulations.views.sidebar.api_reader')
def test_get(self, api_reader):
api_reader.Client.return_value.layer.r... | import re
from unittest import TestCase
from mock import patch
from django.test.client import Client
class ViewsSideBarViewTest(TestCase):
"""Integration tests for the sidebar"""
@patch('regulations.views.sidebar.api_reader')
def test_get(self, api_reader):
api_reader.Client.return_value.layer.r... | Use a 'valid' doc number | Use a 'valid' doc number
| Python | cc0-1.0 | tadhg-ohiggins/regulations-site,tadhg-ohiggins/regulations-site,grapesmoker/regulations-site,grapesmoker/regulations-site,jeremiak/regulations-site,eregs/regulations-site,ascott1/regulations-site,18F/regulations-site,grapesmoker/regulations-site,18F/regulations-site,eregs/regulations-site,eregs/regulations-site,ascott1... |
22a024856b6fa602ee9d6fd7fb6031dde359cc9c | pytablewriter/writer/text/_csv.py | pytablewriter/writer/text/_csv.py | from typing import List
import typepy
from ._text_writer import TextTableWriter
class CsvTableWriter(TextTableWriter):
"""
A table writer class for character separated values format.
The default separated character is a comma (``","``).
:Example:
:ref:`example-csv-table-writer`
... | from typing import List
import typepy
from ._text_writer import TextTableWriter
class CsvTableWriter(TextTableWriter):
"""
A table writer class for character separated values format.
The default separated character is a comma (``","``).
:Example:
:ref:`example-csv-table-writer`
... | Modify initialization to be more properly for CsvTableWriter class | Modify initialization to be more properly for CsvTableWriter class
| Python | mit | thombashi/pytablewriter |
9543d080bf39503a47879b74960f0999e8e94172 | linked_list.py | linked_list.py | #!/usr/bin/env python
from __future__ import print_function
class Node(object):
def __init__(self, value):
self._val = value
self._next = None
@property
def next(self):
return self._next
@next.setter
def next(self, value):
self._next = value
@property
de... | #!/usr/bin/env python
from __future__ import print_function
class Node(object):
def __init__(self, value):
self._val = value
self._next = None
@property
def next(self):
return self._next
@next.setter
def next(self, value):
self._next = value
@property
de... | Add working search function v1 | Nick: Add working search function v1
| Python | mit | constanthatz/data-structures |
f1afb7700ade910ca79a105ec9fe94448cb57d8d | byceps/blueprints/shop_order_admin/forms.py | byceps/blueprints/shop_order_admin/forms.py | # -*- coding: utf-8 -*-
"""
byceps.blueprints.shop_order_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import TextAreaField
from wtforms.validators import InputRequired
from ...util.l10n import Locali... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.shop_order_admin.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from wtforms import TextAreaField
from wtforms.validators import InputRequired, Length
from ...util.l10n impor... | Validate length of cancelation reason supplied via form | Validate length of cancelation reason supplied via form
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps |
5ff16a552e167eb9405713f6c919a729f27f84ee | busbus/util/__init__.py | busbus/util/__init__.py | from abc import ABCMeta, abstractmethod
import six
import busbus
@six.add_metaclass(ABCMeta)
class Iterable(object):
def __iter__(self):
return self
@abstractmethod
def __next__(self):
return NotImplemented
# Python 2 compatibility
def next(self):
return self.__next__()... | from abc import ABCMeta, abstractmethod
import six
import busbus
@six.add_metaclass(ABCMeta)
class Iterable(object):
def __iter__(self):
return self
@abstractmethod
def __next__(self):
return NotImplemented
# Python 2 compatibility
def next(self):
return self.__next__()... | Remove spurious print statement in busbus.util.Lazy | Remove spurious print statement in busbus.util.Lazy
| Python | mit | spaceboats/busbus |
a40a925c29b04b1b6822566e72db4afa5552479c | pygame/_error.py | pygame/_error.py | """ SDL errors.def
"""
from pygame._sdl import sdl, ffi
class SDLError(Exception):
"""SDL error."""
@classmethod
def from_sdl_error(cls):
return cls(ffi.string(sdl.SDL_GetError()))
def unpack_rect(rect):
"""Unpack the size and raise a type error if needed."""
if (not hasattr(rect, '__i... | """ SDL errors.def
"""
from pygame._sdl import sdl, ffi
from numbers import Number
class SDLError(Exception):
"""SDL error."""
@classmethod
def from_sdl_error(cls):
return cls(ffi.string(sdl.SDL_GetError()))
def unpack_rect(rect):
"""Unpack the size and raise a type error if needed."""
... | Support arbitary numeric types for creating pygame surfaces | Support arbitary numeric types for creating pygame surfaces
| Python | lgpl-2.1 | CTPUG/pygame_cffi,CTPUG/pygame_cffi,CTPUG/pygame_cffi |
75df2d93a2624f091eac5d1ff076985b0a2fd462 | src/core/migrations/0019_set_default_news_items.py | src/core/migrations/0019_set_default_news_items.py | from __future__ import unicode_literals
from django.db import migrations, connection
def set_default_news_items(apps, schema_editor):
Plugin = apps.get_model("utils", "Plugin")
Journal = apps.get_model("journal", "Journal")
PluginSetting = apps.get_model("utils", "PluginSetting")
PluginSettingValue =... | from __future__ import unicode_literals
from django.db import migrations, connection
def set_default_news_items(apps, schema_editor):
Plugin = apps.get_model("utils", "Plugin")
Journal = apps.get_model("journal", "Journal")
PluginSetting = apps.get_model("utils", "PluginSetting")
PluginSettingValue =... | Handle setting values of '' and ' ' | 747: Handle setting values of '' and ' '
| Python | agpl-3.0 | BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway |
860636fa3d0354b8358b490c28ed92d727207744 | pola/views.py | pola/views.py | from django.views.generic import TemplateView
from braces.views import LoginRequiredMixin
from product.models import Product
from company.models import Company
from report.models import Report
class FrontPageView(LoginRequiredMixin, TemplateView):
template_name = 'pages/home-cms.html'
def get_context_data(se... | from django.views.generic import TemplateView
from braces.views import LoginRequiredMixin
from product.models import Product
from company.models import Company
from report.models import Report
class FrontPageView(LoginRequiredMixin, TemplateView):
template_name = 'pages/home-cms.html'
def get_context_data(se... | Add extra condition to home page's box | Add extra condition to home page's box
| Python | bsd-3-clause | KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend |
1aec583a52ac9edc95138f5df356da60451dfe2b | enthought/tvtk/view/parametric_function_source_view.py | enthought/tvtk/view/parametric_function_source_view.py | from enthought.traits.ui.api import View, HGroup, Item
view = View((['generate_texture_coordinates'], ['scalar_mode'],
HGroup(Item('u_resolution', label = 'u'),
Item('v_resolution', label = 'v'),
Item('w_resolution', label = 'w'),
label = 'Resolution', show_border = True)),... | from enthought.traits.ui.api import View, HGroup, Item
from enthought.tvtk.tvtk_base import TVTKBaseHandler
view = View((['generate_texture_coordinates'], ['scalar_mode'],
HGroup(Item('u_resolution', label = 'u'),
Item('v_resolution', label = 'v'),
Item('w_resolution', label = 'w'),
... | Add handler to the view. | Add handler to the view.
| Python | bsd-3-clause | liulion/mayavi,liulion/mayavi,alexandreleroux/mayavi,dmsurti/mayavi,dmsurti/mayavi,alexandreleroux/mayavi |
11095d00dd1e4805739ffc376328e4ad2a6893fb | h2o-py/tests/testdir_algos/gbm/pyunit_cv_nfolds_gbm.py | h2o-py/tests/testdir_algos/gbm/pyunit_cv_nfolds_gbm.py | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def cv_nfolds_gbm():
prostate = h2o.import_file(path=pyunit_utils.locate("smalldata/logreg/prostate.csv"))
prostate[1] = prostate[1].asfactor()
... | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def cv_nfolds_gbm():
prostate = h2o.import_file(path=pyunit_utils.locate("smalldata/logreg/prostate.csv"))
prostate[1] = prostate[1].asfactor()
... | Add pyunit test for model_performance(xval=True) | PUBDEV-2984: Add pyunit test for model_performance(xval=True)
| Python | apache-2.0 | mathemage/h2o-3,h2oai/h2o-dev,mathemage/h2o-3,h2oai/h2o-dev,h2oai/h2o-3,mathemage/h2o-3,michalkurka/h2o-3,spennihana/h2o-3,spennihana/h2o-3,mathemage/h2o-3,h2oai/h2o-3,h2oai/h2o-dev,mathemage/h2o-3,spennihana/h2o-3,h2oai/h2o-3,jangorecki/h2o-3,h2oai/h2o-dev,michalkurka/h2o-3,jangorecki/h2o-3,h2oai/h2o-dev,jangorecki/h2... |
c6edb08cdb5ee34accb8a6d74a78f372e2b8addb | tests/chainer_tests/training_tests/test_trainer.py | tests/chainer_tests/training_tests/test_trainer.py | import collections
import os
import tempfile
import time
import unittest
import mock
from chainer import serializers
from chainer import testing
from chainer import training
class TestTrainerElapsedTime(unittest.TestCase):
def setUp(self):
self.trainer = _get_mocked_trainer()
def test_elapsed_time... | import collections
import os
import shutil
import tempfile
import time
import unittest
import mock
from chainer import serializers
from chainer import testing
from chainer import training
class TestTrainerElapsedTime(unittest.TestCase):
def setUp(self):
self.trainer = _get_mocked_trainer()
def tes... | Clean up temporary directory after the test | Clean up temporary directory after the test
| Python | mit | chainer/chainer,ronekko/chainer,chainer/chainer,okuta/chainer,jnishi/chainer,jnishi/chainer,pfnet/chainer,ktnyt/chainer,jnishi/chainer,niboshi/chainer,wkentaro/chainer,keisuke-umezawa/chainer,okuta/chainer,wkentaro/chainer,chainer/chainer,ysekky/chainer,wkentaro/chainer,cupy/cupy,chainer/chainer,keisuke-umezawa/chainer... |
1639a91f018e29c4572242a94c5faf7281b15a6e | netdisco/discoverables/belkin_wemo.py | netdisco/discoverables/belkin_wemo.py | """ Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description['... | """ Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description['... | Handle mac address missing in early wemo firmware. | Handle mac address missing in early wemo firmware.
| Python | mit | balloob/netdisco,sfam/netdisco,brburns/netdisco |
3767fc5d1bf21d4321342e7332f569a97b7396b4 | ipython/config_helper_functions.py | ipython/config_helper_functions.py | import os
import IPython.ipapi
ip = IPython.ipapi.get()
# some config helper functions you can use
def import_mod(modules):
""" Usage: import_mod("os sys") """
for m in modules.split():
ip.ex("import %s" % m)
def import_all(modules):
""" Usage: import_all("os sys") """
for m in modules.split():
ip.ex("f... | """Some config helper functions you can use"""
import os
import IPython.ipapi
ip = IPython.ipapi.get()
def import_mod(modules):
""" Usage: import_mod("os sys") """
for m in modules.split():
ip.ex("import %s" % m)
def import_all(modules):
""" Usage: import_all("os sys") """
for m in modules.split():
ip.ex... | Use triple quotes for docstrings | Use triple quotes for docstrings
git-svn-id: 71e07130022bd36facd9e5e4cff6aac120a9d616@756 f6a8b572-8bf8-43d5-8295-329fc01c5294
| Python | mit | jalanb/jab,jalanb/dotjab,jalanb/dotjab,jalanb/jab |
5e3c81a34944c5877f0fd5e3824216ac7057f413 | src/waypoints_reader/scripts/yaml_reader.py | src/waypoints_reader/scripts/yaml_reader.py | #!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def pub_data():
pub = rospy.Publisher('goal_sequence'... | #!/usr/bin/env python
# coding UTF-8
import yaml
import rospy
from goal_sender_msgs.msg import GoalSequence
from goal_sender_msgs.msg import Waypoint
def read_yaml(path):
f = open(path, 'r')
waypoints = yaml.load(f)
f.close()
return waypoints
def pub_data():
pub = rospy.Publisher('goal_sequence'... | Update read method for dictionaly type | Update read method for dictionaly type
| Python | bsd-3-clause | CIR-KIT/fifth_robot_pkg,CIR-KIT/fifth_robot_pkg,CIR-KIT/fifth_robot_pkg |
5e87af4770a05bc187df7efbb5292c876393aef0 | nbgrader/apps/formgradeapp.py | nbgrader/apps/formgradeapp.py | from IPython.config.loader import Config
from IPython.config.application import catch_config_error
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgrader.apps.customnbconvertapp impor... | from IPython.config.loader import Config
from IPython.utils.traitlets import Unicode
from nbgrader.apps.customnbconvertapp import CustomNbConvertApp
from nbgrader.apps.customnbconvertapp import aliases as base_aliases
from nbgrader.apps.customnbconvertapp import flags as base_flags
from nbgrader.templates import get_t... | Make form grade server be a flag | Make form grade server be a flag
| Python | bsd-3-clause | modulexcite/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,modulexcite/nbgrader,alope107/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,dementrock/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,MatKallada/nbgrad... |
2fbf7ea2dd7f163bb86f60e5c607af2fd43e1739 | kicost/currency_converter/download_rates.py | kicost/currency_converter/download_rates.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Salvador E. Tropea
# Copyright (c) 2021 Instituto Nacional de Tecnología Industrial
# License: Apache 2.0
# Project: KiCost
"""
Simple helper to download the exchange rates.
"""
import sys
from bs4 import BeautifulSoup
if sys.version_info[0] < 3:
from... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Salvador E. Tropea
# Copyright (c) 2021 Instituto Nacional de Tecnología Industrial
# License: Apache 2.0
# Project: KiCost
"""
Simple helper to download the exchange rates.
"""
import os
import sys
from bs4 import BeautifulSoup
if sys.version_info[0] < 3... | Allow to fake the currency rates. | Allow to fake the currency rates.
- The envidonment variable KICOST_CURRENCY_RATES can be used to fake
the cunrrency rates.
- It must indicate the name of an XML file containing the desired
rates.
- The format is the one used by the European Central Bank.
| Python | mit | xesscorp/KiCost,xesscorp/KiCost,hildogjr/KiCost,hildogjr/KiCost,xesscorp/KiCost,hildogjr/KiCost |
ff3c3c3842790cc9eb06f1241d6da77f828859c1 | IPython/external/qt.py | IPython/external/qt.py | """ A Qt API selector that can be used to switch between PyQt and PySide.
"""
import os
# Use PyQt by default until PySide is stable.
qt_api = os.environ.get('QT_API', 'pyqt')
if qt_api == 'pyqt':
# For PySide compatibility, use the new string API that automatically
# converts QStrings to unicode Python stri... | """ A Qt API selector that can be used to switch between PyQt and PySide.
"""
import os
# Available APIs.
QT_API_PYQT = 'pyqt'
QT_API_PYSIDE = 'pyside'
# Use PyQt by default until PySide is stable.
QT_API = os.environ.get('QT_API', QT_API_PYQT)
if QT_API == QT_API_PYQT:
# For PySide compatibility, use the new s... | Clean up in Qt API switcher. | Clean up in Qt API switcher.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython |
f14329dd4449c352cdf82ff2ffab0bfb9bcff882 | parser.py | parser.py | from collections import namedtuple
IRCMsg = namedtuple('IRCMsg', 'prefix cmd params postfix')
def parse(line):
""" Parses line and returns a named tuple IRCMsg
with fields (prefix, cmd, params, postfix).
- prefix is the first part starting with : (colon), without the :
- cmd is the command... | from collections import namedtuple
IRCMsg = namedtuple('IRCMsg', 'prefix cmd params postfix')
def parse(line):
""" Parses line and returns a named tuple IRCMsg
with fields (prefix, cmd, params, postfix).
- prefix is the first part starting with : (colon), without the :
- cmd is the command... | Fix parsing irc messages with empty list of parameters | Fix parsing irc messages with empty list of parameters
| Python | mit | aalien/mib |
d6a054b4d59081920c68917c659ecd51a4517086 | client.py | client.py | import json
import requests
import requests_jwt
try:
from config import credentials, urls
except ImportError:
print('Config.py not found. Copy config.in to config.py and edit to suit.')
exit()
PAGE_SIZE = 20
def login(email, password):
r = requests.post(urls.login,
json={"email... | import json
import requests
import requests_jwt
try:
from config import credentials, urls
except ImportError:
print('Config.py not found. Copy config.in to config.py and edit to suit.')
exit()
PAGE_SIZE = 20
def login(email, password):
r = requests.post(urls.login,
json={"email... | Add Range header for GET that should be HEAD | Add Range header for GET that should be HEAD
| Python | mit | davidthewatson/postgrest_python_requests_client |
d7241f9c22ae6e962a2a7a7b2d9cf2a8eb1044a6 | scripts/stops.py | scripts/stops.py | #!/usr/bin/python
import sys
import csv
import json
def main(argv):
if len(argv) < 1:
print "Usage: ./stops.py outFile.js [/path/to/stops.txt]"
csvFile = open(argv[1] if argv[1] else "stops.txt")
features = []
for row in csv.DictReader(csvFile):
feature = {
'type': 'Featu... | #!/usr/bin/python
# Written by Taylor Denouden March 17, 2014
# Script to convert GTFS stops to geojson
import sys
import csv
import json
def main(argv):
if len(argv) < 1:
print "Usage: ./stops.py outFile.js [/path/to/stops.txt]"
csvFile = open(argv[1] if argv[1] else "stops.txt")
features = []
... | Add author note and description | Add author note and description
| Python | mit | bus-viz/bus-viz,bus-viz/bus-viz,bus-viz/bus-viz |
56a08fae0947f1c3057aebc39a898a4dd390da6e | st2common/st2common/constants/scheduler.py | st2common/st2common/constants/scheduler.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | Fix st2actions tests so they pass under Python 3. | Fix st2actions tests so they pass under Python 3.
| Python | apache-2.0 | Plexxi/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2 |
ca348485b0acf2dbc41f2b4e52140d69e318327c | conanfile.py | conanfile.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile
class CtreConan(ConanFile):
name = "CTRE"
version = "2.0"
license = "MIT"
url = "https://github.com/hanickadot/compile-time-regular-expressions.git"
author = "Hana Dusíková (ctre@hanicka.net)"
description = "Compile Tim... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile
class CtreConan(ConanFile):
name = "CTRE"
version = "2.0"
license = "MIT"
url = "https://github.com/hanickadot/compile-time-regular-expressions"
author = "Hana Dusíková (ctre@hanicka.net)"
description = "Compile Time Re... | Use SCM feature to build Conan package | Use SCM feature to build Conan package
- SCM could export all project files helping to build
Signed-off-by: Uilian Ries <d4bad57018205bdda203549c36d3feb0bfe416a7@gmail.com>
| Python | apache-2.0 | hanickadot/compile-time-regular-expressions,hanickadot/syntax-parser,hanickadot/compile-time-regular-expressions,hanickadot/compile-time-regular-expressions |
e6274c801e9c5233ef40b4f4423072f4626f16e5 | config.py | config.py | from zirc import Sasl
# zIRC
sasl = Sasl(username="BigWolfy1339", password="")
# IRC
channels = ["##wolfy1339", "##powder-bots", "##jeffl35"]
# Logging
logFormat = '%(levelname)s %(asctime)s %(message)s'
colorized = True
timestampFormat = '%Y-%m-%dT%H:%M:%S'
logLevel = 20 # INFO
# Bot
commandChar = '?'
owners = ['b... | from zirc import Sasl, Caps
# zIRC
sasl = Sasl(username="BigWolfy1339", password="")
caps = Caps(sasl, "multi-prefix")
# IRC
channels = ["##wolfy1339", "##powder-bots", "##jeffl35"]
# Logging
logFormat = '%(levelname)s %(asctime)s %(message)s'
colorized = True
timestampFormat = '%Y-%m-%dT%H:%M:%S'
logLevel = 20 # I... | Add new caps variable, fix line length | Add new caps variable, fix line length | Python | mit | wolfy1339/Python-IRC-Bot |
d1330eb44b1842571ff7deacef175b9aa92e09c0 | openacademy/models/res_partner.py | openacademy/models/res_partner.py | # -*- coding: utf-8 -*-
from openerp import models, fields
class Partner(models.Model):
_inherit = 'res.partner'
instructor = fields.Boolean(help="This partner give train our course")
| # -*- coding: utf-8 -*-
from openerp import models, fields
class Partner(models.Model):
_inherit = 'res.partner'
instructor = fields.Boolean(default=False,help="This partner give train our course")
sessions = fields.Many2many('session', string="Session as instructor", readonly=True)
| Add partner view injerit and model inherit | [REF] openacademy: Add partner view injerit and model inherit
| Python | apache-2.0 | juancr83/DockerOpenacademy-proyect |
ac0267d318939e4e7a62342b5dc6a09c3264ea74 | flocker/node/_deploy.py | flocker/node/_deploy.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
# -*- test-case-name: flocker.node.test.test_deploy -*-
"""
Deploy applications on nodes.
"""
class Deployment(object):
"""
"""
_gear_client = None
def start_container(self, application):
"""
Launch the supplied application ... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
# -*- test-case-name: flocker.node.test.test_deploy -*-
"""
Deploy applications on nodes.
"""
from .gear import GearClient
class Deployment(object):
"""
"""
def __init__(self, gear_client=None):
"""
:param IGearClient gear_clien... | Allow a fake gear client to be supplied | Allow a fake gear client to be supplied
| Python | apache-2.0 | wallnerryan/flocker-profiles,hackday-profilers/flocker,lukemarsden/flocker,Azulinho/flocker,w4ngyi/flocker,hackday-profilers/flocker,LaynePeng/flocker,lukemarsden/flocker,AndyHuu/flocker,beni55/flocker,mbrukman/flocker,1d4Nf6/flocker,w4ngyi/flocker,beni55/flocker,adamtheturtle/flocker,hackday-profilers/flocker,achanda/... |
20bcdcfd2eee5e20e76299a81a71ac80c09f2b56 | post_office/test_settings.py | post_office/test_settings.py | # -*- coding: utf-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'TIMEOUT': 36000,
'KEY_PREFIX': 'post-office',
},
'post_office': {
'BACKEND'... | # -*- coding: utf-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'TIMEOUT': 36000,
'KEY_PREFIX': 'post-office',
},
'post_office': {
'BACKEND'... | Make tests pass in Django 1.4. | Make tests pass in Django 1.4.
| Python | mit | JostCrow/django-post_office,ekohl/django-post_office,fapelhanz/django-post_office,ui/django-post_office,jrief/django-post_office,RafRaf/django-post_office,yprez/django-post_office,ui/django-post_office |
550befeed6ff3b2c64454c05f9e05b586d16ff64 | googlevoice/__init__.py | googlevoice/__init__.py | """
This project aims to bring the power of the Google Voice API to
the Python language in a simple,
easy-to-use manner. Currently it allows you to place calls, send sms,
download voicemails/recorded messages, and search the various
folders of your Google Voice Accounts.
You can use the Python API or command line scrip... | """
This project aims to bring the power of the Google Voice API to
the Python language in a simple,
easy-to-use manner. Currently it allows you to place calls, send sms,
download voicemails/recorded messages, and search the various
folders of your Google Voice Accounts.
You can use the Python API or command line scrip... | Load the version from the package metadata. | Load the version from the package metadata.
| Python | bsd-3-clause | pettazz/pygooglevoice |
bb347838ad78d61e6a81a1c14657323ad7eeb82b | analysis/smooth-data.py | analysis/smooth-data.py | import climate
import database
@climate.annotate(
root='load data files from this directory tree',
output='save smoothed data files to this directory tree',
accuracy=('fit SVT with this accuracy', 'option', None, float),
threshold=('SVT threshold', 'option', None, float),
frames=('number of frame... | import climate
import database
@climate.annotate(
root='load data files from this directory tree',
output='save smoothed data files to this directory tree',
frame_rate=('reindex frames to this rate', 'option', None, float),
accuracy=('fit SVT with this accuracy', 'option', None, float),
threshold... | Add parameter for frame rate. | Add parameter for frame rate.
| Python | mit | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment |
dc7a1566fdb581c592554af9c5e7193d06e3724e | tests/query_test/test_hbase_queries.py | tests/query_test/test_hbase_queries.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted Impala HBase Tests
#
import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestHBaseQueries(ImpalaTestSuite):
@classmethod
def get_workload(self):
return 'f... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted Impala HBase Tests
#
import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
class TestHBaseQueries(ImpalaTestSuite):
@classmethod
def get_workload(self):
return 'f... | Disable some tests in test_hbase_insert to fix the build. | Disable some tests in test_hbase_insert to fix the build.
Change-Id: I037b292d0eb93c5c743a201b2045eb2ba0712ae7
Reviewed-on: http://gerrit.ent.cloudera.com:8080/387
Reviewed-by: Ishaan Joshi <d1d1e60202ec9f2503deb1b724986485a125d802@cloudera.com>
Tested-by: Ishaan Joshi <d1d1e60202ec9f2503deb1b724986485a125d802@clouder... | Python | apache-2.0 | michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala |
6fd4e2e4158c968a095832f3bf669109dc9f1481 | mopidy_mpris/__init__.py | mopidy_mpris/__init__.py | import os
from mopidy import config, exceptions, ext
__version__ = "2.0.0"
class Extension(ext.Extension):
dist_name = "Mopidy-MPRIS"
ext_name = "mpris"
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), "ext.conf")
return config... | import pathlib
from mopidy import config, exceptions, ext
__version__ = "2.0.0"
class Extension(ext.Extension):
dist_name = "Mopidy-MPRIS"
ext_name = "mpris"
version = __version__
def get_default_config(self):
return config.read(pathlib.Path(__file__).parent / "ext.conf")
def get_conf... | Use pathlib to read ext.conf | Use pathlib to read ext.conf
| Python | apache-2.0 | mopidy/mopidy-mpris |
f473ebe7ce68560952a68247341bde46c2f26c97 | shoop/core/order_creator/_modifier.py | shoop/core/order_creator/_modifier.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.db.transaction import atomic
from shoop.core.models import Orde... | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.db.transaction import atomic
from shoop.core.models import Orde... | Enable modifying orders with taxes | Core: Enable modifying orders with taxes
Refs SHOOP-2338 / SHOOP-2578
| Python | agpl-3.0 | shawnadelic/shuup,shoopio/shoop,suutari/shoop,hrayr-artunyan/shuup,shawnadelic/shuup,suutari/shoop,hrayr-artunyan/shuup,suutari-ai/shoop,suutari-ai/shoop,suutari-ai/shoop,suutari/shoop,hrayr-artunyan/shuup,shoopio/shoop,shawnadelic/shuup,shoopio/shoop |
0c327e17dba29a4e94213f264fe7ea931bb26782 | invoke/parser/argument.py | invoke/parser/argument.py | class Argument(object):
def __init__(self, name=None, names=(), kind=str, default=None):
if name and names:
msg = "Cannot give both 'name' and 'names' arguments! Pick one."
raise TypeError(msg)
if not (name or names):
raise TypeError("An Argument must have at leas... | class Argument(object):
def __init__(self, name=None, names=(), kind=str, default=None, help=None):
if name and names:
msg = "Cannot give both 'name' and 'names' arguments! Pick one."
raise TypeError(msg)
if not (name or names):
raise TypeError("An Argument must h... | Add support for per Argument help data | Add support for per Argument help data
| Python | bsd-2-clause | kejbaly2/invoke,mattrobenolt/invoke,pyinvoke/invoke,pfmoore/invoke,sophacles/invoke,kejbaly2/invoke,pfmoore/invoke,mkusz/invoke,mattrobenolt/invoke,mkusz/invoke,tyewang/invoke,pyinvoke/invoke,singingwolfboy/invoke,frol/invoke,frol/invoke,alex/invoke |
0d8cd57b6d5d4755709ca853856eb14b4b63f437 | servant.py | servant.py | import os
import sys
import zipfile
from nose import core as nose_core
if sys.argv[1] == "remove_extension":
try:
os.remove("coverage/tracer.so")
except OSError:
pass
elif sys.argv[1] == "test_with_tracer":
os.environ["COVERAGE_TEST_TRACER"] = sys.argv[2]
del sys.argv[1:3]
nose_co... | import os
import sys
import zipfile
from nose import core as nose_core
if sys.argv[1] == "remove_extension":
so_names = """
tracer.so
tracer.cpython-32m.so
""".split()
for filename in so_names:
try:
os.remove(os.path.join("coverage", filename))
except OSErr... | Make tox with with py3.2: the .so is named differently there. | Make tox with with py3.2: the .so is named differently there.
| Python | apache-2.0 | nedbat/coveragepy,nedbat/coveragepy,larsbutler/coveragepy,larsbutler/coveragepy,blueyed/coveragepy,blueyed/coveragepy,hugovk/coveragepy,7WebPages/coveragepy,larsbutler/coveragepy,nedbat/coveragepy,hugovk/coveragepy,7WebPages/coveragepy,jayhetee/coveragepy,larsbutler/coveragepy,nedbat/coveragepy,jayhetee/coveragepy,hugo... |
172c0123d5ce59ce4f162d806fc706dc50eb4312 | distarray/tests/test_client.py | distarray/tests/test_client.py | import unittest
import numpy as np
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestDistArrayContext(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def test_create_DAC(self):
'''Can we create a plain van... | import unittest
from IPython.parallel import Client
from distarray.client import DistArrayContext
class TestDistArrayContext(unittest.TestCase):
def setUp(self):
self.client = Client()
self.dv = self.client[:]
def test_create_DAC(self):
'''Can we create a plain vanilla context?'''
... | Test DAP getitem and setitem together. | Test DAP getitem and setitem together. | Python | bsd-3-clause | RaoUmer/distarray,enthought/distarray,RaoUmer/distarray,enthought/distarray |
0f24e70486b60e27535479c856f41b8ec18ee0f9 | entity_networks/activations.py | entity_networks/activations.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import tensorflow as tf
def prelu(features, initializer=None, scope=None):
"""
Implementation of [Parametric ReLU](https://arxiv.org/abs/1502.01852) borrowed from Keras.
"""
with tf.variable_sc... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import tensorflow as tf
def prelu(features, initializer=None, scope=None):
"""
Implementation of [Parametric ReLU](https://arxiv.org/abs/1502.01852) borrowed from Keras.
"""
with tf.variable_sc... | Remove alpha clipping as it did not help | Remove alpha clipping as it did not help
| Python | mit | jimfleming/recurrent-entity-networks,jimfleming/recurrent-entity-networks,mikalyoung/recurrent-entity-networks,mikalyoung/recurrent-entity-networks |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.