commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
e4d39bd26ce8d95a5b10487e66468e27e5d8052c
Remove correction 'levels' support.
Met48/League-of-Legends-DB
loldb/correct.py
loldb/correct.py
import collections import warnings def correct_champions(champions): for champion in champions: for ability in champion.abilities: correct_ability(ability) ABILITY_CORRECTIONS = { # Ahri 'Fox-Fire': { # @f1 shows maximum damage to a single target # Each fox-fire after...
import collections def correct_champions(champions): for champion in champions: for ability in champion.abilities: correct_ability(ability) ABILITY_CORRECTIONS = { # Ahri 'Fox-Fire': { # @f1 shows maximum damage to a single target # Each fox-fire after the first does ...
mit
Python
938f34201ab90b333385c4e2fc335e081c676678
Fix transaction serializer test after adding message and session credits
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
go/billing/tests/test_django_utils.py
go/billing/tests/test_django_utils.py
""" Test for go.billing.django_utils. """ import json from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper from go.billing.models import Account from go.billing.tests.helpers import ( mk_transaction, get_message_credits, get_storage_credits, get_session_credits) from go.billing.django_uti...
""" Test for go.billing.django_utils. """ import json from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper from go.billing.models import Account from go.billing.tests.helpers import mk_transaction, get_storage_credits from go.billing.django_utils import TransactionSerializer class TestTransacti...
bsd-3-clause
Python
3c83e9b3340a4f49981bdcead871c60e2f983cb2
Simplify fixture decorator
disqus/nydus
tests/__init__.py
tests/__init__.py
""" tests ~~~~~ :copyright: (c) 2011 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ import unittest2 NOTSET = object() class BaseTest(unittest2.TestCase): def setUp(self): pass class fixture(object): """ >>> class Foo(object): >>> @fixture >>> def foo(s...
""" tests ~~~~~ :copyright: (c) 2011 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ import unittest2 NOTSET = object() class BaseTest(unittest2.TestCase): def setUp(self): pass class fixture(object): # This is borrowed from werkzeug : http://bytebucket.org/mitsuhiko/werkze...
apache-2.0
Python
3287c3f40762e9cb99927b3f89828f50942eb48f
add ability run tests from specified file(s)
efiop/dvc,dataversioncontrol/dvc,dmpetrov/dataversioncontrol,efiop/dvc,dataversioncontrol/dvc,dmpetrov/dataversioncontrol
tests/__main__.py
tests/__main__.py
import os import sys from subprocess import check_call REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.chdir(REPO_ROOT) os.putenv( "PATH", "{}:{}".format(os.path.join(REPO_ROOT, "bin"), os.getenv("PATH")) ) os.putenv("DVC_HOME", REPO_ROOT) os.putenv("DVC_TEST", "true") if len(sys.argv...
import os from subprocess import check_call REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.chdir(REPO_ROOT) os.putenv( "PATH", "{}:{}".format(os.path.join(REPO_ROOT, "bin"), os.getenv("PATH")) ) os.putenv("DVC_HOME", REPO_ROOT) os.putenv("DVC_TEST", "true") cmd = ( "nosetests -v -...
apache-2.0
Python
a042c63f0afdd18e2a06fc1c1aa84a053e3ea1a2
Use cleaner setter in tests (#335)
taion/flask-jsonapiview,4Catalyzer/flask-resty,4Catalyzer/flask-jsonapiview
tests/conftest.py
tests/conftest.py
import os import flask_sqlalchemy as fsa import pytest from flask import Flask from flask.testing import FlaskClient from flask_resty.testing import ApiClient # ----------------------------------------------------------------------------- @pytest.fixture def app(): app = Flask(__name__) app.testing = True ...
import os import flask_sqlalchemy as fsa import pytest from flask import Flask from flask.testing import FlaskClient from flask_resty.testing import ApiClient # ----------------------------------------------------------------------------- @pytest.fixture def app(): app = Flask(__name__) app.config["TESTING...
mit
Python
9c447faa2fa54048ee05ea51b89a851ca9b9d76c
Fix docker container tests
RazerM/pg_grant,RazerM/pg_grant
tests/conftest.py
tests/conftest.py
from pathlib import Path import pytest import testing.postgresql from sqlalchemy import create_engine, text from sqlalchemy.engine.url import make_url from testcontainers.postgres import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', ...
from pathlib import Path import pytest import testing.postgresql from sqlalchemy import create_engine from sqlalchemy.engine.url import make_url from testcontainers.postgres import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-...
mit
Python
f51a4727c6327e5fedaed948a68fe513b93967fd
Remove assets from test settings
team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend
tests/settings.py
tests/settings.py
import os import warnings warnings.simplefilter('always') test_dir = os.path.dirname(os.path.abspath(__file__)) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', }, } USE_I18N = True USE_L10N = True INSTALLED_APPS = [ 'django_backend', 'django_ajax', 'django_callable_per...
import os import warnings warnings.simplefilter('always') test_dir = os.path.dirname(os.path.abspath(__file__)) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', }, } USE_I18N = True USE_L10N = True INSTALLED_APPS = [ 'django_backend', 'django_ajax', 'django_assets', ...
bsd-3-clause
Python
feb391e0350efb4f6111f334a777349d910afb4f
add tests for API
Impactstory/paperbuzz-api,Impactstory/paperbuzz-api
tests/test_all.py
tests/test_all.py
from datetime import datetime import json import pytest from views import app, db from event import CedEvent, CedSource @pytest.fixture def client(): app.config['TESTING'] = True app.config['SQLALCHEMY_DATABASE_URI'] = "postgresql://localhost:5432/paperbuzz_test" return app.test_client() @pytest.fixture ...
import pytest from app import app @pytest.fixture def client(): app.config['TESTING'] = True client = app.test_client() def smoke_test(client): rv = client.get('/') assert b'No entries here so far' in rv.data
mit
Python
f9c6c5240aa57b15cb68d85a848731b879040d54
Make sure tests are PEP8
diazjf/reddit-sentiment-analyzer
tests/test_api.py
tests/test_api.py
import bs4 import mock import requests import unittest import warnings from reddit_analyze.api import scraper class APIPostiveTestCases(unittest.TestCase): def setUp(self): super(APIPostiveTestCases, self).setUp() warnings.filterwarnings("ignore") # Setup the BS4 Objects we will expect....
import bs4 import mock import requests import unittest import warnings from reddit_analyze.api import scraper class APIPostiveTestCases(unittest.TestCase): def setUp(self): super(APIPostiveTestCases, self).setUp() warnings.filterwarnings("ignore") # Setup the BS4 Objects we will expect....
mit
Python
1905040f4468c86bbc2cee27b7c00920f9542e11
Implement tests for the config cli command
hackebrot/cibopath
tests/test_cli.py
tests/test_cli.py
# -*- coding: utf-8 -*- import configparser from click.testing import CliRunner import pytest from cibopath.cli import main runner = CliRunner() @pytest.fixture(params=['-V', '--version']) def version_cli_flag(request): return request.param def test_version_option(version_cli_flag): result = runner.invo...
# -*- coding: utf-8 -*- import configparser from click.testing import CliRunner import pytest from cibopath.cli import main runner = CliRunner() @pytest.fixture(params=['-V', '--version']) def version_cli_flag(request): return request.param def test_version_option(version_cli_flag): result = runner.invo...
bsd-3-clause
Python
8852955632b0ef0250ebbe21b5bdefdecdf30e8a
Remove redundant case from padding test
stgl/scarplet,rmsare/scarplet
tests/test_dem.py
tests/test_dem.py
import unittest import numpy as np class CalculationMethodsTestCase(unittest.TestCase): def setUp(self): self.dem = DEMGrid() def test_calculate_slope(self): sx, sy = self.dem._calculate_slope() def test_calculate_laplacian(self): del2z = self.dem._calculate_lapalacian() ...
import unittest import numpy as np class CalculationMethodsTestCase(unittest.TestCase): def setUp(self): self.dem = DEMGrid() def test_calculate_slope(self): sx, sy = self.dem._calculate_slope() def test_calculate_laplacian(self): del2z = self.dem._calculate_lapalacian() ...
mit
Python
18d958e28dc0e8860db3f57b189822b97d5f071d
Add in a test for new onedir.
clalancette/pyfat
tests/test_new.py
tests/test_new.py
import pytest import subprocess import os import sys import StringIO prefix = '.' for i in range(0,3): if os.path.exists(os.path.join(prefix, 'pyfat.py')): sys.path.insert(0, prefix) break else: prefix = '../' + prefix import pyfat from common import * def do_a_test(fat, check_func):...
import pytest import subprocess import os import sys import StringIO prefix = '.' for i in range(0,3): if os.path.exists(os.path.join(prefix, 'pyfat.py')): sys.path.insert(0, prefix) break else: prefix = '../' + prefix import pyfat from common import * def do_a_test(fat, check_func):...
lgpl-2.1
Python
3062b5d877ebc55c85cf9af4fe20571f570c9dba
Fix comment code.
datajoint/datajoint-python,dimitri-yatsenko/datajoint-python,eywalker/datajoint-python
tests/test_ssl.py
tests/test_ssl.py
from nose.tools import assert_true, assert_false, assert_equal, \ assert_list_equal, raises import datajoint as dj from . import CONN_INFO from pymysql.err import OperationalError class TestSSL: @staticmethod def test_secure_connection(): result = dj.conn(reset=True, **CONN_IN...
from nose.tools import assert_true, assert_false, assert_equal, \ assert_list_equal, raises import datajoint as dj from . import CONN_INFO from pymysql.err import OperationalError class TestSSL: # @staticmethod # def test_secure_connection(): # result = dj.conn(reset=True, **C...
lgpl-2.1
Python
cbc1f87a04ca96ef2c54e4c59ae65f757ba0f640
Add Newline
flomotlik/formica
tests/unit/test_docs_examples_links.py
tests/unit/test_docs_examples_links.py
import os import re def test_validate_examples_are_linked(): examples_directory = 'docs/examples' with open('docs/README.md') as file: documentation = file.read() for dir in os.listdir(examples_directory): to_find = '\(examples/{}\)' assert re.search(to_find.format(dir), documenta...
import os import re def test_validate_examples_are_linked(): examples_directory = 'docs/examples' with open('docs/README.md') as file: documentation = file.read() for dir in os.listdir(examples_directory): to_find = '\(examples/{}\)' assert re.search(to_find.format(dir), documenta...
mit
Python
d9938a50429db16ce60d905bca9844073fe2b0fa
Use DataRequired to validate form
borenho/flask-bucketlist,borenho/flask-bucketlist
this_app/forms.py
this_app/forms.py
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField from wtforms.validators import DataRequired, Length, Email class SignupForm(FlaskForm): """Render and validate the signup form""" email = StringField("Email", validators=[DataRequired(), Email(message="Invalid email f...
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField from wtforms.validators import Required, Length, Email class SignupForm(FlaskForm): """Render and validate the signup form""" email = StringField("Email", validators=[Required(), Email(), Length(1, 32)]) username = StringField(...
mit
Python
d23842be6e55cf528e3624c5fd3bbe3ed4d04f5e
use hexlify from binascii
maralla/thriftpy,duydb2/thriftpy,maralla/thriftpy,mariusvniekerk/thriftpy,halfcrazy/thriftpy,keitheis/thriftpy,itnihao/thriftpy,duydb2/thriftpy,misakwa/thriftpy,OctavianLee/thriftpy,keitheis/thriftpy,adsharma/flattools,misakwa/thriftpy,OctavianLee/thriftpy,maralla/thriftpy,importcjj/thriftpy,itnihao/thriftpy,spladug/th...
thriftpy/utils.py
thriftpy/utils.py
# -*- coding: utf-8 -*- import binascii from .transport import TMemoryBuffer from .protocol import TBinaryProtocolFactory def serialize(thrift_object, proto_factory=TBinaryProtocolFactory()): transport = TMemoryBuffer() protocol = proto_factory.get_protocol(transport) thrift_object.write(protocol) r...
# -*- coding: utf-8 -*- from .transport import TMemoryBuffer from .protocol import TBinaryProtocolFactory def serialize(thrift_object, proto_factory=TBinaryProtocolFactory()): transport = TMemoryBuffer() protocol = proto_factory.get_protocol(transport) thrift_object.write(protocol) return transport.g...
mit
Python
594eb1c2eaf67baeaf91f7913f7e21a889340a3f
Bump the version.
appcelerator/titanium_desktop,wyrover/titanium_desktop,wyrover/titanium_desktop,wyrover/titanium_desktop,jvkops/titanium_desktop,jvkops/titanium_desktop,appcelerator/titanium_desktop,appcelerator/titanium_desktop,appcelerator/titanium_desktop,wyrover/titanium_desktop,jvkops/titanium_desktop,wyrover/titanium_desktop,jvk...
tools/__init__.py
tools/__init__.py
def get_titanium_version(): return '0.9.0'
def get_titanium_version(): return '0.8.0'
apache-2.0
Python
6d66cd699eaf8254636ee0b8869d3fac33c93412
Change version to 2.0.0rc1
hechtus/mopidy-gmusic,mopidy/mopidy-gmusic
mopidy_gmusic/__init__.py
mopidy_gmusic/__init__.py
from __future__ import unicode_literals import os from mopidy import config, ext __version__ = '2.0.0rc1' class GMusicExtension(ext.Extension): dist_name = 'Mopidy-GMusic' ext_name = 'gmusic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__f...
from __future__ import unicode_literals import os from mopidy import config, ext __version__ = '1.0.0' class GMusicExtension(ext.Extension): dist_name = 'Mopidy-GMusic' ext_name = 'gmusic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file...
apache-2.0
Python
acbb7a1e8fd00e9eeb88d77d24f1e249861cfb1c
add exapmle for Agent
n0stack/n0core
n0core/processor/agent.py
n0core/processor/agent.py
from typing import List, Dict # NOQA from n0core.processor import Processor from n0core.processor import IncompatibleMessage from n0core.message import Message from n0core.message.notification import Notification from n0core.target import Target # NOQA from n0core.gateway import Gateway # NOQA class Agent(Process...
from typing import List, Dict # NOQA from n0core.processor import Processor from n0core.processor import IncompatibleMessage from n0core.message import Message from n0core.message.notification import Notification from n0core.target import Target # NOQA from n0core.gateway import Gateway # NOQA class Agent(Process...
bsd-2-clause
Python
a6df0cc69f1d415daaa381f40a4dbed52c96ee81
handle missing comments
ngsutils/ngsutils,ngsutils/ngsutils,ngsutils/ngsutils
ngsutils/ngs/tag_fasta.py
ngsutils/ngs/tag_fasta.py
#!/usr/bin/env python ## category Misc ## desc Tag FASTA sequence names with a prefix or suffix ''' Tag FASTA sequence names with a prefix or suffix ''' import sys import os from eta import eta_open_iter def tag_fasta(fname, prefix='', suffix=''): name = '' for line in eta_open_iter(fname, callback=lambda: n...
#!/usr/bin/env python ## category Misc ## desc Tag FASTA sequence names with a prefix or suffix ''' Tag FASTA sequence names with a prefix or suffix ''' import sys import os from eta import eta_open_iter def tag_fasta(fname, prefix='', suffix=''): name = '' for line in eta_open_iter(fname, callback=lambda: n...
bsd-3-clause
Python
5f2ab0dcaec5a7826ff0652e7c052971083a8398
Replace ad-hoc pain with builtin methods
moreati/python3-openid,isagalaev/sm-openid,moreati/python3-openid,moreati/python3-openid,necaris/python3-openid,misli/python3-openid,necaris/python3-openid,misli/python3-openid,misli/python3-openid
openid/test/datadriven.py
openid/test/datadriven.py
import unittest class DataDrivenTestCase(unittest.TestCase): cases = [] @classmethod def generateCases(cls): return cls.cases @classmethod def loadTests(cls): tests = [] for case in cls.generateCases(): if isinstance(case, tuple): test = cls(*c...
import unittest class DataDrivenTestCase(unittest.TestCase): cases = [] @classmethod def generateCases(cls): return cls.cases @classmethod def loadTests(cls): tests = [] for case in cls.generateCases(): if isinstance(case, tuple): test = cls(*c...
apache-2.0
Python
30db0df63312365fd93f89c062cdede5ba6682aa
Change __init__ imports
LuqueDaniel/pybooru,LuqueDaniel/pybooru,buzzbyte/pybooru,buzzbyte/pybooru
pybooru/__init__.py
pybooru/__init__.py
""" Pybooru is a library for Python for access to API Danbooru based sites. Under a MIT License """ __author__ = 'Daniel Luque <danielluque14 at gmail.com>' __version__ = '2.0-dev' #pybooru imports from .pybooru import Pybooru from .exceptions import PybooruError
""" Pybooru is a library for Python for access to API Danbooru based sites. Under a MIT License """ __author__ = 'Daniel Luque <danielluque14 at gmail.com>' __version__ = '2.0-dev' #pybooru imports from .pybooru import Pybooru from .pybooru import PybooruError
mit
Python
5398d07631629091da08b9febfe1d391e9f8914e
Bump version to 0.2.0
oldmantaiter/pydkron
pydkron/__init__.py
pydkron/__init__.py
__version__ = '0.2.0'
__version__ = '0.1.0'
mit
Python
2d2211d70466e3da081d84f4b3339aa7646dca7b
Remove references to inexistent Memface class
lericson/pylibmc,lericson/pylibmc,lericson/pylibmc
pylibmc/__main__.py
pylibmc/__main__.py
"""Interactive shell""" import sys import code import random import pylibmc tips = [ "Want to use 127.0.0.1? Just hit Enter immediately.", "This was supposed to be a list of tips but I...", "I don't really know what to write here.", "Really, hit Enter immediately and you'll connect to 127.0.0.1.", ...
"""Interactive shell""" import sys import code import random import pylibmc tips = [ "Want to use 127.0.0.1? Just hit Enter immediately.", "This was supposed to be a list of tips but I...", "I don't really know what to write here.", "Really, hit Enter immediately and you'll connect to 127.0.0.1.", ...
bsd-3-clause
Python
55ba43ac16f3c794bdd43d5b69c8d876fccf86f1
bump version
wistful/pympris
pympris/__init__.py
pympris/__init__.py
from MediaPlayer import MediaPlayer from PlayLists import PlayLists, PlaylistOrdering from Player import Player from Root import Root from TrackList import TrackList from common import available_players, PyMPRISException __version__ = '1.1' __description__ = 'Library to control media players using MPRIS2 interfaces' r...
from MediaPlayer import MediaPlayer from PlayLists import PlayLists, PlaylistOrdering from Player import Player from Root import Root from TrackList import TrackList from common import available_players, PyMPRISException __version__ = '1.0' __description__ = 'Library to control media players using MPRIS2 interfaces' r...
mit
Python
c72076e3bb9f818eff467c601d95a2a491d7750c
add wikipedia search
anqxyr/jarvis
pyscp_bot/search.py
pyscp_bot/search.py
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import googleapiclient.discovery as googleapi import wikipedia import warnings from . import lexicon ###############...
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import googleapiclient.discovery as googleapi from . import lexicon ################################################...
mit
Python
694a48d7fb1d29ecde5a223773a39d22346c2f79
Add a warning about Python 3.5 deprecation
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine
openquake/commands/__main__.py
openquake/commands/__main__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2018 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2018 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either ...
agpl-3.0
Python
8fb5540d98fabe849907beb71e2305274f4fef08
reformat json dat
shadowgamefly/osf_analysis
crawler/run.py
crawler/run.py
from util import * from crawler import * from parser import * import time def menu_session(subject, dir): q, h, p = init(dir) while True: url, status = crawl_menu(subject, p, dir) if status != 1 : print("Crawling finished") break print("{:s} saved".format(url)) ...
from util import * from crawler import * from parser import * import time def menu_session(subject, dir): q, h, p = init(dir) while True: url, status = crawl_menu(subject, p, dir) if status != 1 : print("Crawling finished") break print("{:s} saved".format(url)) ...
mit
Python
0393c5ad38d66d19cc7366b4bafd62cd984b049d
Update binary_exponentiation.py
TheAlgorithms/Python
other/binary_exponentiation.py
other/binary_exponentiation.py
""" * Binary Exponentiation for Powers * This is a method to find a^b in a time complexity of O(log b) * This is one of the most commonly used methods of finding powers. * Also useful in cases where solution to (a^b)%c is required, * where a,b,c can be numbers over the computers calculation limits. * Done using iterati...
""" * Binary Exponentiation for Powers * This is a method to find a^b in a time complexity of O(log b) * This is one of the most commonly used methods of finding powers. * Also useful in cases where solution to (a^b)%c is required, * where a,b,c can be numbers over the computers calculation limits. * Done using iterati...
mit
Python
8c8dc987df42022c7bd8be44537a3612cdbca5b2
switch to cmake
DeadSix27/python_cross_compile_script
packages/dependencies/expat.py
packages/dependencies/expat.py
{ 'repo_type' : 'archive', 'download_locations' : [ { 'url' : 'https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.xz', 'hashes' : [ { 'type' : 'sha256', 'sum' : '1ea6965b15c2106b6bbe883397271c80dfa0331cdf821b2c319591b55eadc0a4' }, ], }, { 'url' : 'https://fossies.org/linux/www/expat-2....
{ 'repo_type' : 'archive', 'download_locations' : [ { 'url' : 'https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.xz', 'hashes' : [ { 'type' : 'sha256', 'sum' : '1ea6965b15c2106b6bbe883397271c80dfa0331cdf821b2c319591b55eadc0a4' }, ], }, { 'url' : 'https://fossies.org/linux/www/expat-2....
mpl-2.0
Python
db2e09f07b7f127c01aec7ce27f511e523ea3a3e
complete model example
SEMAFORInformatik/femagtools,SEMAFORInformatik/femagtools
examples/model-creation/stator2-magnetSector.py
examples/model-creation/stator2-magnetSector.py
import femagtools def create_fsl(): machine = dict( name="PM 130 L4", lfe=0.1, poles=4, outer_diam=0.13, bore_diam=0.07, inner_diam=0.015, airgap=0.001, stator=dict( num_slots=12, num_slots_gen=12, stator2=dict( ...
import femagtools def create_fsl(): machine = dict( name="PM 130 L4", lfe=0.1, poles=4, outer_diam=0.13, bore_diam=0.07, inner_diam=0.015, airgap=0.001, stator=dict( num_slots=12, stator2=dict( slot_t1=0.001, ...
bsd-2-clause
Python
71fe847ed57dfc136e53d8a2fb12d08b39ee914e
Add a note what the fedora._openid_extensions module is for
fedora-infra/python-fedora
fedora/_openid_extensions/__init__.py
fedora/_openid_extensions/__init__.py
# This exists just to show it is a python module # These modules are only here temporarily while we wait for them to appear in upstream python-openid
# This exists just to tshow it is a python module
lgpl-2.1
Python
0fbf0fab7f87d11e232c232868398214d16300a6
Fix pylint error
getweber/weber-cli
cob/app.py
cob/app.py
import logbook import gossip from .project import get_project _logger = logbook.Logger(__name__) _cached_app = None _building = False def build_app(*, use_cached=False): from flask import Flask global _cached_app # pylint: disable=global-statement global _building # pylint: disable=global-stateme...
import logbook import gossip from .project import get_project _logger = logbook.Logger(__name__) _cached_app = None _building = False def build_app(*, use_cached=False): from flask import Flask global _cached_app # pylint: disable=global-statement global _building # pylint: disable=global-variabl...
bsd-3-clause
Python
3f0ad50647ba250efc1d53d39c4617c6d84c4f1d
Fix old 1.3 style django.conf.urls import in tests
jpotterm/django-fluent-contents,ixc/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,jpotterm/django-fluent-contents,ixc/django-fluent-contents,django-fluent/django-fluent-contents,ixc/django-fluent-contents,edoburu/django-fluent-contents,jpotterm...
fluent_contents/tests/testapp/urls.py
fluent_contents/tests/testapp/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), #url(r'^comments/', include('django.contrib.comments.urls')), #url(r'^forms/', include('form_designer.urls')), )
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), #url(r'^comments/', include('django.contrib.comments.urls')), #url(r'^forms/', include('form_designer.urls')), )
apache-2.0
Python
71ec75fb7b488c2d29ada9ed5516f419632b2209
Use consistent quote marks (double-quotes).
jonlabelle/Trimmer,jonlabelle/Trimmer
Trimmer.py
Trimmer.py
import sublime import sublime_plugin import re class DeleteEmptyLinesCommand(sublime_plugin.TextCommand): def run(self, edit): reobj = re.compile("^[ \t]*$\r?\n", re.MULTILINE) selections = self.get_selections() for sel in selections: trimmed = reobj.sub("", self.view.substr(...
import sublime import sublime_plugin import re class DeleteEmptyLinesCommand(sublime_plugin.TextCommand): def run(self, edit): reobj = re.compile("^[ \t]*$\r?\n", re.MULTILINE) selections = self.get_selections() for sel in selections: trimmed = reobj.sub("", self.view.substr(...
mit
Python
31e6f67d25eeb433743b60f6170459cfb9cf2f63
update checking for uta
joshuadeng/UTA_bot
UTA_bot.py
UTA_bot.py
import praw import time import os REPLY_MESSAGE = "Friendly reminder: 'UTA' refers to UT Arlington. UT Austin is simply 'UT'.\n\nIf you actually meant UT Arlington then ignore this post." def authenticate(): print("authenticating") login_info=retrieve_credentials() reddit=praw.Reddit(username=login_info[...
import praw import time import os REPLY_MESSAGE = "Friendly reminder: 'UTA' refers to UT Arlington. UT Austin is simply 'UT'.\n\nIf you actually meant UT Arlington then ignore this post." def authenticate(): print("authenticating") login_info=retrieve_credentials() reddit=praw.Reddit(username=login_info[...
mit
Python
ea34125bcfe79281d8861e632f1ab0ef5de59607
Correct path for Queue Full exception (#6528)
ifduyue/sentry,mvaled/sentry,looker/sentry,mvaled/sentry,ifduyue/sentry,gencer/sentry,mvaled/sentry,beeftornado/sentry,beeftornado/sentry,mvaled/sentry,mvaled/sentry,looker/sentry,ifduyue/sentry,mvaled/sentry,beeftornado/sentry,gencer/sentry,gencer/sentry,ifduyue/sentry,looker/sentry,gencer/sentry,looker/sentry,looker/...
src/sentry/utils/pubsub.py
src/sentry/utils/pubsub.py
from __future__ import absolute_import import redis import logging import random from django.conf import settings from threading import Thread from six.moves.queue import Queue, Full class QueuedPublisher(): """ A publisher that queues items locally and publishes them to a remote pubsub service on a bac...
from __future__ import absolute_import import redis import logging import random from django.conf import settings from threading import Thread from six.moves.queue import Queue class QueuedPublisher(): """ A publisher that queues items locally and publishes them to a remote pubsub service on a backgroun...
bsd-3-clause
Python
ab555ff4f026ee6070d28118151a59f015f94ed7
Bump version
Aeolitus/Sephrasto,Aeolitus/Sephrasto
Version.py
Version.py
_sephrasto_version_major = 1 _sephrasto_version_minor = 6 _sephrasto_version_build = 0
_sephrasto_version_major = 1 _sephrasto_version_minor = 5 _sephrasto_version_build = 3
mit
Python
5c59ae384d6eef5efb14d3c67133b87738173ca5
Change annotation viewset urls
comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django
app/grandchallenge/retina_api/urls.py
app/grandchallenge/retina_api/urls.py
from django.urls import path, include from rest_framework.routers import DefaultRouter, SimpleRouter from grandchallenge.retina_api import views from django.views.decorators.cache import cache_page from django.conf import settings app_name = "retina_api" router = DefaultRouter() annotation_router = SimpleRouter() an...
from django.urls import path, include from rest_framework.routers import DefaultRouter, SimpleRouter from grandchallenge.retina_api import views from django.views.decorators.cache import cache_page from django.conf import settings app_name = "retina_api" router = DefaultRouter() annotation_router = SimpleRouter() an...
apache-2.0
Python
1340a8a67a0dcf0fc902f2ead54bc531701d389e
fix return value in allow_migrate()
modoboa/modoboa-amavis,modoboa/modoboa-amavis,modoboa/modoboa-amavis,modoboa/modoboa-amavis
modoboa_amavis/dbrouter.py
modoboa_amavis/dbrouter.py
from __future__ import unicode_literals class AmavisRouter(object): """A router to control all database operations on models in the amavis application""" def db_for_read(self, model, **hints): """Point all operations on amavis models to 'amavis'.""" if model._meta.app_label == 'modoboa_a...
from __future__ import unicode_literals class AmavisRouter(object): """A router to control all database operations on models in the amavis application""" def db_for_read(self, model, **hints): """Point all operations on amavis models to 'amavis'.""" if model._meta.app_label == 'modoboa_a...
mit
Python
ce55f427fccd212206159c79caa730b83077bce8
fix host test
globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service
dbaas/base/test_host.py
dbaas/base/test_host.py
# -*- coding:utf-8 -*- from django.utils import unittest from django.test.client import Client from django.test import TestCase from django.utils import simplejson from django.test.client import RequestFactory from django.db import IntegrityError from .models import Host class HostTestCase(TestCase): def setUp(...
# -*- coding:utf-8 -*- from django.utils import unittest from django.test.client import Client from django.test import TestCase from django.utils import simplejson from django.test.client import RequestFactory from .models import Host class HostTestCase(TestCase): def setUp(self): self.client = Client()...
bsd-3-clause
Python
463e5467093f83c5635050797bbb781484571930
add optional dir argument to lint_js
fiduswriter/fiduswriter,fiduswriter/fiduswriter,fiduswriter/fiduswriter,fiduswriter/fiduswriter
fiduswriter/base/management/commands/lint_js.py
fiduswriter/base/management/commands/lint_js.py
import shutil import os import json from subprocess import call from django.apps import apps from django.core.management.base import BaseCommand from django.core.management import call_command from django.conf import settings def dir_path(path): if os.path.isdir(path): return path else: raise...
import shutil import os import json from subprocess import call from django.apps import apps from django.core.management.base import BaseCommand from django.core.management import call_command from django.conf import settings class Command(BaseCommand): help = 'Check JavaScript files with ESLint' def add_ar...
agpl-3.0
Python
e4b1b8346834ad1ea8a176184a5b6443a2a91099
Add handler for logging to RabbitMQ
ddsc/ddsc-incron
ddsc_incron/settings.py
ddsc_incron/settings.py
from __future__ import absolute_import from ddsc_incron.celery import celery # Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: ...
# Note that logging to a single file from multiple processes is NOT supported. # See: http://docs.python.org/2/howto/logging-cookbook.html # #logging-to-a-single-file-from-multiple-processes # This very much applies to ddsc-incron! # TODO: Consider ConcurrentLogHandler on pypi when this bug is solved? # https://bugzil...
mit
Python
41dfede7c82745bb7d944071a800101fa13d5ebf
Fix bugs
tigerneil/deepy,wolet/deepy,ZhangAustin/deepy,dlacombejr/deepy,dlacombejr/deepy,wolet/deepy,rldotai/deepy,wolet/deepy,tigerneil/deepy,dlacombejr/deepy,rldotai/deepy,rldotai/deepy,tigerneil/deepy,ZhangAustin/deepy,ZhangAustin/deepy
deepy/conf/nn_config.py
deepy/conf/nn_config.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from deepy.utils import UniformInitializer from config import GeneralConfig import logging as loggers logging = loggers.getLogger(__name__) class NetworkConfig(GeneralConfig): """ Network configuration container. """ def __init__(self): super(Netw...
#!/usr/bin/env python # -*- coding: utf-8 -*- from deepy.utils.weight_initializer import UniformInitializer from config import GeneralConfig import logging as loggers logging = loggers.getLogger(__name__) class NetworkConfig(GeneralConfig): """ Network configuration container. """ def __init__(self):...
mit
Python
fe5ce375290883c547bd658d049756fb559c7fa9
Set version number to indicate dev version.
JDeuce/webassets,aconrad/webassets,john2x/webassets,wijerasa/webassets,florianjacob/webassets,glorpen/webassets,glorpen/webassets,john2x/webassets,wijerasa/webassets,aconrad/webassets,0x1997/webassets,JDeuce/webassets,heynemann/webassets,heynemann/webassets,heynemann/webassets,aconrad/webassets,glorpen/webassets,scorph...
src/webassets/__init__.py
src/webassets/__init__.py
__version__ = (0, 10, 'dev') # Make a couple frequently used things available right here. from .bundle import Bundle from .env import Environment
__version__ = (0, 9) # Make a couple frequently used things available right here. from .bundle import Bundle from .env import Environment
bsd-2-clause
Python
573e442216e171236063c8e63b38b689537755a4
Fix webhook url
SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci
config/urls.py
config/urls.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views from mr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views from mr...
bsd-3-clause
Python
59add183e167785282cd24e294fce8964cf4c33e
Add missing app to urls.py
watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator
config/urls.py
config/urls.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views urlpat...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views urlpat...
mit
Python
77a7ccee4c7beede06f8bc6bd73d32761813c1ed
change the sitemap and add the root entry
project-musashi/GTR,project-musashi/GTR,project-musashi/GTR,project-musashi/GTR
config/urls.py
config/urls.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView # generate from django.contrib.sitemaps import GenericS...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView # generate from django.contrib.sitemaps import GenericS...
bsd-3-clause
Python
4b7aa7e9fde72187770a581807ffe84434549c54
Fix downloading gziped torrents
laurent-george/weboob,franek/weboob,willprice/weboob,franek/weboob,RouxRC/weboob,frankrousseau/weboob,RouxRC/weboob,nojhan/weboob-devel,Konubinix/weboob,Boussadia/weboob,Konubinix/weboob,willprice/weboob,Konubinix/weboob,laurent-george/weboob,nojhan/weboob-devel,yannrouillard/weboob,laurent-george/weboob,sputnick-dev/w...
modules/kickass/backend.py
modules/kickass/backend.py
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Julien Veyssier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Julien Veyssier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
agpl-3.0
Python
aa069c707ef01cdc268eb80322796bf862de9018
Update catfeeder.py
jeremysells/CatFeeder,jeremysells/CatFeeder
CatFeeder/src/catfeeder.py
CatFeeder/src/catfeeder.py
# Copyright (c) 2015 Jeremy Sells # For copying permission, copyright information, terms, etc read the # LICENSE (file) that that was distributed with this source code. # The page (below) was very helpful when writing this script # http://computers.tutsplus.com/tutorials/controlling-dc-motors-using-python-with-a-raspb...
# Copyright (c) 2015 Jeremy Sells # For copying permission, copyright information, terms, etc read the # LICENSE (file) that that was distributed with this source code. import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BOARD) # Define GPIO PINS Motor1A = 16 Motor1B = 18 Motor1E = 22 MororSwitch = 11; ...
mit
Python
c922950cd1446af646697b60ac95a6303462a7b1
Support python 2
pwr22/cloudflare_client
cloudflare_client.py
cloudflare_client.py
# CloudFlare client API module import requests CF_URL = 'https://www.cloudflare.com/api_json.html' # Specify object explicitly for Python 2 support class Client (object): def __init__(self, email, token): '''Contruct a CloudFlare Client API object''' self.__user = email self.__key = toke...
# CloudFlare client API module import requests CF_URL = 'https://www.cloudflare.com/api_json.html' class Client: def __init__(self, email, token): '''Contruct a CloudFlare Client API object''' self.__user = email self.__key = token def __getattr__(self, callType): '''Overrid...
mit
Python
430b4a77b41066f4ae22c1a09d452241548905a8
move latest update to app via event_handlers.on_build
gangadharkadam/vlinkerp,suyashphadtare/sajil-final-erp,indictranstech/tele-erpnext,saurabh6790/aimobilize-app-backup,gangadharkadam/verveerp,saurabh6790/test-erp,indictranstech/trufil-erpnext,indictranstech/buyback-erp,mahabuber/erpnext,gangadharkadam/contributionerp,gangadharkadam/v5_erp,anandpdoshi/erpnext,indictrans...
startup/event_handlers.py
startup/event_handlers.py
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt" from __future__ import unicode_literals import webnotes import home def on_login_post_session(login_manager): """ called after login update login_from and delete parallel sessions """ # Clear prev...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt" from __future__ import unicode_literals import webnotes import home def on_login_post_session(login_manager): """ called after login update login_from and delete parallel sessions """ # Clear prev...
agpl-3.0
Python
ec3de4ce62f9d9978f5cb39cac9d78201f1457bb
Set version to 0.2.0
farzadghanei/statsd-metrics
statsdmetrics/__init__.py
statsdmetrics/__init__.py
""" statsdmetrics -------------- Metric classes for Statsd. :license: released under the terms of the MIT license. See LICENSE file for more information. """ from .metrics import (Counter, Timer, Gauge, Set, GaugeDelta, normalize_metric_name, parse_met...
""" statsdmetrics -------------- Metric classes for Statsd. :license: released under the terms of the MIT license. See LICENSE file for more information. """ from .metrics import (Counter, Timer, Gauge, Set, GaugeDelta, normalize_metric_name, parse_met...
mit
Python
21c2ad47184c8d3c16be305cc4db4867be81a9e9
Fix year in package date
susam/taskplot,susam/taskplot
taskplot/__init__.py
taskplot/__init__.py
# Copyright (c) 2014 Susam Pal # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and ...
# Copyright (c) 2014 Susam Pal # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and ...
bsd-2-clause
Python
a8f9c8bedae7e1f9a7f62560f1246529fd6209df
Add labels to bars
jollyra/hubot-commit-streak,jollyra/hubot-commit-streak,supermitch/streak-podium,jollyra/hubot-streak-podium,jollyra/hubot-streak-podium,supermitch/streak-podium
streak-podium/render.py
streak-podium/render.py
import pygal def horizontal_bar(sorted_streaks, sort_attrib): """ Render a horizontal bar chart of streaks. Values have already been sorted by sort_attrib. """ users = [user for user, _ in sorted_streaks][::-1] streaks = [getattr(streak, sort_attrib) for _, streak in sorted_streaks][::-1] ...
import pygal def horizontal_bar(sorted_streaks, sort_attrib): """ Render a horizontal bar chart of streaks. Values have already been sorted by sort_attrib. """ users = [user for user, _ in sorted_streaks][::-1] values = [getattr(streak, sort_attrib) for _, streak in sorted_streaks][::-1] ...
mit
Python
170d08442aeabaa5f8e2fb1fef14f9e6464eeeab
Add : implemented parsing method.
nocternology/fail2dash,nocternology/fail2dash
core/parser.py
core/parser.py
class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = config if...
class Parser(object): """ Parser class definition. Takes care of parsing the fail2ban log, either in "all" mode or "realtime". """ def __init__(self, config, mode=None): """ Inits the object by registering the configuration object """ self.config = config if...
mit
Python
880d43f4719ddf70fea6dc90f83cd33f30ec59df
add license information (#4)
jh0ker/mau_mau_bot,imlonghao/unocn_bot,jh0ker/mau_mau_bot,SYHGroup/mau_mau_bot,SYHGroup/mau_mau_bot,pythonalliance/uno2bot,pythonalliance/uno2bot
credentials.py
credentials.py
#!/usr/bin/env python3 # # Telegram bot to play UNO in group chats # Copyright (c) 2016 Jannes Höke <uno@jhoeke.de> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of t...
TOKEN = 'TOKEN' BOTAN_TOKEN = '' # Optional: Add a botan.io token if you want bot statistics
agpl-3.0
Python
b17054e26edb654ea7419fcb4f501cfa66daa1b8
add the black-whitelist example
instagrambot/instapro,instagrambot/instabot,AlexBGoode/instabot,instagrambot/instabot,misisnik/testinsta,rasperepodvipodvert/instabot,misisnik/testinsta,Diapostrofo/instabot,sudoguy/instabot,ohld/instabot,vkgrd/instabot
examples/black-whitelist/black_white_lists.py
examples/black-whitelist/black_white_lists.py
""" instabot example Workflow: 1) Reads user_ids from blacklist and whitelist 2) likes several last medias by users in your timeline Notes: blacklist and whitelist files should contain user_ids - each one on the separate line. Example: 1234125 ...
""" instabot example Workflow: 1) Reads user_ids from blacklist and whitelist Notes: blacklist and whitelist files should contain user_ids - each one on the separate line. Example: 1234125 1234124512 """ import sys import os sys.path.append(os.path...
apache-2.0
Python
abcc6b5a7900e0a8e151425ba3c21c220755b8b1
Update test cases (#429)
pheanex/xpython,exercism/python,exercism/python,exercism/xpython,rootulp/xpython,smalley/python,N-Parsons/exercism-python,mweb/python,pheanex/xpython,jmluy/xpython,mweb/python,smalley/python,N-Parsons/exercism-python,behrtam/xpython,rootulp/xpython,exercism/xpython,jmluy/xpython,behrtam/xpython
exercises/atbash-cipher/atbash_cipher_test.py
exercises/atbash-cipher/atbash_cipher_test.py
import unittest from atbash_cipher import decode, encode # test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0 class AtbashCipherTest(unittest.TestCase): def test_encode_no(self): self.assertMultiLineEqual("ml", encode("no")) def test_encode_yes(self): self.assertMulti...
import unittest from atbash_cipher import decode, encode class AtbashCipherTest(unittest.TestCase): def test_encode_no(self): self.assertMultiLineEqual("ml", encode("no")) def test_encode_yes(self): self.assertMultiLineEqual("bvh", encode("yes")) def test_encode_OMG(self): self...
mit
Python
70689b3b292623aa2690c483ec944483171d0709
Replace _ from key names with camelcase
BernhardDenner/libelektra,mpranj/libelektra,petermax2/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,BernhardDenner/libelektra,mpranj/libelektra,mp...
src/tools/gen/support/c.py
src/tools/gen/support/c.py
from support.gen import * from support.util import * class CSupport(Support): def funcname(self, key): if key.startswith('/'): return self.funcpretty(key[1:]) elif key.startswith('user/'): return self.funcpretty(key[5:]) elif key.startswith('system/'): return self.funcpretty(key[7:]) else: raise E...
from support.gen import * from support.util import * class CSupport(Support): def funcname(self, key): if key.startswith('/'): return self.funcpretty(key[1:]) elif key.startswith('user/'): return self.funcpretty(key[5:]) elif key.startswith('system/'): return self.funcpretty(key[7:]) else: raise E...
bsd-3-clause
Python
6f1160dd7f940eb6f28b6af55777e3919e65f81d
Add middleware for setting the schema when the request comes in.
schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse
multi_schema/middleware.py
multi_schema/middleware.py
""" Middleware to automatically set the schema (namespace). if request.user.is_superuser, then look for a ?schema=XXX and set the schema to that. Otherwise, set the schema to the one associated with the logged in user. """ from models import Schema class SchemaMiddleware: def process_request(self, request): ...
bsd-3-clause
Python
9acdcbc6266c50a3bf2c9b3e9cc5c55f53157890
Fix swift-evolution fastmail path
keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles
mutt/offlineimaphelpers.py
mutt/offlineimaphelpers.py
#!/usr/bin/env python import os import re import subprocess import sys def get_env(var="EP"): return os.environ.get(var) def get_keychain_pass(account=None, server=None): if not sys.platform == 'darwin': return get_env() home = os.environ.get('HOME') user = os.environ.get('USER') para...
#!/usr/bin/env python import os import re import subprocess import sys def get_env(var="EP"): return os.environ.get(var) def get_keychain_pass(account=None, server=None): if not sys.platform == 'darwin': return get_env() home = os.environ.get('HOME') user = os.environ.get('USER') para...
mit
Python
396dd17bade299f9832667225c9ee5322f815473
Update Ch. 5 Question3: added from module import
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/CrackingCodesWithPython/Chapter05/PracticeQuestions/Question3.py
books/CrackingCodesWithPython/Chapter05/PracticeQuestions/Question3.py
# Which Python instruction would import a module named watermelon.py? import watermelon from watermelon import nutrition watermelon.nutrition()
# Which Python instruction would import a module named watermelon.py? import watermelon watermelon.nutrition()
mit
Python
e9a8458a1b49835b9600e1e6a57fa50f185f60a5
Fix HTTP response code
Flexget/Flexget,ianstalk/Flexget,crawln45/Flexget,ianstalk/Flexget,malkavi/Flexget,crawln45/Flexget,crawln45/Flexget,Flexget/Flexget,malkavi/Flexget,malkavi/Flexget,Flexget/Flexget,malkavi/Flexget,crawln45/Flexget,Flexget/Flexget,ianstalk/Flexget
flexget/components/notify/notifiers/gotify.py
flexget/components/notify/notifiers/gotify.py
import logging import base64 import datetime import re from flexget import plugin from flexget.event import event from flexget.config_schema import one_or_more from flexget.plugin import PluginWarning from flexget.utils.requests import Session as RequestSession, TimedLimiter from requests.exceptions import RequestExce...
import logging import base64 import datetime import re from flexget import plugin from flexget.event import event from flexget.config_schema import one_or_more from flexget.plugin import PluginWarning from flexget.utils.requests import Session as RequestSession, TimedLimiter from requests.exceptions import RequestExce...
mit
Python
6c2b64297b0714fb331d77e33aaa0cffb667899b
Remove unused import
blancltd/django-glitter,developersociety/django-glitter,developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter,blancltd/django-glitter
glitter/blocks/related_pages/tests.py
glitter/blocks/related_pages/tests.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import get_callable from django.test import TestCase from django.test.client import RequestFactory from django.test imp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import get_callable from django.test import TestCase from django.test.client import RequestFactory from django.test imp...
bsd-3-clause
Python
60cbbd9a3fcb7d7894549322e29a5880ec788aa7
simplify command-line args
macarthur-lab/xbrowse,ssadedin/seqr,macarthur-lab/xbrowse,ssadedin/seqr,macarthur-lab/xbrowse,macarthur-lab/seqr,macarthur-lab/seqr,macarthur-lab/xbrowse,macarthur-lab/xbrowse,ssadedin/seqr,macarthur-lab/seqr,macarthur-lab/xbrowse,macarthur-lab/seqr,ssadedin/seqr,macarthur-lab/seqr,ssadedin/seqr
xbrowse_server/base/management/commands/add_families_to_project.py
xbrowse_server/base/management/commands/add_families_to_project.py
from optparse import make_option from django.core.management.base import BaseCommand from xbrowse_server.base.models import Project from xbrowse_server import sample_management class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--fam-file') parser.add_argument('pr...
from optparse import make_option from django.core.management.base import BaseCommand from xbrowse_server.base.models import Project from xbrowse_server import sample_management class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('args', nargs='*') parser.add_argumen...
agpl-3.0
Python
44d3973be9203291207c99e4def8d1d29c89db8c
Prepare for new release
paci4416/keep,OrkoHunter/keep,OrkoHunter/keep,paci4416/keep
keep/about.py
keep/about.py
__name__ = 'keep' __version__ = '2.4.0'
__name__ = 'keep' __version__ = '2.1.3'
mit
Python
1a7dba62356362e77723e6320911097c85568b99
Make model_base work with sqla 0.7.X
esikachev/scenario,zhujzhuo/Sahara,crobby/sahara,citrix-openstack-build/sahara,henaras/sahara,matips/iosr-2015,bigfootproject/sahara,tellesnobrega/storm_plugin,ekasitk/sahara,redhat-openstack/sahara,mapr/sahara,bigfootproject/sahara,xme1226/sahara,ekasitk/sahara,redhat-openstack/sahara,zhujzhuo/Sahara,openstack/sahara,...
savanna/db/sqlalchemy/model_base.py
savanna/db/sqlalchemy/model_base.py
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
Python
d0b74b614ef95abe4613477ac8ea3685b1969e61
Update wegmans.py
iandees/all-the-places,iandees/all-the-places,iandees/all-the-places
locations/spiders/wegmans.py
locations/spiders/wegmans.py
import scrapy import re from locations.items import GeojsonPointItem class WegmansSpider(scrapy.Spider): name = "wegmans" allowed_domains = ["www.wegmans.com"] download_delay = 1.5 start_urls = ( 'https://www.wegmans.com/stores.html', ) def parse_stores(self, response): propert...
import scrapy import re from locations.items import GeojsonPointItem class WegmansSpider(scrapy.Spider): name = "wegmans" allowed_domains = ["www.wegmans.com"] download_delay = 0 start_urls = ( 'https://www.wegmans.com/stores.html', ) def parse_stores(self, response): propertie...
mit
Python
644280d817feeddd3036f263482bae394e5ee4d0
use vis.js and update the static/
HimmelStein/lg-flask,HimmelStein/lg-flask,HimmelStein/lg-flask
tasks/chinese/clgnet.py
tasks/chinese/clgnet.py
# -*- coding: utf-8 -*- from ..lgutil import database_utility as dbutil from ..lgutil.lg_graph import LgGraph def get_raw_ldg(chsntOrId, table='PONS'): if chsntOrId.isdigit(): id = int(chsntOrId) raw_ldg_str = dbutil.get_raw_ldg_with_id(id, table=table) LgGraphObj = LgGraph() pri...
mit
Python
b9199acca9031e2f533b8455985efe19a7452aca
Correct CPP03 name; #71
DMOJ/judge,DMOJ/judge,DMOJ/judge
dmoj/executors/CPP03.py
dmoj/executors/CPP03.py
from .GCCExecutor import GCCExecutor class Executor(GCCExecutor): command = 'g++' command_paths = ['g++'] std = None ext = '.cpp' name = 'CPP03' test_program = ''' #include <iostream> int main() { std::cout << std::cin.rdbuf(); return 0; } ''' def get_flags(self): return ...
from .GCCExecutor import GCCExecutor class Executor(GCCExecutor): command = 'g++' command_paths = ['g++'] std = None ext = '.cpp' name = 'CPP' test_program = ''' #include <iostream> int main() { std::cout << std::cin.rdbuf(); return 0; } ''' def get_flags(self): return ([...
agpl-3.0
Python
7f37fe37fc70b5886d75386160a8904879eeb964
remove files/paths
iivvoo/cubric
cubric/file.py
cubric/file.py
from .cubric import Tool, NonZero class File(Tool): DIR = 1 FILE = 2 LINK = 3 def present(self, path, type=DIR, mode=None, user=None, group=None, target=None): if type == File.LINK: if target: self.env.command("ln", "-sfn", path, target) ...
from .cubric import Tool, NonZero class File(Tool): DIR = 1 FILE = 2 LINK = 3 def present(self, path, type=DIR, mode=None, user=None, group=None, target=None): if type == File.LINK: if target: self.env.command("ln", "-sfn", path, target) ...
isc
Python
5d11ee8e9e2992432776c080b5fbd3c560d41c09
Add breakline on write
davidmogar/normalizr,davidmogar/cucco,davidmogar/cucco
cucco/batch.py
cucco/batch.py
from __future__ import absolute_import import os BATCH_EXTENSION = '.cucco' class Batch(object): def __init__(self, config, cucco): """Inits Batch class.""" self._config = config self._cucco = cucco self._logger = config.logger def _file_generator(self, path, recursive): ...
from __future__ import absolute_import import os BATCH_EXTENSION = '.cucco' class Batch(object): def __init__(self, config, cucco): """Inits Batch class.""" self._config = config self._cucco = cucco self._logger = config.logger def _file_generator(self, path, recursive): ...
mit
Python
953ac13a3349322714200f2d4b4c501f4cb3ef32
make parse_log.py more robust
zhaozengguang/opencog,kinoc/opencog,rodsol/atomspace,kim135797531/opencog,roselleebarle04/opencog,Tiggels/opencog,ruiting/opencog,Allend575/opencog,sanuj/opencog,yantrabuddhi/opencog,iAMr00t/opencog,AmeBel/atomspace,williampma/atomspace,UIKit0/atomspace,kinoc/opencog,yantrabuddhi/opencog,sumitsourabh/opencog,misgeatgit...
scripts/learning/moses/parse_log.py
scripts/learning/moses/parse_log.py
#!/usr/bin/env python import sys from common import datetime_from_str from optparse import OptionParser def parse_log(logFileName, options): of = open(options.output_file, "w") if options.output_file else sys.stdout prefix = options.prefix prefix_delim = " " + options.prefix + ":" header_written = Fals...
#!/usr/bin/env python import sys from common import datetime_from_str from optparse import OptionParser def parse_log(logFileName, options): of = open(options.output_file, "w") if options.output_file else sys.stdout prefix = options.prefix prefix_colon = options.prefix + ":" header_written = False ...
agpl-3.0
Python
1794f51821a191bd98fa3bcb5315d6ba0fa6f9a8
Remove print statement and add newline
jkvoorhis/cheeseburger_backpack_bot
plugins/plugin_word_respond.py
plugins/plugin_word_respond.py
from __future__ import unicode_literals from rtmbot.core import Plugin from utils import word_checking as wc_utils import json class PluginWordRespond(Plugin): def __init__(self, slack_client=None, plugin_config=None): # because of the way plugins are called we must explicitly pass the # argumen...
from __future__ import unicode_literals from rtmbot.core import Plugin from utils import word_checking as wc_utils import json class PluginWordRespond(Plugin): def __init__(self, slack_client=None, plugin_config=None): # because of the way plugins are called we must explicitly pass the # argumen...
apache-2.0
Python
7ee2558ba79df6ceef4f1d5e7ef035d537c0fa99
update settings module
apipanda/openssl,apipanda/openssl,apipanda/openssl,apipanda/openssl
openssl/settings/common.py
openssl/settings/common.py
""" Django settings for mapoint project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
""" Django settings for mapoint project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
mit
Python
c72fee131a1fd3e657ea73ae98da1f5b4b021995
Update vigenereDicitonaryHacker: added è character
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py
books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py
# Vigenère Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print(...
# Vigenere Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print(...
mit
Python
c6c06ab8197bfe3f007bab231536656abfcf0954
Add mock for shapely module
mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys from unittest import mock # Add repository root so we can import ichnaea things REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) # Fake the shapely module so things will import sys.modules['shapely'] = mock.MagicMoc...
# -*- coding: utf-8 -*- import os import sphinx_rtd_theme import sys REPO_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(REPO_DIR) project = 'Ichnaea' copyright = '2013-2019, Mozilla' # The short X.Y version. version = '2.0' # The full version, including alpha/beta/rc tags. release = '2.0' auto...
apache-2.0
Python
3c6a4ffd9bd11fd36df5249956ca7ccedabf112a
Switch to RTD Sphinx theme
TangledWeb/tangled.sqlalchemy
docs/conf.py
docs/conf.py
import datetime import pkg_resources import sphinx_rtd_theme # -- General configuration ------------------------------------------------ current_year = datetime.datetime.today().year project = 'tangled.sqlalchemy' author = 'Wyatt Baldwin' copyright = '2013-{} {}'.format(current_year, author) # The short X.Y |versio...
import datetime import pkg_resources # -- General configuration ------------------------------------------------ current_year = datetime.datetime.today().year project = 'tangled.sqlalchemy' author = 'Wyatt Baldwin' copyright = '2013-{} {}'.format(current_year, author) # The short X.Y |version| version = pkg_resource...
mit
Python
4fadbc00b22726f6f36dd6207bfca4f5cc0af074
add test of manual setup
olivierverdier/SpecTraVVave
test/test_diagram.py
test/test_diagram.py
from __future__ import division import unittest from travwave.diagram import BifurcationDiagram import travwave.equations as teq import travwave.boundary as tbc from travwave.discretization import Discretization from travwave.solver import Solver from travwave.navigation import Navigator import numpy.testing as np...
from __future__ import division import unittest from travwave.equations import * from travwave.diagram import * from travwave.boundary import * import numpy.testing as npt class TestGeneral(unittest.TestCase): """ Only tests that the problem can be set up and run without raising any exception. No tests a...
bsd-3-clause
Python
c6447310063a1521d83a4f7fd0b4bc548d54835b
Add create_zip fixture to get_new test to cover more branches
rlee287/pyautoupdate,rlee287/pyautoupdate
test/test_get_new.py
test/test_get_new.py
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os import sys @pytest.fixture("function") def create_zip(request): def teardown(): if os.path.i...
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher from .pytest_skipif import needinternet from .pytest_makevers import fixture_update_dir import pytest import os @pytest.mark.trylast @needinternet def test_check_vers_update(fixture_update_dir): package=fixture_u...
lgpl-2.1
Python
59050c9db6f36b2a07cfd18cfed06476040e01bf
Fix newline issue when reading from dbtk.config
henrykironde/deletedret,embaldridge/retriever,embaldridge/retriever,bendmorris/retriever,bendmorris/retriever,embaldridge/retriever,bendmorris/retriever,davharris/retriever,davharris/retriever,goelakash/retriever,davharris/retriever,goelakash/retriever,henrykironde/deletedret
dbtk_wizard.py
dbtk_wizard.py
"""Database Toolkit Wizard This module contains a list of all current DBTK scripts. Running this module directly will launch the download wizard, allowing the user to choose from all scripts. """ import os from dbtks_EA_ernest2003 import * from dbtks_EA_pantheria import * from dbtks_bbs import * from dbtks_EA_porta...
"""Database Toolkit Wizard This module contains a list of all current DBTK scripts. Running this module directly will launch the download wizard, allowing the user to choose from all scripts. """ import os from dbtks_EA_ernest2003 import * from dbtks_EA_pantheria import * from dbtks_bbs import * from dbtks_EA_porta...
mit
Python
7eefcc20259f7b4b1ae2ebe4536ad8b7ebf27025
add comments
medifle/python_6.00.1x
defGcdRecur.py
defGcdRecur.py
# recursive version of greatest common divisor # Euclidean algorithm def gcdRecur(a, b): # base case if b == 0: return a # recursive block else: t = a a = b b = t % b return gcdRecur(a, b)
# recursive version of greatest common divisor # Euclidean algorithm def gcdRecur(a, b): if b == 0: return a else: t = a a = b b = t % b return gcdRecur(a, b)
mit
Python
a95eba2b2379dd58cea96f09bf51be3e2e80faac
Change Sphinx documentation theme
xolox/python-property-manager
docs/conf.py
docs/conf.py
# Useful property variants for Python programming. # # Author: Peter Odding <peter@peterodding.com> # Last Change: April 27, 2018 # URL: https://property-manager.readthedocs.io """Sphinx documentation configuration for the `property-manager` package.""" import os import sys # Add the property-manager source distribu...
# Useful property variants for Python programming. # # Author: Peter Odding <peter@peterodding.com> # Last Change: April 27, 2018 # URL: https://property-manager.readthedocs.io """Sphinx documentation configuration for the `property-manager` package.""" import os import sys # Add the property-manager source distribu...
mit
Python
bb45fe27f2fb3247ea4a9c400c357091ce542972
Enable napoleon extension
pymanopt/pymanopt,pymanopt/pymanopt
docs/conf.py
docs/conf.py
import datetime import pymanopt # Package information project = "Pymanopt" author = "Jamie Townsend, Niklas Koep, Sebastian Weichwald" copyright = f"2016-{datetime.date.today().year}, {author}" release = version = pymanopt.__version__ # Build settings extensions = [ "sphinx.ext.autodoc", "sphinx.ext.coverage...
import datetime import pymanopt # Package information project = "Pymanopt" author = "Jamie Townsend, Niklas Koep, Sebastian Weichwald" copyright = f"2016-{datetime.date.today().year}, {author}" release = version = pymanopt.__version__ # Build settings extensions = [ "sphinx.ext.autodoc", "sphinx.ext.coverage...
bsd-3-clause
Python
b5c06e4fe591cace84a70b280aa15a9cf8ca9e0b
Fix the documentation config
prophile/sr-scheduler-2015
docs/conf.py
docs/conf.py
import sys sys.path.insert(0, os.path.abspath('..')) # Sphinx configuration extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinxarg.ext' ] source_suffix = '.rst' master_doc = 'index' project = 'Student Robotics match scheduler' copyright = '2015, Student Robotics' from sr.comp.scheduler.m...
sys.path.insert(0, os.path.abspath('..')) # Sphinx configuration extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinxarg.ext' ] source_suffix = '.rst' master_doc = 'index' project = 'Student Robotics match scheduler' copyright = '2015, Student Robotics' from sr.comp.scheduler.metadata imp...
mit
Python
b05035675cc1f7e9fe3867c2d3decd759a4711e8
Add "compress" command to init script
yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core
memopol/base/management/commands/init.py
memopol/base/management/commands/init.py
from django.core.management import call_command from django.core.management.base import BaseCommand from django.conf import settings class Command(BaseCommand): help = 'Initialize project' def handle(self, *args, **options): call_command("syncdb", interactive=False) call_command("migrate", "c...
from django.core.management import call_command from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Initialize project' def handle(self, *args, **options): call_command("syncdb", interactive=False) call_command("migrate", "categories") call_command(...
agpl-3.0
Python
894aa960d912573f80b6a7a66e3dd883106801ee
Update base.py
menpo/menpo,patricksnape/menpo,mozata/menpo,mozata/menpo,yuxiang-zhou/menpo,mozata/menpo,patricksnape/menpo,grigorisg9gr/menpo,menpo/menpo,grigorisg9gr/menpo,menpo/menpo,grigorisg9gr/menpo,yuxiang-zhou/menpo,mozata/menpo,yuxiang-zhou/menpo,patricksnape/menpo
menpo/fit/lucaskanade/appearance/base.py
menpo/fit/lucaskanade/appearance/base.py
from menpo.fit.lucaskanade.residual import SSD from menpo.fit.lucaskanade.base import LucasKanade class AppearanceLucasKanade(LucasKanade): def __init__(self, model, transform, eps=10**-6): # note that the only supported residual for Appearance LK is SSD. # this is becuase in general we don't kno...
from menpo.fit.lucaskanade.residual import SSD from menpo.fit.lucaskanade.base import LucasKanade class AppearanceLucasKanade(LucasKanade): def __init__(self, model, transform, eps=10**-6): super(AppearanceLucasKanade, self).__init__(SSD(), transform, eps=eps) # in appearance alignment, target i...
bsd-3-clause
Python
8e0cb5fcec3d00064adff44f14cd6a5e7f06b1f8
Fix clickatell send_error error check (#57985)
jawilson/home-assistant,rohitranjan1991/home-assistant,mezz64/home-assistant,lukas-hetzenecker/home-assistant,GenericStudent/home-assistant,aronsky/home-assistant,lukas-hetzenecker/home-assistant,nkgilley/home-assistant,aronsky/home-assistant,rohitranjan1991/home-assistant,home-assistant/home-assistant,home-assistant/h...
homeassistant/components/clickatell/notify.py
homeassistant/components/clickatell/notify.py
"""Clickatell platform for notify component.""" from http import HTTPStatus import logging import requests import voluptuous as vol from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT import homeassistant.helpers.config_vali...
"""Clickatell platform for notify component.""" import logging import requests import voluptuous as vol from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT, HTTP_ACCEPTED, HTTP_OK import homeassistant.helpers.config_validati...
apache-2.0
Python
6d97c1adce9072df020b13efc0d0a6abed27cea1
Update followLineTest.py
task123/AutoTT,task123/AutoTT,task123/AutoTT
scriptsForTesting/followLineTest.py
scriptsForTesting/followLineTest.py
import TCP import Motor import Steering import Status import time import Cameras import Lights import Modes import os try: trip_meter = Motor.TripMeter() motors = Motor.Motor(trip_meter) follow_line = Steering.FollowLine(motors, start_speed = 20) while True: time.sleep(10) except: print "except" motor...
import TCP import Motor import Steering import Status import time import Cameras import Lights import Modes import os try: trip_meter = Motor.TripMeter() motors = Motor.Motor(trip_meter) follow_line = Steering.FollowLine(motors, start_speed = 20) while True: time.sleep(10) except: motors.turn_off() fo...
mit
Python
cb135dd3565ea1c7dc464a822476a054849a33d2
Add gtk/opencv as required packages
wheeler-microfluidics/dmf-device-ui
pavement.py
pavement.py
import platform import sys from paver.easy import task, needs, path from paver.setuputils import setup, install_distutils_tasks sys.path.insert(0, path('.').abspath()) import version install_distutils_tasks() # Platform-independent package requirements. install_requires = ['microdrop-utility>=0.4', 'networkx>=1.10'...
import sys from paver.easy import task, needs, path from paver.setuputils import setup, install_distutils_tasks sys.path.insert(0, path('.').abspath()) import version install_distutils_tasks() setup(name='dmf-device-ui', version=version.getVersion(), description='Device user interface for Microdrop digi...
lgpl-2.1
Python
b97345cab3c61f6c52821708e746d83dfcf0115f
Bump version
jboss-container-images/concreate,jboss-container-images/concreate,jboss-container-images/concreate
concreate/version.py
concreate/version.py
version = "1.1.0dev" schema_version = 1
version = "1.0.0dev" schema_version = 1
mit
Python
17887bb12c8666f234fe2a2f08f0ce90467e7dd2
add utility functions for determining type of binaries.
groutr/conda-tools,groutr/conda-tools
conda_tools/utils.py
conda_tools/utils.py
import stat from os import lstat, error def is_hardlinked(f1, f2): """ Determine if two files are hardlinks to the same inode. """ try: s, d = lstat(f1), lstat(f2) return s.st_ino == d.st_ino and s.st_dev == d.st_dev except error: return False def is_executable(mode): "...
import stat from os import lstat, error def is_hardlinked(f1, f2): """ Determine if two files are hardlinks to the same inode. """ try: s, d = lstat(f1), lstat(f2) return s.st_ino == d.st_ino and s.st_dev == d.st_dev except error: return False def is_executable(mode): ...
bsd-3-clause
Python
05ca90e96310b9b5c611828207bf7c85812175fe
revert to fsl 5.0.9 to avoid running out of space in travis ci
kaczmarj/neurodocker,kaczmarj/neurodocker
neurodocker/interfaces/tests/test_fsl.py
neurodocker/interfaces/tests/test_fsl.py
"""Tests for neurodocker.interfaces.FSL""" # Author: Jakub Kaczmarzyk <jakubk@mit.edu> from __future__ import absolute_import, division, print_function import pytest from neurodocker.interfaces import FSL from neurodocker.interfaces.tests import utils class TestFSL(object): """Tests for FSL class.""" @pytes...
"""Tests for neurodocker.interfaces.FSL""" # Author: Jakub Kaczmarzyk <jakubk@mit.edu> from __future__ import absolute_import, division, print_function import pytest from neurodocker.interfaces import FSL from neurodocker.interfaces.tests import utils class TestFSL(object): """Tests for FSL class.""" @pytes...
apache-2.0
Python
3ff9939a12a9d8d3a0b26f693e72c14af01929be
use different vars for different types
thomasvs/pychecker,akaihola/PyChecker,thomasvs/pychecker,akaihola/PyChecker
test_input/test79.py
test_input/test79.py
'test iterating over a string' __pychecker__ = 'stringiter' def func1(): 'should generate a warning' s = 'string' for c in s: print 'oops', c[0] def func2(): 'should generate a warning' f = open('/dev/null') s = f.read() for c in s: print 'oops', c[0] def func3(): 'sh...
'test iterating over a string' __pychecker__ = 'stringiter' def func1(): 'should generate a warning' s = 'string' for c in s: print 'oops', c[0] def func2(): 'should generate a warning' f = open('/dev/null') s = f.read() for c in s: print 'oops', c[0] def func3(): 'sh...
bsd-3-clause
Python
4fec5a3a3b18030d72cda98ed331f3d09e995226
Add new view class for React CfP timeline
pferreir/indico,DirkHoffmann/indico,mic4ael/indico,ThiefMaster/indico,pferreir/indico,indico/indico,indico/indico,DirkHoffmann/indico,mic4ael/indico,mic4ael/indico,ThiefMaster/indico,indico/indico,ThiefMaster/indico,mic4ael/indico,DirkHoffmann/indico,pferreir/indico,ThiefMaster/indico,pferreir/indico,DirkHoffmann/indic...
indico/modules/events/papers/views.py
indico/modules/events/papers/views.py
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from flask import render_template, session from indico.modules.e...
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from flask import render_template, session from indico.modules.e...
mit
Python
85c15b11d35ea5e842b07095d2dbaa6c06573405
Fix test project urls
trilan/lemon,trilan/lemon,trilan/lemon
test_project/urls.py
test_project/urls.py
from django.conf import settings from django.conf.urls.defaults import include, patterns, url from django.conf.urls.static import static from django.contrib import admin from lemon import extradmin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(extradmin.site.urls)), url(r'^tinymce/...
from django.conf import settings from django.conf.urls.defaults import include, patterns, url from django.conf.urls.static import static from django.contrib import admin from lemon import extradmin from lemon.utils import urls admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(extradmin.sit...
bsd-3-clause
Python
5e34c2ff48150537848b5d86812effe4c09b6397
Update expert.py
robcza/intelmq,robcza/intelmq,pkug/intelmq,sch3m4/intelmq,aaronkaplan/intelmq,sch3m4/intelmq,pkug/intelmq,pkug/intelmq,aaronkaplan/intelmq,robcza/intelmq,robcza/intelmq,certtools/intelmq,sch3m4/intelmq,certtools/intelmq,pkug/intelmq,sch3m4/intelmq,aaronkaplan/intelmq,certtools/intelmq
intelmq/bots/experts/filter/expert.py
intelmq/bots/experts/filter/expert.py
from intelmq.lib.bot import Bot, sys from intelmq.lib.cache import Cache from intelmq.lib.message import Event class FilterBot(Bot): def init(self): if not self.parameters.filter_key: self.logger.warn("No filter_key parameter found.") self.stop() elif not self.paramete...
from intelmq.lib.bot import Bot, sys from intelmq.lib.cache import Cache from intelmq.lib.message import Event class FilterBot(Bot): def init(self): if not self.parameters.filter_key: self.logger.warn("No filter_key parameter found.") self.stop() elif not self.paramete...
agpl-3.0
Python
bc9939bfd2430aece7915bdb77a8ac71c699776b
Remove parameter that is set in the tool dialog
Esri/public-transit-tools,Esri/public-transit-tools
transit-network-analysis-tools/CreateTimeLapsePolygons_SA_config.py
transit-network-analysis-tools/CreateTimeLapsePolygons_SA_config.py
"""Defines Service Area solver object properties that are not specified in the tool dialog. A list of Service Area solver properties is documented here: https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/servicearea.htm You can include any of them in the dictionary in this file, and the tool will us...
"""Defines Service Area solver object properties that are not specified in the tool dialog. A list of Service Area solver properties is documented here: https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/servicearea.htm You can include any of them in the dictionary in this file, and the tool will u...
apache-2.0
Python
931721a6856dc41fe2a410c826b5dc6461f4b63c
Revert "Bump the stack from cflinuxfs2 to cflinuxfs3 for python tests which run in the ci image, which appears to be an Ubuntu Bionic based image."
cloudfoundry/php-buildpack,cloudfoundry/php-buildpack,cloudfoundry/php-buildpack,cloudfoundry/php-buildpack,cloudfoundry/php-buildpack,cloudfoundry/php-buildpack,cloudfoundry/php-buildpack
tests/common/base.py
tests/common/base.py
import os from build_pack_utils import BuildPack from common.integration import DirectoryHelper from common.integration import OptionsHelper class BaseCompileApp(object): def setUp(self): self.dh = DirectoryHelper() (self.build_dir, self.cache_dir, self.temp_dir) = self.dh.create...
import os from build_pack_utils import BuildPack from common.integration import DirectoryHelper from common.integration import OptionsHelper class BaseCompileApp(object): def setUp(self): self.dh = DirectoryHelper() (self.build_dir, self.cache_dir, self.temp_dir) = self.dh.create...
apache-2.0
Python