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 |
|---|---|---|---|---|---|---|---|---|
c8e09d7d8fae748731b97b5f1f77bdf1062ce539 | remove most likely unintentional string comparison with is | jplusplus/statscraper | statscraper/base_scraper.py | statscraper/base_scraper.py | # encoding: utf-8
import csv
import requests
class BaseScraper():
"""Base class from which all scrapers inherit."""
def select(self, label):
"""Select a dataset."""
def filterfunc(x):
return x.label == label
self.selection = next(filter(filterfunc, self._datasets))
... | # encoding: utf-8
import csv
import requests
class BaseScraper():
"""Base class from which all scrapers inherit."""
def select(self, label):
"""Select a dataset."""
def filterfunc(x):
return x.label == label
self.selection = next(filter(filterfunc, self._datasets))
... | mit | Python |
4dd9d571cc99c5558cff3e8e65cfd4214ad94a62 | Test default states | AstroHuntsman/POCS,AstroHuntsman/POCS,Guokr1991/POCS,AstroHuntsman/POCS,fmin2958/POCS,panoptes/POCS,AstroHuntsman/POCS,joshwalawender/POCS,joshwalawender/POCS,Guokr1991/POCS,joshwalawender/POCS,Guokr1991/POCS,panoptes/POCS,fmin2958/POCS,fmin2958/POCS,panoptes/POCS,panoptes/POCS,Guokr1991/POCS | panoptes/test/mount/test_ioptron.py | panoptes/test/mount/test_ioptron.py | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_bad_commands(self):
""" Passes in a default config ... | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_bad_commands(self):
""" Passes in a default config ... | mit | Python |
94f5d70753c87250eb13a867c37779078198abed | fix typo | StellarCN/py-stellar-base | stellar_sdk/type_checked.py | stellar_sdk/type_checked.py | import os
from typing import Callable, overload
from typeguard import T_CallableOrType
from typeguard import typechecked as _typechecked
_STELLAR_SDK_ENFORCE_TYPE_CHECK_FLAG: str = "STELLAR_SDK_ENFORCE_TYPE_CHECK"
_STELLAR_SDK_ENFORCE_TYPE_CHECK: bool = os.getenv(
_STELLAR_SDK_ENFORCE_TYPE_CHECK_FLAG, "False"
).l... | import os
from typing import Callable, overload
from typeguard import T_CallableOrType
from typeguard import typechecked as _typechecked
_STELLAR_SDK_ENFORCE_TYPE_CHECK_FLAG: str = "STELLAR_SDK_ENFORCE_TYPE_CHECK_FLAG"
_STELLAR_SDK_ENFORCE_TYPE_CHECK: bool = os.getenv(
_STELLAR_SDK_ENFORCE_TYPE_CHECK_FLAG, "False... | apache-2.0 | Python |
8fb340577f89d8eb62425f324307cdb61e4beb6a | Rephrase note on `config.ini` | oemof/oemof.db | oemof/db/__init__.py | oemof/db/__init__.py | from configparser import NoOptionError as option, NoSectionError as section
from sqlalchemy import create_engine
import keyring
from . import config as cfg
def engine(db_section="postGIS"):
"""Creates engine object for database access
If keyword argument `db_section` is used it requires an existing config.in... | from configparser import NoOptionError as option, NoSectionError as section
from sqlalchemy import create_engine
import keyring
from . import config as cfg
def engine(db_section="postGIS"):
"""Creates engine object for database access
If keyword argument `db_section` is used it requires an existing config.in... | mit | Python |
99dad2a9f46480d6fdf1994b63339200ad96bca2 | Remove build links | dbinetti/barberscore,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore-django | project/apps/website/urls.py | project/apps/website/urls.py | from django.conf.urls import url
from django.conf.urls.static import static
from django.conf import settings
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^person/$', views.persons, name='persons'),
url(r'^chorus/$', views.choruses, name='choruses'),
url(r'^quartet/$',... | from django.conf.urls import url
from django.conf.urls.static import static
from django.conf import settings
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^person/$', views.persons, name='persons'),
url(r'^chorus/$', views.choruses, name='choruses'),
url(r'^quartet/$',... | bsd-2-clause | Python |
32a8eb430b235349ffece6504e3fd8734943fca0 | Update settings.py | ResearchComputing/oide-simpleupload,ResearchComputing/oide-simpleupload,ResearchComputing/oide-simpleupload | oidesupl/settings.py | oidesupl/settings.py | import os
APP_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
APP_SPECIFICATION = {
'APP_DESCRIPTION': {
'name': 'Upload',
'link': '/#/supl',
'description': 'Simple HTTP Upload'
},
'NG_MODULE_NAME': 'supl',
'NG_MODULE_STYLESHEETS': (
'supl.css',
),
'NG_MO... | import os
APP_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
APP_SPECIFICATION = {
'APP_DESCRIPTION': {
'name': 'Upload',
'link': '/#/supl',
'description': 'Simple HTTP Upload'
},
'NG_MODULE_NAME': 'supl',
'NG_MODULE_STYLESHEETS': (
'supl.css',
),
'NG_MO... | agpl-3.0 | Python |
a2bb91243a9c7259faee4b3ee792a8c20e5cd9f4 | Fix NoAuthorizationError (#19355) | zhouyao1994/incubator-superset,airbnb/caravel,airbnb/caravel,zhouyao1994/incubator-superset,airbnb/caravel,zhouyao1994/incubator-superset,zhouyao1994/incubator-superset,zhouyao1994/incubator-superset,airbnb/caravel | superset/views/users/api.py | superset/views/users/api.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 | Python |
e92f10706aaf2249853b4407c8b803feb177e530 | Add in coyright | oldarmyc/pitchfork,rackerlabs/pitchfork,oldarmyc/pitchfork,rackerlabs/pitchfork,oldarmyc/pitchfork,rackerlabs/pitchfork | pitchfork/config/config.example.py | pitchfork/config/config.example.py | # Copyright 2014 Dave Kludt
#
# 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, s... | # Application config file
import os
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_KWARGS = {'tz_aware': True}
MONGO_DATABASE = 'pitchfork'
ADMIN = 'cloud_username'
ADMIN_NAME = 'Admin Full Name'
SECRET_KEY = 'secret_key_for_cookie'
LOG_PATH = os.path.join(os.path.dirname(__file__), 'logs/devel.log')
| apache-2.0 | Python |
5c68ed4ac5ca97a5836c1c3b9a65591af7781315 | Fix ikasan unittest | kfdm/promgen,kfdm/promgen,kfdm/promgen,kfdm/promgen | promgen/tests/test_ikasan.py | promgen/tests/test_ikasan.py | import json
from unittest import mock
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, override_settings
from django.urls import reverse
from promgen import models
from promgen.sender.ikasan import SenderIkasan
from promgen.tests import TEST_ALERT, TEST_SETTINGS
_MESSAGE =... | import json
from unittest import mock
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, override_settings
from django.urls import reverse
from promgen import models
from promgen.sender.ikasan import SenderIkasan
from promgen.tests import TEST_ALERT, TEST_SETTINGS
_MESSAGE =... | mit | Python |
72eebc13ed443a3108d0fad69b20bcd0dbf13d33 | Format catimg --help correctly | asmeurer/catimg | catimg/__main__.py | catimg/__main__.py | import sys
import argparse
from iterm2_tools import display_image_file
from .imgur import update_img_cache, get_random_image
from . import __version__, __doc__
def main():
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('-f', '--files', ... | import sys
import argparse
from iterm2_tools import display_image_file
from .imgur import update_img_cache, get_random_image
from . import __version__, __doc__
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('-f', '--files', nargs='+', metavar='IMAGES', default=(),
... | mit | Python |
6a3a28ae45915571fbfcc594789c4d41e9750633 | bump version number to rc5 | jepegit/cellpy,jepegit/cellpy | cellpy/_version.py | cellpy/_version.py | version_info = (0, 3, 0, "rc5")
__version__ = '.'.join(map(str, version_info))
| version_info = (0, 3, 0, "rc4")
__version__ = '.'.join(map(str, version_info))
| mit | Python |
89cb89b521771cc217a1f26ee21ba978c0a55822 | bump version to 0.9.66 | craigahobbs/chisel | chisel/__init__.py | chisel/__init__.py | # Copyright (C) 2012-2017 Craig Hobbs
#
# Licensed under the MIT License
# https://github.com/craigahobbs/chisel/blob/master/LICENSE
__version__ = '0.9.66'
from .action import \
action, \
Action, \
ActionError
from .app import \
Application, \
Context
from .app_defs import \
Environ, \
S... | # Copyright (C) 2012-2017 Craig Hobbs
#
# Licensed under the MIT License
# https://github.com/craigahobbs/chisel/blob/master/LICENSE
__version__ = '0.9.65'
from .action import \
action, \
Action, \
ActionError
from .app import \
Application, \
Context
from .app_defs import \
Environ, \
S... | mit | Python |
784a5264d9247623ff8c942f3a56f3843e57659c | Increase time limits by 10x to help race condition | openai/universe,rht/universe | universe/wrappers/tests/test_time_limit.py | universe/wrappers/tests/test_time_limit.py | import gym
import time
import universe
from gym.envs import register
from universe import wrappers
register(
id='test.SecondsLimitDummyVNCEnv-v0',
entry_point='universe.envs:DummyVNCEnv',
tags={
'vnc': True,
'wrapper_config.TimeLimit.max_episode_seconds': 0.1
}
)
register(
... | import gym
import time
import universe
from gym.envs import register
from universe import wrappers
register(
id='test.SecondsLimitDummyVNCEnv-v0',
entry_point='universe.envs:DummyVNCEnv',
tags={
'vnc': True,
'wrapper_config.TimeLimit.max_episode_seconds': 0.01
}
)
register(
... | mit | Python |
48c0e72d7df002c3e6548b8453a0781e7efacbdc | Revert to original try/except style, this time with correct Exception! | laterpay/djtranslationchecker | djtranslationchecker/management/commands/translationchecker.py | djtranslationchecker/management/commands/translationchecker.py | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db.models import get_app_paths
import fnmatch
import importlib
import subprocess
import os
class Command(BaseCommand):
help = "Checks your message files for missing or fuzzy translations"
def handle... | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db.models import get_app_paths
import fnmatch
import importlib
import subprocess
import os
class Command(BaseCommand):
help = "Checks your message files for missing or fuzzy translations"
def handle... | mit | Python |
e618764e86d530b961193a615c47b25a49fac927 | Fix bug | OpenNewsLabs/pybossa,geotagx/pybossa,inteligencia-coletiva-lsd/pybossa,inteligencia-coletiva-lsd/pybossa,PyBossa/pybossa,stefanhahmann/pybossa,Scifabric/pybossa,jean/pybossa,stefanhahmann/pybossa,geotagx/pybossa,jean/pybossa,PyBossa/pybossa,OpenNewsLabs/pybossa,Scifabric/pybossa | pybossa/sentinel/__init__.py | pybossa/sentinel/__init__.py | from redis import sentinel
class Sentinel(object):
def __init__(self, app=None):
self.app = app
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connection = sentinel.Sentinel(app.config['REDIS_SENTINEL'],
... | from redis import sentinel
class Sentinel(object):
def __init__(self, app=None):
self.app = app
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connection = sentinel.Sentinel(app.config['REDIS_SENTINEL'],
... | agpl-3.0 | Python |
4eea5c3ce0caa121ac6b12ac4107f4650f74679d | Fix warnings. | pyflakes/pyflakes,PyCQA/pyflakes,jayvdb/pyflakes,bitglue/pyflakes,nikolas/pyflakes,asmeurer/pyflakes,epsy/pyflakes | pyflakes/scripts/pyflakes.py | pyflakes/scripts/pyflakes.py | """
Implementation of the command-line I{pyflakes} tool.
"""
from __future__ import absolute_import
# For backward compatibility
__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main']
from pyflakes.api import check, checkPath, checkRecursive, iterSourceCode, main
| """
Implementation of the command-line I{pyflakes} tool.
"""
from __future__ import absolute_import
# For backward compatibility
from pyflakes.api import check, checkPath, checkRecursive, iterSourceCode, main
| mit | Python |
8bac5a68b9668092e7c1316f6b2727e668e5e38d | Bump version | thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader | pytablereader/__version__.py | pytablereader/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.24.2"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.24.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
bcf64f2394465f1002ace06e7c02074a91a70a9a | Bump version | thombashi/pytablewriter | pytablewriter/__version__.py | pytablewriter/__version__.py | __author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016, {}".format(__author__)
__license__ = "MIT License"
__version__ = "0.59.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| __author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016, {}".format(__author__)
__license__ = "MIT License"
__version__ = "0.58.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
dd0845f1ff3dbd6754867d3f61ffc2be5d019e4b | Fix #40: Use shop.redirect correctly | armicron/plata,armicron/plata,armicron/plata | plata/payment/modules/cod.py | plata/payment/modules/cod.py | """
Payment module for cash on delivery handling
Automatically completes every order passed.
"""
from datetime import datetime
import logging
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from plata.payment.modules.base import ProcessorBase
from plata.product.stock.mo... | """
Payment module for cash on delivery handling
Automatically completes every order passed.
"""
from datetime import datetime
import logging
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from plata.payment.modules.base import ProcessorBase
from plata.product.stock.mo... | bsd-3-clause | Python |
ba7da40c8893a35d9f9b807ce88d7c79eb53e256 | Test fix | evernym/plenum,evernym/zeno | plenum/test/node/test_api.py | plenum/test/node/test_api.py | import pytest
from common.exceptions import LogicError
from plenum.common.constants import TXN_TYPE, TXN_PAYLOAD, TXN_PAYLOAD_METADATA, TXN_PAYLOAD_METADATA_DIGEST, \
TXN_PAYLOAD_TYPE, TXN_PAYLOAD_DATA, TXN_PAYLOAD_METADATA_REQ_ID, TXN_METADATA, TXN_METADATA_SEQ_NO, \
TXN_PAYLOAD_METADATA_PAYLOAD_DIGEST
from p... | import pytest
from common.exceptions import LogicError
from plenum.common.constants import TXN_TYPE, TXN_PAYLOAD, TXN_PAYLOAD_METADATA, TXN_PAYLOAD_METADATA_DIGEST, \
TXN_PAYLOAD_TYPE, TXN_PAYLOAD_DATA, TXN_PAYLOAD_METADATA_REQ_ID, TXN_METADATA, TXN_METADATA_SEQ_NO
from plenum.common.request import Request
def t... | apache-2.0 | Python |
99d16198b5b61ba13a441a6546ccd1f7ce0b91bc | Add octicons in font test script | mkofinas/prompt-support,mkofinas/prompt-support | test/symbols/show_glyphs.py | test/symbols/show_glyphs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
devicons_start = "e700"
devicons_end = "e7c5"
print "Devicons"
for ii in xrange(int(devicons_start, 16), int(devicons_end, 16) + 1):
print unichr(ii),
custom_start = "e5fa"
custom_end = "e62b"
print "\nCustom"
for ii in xrange(int(custom_start, 16), int(custom_end, ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
devicons_start = "e700"
devicons_end = "e7c5"
print "Devicons"
for ii in xrange(int(devicons_start, 16), int(devicons_end, 16) + 1):
print unichr(ii),
custom_start = "e5fa"
custom_end = "e62b"
print "\nCustom"
for ii in xrange(int(custom_start, 16), int(custom_end, ... | mit | Python |
6b1cf995116ed060679477c0496e98836a05e6af | decrease timeout to 2 seconds for bad-server tests | MSLNZ/msl-loadlib,MSLNZ/msl-loadlib,MSLNZ/msl-loadlib,MSLNZ/msl-loadlib,MSLNZ/msl-loadlib | tests/bad_servers/client.py | tests/bad_servers/client.py | from msl.loadlib import Client64
class Client(Client64):
def __init__(self, module32):
super(Client, self).__init__(module32, timeout=2)
| from msl.loadlib import Client64
class Client(Client64):
def __init__(self, module32):
super(Client, self).__init__(module32, timeout=5)
| mit | Python |
fb68461b249602fc3568281fb7eaa4fa2aff8072 | exclude duplicate/ambiguous district codes in epsom+ewell import | DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_epsom_and_ewell.py | polling_stations/apps/data_collection/management/commands/import_epsom_and_ewell.py | from data_collection.morph_importer import BaseMorphApiImporter
class Command(BaseMorphApiImporter):
srid = 27700
districts_srid = 27700
council_id = 'E07000208'
elections = ['local.surrey.2017-05-04']
scraper_name = 'wdiv-scrapers/DC-PollingStations-EpsomAndEwell'
geom_type = 'gml'
dupli... | from data_collection.morph_importer import BaseMorphApiImporter
class Command(BaseMorphApiImporter):
srid = 27700
districts_srid = 27700
council_id = 'E07000208'
elections = ['local.surrey.2017-05-04']
scraper_name = 'wdiv-scrapers/DC-PollingStations-EpsomAndEwell'
geom_type = 'gml'
def ... | bsd-3-clause | Python |
23da7e360533d166eaccd70a39502625d461ae75 | truncate output in html preview | c3nav/c3nav,c3nav/c3nav,c3nav/c3nav,c3nav/c3nav | src/c3nav/api/__init__.py | src/c3nav/api/__init__.py | from functools import wraps
from rest_framework.renderers import JSONRenderer
from c3nav.mapdata.utils import json_encoder_reindent
orig_render = JSONRenderer.render
@wraps(JSONRenderer.render)
def nicer_renderer(self, data, accepted_media_type=None, renderer_context=None):
if self.get_indent(accepted_media_ty... | from functools import wraps
from rest_framework.renderers import JSONRenderer
from c3nav.mapdata.utils import json_encoder_reindent
orig_render = JSONRenderer.render
@wraps(JSONRenderer.render)
def nicer_renderer(self, data, accepted_media_type=None, renderer_context=None):
if self.get_indent(accepted_media_ty... | apache-2.0 | Python |
ad7199dfe666e7b988c58e9cc51be929ef3af37d | Update version. | r3c/Creep | creep/__init__.py | creep/__init__.py | #!/usr/bin/env python
__version__ = '0.3.2'
| #!/usr/bin/env python
__version__ = '0.3.1'
| mit | Python |
c82dd9e98545111df1823b4b3f682f31fcaa8448 | Update help message | thombashi/tcconfig,thombashi/tcconfig | tcconfig/_argparse_wrapper.py | tcconfig/_argparse_wrapper.py | #!/usr/bin/env python
# encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import argparse
import logbook
from ._const import TcCoomandOutput
class ArgparseWrapper(object):
"""
wrapper class of argparse
"""
def __init__(self, ver... | #!/usr/bin/env python
# encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import argparse
import logbook
from ._const import TcCoomandOutput
class ArgparseWrapper(object):
"""
wrapper class of argparse
"""
def __init__(self, ver... | mit | Python |
346dd546b04634ad14bfcb98af4f7c14477e55e8 | Support non-dotted modules in argv.StoreInModule (#393) | ShaperTools/openhtf,grybmadsci/openhtf,ShaperTools/openhtf,fahhem/openhtf,fahhem/openhtf,fahhem/openhtf,jettisonjoe/openhtf,google/openhtf,grybmadsci/openhtf,fahhem/openhtf,jettisonjoe/openhtf,ShaperTools/openhtf,jettisonjoe/openhtf,jettisonjoe/openhtf,ShaperTools/openhtf,grybmadsci/openhtf,google/openhtf,grybmadsci/op... | openhtf/util/argv.py | openhtf/util/argv.py | """Utilities for handling command line arguments.
StoreInModule:
Enables emulating a gflags-esque API (flag affects global value), but one
doesn't necessarily need to use flags to set values.
Example usage:
DEFAULT_VALUE = 0
ARG_PARSER = argv.ModuleParser()
ARG_PARSER.add_argument(
'--over... | """Utilities for handling command line arguments.
StoreInModule:
Enables emulating a gflags-esque API (flag affects global value), but one
doesn't necessarily need to use flags to set values.
Example usage:
DEFAULT_VALUE = 0
ARG_PARSER = argv.ModuleParser()
ARG_PARSER.add_argument(
'--over... | apache-2.0 | Python |
e5570654f83e50b4342eba6def79b614009ae6cf | fix file path for thrift.load | uber/tchannel-python,uber/tchannel-python | tchannel/testing/vcr/proxy.py | tchannel/testing/vcr/proxy.py | # Copyright (c) 2015 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | # Copyright (c) 2015 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | mit | Python |
a98cc338d8cc796e6f77d28317207cac1b7ce2c0 | Bump version to 1.1.0-alpha | bechtoldt/imapclient,bechtoldt/imapclient | imapclient/version.py | imapclient/version.py | # Copyright (c) 2015, Menno Smits
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
from __future__ import unicode_literals
version_info = (1, 1, 0, 'alpha')
def _imapclient_version_string(vinfo):
major, minor, micro, releaselevel = vinfo
v = '%d.%d.%d' % (majo... | # Copyright (c) 2015, Menno Smits
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
from __future__ import unicode_literals
version_info = (1, 0, 2, 'final')
def _imapclient_version_string(vinfo):
major, minor, micro, releaselevel = vinfo
v = '%d.%d.%d' % (majo... | bsd-3-clause | Python |
5f57cfd16aa541f55c246ff5d1dfb7c3bd8c208c | add a function to find Event class for given OFP class | lagopus/ryu-lagopus-ext,haniehrajabi/ryu,habibiefaried/ryu,StephenKing/ryu,John-Lin/ryu,openvapour/ryu,habibiefaried/ryu,sivaramakrishnansr/ryu,yamt/ryu,hisaharu/ryu,jazzmes/ryu,takahashiminoru/ryu,diogommartins/ryu,zangree/ryu,yamt/ryu,takahashiminoru/ryu,muzixing/ryu,iwaseyusuke/ryu,zyq001/ryu,o3project/ryu-oe,osrg/r... | ryu/controller/ofp_event.py | ryu/controller/ofp_event.py | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 | Python |
2daeee0b9fabb4f1ad709bdbe9c8c12a6281d32d | Fix main failing on no event_callback | Kane610/axis | axis/__main__.py | axis/__main__.py | """Read events and parameters from your Axis device."""
import asyncio
import argparse
import logging
import sys
from axis import AxisDevice
async def main(args):
loop = asyncio.get_event_loop()
device = AxisDevice(
loop=loop, host=args.host, username=args.username,
password=args.password, p... | """Read events and parameters from your Axis device."""
import asyncio
import argparse
import logging
import sys
from axis import AxisDevice
async def main(args):
loop = asyncio.get_event_loop()
device = AxisDevice(
loop=loop, host=args.host, username=args.username,
password=args.password, p... | mit | Python |
439db29a5319cc531208f4c92a7133aa3519a50c | Fix validators for payment fields | fusionbox/satchless,fusionbox/satchless,taedori81/satchless,fusionbox/satchless | satchless/payment/fields.py | satchless/payment/fields.py | import calendar
import datetime
from django import forms
from django.core import validators
from django.utils.translation import ugettext_lazy as _
import re
from . import widgets
def mod10(number):
digits = []
even = False
if not number.isdigit():
return False
for digit in reversed(number):
... | import calendar
import datetime
from django import forms
from django.core import validators
from django.utils.translation import ugettext_lazy as _
import re
from . import widgets
def mod10(number):
digits = []
even = False
if not number.isdigit():
return False
for digit in reversed(number):
... | bsd-3-clause | Python |
7318ec2095b99d6e5c1df68c1fcef7ca1825220e | check if output is empty | aldanor/ipybind,aldanor/ipybind,aldanor/ipybind | ipybind/spawn.py | ipybind/spawn.py | # -*- coding: utf-8 -*-
import contextlib
import os
import subprocess
import sys
import distutils.errors
import distutils.spawn
class inject:
def __init__(self, fn):
self.orig = fn
self.set(fn)
def set(self, fn):
self.fn = fn
def reset(self):
self.fn = self.orig
de... | # -*- coding: utf-8 -*-
import contextlib
import os
import subprocess
import sys
import distutils.errors
import distutils.spawn
class inject:
def __init__(self, fn):
self.orig = fn
self.set(fn)
def set(self, fn):
self.fn = fn
def reset(self):
self.fn = self.orig
de... | mit | Python |
3622e7a2e79c863aa9933bf92a473ce107f48bfa | update Craven import script for parl.2017-06-08 (closes #951) | DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_craven.py | polling_stations/apps/data_collection/management/commands/import_craven.py | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E07000163'
addresses_name = 'parl.2017-06-08/Version 1/Craven Democracy_Club__08June2017.tsv'
stations_name = 'parl.2017-06-08/Version 1/Craven Democracy_Club_... | from django.contrib.gis.geos import Point
from data_collection.base_importers import BaseCsvStationsCsvAddressesImporter
class Command(BaseCsvStationsCsvAddressesImporter):
council_id = 'E07000163'
addresses_name = 'Craven Property List with UPRNs.csv'
stations_name = 'CravePolling Station List.cs... | bsd-3-clause | Python |
b6e934ef32e6591ad60636e3fe167d0e3e9aa5d4 | Fix URL KeyError | catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult | telemetry/telemetry/internal/backends/chrome_inspector/inspector_console.py | telemetry/telemetry/internal/backends/chrome_inspector/inspector_console.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from telemetry.internal.backends.ch... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from telemetry.internal.backends.ch... | bsd-3-clause | Python |
dd8a1f0041acbaab6bf51103cc9fd699a605adaf | rework this | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | scripts/cache/warn_cache.py | scripts/cache/warn_cache.py | # Need something to cache the warnings GIS files, since they are so
# huge.
import os
import mx.DateTime
FINAL = "/mesonet/share/pickup/wwa/"
URL = "http://iem21.local/cgi-bin/request/gis/watchwarn.py"
def get_files(sts, ets):
year = mx.DateTime.now().year
cmd = 'wget --timeout=60000 -q -O %s/%s_all.zip "%... | # Need something to cache the warnings GIS files, since they are so
# huge.
import os
import mx.DateTime
FINAL = "/mesonet/share/pickup/wwa/"
#for year in range(1986,2010):
year = mx.DateTime.now().year
cmd = 'wget --timeout=60000 -q -O %s/%s_all.zip "http://iem50.local/cgi-bin/request/gis/watchwarn.py?year1=%s&mon... | mit | Python |
bc02981c4ad0dc424c3721856565ce1adbfd6411 | Update verifyAuthenticode.py | jgstew/tools,jgstew/tools,jgstew/tools,jgstew/tools | Python/verifyAuthenticode.py | Python/verifyAuthenticode.py |
# This is Windows Only and Python2 only: https://github.com/hakril/PythonForWindows/projects/1
# https://twitter.com/jgstew/status/1012509162540974080
# https://programtalk.com/vs2/python/5137/PythonForWindows/windows/wintrust.py/
# https://github.com/hakril/PythonForWindows/blob/master/samples/crypto/wintrust.py
imp... |
# This is Windows Only
# https://twitter.com/jgstew/status/1012509162540974080
# https://programtalk.com/vs2/python/5137/PythonForWindows/windows/wintrust.py/
# https://github.com/hakril/PythonForWindows/blob/master/samples/crypto/wintrust.py
import windows.wintrust
# git clone https://github.com/hakril/PythonForWind... | mit | Python |
14dd325a4beeade048c25994c72a5afb3df4ff50 | bump workers | chrander/pygameday | tests/test_GameDayClient.py | tests/test_GameDayClient.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from datetime import datetime
from pygameday import GameDayClient
class TestGameDayClient(unittest.TestCase):
def test_ingest(self):
start_date = datetime(2018, 4, 1)
end_date = datetime(2018, 4, 1)
database_uri = "sqlite:///g... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from datetime import datetime
from pygameday import GameDayClient
class TestGameDayClient(unittest.TestCase):
def test_ingest(self):
start_date = datetime(2016, 4, 8)
end_date = datetime(2016, 4, 8)
database_uri = "sqlite:///g... | mit | Python |
9301ff04f97cce8713463b870f6140e7549c854f | Test jaccard | jakirkham/dask-distance | tests/test_dask_distance.py | tests/test_dask_distance.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
import scipy.spatial.distance as spdist
import dask.array as da
import pytest
import dask_distance
@pytest.mark.parametrize(
"funcname", [
"dice",
"hamming",
"jaccard",
]
)
@pyt... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
import scipy.spatial.distance as spdist
import dask.array as da
import pytest
import dask_distance
@pytest.mark.parametrize(
"funcname", [
"dice",
"hamming",
]
)
@pytest.mark.parametriz... | bsd-3-clause | Python |
e131ef5b7ed7df341d23c1b295a9d6caef5b0fe6 | Test on collinear vectors | ppb/ppb-vector,ppb/ppb-vector | tests/test_vector2_angle.py | tests/test_vector2_angle.py | from ppb_vector import Vector2
from math import isclose
import pytest # type: ignore
from hypothesis import assume, given, note
from hypothesis.strategies import floats
from utils import angle_isclose, vectors
@pytest.mark.parametrize("left, right, expected", [
(Vector2(1, 1), Vector2(0, -1), -135),
(Vector2... | from ppb_vector import Vector2
from math import isclose
import pytest # type: ignore
from hypothesis import assume, given, note
from utils import angle_isclose, vectors
@pytest.mark.parametrize("left, right, expected", [
(Vector2(1, 1), Vector2(0, -1), -135),
(Vector2(1, 1), Vector2(-1, 0), 135),
(Vector... | artistic-2.0 | Python |
b2d8def3f735e7a0464d7ffe89b140574d65759e | Fix tests | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles | surveys/tests.py | surveys/tests.py | from django.test import TestCase
from studygroups.models import Course
from .community_feedback import calculate_course_ratings
from .community_feedback import calculate_course_tagdorsements
class TestCommunityFeedback(TestCase):
fixtures = ['test_courses.json', 'test_studygroups.json', 'test_applications.json',... | from django.test import TestCase
from studygroups.models import Course
from .community_feedback import calculate_course_ratings
from .community_feedback import calculate_course_tagdorsements
class TestCommunityFeedback(TestCase):
fixtures = ['test_courses.json', 'test_studygroups.json', 'test_applications.json',... | mit | Python |
06cfc43383e6130d74668b214c214e93e7d031c9 | Bump GTK+ to 2.24.5, update Mac patchset | mono/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild,bl8/bockbuild,bl8/bockbuild,BansheeMediaPlayer/bockbuild,bl8/bockbuild | packages/gtk+.py | packages/gtk+.py | class GtkPackage (GnomePackage):
def __init__ (self):
GnomePackage.__init__ (self, 'gtk+',
version_major = '2.24',
version_minor = '5',
configure_flags = [
'--with-gdktarget=%{gdk_target}',
'--disable-cups',
]
)
self.gdk_target = 'x11'
if Package.profile.name == 'darwin':
self.gdk_targe... | class GtkPackage (GnomePackage):
def __init__ (self):
GnomePackage.__init__ (self, 'gtk+',
version_major = '2.24',
version_minor = '4',
configure_flags = [
'--with-gdktarget=%{gdk_target}',
'--disable-cups',
]
)
self.gdk_target = 'x11'
if Package.profile.name == 'darwin':
self.gdk_targe... | mit | Python |
21b6360ddc198fb70c3973031e55baa74e5db764 | Make FindRoot use both the current working directory and the paths in sys.path to search for the root directory. This allows us to run scripts outside the repository directory using PYTHONPATH and things should still work. | sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata | scripts/util/cbr_wrapper.py | scripts/util/cbr_wrapper.py | #!/usr/bin/python
import sys
import os
import os.path
import invoke
import stdio
CBR_WRAPPER = "scripts/util/cbr_wrapper.sh"
def FindRoot(start):
search_offsets = ['.', '..', '../..', '../../..']
# Search directories: locals preferred first
search_dirs = [os.getcwd()]
# Otherwise search system dirs
... | #!/usr/bin/python
import sys
import os
import os.path
import invoke
import stdio
CBR_WRAPPER = "scripts/util/cbr_wrapper.sh"
def FindRoot(start):
for offset in ['.', '..', '../..', '../../..']:
offset_dir = start + '/' + offset
test_file = offset_dir + '/install-deps.sh'
if (os.path.isfil... | bsd-3-clause | Python |
5bd912545ac56af4793d0af6bd58276b77bf11f6 | FIX dependencies | ingadhoc/website | website_sale_taxes_included/__openerp__.py | website_sale_taxes_included/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | agpl-3.0 | Python |
73a03c70d2d7350d5bbb5b21dcb46890d1777824 | Use lxml only when installed | elfxiong/wiktionary-translations-parser | parser/helper.py | parser/helper.py | """
The common methods in different editions
"""
import string
import re
import requests
from bs4 import BeautifulSoup, Tag
html_parser = 'html.parser'
try:
import lxml
html_parser = 'lxml'
except ImportError:
pass
HEADING_TAG = re.compile(r'^h(?P<level>[1-6])$', re.I)
COMMA_OR_SEMICOLON = re.compile('[... | """
The common methods in different editions
"""
import string
import re
import requests
from bs4 import BeautifulSoup, Tag
HEADING_TAG = re.compile(r'^h(?P<level>[1-6])$', re.I)
COMMA_OR_SEMICOLON = re.compile('[,;]')
PARENTHESIS_WITH_TEXT = re.compile(r'\([^()]*\)') # no nesting
def infer_edition_from_url(url):
... | mit | Python |
cf2caee3136820b2b160bf9c038aa7c1ce32ca24 | Add not implemented error raise | bio2bel/hmdb | src/bio2bel_hmdb/manager.py | src/bio2bel_hmdb/manager.py | # -*- coding: utf-8 -*-
"""
Work in progress
- import database model
- change get_data() to work with xml parser
- write populate function
"""
import configparser
import logging
import os
import requests
import zipfile
from io import BytesIO
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmak... | # -*- coding: utf-8 -*-
"""
Work in progress
- import database model
- change get_data() to work with xml parser
- write populate function
"""
import configparser
import logging
import os
import requests
import zipfile
from io import BytesIO
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmak... | mit | Python |
4abe9f180f2edf6e573ba82fd559e17a589e096c | add time guard in notice_all | Answeror/torabot,Answeror/torabot,Answeror/torabot | torabot/tasks/notice.py | torabot/tasks/notice.py | from .engine import make as make_engine
from ..ut.connection import ccontext
from ..ut.guard import timeguard
from ..db import get_pending_notices
from ..core.notice import send_notice
@timeguard
def notice_all(conf):
engine = make_engine(conf)
with ccontext(engine=engine) as conn:
notices = get_pend... | from .engine import make as make_engine
from ..ut.session import makesession
from ..db import get_pending_notices
from ..core.notice import send_notice
def notice_all(conf):
engine = make_engine(conf)
with makesession(engine=engine) as session:
for notice in get_pending_notices(session.connection()):... | mit | Python |
4d494d009990adbd52cd69b0408d24cb0898592e | Update generic to get filename | vparitskiy/data-importer,vparitskiy/data-importer | data_importer/importers/generic.py | data_importer/importers/generic.py | # -*- coding: utf-8 -*-
from data_importer.readers.xls_reader import XLSReader
from data_importer.readers.xlsx_reader import XLSXReader
from data_importer.readers.csv_reader import CSVReader
from data_importer.readers.xml_reader import XMLReader
from data_importer.core.exceptions import UnsuportedFile
from .base import... | # -*- coding: utf-8 -*-
from data_importer.readers.xls_reader import XLSReader
from data_importer.readers.xlsx_reader import XLSXReader
from data_importer.readers.csv_reader import CSVReader
from data_importer.readers.xml_reader import XMLReader
from data_importer.core.exceptions import UnsuportedFile
from .base import... | bsd-2-clause | Python |
d59635e9542ca54b39eaa10f31b53da46df68e61 | Remove extra space in help string | gkotton/vmware-nsx,gkotton/vmware-nsx | neutron/plugins/ml2/drivers/mlnx/config.py | neutron/plugins/ml2/drivers/mlnx/config.py | # Copyright (c) 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | # Copyright (c) 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 | Python |
579fb65aef6e0d8461d79db9c1cbf8e0dd46445d | Add test purchases not allowed for any project | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/iaas/tests/test_purchases.py | nodeconductor/iaas/tests/test_purchases.py | from rest_framework import test
from rest_framework import status
from rest_framework.reverse import reverse
from nodeconductor.iaas.tests import factories as iaas_factories
from nodeconductor.structure.models import Role
from nodeconductor.structure.tests import factories as structure_factories
class PurchasePermis... | from rest_framework import test
from rest_framework import status
from rest_framework.reverse import reverse
from nodeconductor.iaas.tests import factories as iaas_factories
from nodeconductor.structure.models import Role
from nodeconductor.structure.tests import factories as structure_factories
class PurchasePermis... | mit | Python |
3d88eb92c190d26693691f779f911fcbf936433e | change default max fee to $25 | lbryio/lbry,lbryio/lbry,zestyr/lbry,zestyr/lbry,DaveA50/lbry,DaveA50/lbry,zestyr/lbry,lbryio/lbry | lbrynet/conf.py | lbrynet/conf.py | """
Some network wide and also application specific parameters
"""
MAX_HANDSHAKE_SIZE = 2**16
MAX_REQUEST_SIZE = 2**16
MAX_BLOB_REQUEST_SIZE = 2**16
MAX_RESPONSE_INFO_SIZE = 2**16
MAX_BLOB_INFOS_TO_REQUEST = 20
BLOBFILES_DIR = ".blobfiles"
BLOB_SIZE = 2**21
MIN_BLOB_DATA_PAYMENT_RATE = .005 # points/megabyte
MIN_BLO... | """
Some network wide and also application specific parameters
"""
MAX_HANDSHAKE_SIZE = 2**16
MAX_REQUEST_SIZE = 2**16
MAX_BLOB_REQUEST_SIZE = 2**16
MAX_RESPONSE_INFO_SIZE = 2**16
MAX_BLOB_INFOS_TO_REQUEST = 20
BLOBFILES_DIR = ".blobfiles"
BLOB_SIZE = 2**21
MIN_BLOB_DATA_PAYMENT_RATE = .005 # points/megabyte
MIN_BLO... | mit | Python |
6b62c281b926bff305e74175fe3598ac0046d983 | Prepare 0.3.0 | silentsokolov/django-treasuremap,silentsokolov/django-treasuremap,silentsokolov/django-treasuremap | treasuremap/__init__.py | treasuremap/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__author__ = 'Dmitriy Sokolov'
__version__ = '0.3.0'
default_app_config = 'treasuremap.apps.TreasureMapConfig'
VERSION = __version__
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__author__ = 'Dmitriy Sokolov'
__version__ = '0.2.7'
default_app_config = 'treasuremap.apps.TreasureMapConfig'
VERSION = __version__
| mit | Python |
88d963f3d0ba033ff6eefd85c5913f173abeed8b | Remove unused vars in favour of underscores | wintersandroid/tvrenamr,ghickman/tvrenamr | tvrenamr/cli/helpers.py | tvrenamr/cli/helpers.py | import os
import sys
from tvrenamr.config import Config
def build_file_list(paths, recursive=False, ignore_filelist=()):
"""Finds files from a list of paths"""
for path in paths:
if os.path.isfile(path):
yield os.path.split(path)
if os.path.isdir(path):
for root, _, f... | import os
import sys
from tvrenamr.config import Config
def build_file_list(paths, recursive=False, ignore_filelist=()):
"""Finds files from a list of paths"""
for path in paths:
if os.path.isfile(path):
yield os.path.split(path)
if os.path.isdir(path):
for root, dirs... | mit | Python |
0304eb228c008f2d74695eec46ef3950e5da3ef7 | Add missing import. | PCManticore/argus-ci,stefan-caraiman/cloudbase-init-ci,cmin764/argus-ci,micumatei/cloudbase-init-ci,cloudbase/cloudbase-init-ci,AlexandruTudose/cloudbase-init-ci | argus/shell.py | argus/shell.py | # Copyright 2014 Cloudbase Solutions Srl
#
# 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 l... | # Copyright 2014 Cloudbase Solutions Srl
#
# 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 l... | apache-2.0 | Python |
aa3029f962e47a6c0cd3023192616acb8eff5b75 | Insert third_party into the second slot of sys.path rather than the last slot | protron/namebench,google/namebench,rogers0/namebench,google/namebench,google/namebench | third_party/__init__.py | third_party/__init__.py | import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.insert(1, os.path.dirname(__file__))
| import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.append(os.path.dirname(__file__))
| apache-2.0 | Python |
dfd683d5e1a2aa479848a565f221a760b18bf198 | Add some logging to MeshFileHandler | onitake/Uranium,onitake/Uranium | Cura/MeshHandling/MeshFileHandler.py | Cura/MeshHandling/MeshFileHandler.py | from Cura.Logger import Logger
## Central class for reading and writing meshes.
#
# This class is created by Application and handles reading and writing mesh files.
class MeshFileHandler(object):
def __init__(self):
self._mesh_readers = []
self._mesh_writers = []
# Try to read the mesh_... |
## Central class for reading and writing meshes.
#
# This class is created by Application and handles reading and writing mesh files.
class MeshFileHandler(object):
def __init__(self):
self._mesh_readers = []
self._mesh_writers = []
# Try to read the mesh_data from a file. Based on the ... | agpl-3.0 | Python |
51fabb65d702e3099031567e93b9ee2b0dc65d5d | change platform to config | tLDP/python-tldp,tLDP/python-tldp,tLDP/python-tldp | tldp/doctypes/common.py | tldp/doctypes/common.py | #! /usr/bin/python
# -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import os
from ..utils import logger
class SignatureChecker(object):
@classmethod
def signatureLocation(cls, f):
f.seek(0)
buf = f.read(1024).lower()
for sig in cls.signatures:... | #! /usr/bin/python
# -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import os
from ..utils import logger
class SignatureChecker(object):
@classmethod
def signatureLocation(cls, f):
f.seek(0)
buf = f.read(1024).lower()
for sig in cls.signatures:... | mit | Python |
1da66730632257b47ba004ceeddcc2213cae662f | Fix error hydration bug. | pombreda/py2neo,pombreda/py2neo,technige/py2neo,nigelsmall/py2neo,nigelsmall/py2neo,nicolewhite/py2neo,fpieper/py2neo,pombreda/py2neo,fpieper/py2neo,technige/py2neo,fpieper/py2neo,technige/py2neo,nicolewhite/py2neo,nicolewhite/py2neo | py2neo/error.py | py2neo/error.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | apache-2.0 | Python |
6b23430b27d6df955166c22a91e843d5efce74b0 | Make sure client_id for IPython is not None | cyrixhero/powerline,bezhermoso/powerline,dragon788/powerline,seanfisk/powerline,kenrachynski/powerline,russellb/powerline,lukw00/powerline,prvnkumar/powerline,S0lll0s/powerline,kenrachynski/powerline,Luffin/powerline,blindFS/powerline,lukw00/powerline,junix/powerline,s0undt3ch/powerline,Liangjianghao/powerline,DoctorJe... | powerline/renderers/ipython/__init__.py | powerline/renderers/ipython/__init__.py | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
from powerline.renderers.shell import ShellRenderer
from powerline.theme import Theme
class IPythonRenderer(ShellRenderer):
'''Powerline ipython segment renderer.'''
def get_segment_info(self, segment... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
from powerline.renderers.shell import ShellRenderer
from powerline.theme import Theme
class IPythonRenderer(ShellRenderer):
'''Powerline ipython segment renderer.'''
def get_segment_info(self, segment... | mit | Python |
ff42a4595549f347a4aa6d219af79beec8ca9f31 | bump version | rtqichen/torchdiffeq | torchdiffeq/__init__.py | torchdiffeq/__init__.py | from ._impl import odeint
from ._impl import odeint_adjoint
from ._impl import odeint_event
__version__ = "0.2.1"
| from ._impl import odeint
from ._impl import odeint_adjoint
from ._impl import odeint_event
__version__ = "0.2.0"
| mit | Python |
a2606be16408f0e1614059cf45915eaad01a694a | use RLock | Zex/juicemachine,Zex/juicemachine,Zex/juicemachine | python/timer.py | python/timer.py | #! /usr/bin/python
# Timer.py
import threading
def timer_cb():
print('timer_cb ...')
"""
threading.Timer(3.0, timer_cb).run()
obj = threading.Timer(3.0, timer_cb)
obj.run()
"""
class Timer(threading.Thread):
def __init__(self, intv=None, func=None, *args):
self._intv = intv
sel... | #! /usr/bin/python
# Timer.py
import threading
def timer_cb():
print('timer_cb ...')
"""
threading.Timer(3.0, timer_cb).run()
obj = threading.Timer(3.0, timer_cb)
obj.run()
"""
class Timer(threading.Thread):
def __init__(self, intv=None, func=None, *args):
self.__intv = intv
se... | mit | Python |
00ca3102ed7daca12098f09214ff25c890a602c0 | increase num_elements in MapDefunBenchmark | karllessard/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,petewarden/tensorflow,sarvex/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/te... | tensorflow/python/data/experimental/benchmarks/map_defun_benchmark.py | tensorflow/python/data/experimental/benchmarks/map_defun_benchmark.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | Python |
5afd8346a8d710d09591c36780bd17c46192a2f2 | edit ... | ryanrhymes/scandex | cache.py | cache.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Cache abstraction.
#
# Liang Wang @ Computer Lab, Cambridge University
# 2015.06.15
class Cache():
def __init__(self, quota):
"""Init the cache."""
self._quota = quota
pass
def add(self):
"""Add a new item to cache."""
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Cache abstraction.
#
# Liang Wang @ Computer Lab, Cambridge University
# 2015.06.15
class Cache():
def __init__(self, quota):
self._quota = quota
pass
def add(self):
pass
def remove(self):
pass
def is_full(self):
... | mit | Python |
ab21fb971378b9c8f587a27c7ba556b3b8cf5d6f | Bump Version | messente/verigator-python | messente/verigator/__init__.py | messente/verigator/__init__.py | __version__ = "1.0.2"
| __version__ = "1.0.1"
| apache-2.0 | Python |
6591ecb735c8f52c4e9aee24310ad89b0d4030b6 | Print arguments in the debug pipeline | merutak/python-social-auth,rsteca/python-social-auth,VishvajitP/python-social-auth,VishvajitP/python-social-auth,mrwags/python-social-auth,DhiaEddineSaidi/python-social-auth,mark-adams/python-social-auth,webjunkie/python-social-auth,jeyraof/python-social-auth,robbiet480/python-social-auth,merutak/python-social-auth,cmi... | social/pipeline/debug.py | social/pipeline/debug.py | from pprint import pprint
def debug(response, details, *args, **kwargs):
print('=' * 80)
pprint(response)
print('=' * 80)
pprint(details)
print('=' * 80)
pprint(args)
print('=' * 80)
pprint(kwargs)
print('=' * 80)
| from pprint import pprint
def debug(response, details, *args, **kwargs):
print('=' * 80)
pprint(response)
print('=' * 80)
pprint(details)
print('=' * 80)
| bsd-3-clause | Python |
761e47b6c240251fde15991abcd37846a702692e | Update test_graphviz.py | sdpython/mlstatpy | _unittests/ut_graph/test_graphviz.py | _unittests/ut_graph/test_graphviz.py | """
@brief test log(time=2s)
"""
import os
import unittest
from pyquickhelper.pycode import get_temp_folder, skipif_travis, skipif_appveyor
from mlstatpy.graph.graphviz_helper import draw_graph_graphviz
class TestGraphviz(unittest.TestCase):
@skipif_appveyor("no graphviz")
@skipif_travis("no graphviz")... | """
@brief test log(time=2s)
"""
import os
import unittest
from pyquickhelper.pycode import get_temp_folder, skipif_travis, skipif_appveyor
from mlstatpy.graph.graphviz_helper import draw_graph_graphviz
class TestGraphviz(unittest.TestCase):
@skipif_appveyor("no graphviz")
@skipif_travis("no graphviz")... | mit | Python |
bbeb9b780908cf1322722669f1c68259345fe261 | Add documentation to the root view of BrowsableAPI | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | readthedocs/v3/routers.py | readthedocs/v3/routers.py | from rest_framework.routers import DefaultRouter, APIRootView
from rest_framework_extensions.routers import NestedRouterMixin
class DocsAPIRootView(APIRootView):
# Overridden only to add documentation for BrowsableAPIRenderer.
"""
Read the Docs APIv3 root endpoint.
Full documentation at [https://do... | from rest_framework.routers import DefaultRouter
from rest_framework_extensions.routers import NestedRouterMixin
class DefaultRouterWithNesting(NestedRouterMixin, DefaultRouter):
pass
| mit | Python |
32d9d1c78a3ef6a62eadfa3930ad921c583d6d26 | Update setup.py | SYNHAK/spiff,SYNHAK/spiff,SYNHAK/spiff | client/python/setup.py | client/python/setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='Spiff',
version='0.1.4',
description="API to Spaceman Spiff",
author='Torrie Fischer',
author_email='tdfischer@hackerbots.net',
url='http://github.com/synhak/spiff',
packages=['spiff'],
requires=['requests'],
)
| #!/usr/bin/env python
from distutils.core import setup
setup(name='Spiff',
version='0.1.4',
description="API to Spaceman Spiff",
author='Torrie Fischer',
author_email='tdfischer@hackerbots.net',
url='http://github.com/synhak/spiff',
py_modules=['spiff'],
requires=['requests'],
)
| agpl-3.0 | Python |
5f5e61d95182a0e31fc45cec48fcb6db9ced1f62 | fix "shadowing from outer scope variables" issue. | ImmobilienScout24/aws-monocyte,ImmobilienScout24/aws-monocyte | src/main/python/monocyte/__init__.py | src/main/python/monocyte/__init__.py | from __future__ import print_function
import sys
from monocyte.handler import aws_handler
REMOVE_WARNING = "WARNING: region '%s' not allowed!"
IGNORED_REGIONS = ["cn-north-1", "us-gov-west-1", "us-east-1", "us-west-2"]
ALLOWED_REGIONS_STARTS_WITH = "eu"
class Monocyte(object):
def is_region_allowed(self, regio... | from __future__ import print_function
import sys
from monocyte.handler import aws_handler
REMOVE_WARNING = "WARNING: region '%s' not allowed!"
IGNORED_REGIONS = ["cn-north-1", "us-gov-west-1", "us-east-1", "us-west-2"]
ALLOWED_REGIONS_STARTS_WITH = "eu"
class Monocyte(object):
def is_region_allowed(self, regio... | apache-2.0 | Python |
119aef19df7cdaa191101e58403b04c8320c085e | bump version (#39) | logdna/python | _version.py | _version.py | __version__ = '1.5.1'
| __version__ = '1.5.0'
| mit | Python |
e0ef5541c792c91529b3957b09194a1948a3e1e0 | Update __init__.py | infin8/spitfire,infin8/spitfire,infin8/spitfire,infin8/spitfire | spitfire/__init__.py | spitfire/__init__.py | __author__ = 'Mike Solomon'
__author_email__ = '<mas63 @t cornell d0t edu>'
__version__ = '0.7.15'
__license__ = 'BSD License'
import imp
from compiler.util import Compiler, add_common_options
class Template(object):
def __init__(self, txt):
self.txt = txt
self.tmp = None
def __call__(self, n... | __author__ = 'Mike Solomon'
__author_email__ = '<mas63 @t cornell d0t edu>'
__version__ = '0.7.15'
__license__ = 'BSD License'
| bsd-3-clause | Python |
cd8e592ccf963863507f4468cbafb0bfabf945bf | update bot command char | ArchStrike/archstrike-installer | asinstaller/irc.py | asinstaller/irc.py | import socket
import ssl
from config import *
logger = setup_logger(__name__)
class LogHandler(object):
def __init__(self, nick, logs):
self.server = IRC_SERVER
self.port = IRC_PORT
self.bot_nick = IRC_BOT_NICK
self.nick = nick
self.connect()
self.send_logs(logs)... | import socket
import ssl
from config import *
logger = setup_logger(__name__)
class LogHandler(object):
def __init__(self, nick, logs):
self.server = IRC_SERVER
self.port = IRC_PORT
self.bot_nick = IRC_BOT_NICK
self.nick = nick
self.connect()
self.send_logs(logs)... | mit | Python |
a900305ef043ade2f3e77bb0e6164cec307e1b38 | simplify ansys test | nschloe/meshio | test/test_ansys.py | test/test_ansys.py | # -*- coding: utf-8 -*-
#
import meshio
import pytest
import helpers
@pytest.mark.parametrize('mesh', [
helpers.tri_mesh,
helpers.quad_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpers.hex_mesh,
])
@pytest.mark.parametrize('write_binary', [False, True])
def test(m... | # -*- coding: utf-8 -*-
#
import meshio
import pytest
import helpers
@pytest.mark.parametrize('mesh', [
helpers.tri_mesh,
helpers.quad_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpers.hex_mesh,
])
def test_ascii(mesh):
def writer(*args, **kwargs):
ret... | mit | Python |
833c3f4003cd015d57b154d941a07c29645432c6 | clean up reinforce_grid | openego/dingo,openego/dingo | dingo/flexopt/reinforce_grid.py | dingo/flexopt/reinforce_grid.py | from .check_tech_constraints import check_load, check_voltage
from .reinforce_measures import reinforce_branches_current, reinforce_branches_voltage, extend_substation, new_substation
def reinforce_grid(grid, mode):
""" Evaluates grid reinforcement needs and performs measures
Args:
grid: GridDingo obj... | from .check_tech_constraints import check_load, check_voltage
from .reinforce_measures import reinforce_branches_current, reinforce_branches_voltage, extend_substation, new_substation
def reinforce_grid(grid, mode):
""" Evaluates grid reinforcement needs and performs measures
Args:
grid: GridDingo obj... | agpl-3.0 | Python |
6ceeb6e522228a1b1059a2919d26955af7576318 | Fix unit tests | DanNixon/Sakuya,DanNixon/Sakuya | pc_client/test/test_notification_centre.py | pc_client/test/test_notification_centre.py | import os
import unittest
from sakuyaclient.jenkins import JenkinsClient
from sakuyaclient.trac import TracClient
from sakuyaclient.notification_centre import NotificationCentre
class NotificationCentreTest(unittest.TestCase):
def setUp(self):
self._trac_cache_file = 'ticket_cache.txt'
self._build... | import os
import unittest
from sakuyaclient.jenkins import JenkinsClient
from sakuyaclient.trac import TracClient
from sakuyaclient.notification_centre import NotificationCentre
class NotificationCentreTest(unittest.TestCase):
def setUp(self):
self._trac_cache_file = 'ticket_cache.txt'
self._build... | apache-2.0 | Python |
a3364a991b3f3966e7ea0d31cea4e594dff0befc | Bump version to 1.3.2. | 1313e/CMasher | cmasher/__version__.py | cmasher/__version__.py | # -*- coding: utf-8 -*-
"""
CMasher Version
===============
Stores the different versions of the *CMasher* package.
"""
# %% VERSIONS
# Default/Latest/Current version
__version__ = '1.3.2'
| # -*- coding: utf-8 -*-
"""
CMasher Version
===============
Stores the different versions of the *CMasher* package.
"""
# %% VERSIONS
# Default/Latest/Current version
__version__ = '1.3.1'
| bsd-3-clause | Python |
83f63f17c9ce707749609aa466cd4d7152e5f5ed | clean up variable/class names | nkoep/pymanopt,nkoep/pymanopt,pymanopt/pymanopt,pymanopt/pymanopt,nkoep/pymanopt | pymanopt/autodiff/backends/_callable.py | pymanopt/autodiff/backends/_callable.py | from ._backend import Backend, assert_backend_available
from .. import make_tracing_backend_decorator
class _CallableBackend(Backend):
def __str__(self):
return "callable"
@staticmethod
def is_available():
return True
@assert_backend_available
def is_compatible(self, objective, a... | from ._backend import Backend, assert_backend_available
from .. import make_tracing_backend_decorator
class CallableBackend(Backend):
def __str__(self):
return "callable"
@staticmethod
def is_available():
return True
@assert_backend_available
def is_compatible(self, objective, ar... | bsd-3-clause | Python |
0cae1ae6ca372df40864feb2c45763bc2640890b | Disable migrations | djangocon/2017.djangocon.eu,djangocon/2017.djangocon.eu,djangocon/2017.djangocon.eu,djangocon/2017.djangocon.eu,djangocon/2017.djangocon.eu | djangocon_europe/settings_tests.py | djangocon_europe/settings_tests.py | # -*- coding: utf-8 -*-
from .settings import * # NOQA
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
'ADMINUSER': 'admin',
},
}
RAVEN_CONFIG = {}
class Disab... | # -*- coding: utf-8 -*-
from .settings import * # NOQA
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
'ADMINUSER': 'admin',
},
}
RAVEN_CONFIG = {}
| bsd-3-clause | Python |
5aad76a5005ab094f762d909549db3bb643b6a95 | Update is_transaction_effect_satisfied test | hackaugusto/raiden,hackaugusto/raiden | raiden/tests/unit/transfer/test_node.py | raiden/tests/unit/transfer/test_node.py | from raiden.constants import EMPTY_MERKLE_ROOT
from raiden.tests.utils.factories import HOP1, HOP2, UNIT_SECRETHASH, make_block_hash
from raiden.transfer.events import ContractSendChannelBatchUnlock
from raiden.transfer.node import is_transaction_effect_satisfied, state_transition
from raiden.transfer.state_change impo... | from raiden.constants import EMPTY_MERKLE_ROOT
from raiden.tests.utils.factories import HOP1, HOP2, UNIT_SECRETHASH, make_block_hash
from raiden.transfer.events import ContractSendChannelBatchUnlock
from raiden.transfer.node import is_transaction_effect_satisfied
from raiden.transfer.state_change import ContractReceive... | mit | Python |
4573fe1bbf1ebcbcea2ed65f3545c3c9c46eb3e6 | comment edit | DarkEnergySurvey/ugali,kadrlica/ugali | ugali/utils/__init__.py | ugali/utils/__init__.py | """
This is the UGaLi utils sub-package.
Various helpful classes and functions live here.
"""
| """
This is the UGaLi utils sub-package.
Various helpful classes and functions live here.
Modules
plotting :
"""
| mit | Python |
6efa6fc6480e8436f1c58df46e84db9f9e2d3705 | remove unused client_d | garbas/mozilla-releng-services,djmitche/build-relengapi,lundjordan/services,lundjordan/services,djmitche/build-relengapi,srfraser/services,garbas/mozilla-releng-services,La0/mozilla-relengapi,lundjordan/services,djmitche/build-relengapi,mozilla/build-relengapi,mozilla-releng/services,srfraser/services,garbas/mozilla-re... | relengapi/blueprints/tokenauth/types.py | relengapi/blueprints/tokenauth/types.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import wsme.types
from datetime import datetime
from relengapi.lib.api import jsonObject
class JsonToken(wsme.types.B... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import wsme.types
from datetime import datetime
from relengapi.lib.api import jsonObject
class JsonToken(wsme.types.B... | mpl-2.0 | Python |
20696d6f236afc1bc0e2b3db570363540e70ca84 | Use ip instead of localhost for travis | witchard/grole | test/test_serve.py | test/test_serve.py | import unittest
import asyncio
import io
import multiprocessing
import urllib.request
import time
import grole
def simple_server():
app = grole.Grole()
@app.route('/')
def hello(env, req):
return 'Hello, World!'
app.run(host='127.0.0.1')
class TestServe(unittest.TestCase):
def test_sim... | import unittest
import asyncio
import io
import multiprocessing
import urllib.request
import time
import grole
def simple_server():
app = grole.Grole()
@app.route('/')
def hello(env, req):
return 'Hello, World!'
app.run()
class TestServe(unittest.TestCase):
def test_simple(self):
... | mit | Python |
67524ff595ff39611981c459330ec5b947a9e754 | fix missing import | HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak | spyvm/plugins/large_integer.py | spyvm/plugins/large_integer.py | from spyvm import model
from spyvm.primitives import prim_table, \
BIT_AND, BIT_OR, BIT_XOR, BIT_SHIFT, ADD, SUBTRACT, DIVIDE, MULTIPLY
from spyvm.error import PrimitiveFailedError
from spyvm.plugins.plugin import Plugin
LargeIntegerPlugin = Plugin()
ops = {
'primDigitBitAnd': BIT_AND,
'primDigitBitOr':... | from spyvm import model
from spyvm.primitives import prim_table, \
BIT_AND, BIT_OR, BIT_XOR, BIT_SHIFT, ADD, SUBTRACT
from spyvm.error import PrimitiveFailedError
from spyvm.plugins.plugin import Plugin
LargeIntegerPlugin = Plugin()
ops = {
'primDigitBitAnd': BIT_AND,
'primDigitBitOr': BIT_OR,
'prim... | bsd-3-clause | Python |
b811f3fd8e114514ca0cac6b2e134ce8a66d4fdb | Update __init__.py | rouxcode/django-cms-plugins,rouxcode/django-cms-plugins,rouxcode/django-cms-plugins | cmsplugins/__init__.py | cmsplugins/__init__.py | __version__ = '0.4.0'
__author__ = 'alaric'
| __version__ = '0.3.18'
__author__ = 'alaric'
| mit | Python |
049df6bbc6805312df4bbf86fc40f1603547d334 | enable tracking STARTED for workers picking up job (baking) (#198) | Connexions/cnx-publishing,Connexions/cnx-publishing,Connexions/cnx-publishing | cnxpublishing/tasks.py | cnxpublishing/tasks.py | # -*- coding: utf-8 -*-
"""\
Implementation of the Celery framework within a Pyramid application.
Use the ``task`` decorator provided by this module where the celery
documentation says to use ``@app.task``. It is used to register a function as
a task without making the celery application a global object.
"""
from __f... | # -*- coding: utf-8 -*-
"""\
Implementation of the Celery framework within a Pyramid application.
Use the ``task`` decorator provided by this module where the celery
documentation says to use ``@app.task``. It is used to register a function as
a task without making the celery application a global object.
"""
from __f... | agpl-3.0 | Python |
bacdf53702306172063971aca5f122380960db03 | Bump version number to 1.2f1 | jayfk/django-comments-xtd,jayfk/django-comments-xtd,agilosoftware/django-comments-xtd,danirus/django-comments-xtd,danirus/django-comments-xtd,agilosoftware/django-comments-xtd,danirus/django-comments-xtd,agilosoftware/django-comments-xtd,danirus/django-comments-xtd | django_comments_xtd/__init__.py | django_comments_xtd/__init__.py | from django_comments_xtd.models import XtdComment
from django_comments_xtd.forms import XtdCommentForm
def get_model():
return XtdComment
def get_form():
return XtdCommentForm
VERSION = (1, 2, 0, 'f', 1) # following PEP 386
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2... | from django_comments_xtd.models import XtdComment
from django_comments_xtd.forms import XtdCommentForm
def get_model():
return XtdComment
def get_form():
return XtdCommentForm
VERSION = (1, 2, 0, 'f', 0) # following PEP 386
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2... | bsd-2-clause | Python |
8a6fe23ac93ecc3f7d08d41857a4752c1396fdff | Bump version | stoneworksolutions/django-rq-dashboard,brutasse/django-rq-dashboard,coffenbacher/django-rq-dashboard,brutasse/django-rq-dashboard,stoneworksolutions/django-rq-dashboard,spapas/django-rq-dashboard,coffenbacher/django-rq-dashboard,spapas/django-rq-dashboard,brutasse/django-rq-dashboard,spapas/django-rq-dashboard,stonewor... | django_rq_dashboard/__init__.py | django_rq_dashboard/__init__.py | VERSION = (0, 2, 1)
def get_version():
return ".".join(map(str, VERSION))
__version__ = get_version()
| VERSION = (0, 2)
def get_version():
return ".".join(map(str, VERSION))
__version__ = get_version()
| bsd-3-clause | Python |
296951f29e42b79b239f287beba5d525c523dd0d | use max_int instead of any_int in `random` | shellphish/driller | driller/simprocedures.py | driller/simprocedures.py | #!/usr/bin/env pypy
import simuvex
import itertools
rand_count = itertools.count()
class random(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, buf, count, rnd_bytes):
# return code
r = self.state.se.ite_cases((
(self.state.cgc.addr_invalid(buf), self.st... | #!/usr/bin/env pypy
import simuvex
import itertools
rand_count = itertools.count()
class random(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, buf, count, rnd_bytes):
# return code
r = self.state.se.ite_cases((
(self.state.cgc.addr_invalid(buf), self.st... | bsd-2-clause | Python |
27308921de842f388d49cde8ff8ad9b258059b47 | Make code block stripping regex make sense (#46) | executablebooks/mdformat | mdformat/_util.py | mdformat/_util.py | import re
from typing import Any, Iterable, Mapping
from markdown_it import MarkdownIt
import mdformat.plugins
def is_md_equal(
md1: str,
md2: str,
options: Mapping[str, Any],
*,
extensions: Iterable[str] = (),
codeformatters: Iterable[str] = (),
) -> bool:
"""Check if two Markdown produ... | import re
from typing import Any, Iterable, Mapping
from markdown_it import MarkdownIt
import mdformat.plugins
def is_md_equal(
md1: str,
md2: str,
options: Mapping[str, Any],
*,
extensions: Iterable[str] = (),
codeformatters: Iterable[str] = (),
) -> bool:
"""Check if two Markdown produ... | mit | Python |
314d7a293ac875fec5656ce997ff6b1808f64bf0 | Mark oq dbserver restart as broken | gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine | openquake/commands/dbserver.py | openquake/commands/dbserver.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2016-2019 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 version 3 of the Licen... | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2016-2019 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 version 3 of the Licen... | agpl-3.0 | Python |
508f940755f3fdc2aca2ccd32fd4092dcf618423 | Update test_bugs.py | PyPSA/PyPSA | test/test_bugs.py | test/test_bugs.py | # -*- coding: utf-8 -*-
import numpy as np
import pypsa
def test_344():
"""
Overridden multi-links but empty n.links.
"""
override = pypsa.descriptors.Dict(
{k: v.copy() for k, v in pypsa.components.component_attrs.items()}
)
override["Link"].loc["bus2"] = [
"string",
... | # -*- coding: utf-8 -*-
import numpy as np
import pypsa
def test_344():
"""
Overridden multi-links but empty n.links.
"""
override = pypsa.descriptors.Dict(
{k: v.copy() for k, v in pypsa.components.component_attrs.items()}
)
override["Link"].loc["bus2"] = [
"string",
... | mit | Python |
a1bcadf74fcaaedaa0d21abafce8e3a11fb3191a | Modify test to pass. Fixes #51 test failure | gouthambs/Flask-Blogging,gouthambs/Flask-Blogging | test/test_core.py | test/test_core.py | try:
from builtins import str, range
except ImportError:
pass
from unittest import TestCase
from flask.ext.blogging import BloggingEngine, PostProcessor
from markdown.extensions.codehilite import CodeHiliteExtension
sample_markdown = """
##This is a test
:::python
print("Hello, World")
"""
expect... | try:
from builtins import str, range
except ImportError:
pass
from unittest import TestCase
from flask.ext.blogging import BloggingEngine, PostProcessor
from markdown.extensions.codehilite import CodeHiliteExtension
sample_markdown = """
##This is a test
:::python
print("Hello, World")
"""
expect... | mit | Python |
5324e8159e0a1114b597cf06e1eab6237dae752b | Fix problem with inline flowables near end of line | brechtm/rinohtype,brechtm/rinohtype,beni55/rinohtype,brechtm/rinohtype,beni55/rinohtype | rinoh/inline.py | rinoh/inline.py | # This file is part of RinohType, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from .element import DocumentElement
from .flowable impo... | # This file is part of RinohType, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from .element import DocumentElement
from .flowable impo... | agpl-3.0 | Python |
ce5cd35c62a94b7b35d0de6c351d0ad05e1a9f11 | fix #12 | r2600r/py-junos-netconify,r2600r/py-junos-netconify | lib/netconify/tty_telnet.py | lib/netconify/tty_telnet.py | from time import sleep
import telnetlib
from .tty import Terminal
##### -------------------------------------------------------------------------
##### Terminal connection over TELNET CONSOLE
##### -------------------------------------------------------------------------
class Telnet(Terminal):
RETRY_OPEN = 3 ... | import telnetlib
from .tty import Terminal
##### -------------------------------------------------------------------------
##### Terminal connection over TELNET CONSOLE
##### -------------------------------------------------------------------------
class Telnet(Terminal):
def __init__(self, host, port, **kvargs):
... | apache-2.0 | Python |
838175b849dd4eeb7ece537c4b286de88ff78987 | use new colorbar method | matplotlib/basemap,matplotlib/basemap,guziy/basemap,guziy/basemap | doc/users/figures/plotprecip.py | doc/users/figures/plotprecip.py | from mpl_toolkits.basemap import Basemap, cm
# requires netcdf4-python (netcdf4-python.googlecode.com)
from netCDF4 import Dataset as NetCDFFile
import numpy as np
import matplotlib.pyplot as plt
import copy
from matplotlib import rcParams
# plot rainfall from NWS using special precipitation
# colormap used by the NWS... | from mpl_toolkits.basemap import Basemap, cm
# requires netcdf4-python (netcdf4-python.googlecode.com)
from netCDF4 import Dataset as NetCDFFile
import numpy as np
import matplotlib.pyplot as plt
import copy
from matplotlib import rcParams
# plot rainfall from NWS using special precipitation
# colormap used by the NWS... | mit | Python |
c760a0c8b06367d5e2ca954cb94d47efc2fcbe61 | Update 06_Potentiometer_Controlled_Servo.py | userdw/RaspberryPi_3_Starter_Kit | 06_Potentiometer_Controlled_Servo/06_Potentiometer_Controlled_Servo.py | 06_Potentiometer_Controlled_Servo/06_Potentiometer_Controlled_Servo.py | import MCP3202, wiringpi, os
from time import sleep
wiringpi.wiringPiSetup() # Must be called before using I/O function
wiringpi.softPwmCreate(1, 0, 100)
def translate(value,leftMin,leftMax,rightMin,rightMax):
# Figure out how 'wide' each range is
leftSpan = leftMax - leftMin
rightSpan = rightMax - right... | import MCP3202, wiringpi,os # import library WiringPi2-Python
from time import sleep
wiringpi.wiringPiSetup() # Must be called before using IO function
wiringpi.softPwmCreate(1,0,100)
def translate(value,leftMin,leftMax,rightMin,rightMax):
# Figure out how 'wide' each range is
leftSpan = leftMax - leftMin
... | mit | Python |
428db361f4deaeb6b5d17a5e4eda85efecdeb77d | mark for release | PaesslerAG/django-performance-testing | django_performance_testing/__init__.py | django_performance_testing/__init__.py | __version__ = '0.7.0'
default_app_config = \
'django_performance_testing.apps.DjangoPerformanceTestingAppConfig'
| __version__ = '0.7.0-dev'
default_app_config = \
'django_performance_testing.apps.DjangoPerformanceTestingAppConfig'
| bsd-3-clause | Python |
1df3dd466c312118cbce1ab952a8ec1baed344ae | Remove info | RDCEP/atlas-viewer,RDCEP/atlas-viewer,RDCEP/atlas-viewer | atlas/constants.py | atlas/constants.py | import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
NC_FILE = os.path.join(
BASE_DIR, 'data', 'netcdf', 'full_global',
'papsim_wfdei.cru_hist_default_firr_aet_whe_annual_1979_2012.nc4')
MONGO = dict(user='username',
password='password',
domain='domain.tld',
... | import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
NC_FILE = os.path.join(
BASE_DIR, 'data', 'netcdf', 'full_global',
'papsim_wfdei.cru_hist_default_firr_aet_whe_annual_1979_2012.nc4')
MONGO = dict(user='username',
password='password',
domain='domain.tld',
... | apache-2.0 | Python |
571b83b5d0389c205bd9a7a3978fb04bc146c192 | replace action hash list() by a set(). | maximumG/exscript,knipknap/exscript,knipknap/exscript,maximumG/exscript | src/Exscript/Task.py | src/Exscript/Task.py | # Copyright (C) 2007-2011 Samuel Abels.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | # Copyright (C) 2007-2011 Samuel Abels.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | mit | Python |
97d2711e9b3aa1d2a8610cbb622f7b451ba660fa | Add a way to login | hreeder/WHAuth,hreeder/WHAuth,hreeder/WHAuth | auth/core/views.py | auth/core/views.py | from flask import render_template, redirect, url_for, flash, request
from flask.ext.login import login_required, login_user
from auth import db
from auth.utils import send_email
from auth.core import core
from auth.core.forms import LoginForm, RegistrationForm
from auth.core.models.user import User
@core.route("/")... | from flask import render_template, redirect, url_for
from flask.ext.login import login_required
from auth import db
from auth.utils import send_email
from auth.core import core
from auth.core.forms import LoginForm, RegistrationForm
from auth.core.models.user import User
@core.route("/")
@login_required
def home():... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.