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
ea3e327bb602689e136479ce41f568aa2ee47cf4
Improve detection of page encoding
sirex/databot,sirex/databot
databot/utils/html.py
databot/utils/html.py
import bs4 import cgi def get_page_encoding(soup, default_encoding=None): for meta in soup.select('head > meta[http-equiv="Content-Type"]'): content_type, params = cgi.parse_header(meta['content']) if 'charset' in params: return params['charset'] return default_encoding def get_c...
import bs4 import cgi def get_content(data, errors='strict'): headers = {k.lower(): v for k, v in data.get('headers', {}).items()} content_type_header = headers.get('content-type', '') content_type, params = cgi.parse_header(content_type_header) if content_type.lower() in ('text/html', 'text/xml'): ...
agpl-3.0
Python
852dcf7a78fb34106a7a5a0b2cbdeb6dbf99570c
Update _version.py
RAMSProject/rams,RAMSProject/rams,magfest/ubersystem,magfest/ubersystem,magfest/ubersystem,magfest/ubersystem,RAMSProject/rams
uber/_version.py
uber/_version.py
__version__ = '2017.07'
__version__ = '2016.10'
agpl-3.0
Python
4cc1b1cfb02dad6b944a7b030a53015d8384e348
create easy executable plugins
jeff-99/toolbox
toolbox/plugin.py
toolbox/plugin.py
__author__ = 'jeff' from abc import ABCMeta, abstractmethod, abstractproperty import subprocess, os class ToolboxPlugin(object): __metaclass__ = ABCMeta name = None @abstractmethod def prepare_parser(self, parser): pass @abstractmethod def execute(self, args): pass class Not...
__author__ = 'jeff' from abc import ABCMeta, abstractmethod, abstractproperty class ToolboxPlugin(object): __metaclass__ = ABCMeta name = None @abstractmethod def prepare_parser(self, parser): pass @abstractmethod def execute(self, args): pass class NotCallableException (Exc...
isc
Python
293759262d0f94bc4098357e401ba2e7d346e215
Save utc time instead on local
dhermyt/WONS
tools/DbClient.py
tools/DbClient.py
import pymongo from urllib.parse import quote_plus from datetime import datetime class DbClient: __client = None __db = None __configuration = None def connect(self, configuration): uri = "mongodb://%s:%s@%s/wonsdb" % ( quote_plus(configuration.DB_USER), quote_plus(configuration.D...
import pymongo from urllib.parse import quote_plus from datetime import datetime class DbClient: __client = None __db = None __configuration = None def connect(self, configuration): uri = "mongodb://%s:%s@%s/wonsdb" % ( quote_plus(configuration.DB_USER), quote_plus(configuration.D...
bsd-2-clause
Python
21bbd98b1040cabe1be520a57503cc68f2a3df22
support python2 and python3.
dictoss/osmmarkerstorage,dictoss/osmmarkerstorage,dictoss/osmmarkerstorage,dictoss/osmmarkerstorage
tools/wsrecv.py
tools/wsrecv.py
#!/usr/bin/python # import sys import json import datetime import time from ws4py.client.threadedclient import WebSocketClient class DummyClient(WebSocketClient): def opened(self): senddata = {'func': 'auth', 'param': {'token': '12345678'} } self.send(json.d...
#!/usr/bin/python # import sys import json import datetime import time from ws4py.client.threadedclient import WebSocketClient class DummyClient(WebSocketClient): def opened(self): senddata = {'func': 'auth', 'param': {'token': '12345678'} } self.send(json.d...
bsd-2-clause
Python
1604a1ce7acc87ddf51eed2159925834457f86f3
版本0.1.2
sih4sing5hong5/hue7jip8,sih4sing5hong5/hue7jip8
版本.py
版本.py
# -*- coding: utf-8 -*- 版本 = '0.1.2'
# -*- coding: utf-8 -*- 版本 = '0.1.1'
mit
Python
7d5db46e89e13803882267125040f1680404badc
Add android perf trybots.
UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh
tools/try_perf.py
tools/try_perf.py
#!/usr/bin/env python # Copyright 2014 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import find_depot_tools import sys find_depot_tools.add_depot_tools_to_path() from git_cl import Changelist BOTS =...
#!/usr/bin/env python # Copyright 2014 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import find_depot_tools import sys find_depot_tools.add_depot_tools_to_path() from git_cl import Changelist BOTS =...
mit
Python
a966e389ea9fb642086974f9e009555caa239291
Add a check for boundary rules for QUERY (tornado)
grob/FrameworkBenchmarks,xitrum-framework/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,diablonhn/FrameworkBenchmarks,waiteb3/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,ratpack/FrameworkBenchmarks,marko-asplund/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,khellang/FrameworkBenchmarks,Rayne/Fra...
tornado/server.py
tornado/server.py
#!/usr/bin/env python import sys import json from random import randint import motor import tornado.ioloop import tornado.web from tornado import gen import tornado.options from tornado.options import options import tornado.httpserver PY3 = False if sys.version_info[0] == 3: PY3 = True xrange = range tornad...
import random import sys import json import motor import tornado.ioloop import tornado.web from tornado import gen import tornado.options from tornado.options import options import tornado.httpserver PY3 = False if sys.version_info[0] == 3: PY3 = True xrange = range tornado.options.define('port', default=888...
bsd-3-clause
Python
fd65ce69714457578266297968f274247be4e01c
create object on screen
ian4ik/helloworld,deadsquirrel/helloworld
trygame/screen.py
trygame/screen.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import pygame # создадим окно (высота, ширина) window = pygame.display.set_mode((400, 400)) pygame.display.set_caption('ура! это заголовок окна!') #игровой экран screen = pygame.Surface((400, 400)) # создаем обьект square = pygame.Surface((40, 40)) square.fill((0, 255,...
#!/usr/bin/env python # -*- coding: utf-8 -*- import pygame # создадим окно (высота, ширина) window = pygame.display.set_mode((400, 400)) pygame.display.set_caption('ура! это заголовок окна!') #игровой экран screen = pygame.Surface((400, 400)) done = True while done: for e in pygame.event.get(): if e.t...
unlicense
Python
939b405484e4dc8aad6af2823cc3cef39da67dd1
Bump version to v0.2.0
jreese/tasky
tasky/__init__.py
tasky/__init__.py
# Copyright 2016 John Reese # Licensed under the MIT license # flake8: noqa from .tasks import Task, OneShotTask, PeriodicTask, TimerTask from .loop import Tasky __version__ = '0.2.0'
# Copyright 2016 John Reese # Licensed under the MIT license # flake8: noqa from .tasks import Task, OneShotTask, PeriodicTask, TimerTask from .loop import Tasky __version__ = '0.1.0'
mit
Python
02077249a28e2889d8680c778427b1ec2dea156a
Update tcset command help
thombashi/tcconfig,thombashi/tcconfig
tcconfig/tcset.py
tcconfig/tcset.py
#!/usr/bin/env python # encoding: utf-8 ''' @author: Tsuyoshi Hombashi ''' from __future__ import absolute_import from __future__ import with_statement import sys import thutils import tcconfig import tcconfig.traffic_control def parse_option(): parser = thutils.option.ArgumentParserObject() parser.make(ve...
#!/usr/bin/env python # encoding: utf-8 ''' @author: Tsuyoshi Hombashi ''' from __future__ import absolute_import from __future__ import with_statement import sys import thutils import tcconfig import tcconfig.traffic_control def parse_option(): parser = thutils.option.ArgumentParserObject() parser.make(ve...
mit
Python
0f0829967c47e6a9149197d078be216eb1c56d2b
Fix missing comma.
dgilland/logconfig
configlog/__init__.py
configlog/__init__.py
"""Simple helper moudle for configuring Python logging. For more details on logging config: https://docs.python.org/library/logging.config.html """ import os import json import yaml import logging.config from ._compat import string_types __all__ = ( 'ConfigLogException', 'from_autodetect', 'from_dict'...
"""Simple helper moudle for configuring Python logging. For more details on logging config: https://docs.python.org/library/logging.config.html """ import os import json import yaml import logging.config from ._compat import string_types __all__ = ( 'ConfigLogException', 'from_autodetect' 'from_dict',...
mit
Python
22be3e5302baeef8e202c278c42a3c0d78d40c57
Fix converge check.
tkarna/cofs
test/swe2d/test_steady_state_channel.py
test/swe2d/test_steady_state_channel.py
# Tuomas Karna 2015-03-03 from thetis import * import math def test_steady_state_channel(do_export=False): lx = 5e3 ly = 1e3 # we don't expect converge as the reference solution neglects the advection term mesh2d = RectangleMesh(10, 1, lx, ly) # bathymetry p1_2d = FunctionSpace(mesh2d, 'CG',...
# Tuomas Karna 2015-03-03 from thetis import * import math def test_steady_state_channel(do_export=False): lx = 5e3 ly = 1e3 # we don't expect converge as the reference solution neglects the advection term mesh2d = RectangleMesh(5, 1, lx, ly) # bathymetry p1_2d = FunctionSpace(mesh2d, 'CG', ...
mit
Python
3cebe8e878e942f9e69266463adb8f42196dd98d
Update binnify command
mirnylab/cooler
cooler/cli/binnify.py
cooler/cli/binnify.py
# -*- coding: utf-8 -*- from __future__ import division, print_function import sys import click from . import cli from .. import util @cli.command() @click.option( "--out", "-o", help="Output file (defaults to stdout)") @click.argument( "chromsizes", type=str, metavar="CHROMSIZES_PATH") @click.ar...
# -*- coding: utf-8 -*- from __future__ import division, print_function import sys import click from . import cli from .. import util @cli.command() @click.option( "--out", "-o", help="Output file (defaults to stdout)") @click.argument( "chromsizes", type=str, metavar="CHROMSIZES_PATH") @click.ar...
bsd-3-clause
Python
806dde30f19755d58197bc33789e1ff8799c86ab
Update rotate_example.py
AndreiDrang/python-rucaptcha
src/examples/rotate_example.py
src/examples/rotate_example.py
import asyncio from src.python_rucaptcha.enums import RotateCaptchaEnm from src.python_rucaptcha.RotateCaptcha import RotateCaptcha, aioRotateCaptcha # Rucaptcha API Key from your account RUCAPTCHA_KEY = "ad911111111111ca81755768608fa758570" captcha_url = "https://rucaptcha.com/dist/web/b771cc7c5eb0c1a811fcb91d54e44...
from src.python_rucaptcha.enums import RotateCaptchaEnm from src.python_rucaptcha.RotateCaptcha import RotateCaptcha # Rucaptcha API Key from your account RUCAPTCHA_KEY = "ad911111111111ca81755768608fa758570" rotate_captcha = RotateCaptcha(rucaptcha_key=RUCAPTCHA_KEY, method=RotateCaptchaEnm.ROTATECAPTCHA.value) # f...
mit
Python
fa786cce92c21d24162995333e1fc615fb086e92
remove hard coded input from category file generation (#4841)
pytorch/vision,pytorch/vision,pytorch/vision,pytorch/vision,pytorch/vision,pytorch/vision
torchvision/prototype/datasets/generate_category_files.py
torchvision/prototype/datasets/generate_category_files.py
# type: ignore import argparse import csv import sys from torchvision.prototype import datasets from torchvision.prototype.datasets._api import find from torchvision.prototype.datasets.utils._internal import BUILTIN_DIR def main(*names, force=False): root = datasets.home() for name in names: path =...
# type: ignore import argparse import csv import sys from torchvision.prototype import datasets from torchvision.prototype.datasets._api import find from torchvision.prototype.datasets.utils._internal import BUILTIN_DIR def main(*names, force=False): root = datasets.home() for name in names: path =...
bsd-3-clause
Python
a1d243c73f888e2a780a575229c0b2ad6fc10732
update led display to use proper renderer object changes
mackay/ble_detector,mackay/ble_detector
display/renderers/led.py
display/renderers/led.py
from display import Renderer from neopixel import Adafruit_NeoPixel import _rpi_ws281x as ws # LED strip configuration: # LED_COUNT = 40 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!). LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 8...
from display import Renderer from neopixel import Adafruit_NeoPixel import _rpi_ws281x as ws # LED strip configuration: # LED_COUNT = 40 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!). LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 8...
mit
Python
ce40f9e672603fcba436fc457dcbfda82d02b62a
Update __init__.py
thouska/spotpy,bees4ever/spotpy,bees4ever/spotpy,bees4ever/spotpy,thouska/spotpy,thouska/spotpy
spotpy/__init__.py
spotpy/__init__.py
# -*- coding: utf-8 -*- ''' Copyright (c) 2015 by Tobias Houska This file is part of Statistical Parameter Estimation Tool (SPOTPY). :author: Tobias Houska :paper: Houska, T., Kraft, P., Chamorro-Chavez, A. and Breuer, L.: SPOTting Model Parameters Using a Ready-Made Python Package, PLoS ONE, 10(12), e0145180, doi:...
# -*- coding: utf-8 -*- ''' Copyright (c) 2015 by Tobias Houska This file is part of Statistical Parameter Estimation Tool (SPOTPY). :author: Tobias Houska :paper: Houska, T., Kraft, P., Chamorro-Chavez, A. and Breuer, L.: SPOTting Model Parameters Using a Ready-Made Python Package, PLoS ONE, 10(12), e0145180, doi:...
mit
Python
7328d26ba588d621b5794c7717e84346465859cb
Allow to search entries by tag
bjoernricks/trex,bjoernricks/trex
trex/filters.py
trex/filters.py
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # import django_filters from django import forms from django.db.models import Q from trex.models import Entry, Tag class MultipleTextFilter(django_filters.Filter): field_cla...
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # import django_filters from django import forms from django.db.models import Q from trex.models import Entry, Tag class MultipleTextFilter(django_filters.Filter): field_cla...
mit
Python
e9f86b56edae5ecc236e82c0dc76c4f201e1df43
fix ajax errors logging in Sentry
ReachingOut/unisubs,ofer43211/unisubs,wevoice/wesub,ujdhesa/unisubs,ujdhesa/unisubs,ofer43211/unisubs,norayr/unisubs,norayr/unisubs,pculture/unisubs,wevoice/wesub,norayr/unisubs,eloquence/unisubs,norayr/unisubs,wevoice/wesub,wevoice/wesub,eloquence/unisubs,ofer43211/unisubs,ReachingOut/unisubs,ReachingOut/unisubs,pcult...
utils/ajaxmiddleware.py
utils/ajaxmiddleware.py
from django.conf import settings from django.http import HttpResponse, Http404 from django.db.models.base import ObjectDoesNotExist from django.utils.translation import ugettext as _ from sentry.client.models import client import sys, traceback import json class AjaxErrorMiddleware(object): '''Return AJAX...
from django.conf import settings from django.http import HttpResponse, Http404 from django.db.models.base import ObjectDoesNotExist from django.utils.translation import ugettext as _ import json class AjaxErrorMiddleware(object): '''Return AJAX errors to the browser in a sensible way. Includes some...
agpl-3.0
Python
3b7fd461bee2d6e2ce3cc35a0aad7a08b307fac8
Drop whitespace
edavis/django-override-settings
override_settings/__init__.py
override_settings/__init__.py
import copy import mock from functools import wraps from django.conf import global_settings, settings SETTING_DELETED = mock.sentinel.SETTING_DELETED class override_settings(object): def __init__(self, **kwargs): self.patcher = mock.patch('django.conf.settings._wrapped', **kwargs) def __call__(self, ...
import copy import mock from functools import wraps from django.conf import global_settings, settings SETTING_DELETED = mock.sentinel.SETTING_DELETED class override_settings(object): def __init__(self, **kwargs): self.patcher = mock.patch('django.conf.settings._wrapped', **kwargs) def __call__(self,...
bsd-3-clause
Python
7ed6996eb0cf233728c76824289ef944d1007ece
Add __version__ variable to __init__.py
lrq3000/tqdm
tqdm/__init__.py
tqdm/__init__.py
from ._tqdm import tqdm from ._tqdm import trange from ._tqdm import format_interval from ._tqdm import format_meter __all__ = ['tqdm', 'trange', 'format_interval', 'format_meter'] from ._version import __version__
from ._tqdm import tqdm from ._tqdm import trange from ._tqdm import format_interval from ._tqdm import format_meter __all__ = ['tqdm', 'trange', 'format_interval', 'format_meter']
mit
Python
52884380ce9a6dc79e44e3ce81b7e9757de6fb04
Update password in unit test to comply with password rules
tenable/Tenable.io-SDK-for-Python
tests/integration/test_impersonation.py
tests/integration/test_impersonation.py
import pytest from tenable_io.api.users import UserCreateRequest from tests.base import BaseTest from tests.config import TenableIOTestConfig class TestImpersonation(BaseTest): @pytest.fixture(scope='class') def user(self, app, client): user_id = client.users_api.create(UserCreateRequest( ...
import pytest from tenable_io.api.users import UserCreateRequest from tests.base import BaseTest from tests.config import TenableIOTestConfig class TestImpersonation(BaseTest): @pytest.fixture(scope='class') def user(self, app, client): user_id = client.users_api.create(UserCreateRequest( ...
mit
Python
8ba03f9ff0ca0a7e96f262db7338b0371d73835f
Test GetRole
GNOME/at-spi2-core,GNOME/at-spi2-core,GNOME/at-spi2-core
tests/registryd/test_root_accessible.py
tests/registryd/test_root_accessible.py
# Pytest will pick up this module automatically when running just "pytest". # # Each test_*() function gets passed test fixtures, which are defined # in conftest.py. So, a function "def test_foo(bar)" will get a bar() # fixture created for it. import pytest import dbus from utils import get_property, check_unknown_p...
# Pytest will pick up this module automatically when running just "pytest". # # Each test_*() function gets passed test fixtures, which are defined # in conftest.py. So, a function "def test_foo(bar)" will get a bar() # fixture created for it. import pytest import dbus from utils import get_property, check_unknown_p...
lgpl-2.1
Python
fb7ffa82672f2432624cc543b15c842082e39fc5
Remove ipdb trace.
hasadna/OpenCommunity,nonZero/OpenCommunity,nonZero/OpenCommunity,nonZero/OpenCommunity,yaniv14/OpenCommunity,yaniv14/OpenCommunity,hasadna/OpenCommunity,hasadna/OpenCommunity,hasadna/OpenCommunity,yaniv14/OpenCommunity,yaniv14/OpenCommunity,nonZero/OpenCommunity
src/ocd/context_processors.py
src/ocd/context_processors.py
from django.conf import settings def analytics(request): """OPENCOMMUNITY_ANALYTICS setup in the request context.""" analytics = { 'piwik': settings.OPENCOMMUNITY_ANALYTICS.get('piwik'), 'ga': settings.OPENCOMMUNITY_ANALYTICS.get('ga') } return {'analytics': analytics} def smart_4...
from django.conf import settings def analytics(request): """OPENCOMMUNITY_ANALYTICS setup in the request context.""" analytics = { 'piwik': settings.OPENCOMMUNITY_ANALYTICS.get('piwik'), 'ga': settings.OPENCOMMUNITY_ANALYTICS.get('ga') } return {'analytics': analytics} def smart_4...
bsd-3-clause
Python
924276d8c5c39ed8a037ac7d47856ddc1df3b706
Rename to use standard convention
ariscop/cpp-coveralls,ariscop/cpp-coveralls,ariscop/cpp-coveralls
coveralls/__init__.py
coveralls/__init__.py
__author__ = 'Lei Xu <eddyxu@gmail.com>' __version__ = '0.0.1' __classifiers__ = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Top...
__author__ = 'Lei Xu <eddyxu@gmail.com>' __version__ = '0.0.1' __classifiers__ = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Top...
apache-2.0
Python
0dba57bcd4b20434e01e4cb2deed90f0d0581c84
Add get_relative_path helper.
rbarrois/uconf
uconf/helpers.py
uconf/helpers.py
# coding: utf-8 # Copyright (c) 2010-2012 Raphaël Barrois from __future__ import unicode_literals, absolute_import from fs import mountfs import os def filter_iter(iterator, items, key=lambda o: o, empty_is_all=False): """Filter items from an iterator, keeping only those in a set.""" output_all = False ...
# coding: utf-8 # Copyright (c) 2010-2012 Raphaël Barrois from __future__ import unicode_literals, absolute_import from fs import mountfs import os def filter_iter(iterator, items, key=lambda o: o, empty_is_all=False): """Filter items from an iterator, keeping only those in a set.""" output_all = False ...
bsd-2-clause
Python
6c884d274767348941f41b37a14ca3cf3417e029
Update the comment section of blacklist.py with the command line to reproduce the crash.
apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb
test/blacklist.py
test/blacklist.py
""" 'blacklist' is a Python dictionary, it stores the mapping of a string describing either a testclass or a testcase, i.e, testclass.testmethod, to the reason (a string) it is blacklisted. Following is an example which states that test class IntegerTypesExprTestCase should be skipped because 'This test class crashed'...
""" 'blacklist' is a Python dictionary, it stores the mapping of a string describing either a testclass or a testcase, i.e, testclass.testmethod, to the reason (a string) it is blacklisted. Following is an example which states that test class IntegerTypesExprTestCase should be skipped because 'This test class crashed'...
apache-2.0
Python
a84c6be7e2e8efdf934e75fee67703af544223a3
test for dsp.dsp attribute.
marcecj/faust_python
test/dsp_tests.py
test/dsp_tests.py
import os import unittest import cffi import numpy as np from . helpers import init_ffi from FAUSTPy import PythonDSP ################################# # test PythonDSP ################################# class test_faustdsp(unittest.TestCase): def setUp(self): self.ffi, self.C = init_ffi() self....
import os import unittest import cffi import numpy as np from . helpers import init_ffi from FAUSTPy import PythonDSP ################################# # test PythonDSP ################################# class test_faustdsp(unittest.TestCase): def setUp(self): self.ffi, self.C = init_ffi() self....
mit
Python
927af929f4743ee02ca788ab6e7305587d39045d
Update to version 1.5 (#7041)
LLNL/spack,krafczyk/spack,iulian787/spack,krafczyk/spack,LLNL/spack,LLNL/spack,matthiasdiener/spack,matthiasdiener/spack,LLNL/spack,LLNL/spack,mfherbst/spack,tmerrick1/spack,tmerrick1/spack,EmreAtes/spack,iulian787/spack,mfherbst/spack,tmerrick1/spack,krafczyk/spack,matthiasdiener/spack,iulian787/spack,krafczyk/spack,E...
var/spack/repos/builtin/packages/highfive/package.py
var/spack/repos/builtin/packages/highfive/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
57d36426bd82852591f6afd659e0e4a0e335c253
add versions 4.6.11 and 5.0.2 (#19071)
iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/py-kombu/package.py
var/spack/repos/builtin/packages/py-kombu/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyKombu(PythonPackage): """Messaging library for Python.""" homepage = "https://pypi....
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyKombu(PythonPackage): """Messaging library for Python.""" homepage = "https://pypi....
lgpl-2.1
Python
9c7fcff9370ce7c153171269f36b246026e34d42
Rename reset() deletealldata()
tmtmtmtm/voteit-api
voteit/manage.py
voteit/manage.py
import json from flask.ext.script import Manager from voteit.core import db from voteit.web import app from voteit.loader import bulk_load_motions from voteit.loader import bulk_load_parties from voteit.loader import bulk_load_people manager = Manager(app) @manager.command def loadpeople(file_name): with open(...
import json from flask.ext.script import Manager from voteit.core import db from voteit.web import app from voteit.loader import bulk_load_motions from voteit.loader import bulk_load_parties from voteit.loader import bulk_load_people manager = Manager(app) @manager.command def loadpeople(file_name): with open(...
mit
Python
d2fbe86272934864c385125e63344b6bda78b1b1
Fix import
jackfirth/pyramda
pamda/__init__.py
pamda/__init__.py
from .curry import curry
from curry import curry
mit
Python
fe299c72fd64b945dec152da25736152b688ff03
Remove default arguments of multi_conv_and_pool
raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten
nn/conv.py
nn/conv.py
import functools import tensorflow as tf from .util import funcname_scope, static_rank, static_shape from .variable import variable from .assertion import is_natural_num, is_natural_num_list @funcname_scope def multi_conv_and_pool(x, *, nums_of_channels, ...
import functools import tensorflow as tf from .util import funcname_scope, static_rank, static_shape from .variable import variable from .assertion import is_natural_num, is_natural_num_list @funcname_scope def multi_conv_and_pool(x, *, nums_of_channels=[20, 50], ...
unlicense
Python
09642e9198a7abd6d159954c10119a9892cfbb2b
Enable fasttext and change logging
fnielsen/dasem,fnielsen/dasem
dasem/app/__init__.py
dasem/app/__init__.py
"""Dasem app.""" from __future__ import absolute_import, division, print_function from flask import Flask from flask_bootstrap import Bootstrap from ..dannet import Dannet from ..eparole import EParole from ..wikipedia import ExplicitSemanticAnalysis from ..fullmonty import FastText, Word2Vec def create_app(enabl...
"""Dasem app.""" from __future__ import absolute_import, division, print_function import logging from flask import Flask from flask_bootstrap import Bootstrap from ..dannet import Dannet from ..eparole import EParole from ..wikipedia import ExplicitSemanticAnalysis from ..fullmonty import Word2Vec def create_app...
apache-2.0
Python
5eb9a8157439a5c8598a2691e98d175d9a04475c
Fix typo.
incuna/django-txtlocal
txtlocal/utils.py
txtlocal/utils.py
import requests from django.conf import settings from django.contrib.sites.models import Site from django.template.loader import render_to_string from django.utils.http import urlencode def send_sms(text, recipient_list, sender=None, username=None, password=None, **kwargs): """ Render and send a...
import requests from django.conf import settings from django.contrib.sites.models import Site from django.template.loader import render_to_string from django.utils.http import urlencode def send_sms(text, recipient_list, sender=None, username=None, password=None, **kwargs): """ Render and send a...
bsd-2-clause
Python
8f330d4d07ed548a9cab348895124f5f5d92a6e8
Handle scalar values in _assert_eq_nan
dask-image/dask-ndmeasure
dask_ndmeasure/_test_utils.py
dask_ndmeasure/_test_utils.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import dask.array.utils def _assert_eq_nan(a, b, **kwargs): a = a.copy() b = b.copy() a = a[...] b = b[...] a_nan = (a != a) b_nan = (b != b) a[a_nan] = 0 b[b_nan] = 0 dask.array.utils.assert_eq(a_nan, b_nan, **kw...
# -*- coding: utf-8 -*- from __future__ import absolute_import import dask.array.utils def _assert_eq_nan(a, b, **kwargs): a = a.copy() b = b.copy() a_nan = (a != a) b_nan = (b != b) a[a_nan] = 0 b[b_nan] = 0 dask.array.utils.assert_eq(a_nan, b_nan, **kwargs) dask.array.utils.asse...
bsd-3-clause
Python
dcb3add4a5b9a145abe2c45be70b515e734dcc05
change sys.path config
wegamekinglc/Finance-Python,ChinaQuants/Finance-Python
finpy/tests/testSuite.py
finpy/tests/testSuite.py
# -*- coding: utf-8 -*- u""" Created on 2015-7-13 @author: cheng.li """ import sys import os thisFilePath = os.path.abspath(__file__) sys.path.append(os.path.sep.join(thisFilePath.split(os.path.sep)[:-3])) import unittest import finpy.tests.API as API import finpy.tests.Analysis as Analysis import finpy.tests.Date...
# -*- coding: utf-8 -*- u""" Created on 2015-7-13 @author: cheng.li """ import sys sys.path.append('D:\\dev\\gitcafe\\finpy') import unittest import finpy.tests.API as API import finpy.tests.DateUtilities as DateUtilities import finpy.tests.Env as Env import finpy.tests.Math as Math import finpy.tests.PricingEngines ...
mit
Python
4356ee4e4a33b8b17e3b99fcccc7b2640b6786da
Clean up usage message
FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition
options.py
options.py
# -*- coding: utf-8 -*- # # Copyright 2016 Vale Tolpegin # Distributed under the terms of the MIT License. # -- Modules ------------------------------------------------------------------ from optparse import OptionParser # -- global options ----------------------------------------------------------- global __Optio...
# -*- coding: utf-8 -*- # # Copyright 2016 Vale Tolpegin # Distributed under the terms of the MIT License. # -- Modules ------------------------------------------------------------------ from optparse import OptionParser # -- global options ----------------------------------------------------------- global __Optio...
mit
Python
075206bc19d13baaeeb3f91389bfebafa143185a
Update base.py
fcurella/django-recommends,fcurella/django-recommends
recommends/algorithms/base.py
recommends/algorithms/base.py
class BaseAlgorithm(object): """ """ _cache = {} def clear_cache(self): self._cache = {} @property def cache(self): return self._cache def calculate_similarities(self, vote_list, verbose=0): """ Must return an dict of similarities for every object: ...
class BaseAlgorithm(object): """ """ _cache = {} def clear_cache(self): self._cache = {} @property def cache(self): return self._cache def calculate_similarities(self, vote_list, verbose=0): """ Must return an dict of similarities for every object: ...
mit
Python
f63edf38de04f0829ba1045a38c07f3c660d07f5
Remove live canvas URL
ibnIrshad/canvas-cptool
testCanvasTool.py
testCanvasTool.py
import cherrypy import CanvasLMSTool import memcache # This file stores my CANVAS_CLIENT_ID and CANVAS_CLIENT_SECRET. I'm not going to release that on Github from secretglobals import * # Do not include the trailing slash - this is where your Canvas installation is located CANVAS_URL = 'https://my-canvas-installation...
import cherrypy import CanvasLMSTool import memcache # This file stores my CANVAS_CLIENT_ID and CANVAS_CLIENT_SECRET. I'm not going to release that on Github from secretglobals import * # Do not include the trailing slash - this is where your Canvas installation is located CANVAS_URL = 'https://learn.razigroup.org' ...
mit
Python
502dff1dd5f3feec82ceaa3ad29406c39e829d96
add group without using tab button
sabinaczopik/python_training,sabinaczopik/python_training,sabinaczopik/python_training
test_add_group.py
test_add_group.py
# -*- coding: utf-8 -*- from selenium.webdriver.firefox.webdriver import WebDriver from selenium.webdriver.common.action_chains import ActionChains import time, unittest def is_alert_present(wd): try: wd.switch_to_alert().text return True except: return False class test_add_group(unitt...
# -*- coding: utf-8 -*- from selenium.webdriver.firefox.webdriver import WebDriver from selenium.webdriver.common.action_chains import ActionChains import time, unittest def is_alert_present(wd): try: wd.switch_to_alert().text return True except: return False class test_add_group(unitt...
apache-2.0
Python
892bc14cc087c47909778a178772d0895d2fb599
Change structure of the output properties
OpenChemistry/mongochemdeploy,OpenChemistry/mongochemdeploy
docker/chemml/src/run.py
docker/chemml/src/run.py
import json from chemml.models.keras.trained import OrganicLorentzLorenz from openbabel import OBMol, OBConversion def ob_convert_str(str_data, in_format, out_format): mol = OBMol() conv = OBConversion() conv.SetInFormat(in_format) conv.SetOutFormat(out_format) conv.ReadString(mol, str_data) ...
import json from chemml.models.keras.trained import OrganicLorentzLorenz from openbabel import OBMol, OBConversion def ob_convert_str(str_data, in_format, out_format): mol = OBMol() conv = OBConversion() conv.SetInFormat(in_format) conv.SetOutFormat(out_format) conv.ReadString(mol, str_data) ...
bsd-3-clause
Python
56eab810ab7517d188f28bd44857ce1c94918841
use the correct method
crate-archive/crate-site,crate-archive/crate-site,crateio/crate.pypi
crate_project/apps/crate/management/commands/get_pypi_serverkey.py
crate_project/apps/crate/management/commands/get_pypi_serverkey.py
import redis from django.conf import settings from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args, **options): r = redis.StrictRedis(host=settings.GONDOR_REDIS_HOST, port=settings.GONDOR_REDIS_PORT, password=settings.GONDOR_REDIS_PASSWORD) print...
import redis from django.conf import settings from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args, **options): r = redis.StrictRedis(host=settings.GONDOR_REDIS_HOST, port=settings.GONDOR_REDIS_PORT, password=settings.GONDOR_REDIS_PASSWORD) print...
bsd-2-clause
Python
494842910e078ac4f43ccdbe768c1b22e4898bd1
test fix
FRBs/FRB,FRBs/DM
frb/tests/test_galfit.py
frb/tests/test_galfit.py
# Module to test # the galfit wrapper import pytest import os import shutil import numpy as np from astropy.io import fits from astropy.table import Table from astropy.wcs import WCS from pkg_resources import resource_filename from frb.galaxies.frbgalaxy import FRBHost from frb.galaxies import galfit as glf remo...
# Module to test # the galfit wrapper import pytest import os import shutil import numpy as np from astropy.io import fits from astropy.table import Table from astropy.wcs import WCS from pkg_resources import resource_filename from frb.galaxies.frbgalaxy import FRBHost from frb.galaxies import galfit as glf def...
bsd-3-clause
Python
106126f1d2c56225aba9330e0207cb12aab7d613
refactor event_type route
lwrubel/disasterview,lwrubel/disasterview
disasterview/views.py
disasterview/views.py
from disasterview import app from flask import render_template from pymongo import MongoClient import math def connect(): client = MongoClient() db = client['disasters'] return db db = connect() @app.route('/') def return_cover(): return render_template('main.html') @app.route('/single/'...
from disasterview import app from flask import render_template from pymongo import MongoClient import math def connect(): client = MongoClient() db = client['disasters'] return db db = connect() @app.route('/') def return_cover(): return render_template('main.html') @app.route('/single/'...
mit
Python
f1efc8f4094b52b95b5aeec1a422d46bf39f6458
increase ulimit to 4096 (#4942)
efiop/dvc,dmpetrov/dataversioncontrol,dmpetrov/dataversioncontrol,efiop/dvc
tests/__init__.py
tests/__init__.py
import os import sys # FIXME: Search and replace these from the tests if pyarrow wheel is available PY39 = sys.version_info >= (3, 9, 0) PYARROW_NOT_AVAILABLE = "pyarrow not available yet for Python3.9" # Increasing fd ulimit for tests if os.name == "nt": import subprocess import win32file # pylint: disabl...
import os import sys # FIXME: Search and replace these from the tests if pyarrow wheel is available PY39 = sys.version_info >= (3, 9, 0) PYARROW_NOT_AVAILABLE = "pyarrow not available yet for Python3.9" # Increasing fd ulimit for tests if os.name == "nt": import subprocess import win32file # pylint: disabl...
apache-2.0
Python
97331d9d591c7cdd5dc0e734d03585b0aa58411a
Update __init__.py
UCBerkeleySETI/blimpy,UCBerkeleySETI/blimpy
tests/__init__.py
tests/__init__.py
import subprocess import sys from os import path, listdir print("Reached blimpy.tests init!") here = path.dirname(path.abspath(__file__)) print("Running tests from {}".format(here)) if "test_data" not in listdir(here): print("Test data has not yet been downloaded. Downloading Data...") if sys.version_info >= (...
bsd-3-clause
Python
5fa1150518cca3f30f93dfbdad89860bfe6a9e52
Fix headers condition
rhumbixsf/django-request-logging,steven-lee-qadium/django-request-logging,Rhumbix/django-request-logging
request_logging/middleware.py
request_logging/middleware.py
import logging import re from django.utils.termcolors import colorize from django.utils.deprecation import MiddlewareMixin MAX_BODY_LENGTH = 50000 # log no more than 3k bytes of content request_logger = logging.getLogger('django.request') class LoggingMiddleware(MiddlewareMixin): def process_request(self, requ...
import logging import re from django.utils.termcolors import colorize from django.utils.deprecation import MiddlewareMixin MAX_BODY_LENGTH = 50000 # log no more than 3k bytes of content request_logger = logging.getLogger('django.request') class LoggingMiddleware(MiddlewareMixin): def process_request(self, requ...
mit
Python
adce8f4daa0d6edfa5776aee76201836ae8eb081
Make helper methods protected
steven-lee-qadium/django-request-logging,rhumbixsf/django-request-logging,Rhumbix/django-request-logging
request_logging/middleware.py
request_logging/middleware.py
import logging import re from django.utils.termcolors import colorize from django.utils.deprecation import MiddlewareMixin MAX_BODY_LENGTH = 50000 # log no more than 3k bytes of content request_logger = logging.getLogger('django.request') class LoggingMiddleware(MiddlewareMixin): def process_request(self, requ...
import logging import re from django.utils.termcolors import colorize from django.utils.deprecation import MiddlewareMixin MAX_BODY_LENGTH = 50000 # log no more than 3k bytes of content request_logger = logging.getLogger('django.request') class LoggingMiddleware(MiddlewareMixin): def process_request(self, requ...
mit
Python
38db2c4b21bbb96cdb45591a21c381851d05ab99
Bump version
mishbahr/django-users2,mishbahr/django-users2
users/__init__.py
users/__init__.py
__version__ = '0.1.13'
__version__ = '0.1.12'
bsd-3-clause
Python
115f61be924ae1713ead8cdeed746b673152f0e5
Bump version to 1.3.0
ecometrica/gdal2mbtiles
gdal2mbtiles/__init__.py
gdal2mbtiles/__init__.py
# -*- coding: utf-8 -*- # Licensed to Ecometrica under one or more contributor license # agreements. See the NOTICE file distributed with this work # for additional information regarding copyright ownership. # Ecometrica licenses this file to you under the Apache # License, Version 2.0 (the "License"); you may not us...
# -*- coding: utf-8 -*- # Licensed to Ecometrica under one or more contributor license # agreements. See the NOTICE file distributed with this work # for additional information regarding copyright ownership. # Ecometrica licenses this file to you under the Apache # License, Version 2.0 (the "License"); you may not us...
apache-2.0
Python
0be7d5f23231e89ff44585582734d203d5caf547
Rename class
francbartoli/dj-experiment,francbartoli/dj-experiment
dj_experiment/conf.py
dj_experiment/conf.py
from appconf import AppConf from django.conf import settings class DjExperimentAppConf(AppConf): DATA_DIR = "./" SEPARATOR = "." OUTPUT_PREFIX = "" OUTPUT_SUFFIX = ".nc" CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672//' CELERY_RESULT_BACKEND = 'rpc://' class Meta: prefix =...
from appconf import AppConf from django.conf import settings class MyAppConf(AppConf): DATA_DIR = "./" SEPARATOR = "." OUTPUT_PREFIX = "" OUTPUT_SUFFIX = ".nc" CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672//' CELERY_RESULT_BACKEND = 'rpc://' class Meta: prefix = 'dj_exper...
mit
Python
30d193be41d2e05990f68a8aa79c4d872c425b5d
Work around lack of --version for all TCL; #197
DMOJ/judge,DMOJ/judge,DMOJ/judge
dmoj/executors/TCL.py
dmoj/executors/TCL.py
from dmoj.executors.base_executor import ScriptExecutor import os if os.name != 'nt': from dmoj.cptbox.handlers import ACCESS_DENIED def do_write(debugger): if debugger.arg0 <= 2: return True # TCL doesn't seem to care if anything past 2 fails return ACCESS_DENIED(debugger) class Executor(S...
from dmoj.executors.base_executor import ScriptExecutor import os if os.name != 'nt': from dmoj.cptbox.handlers import ACCESS_DENIED def do_write(debugger): if debugger.arg0 <= 2: return True # TCL doesn't seem to care if anything past 2 fails return ACCESS_DENIED(debugger) class Executor(S...
agpl-3.0
Python
e9d32d5301ab565d99f7a83b9b2fb124da84dc99
delete after too
dashwav/nano-chan
cogs/pingy.py
cogs/pingy.py
from discord.ext import commands from discord.utils import find class Pingy(): def __init__(self, bot): """ init for cog class """ super().__init__() self.bot = bot @commands.command() async def pingy(self, ctx, *roles: commands.clean_content): """ ...
from discord.ext import commands from discord.utils import find class Pingy(): def __init__(self, bot): """ init for cog class """ super().__init__() self.bot = bot @commands.command() async def pingy(self, ctx, *roles: commands.clean_content): """ ...
mit
Python
18b43a4a42c5928073a9c601f2b8bfbf9656564b
Enlarge metadata view popup
DirkHoffmann/nuxeo-drive,DirkHoffmann/nuxeo-drive,DirkHoffmann/nuxeo-drive,ssdi-drive/nuxeo-drive,arameshkumar/base-nuxeo-drive,rsoumyassdi/nuxeo-drive,arameshkumar/base-nuxeo-drive,loopingz/nuxeo-drive,loopingz/nuxeo-drive,rsoumyassdi/nuxeo-drive,arameshkumar/nuxeo-drive,ssdi-drive/nuxeo-drive,rsoumyassdi/nuxeo-drive,...
nuxeo-drive-client/nxdrive/gui/metadata.py
nuxeo-drive-client/nxdrive/gui/metadata.py
"""GUI prompt to manage metadata""" import sys from nxdrive.logging_config import get_logger from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork from PyQt4.Qt import QUrl, QObject from PyQt4.QtCore import Qt from nxdrive.gui.resources import find_icon log = get_logger(__name__) METADATA_WEBVIEW_WIDTH = 800 METADATA_...
"""GUI prompt to manage metadata""" import sys from nxdrive.logging_config import get_logger from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork from PyQt4.Qt import QUrl, QObject from PyQt4.QtCore import Qt from nxdrive.gui.resources import find_icon log = get_logger(__name__) METADATA_WEBVIEW_WIDTH = 630 METADATA_...
lgpl-2.1
Python
c30f0c82366f6c079823d8ee95cab114463cbd01
update update dropout code
nsauder/treeano,jagill/treeano,jagill/treeano,nsauder/treeano,jagill/treeano,diogo149/treeano,diogo149/treeano,diogo149/treeano,nsauder/treeano
treeano/sandbox/nodes/update_dropout.py
treeano/sandbox/nodes/update_dropout.py
""" technique that randomly 0's out the update deltas for each parameter """ import theano import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams import treeano import treeano.nodes as tn fX = theano.config.floatX @treeano.register_node("update_dropout") class UpdateDropoutNode(treeano.Wrap...
""" technique that randomly 0's out the update deltas for each parameter """ import theano import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams import treeano import treeano.nodes as tn fX = theano.config.floatX @treeano.register_node("update_dropout") class UpdateDropoutNode(treeano.Wrap...
apache-2.0
Python
ac41cc32f545d66204690eac3667770260a28d90
update comments
devlights/try-python
trypython/extlib/dateutil/dateutil01.py
trypython/extlib/dateutil/dateutil01.py
""" dateutil (python-dateutil) モジュールに関するサンプルです。 relativedelta について REFERENCES:: http://bit.ly/2KNPi0p """ import datetime import dateutil.relativedelta from trypython.common.commoncls import SampleBase from trypython.common.commonfunc import pr class Sample(SampleBase): def exec(self): today = datetim...
""" dateutil (python-dateutil) モジュールに関するサンプルです。 relativedelta について """ import datetime import dateutil.relativedelta from trypython.common.commoncls import SampleBase from trypython.common.commonfunc import pr class Sample(SampleBase): def exec(self): today = datetime.date.today() pr('today', t...
mit
Python
812cca3e40b905f013bc4e7bf04eeae1b759efa2
Make the decompose consistant with scikit-learn convention
bmcfee/librosa,librosa/librosa,librosa/librosa,bmcfee/librosa,bmcfee/librosa
librosa/decompose.py
librosa/decompose.py
#!/usr/bin/env python """ Decomposition """ import sklearn.decomposition def decompose(X, n_components=None, NMF=None): """Decompose the feature matrix with non-negative matrix factorization :parameters: - X : np.ndarray feature matrix (d-by-t) - n_components : int > 0 or None ...
#!/usr/bin/env python """ Decomposition """ import sklearn.decomposition def decompose(X, n_components=None, NMF=None): """Decompose the feature matrix with non-negative matrix factorization :parameters: - X : np.ndarray feature matrix (d-by-t) - n_components : int > 0 or None ...
isc
Python
f893e038b1c6278fad7f8ce0c94a1bf28788343a
Add Privileges.as_{grant,revoke}_statements
RazerM/pg_grant,RazerM/pg_grant
pg_grant/types.py
pg_grant/types.py
from enum import Enum import attr class PgObjectType(Enum): TABLE = 'TABLE' SEQUENCE = 'SEQUENCE' FUNCTION = 'FUNCTION' LANGUAGE = 'LANGUAGE' SCHEMA = 'SCHEMA' DATABASE = 'DATABASE' TABLESPACE = 'TABLESPACE' TYPE = 'TYPE' FOREIGN_DATA_WRAPPER = 'FOREIGN DATA WRAPPER' FOREIGN_S...
from enum import Enum import attr class PgObjectType(Enum): TABLE = 'TABLE' SEQUENCE = 'SEQUENCE' FUNCTION = 'FUNCTION' LANGUAGE = 'LANGUAGE' SCHEMA = 'SCHEMA' DATABASE = 'DATABASE' TABLESPACE = 'TABLESPACE' TYPE = 'TYPE' FOREIGN_DATA_WRAPPER = 'FOREIGN DATA WRAPPER' FOREIGN_S...
mit
Python
0d5bb8f9b6c50326f366ea6cea9bae860500026a
Fix closed file
JokerQyou/pitools
pitools/camera.py
pitools/camera.py
# coding: utf-8 from __future__ import unicode_literals import json import time from io import BytesIO from flask import Blueprint, current_app, request, send_file from picamera import PiCamera blueprint = Blueprint('camera', __name__, url_prefix='/camera') DEFAULT_RESOLUTION = (600, 800) def setup_camera(): '...
# coding: utf-8 from __future__ import unicode_literals import json import time from io import BytesIO from flask import Blueprint, current_app, request, send_file from picamera import PiCamera blueprint = Blueprint('camera', __name__, url_prefix='/camera') DEFAULT_RESOLUTION = (600, 800) def setup_camera(): '...
bsd-2-clause
Python
2621b0c8a28e9cc1b0ea4d8c274cf77671a6069f
Fix random range bug
markcharyk/data-structures
data_structures/quick_sort.py
data_structures/quick_sort.py
import random def quick_sort(unsorted, pivot_select=None): if len(unsorted) <= 1: return unsorted pivot = select_pivot(unsorted, pivot_select) less, greater = [], [] for elem in unsorted: if elem < pivot: less.append(elem) else: greater.append(elem) ...
import random def quick_sort(unsorted, pivot_select=None): if len(unsorted) <= 1: return unsorted pivot = select_pivot(unsorted, pivot_select) less, greater = [], [] for elem in unsorted: if elem < pivot: less.append(elem) else: greater.append(elem) ...
mit
Python
42003fa3b9b37d8a65484450612d8417e050f392
Make cleanup_mail management command much more memory efficient when used with tables with large number of rows.
RafRaf/django-post_office,jrief/django-post_office,CasherWest/django-post_office,JostCrow/django-post_office,fapelhanz/django-post_office,CasherWest/django-post_office,ui/django-post_office,yprez/django-post_office,ekohl/django-post_office,LeGast00n/django-post_office,carrerasrodrigo/django-post_office,ui/django-post_o...
post_office/management/commands/cleanup_mail.py
post_office/management/commands/cleanup_mail.py
import datetime from optparse import make_option from django.core.management.base import BaseCommand from ...models import Email try: from django.utils.timezone import now now = now except ImportError: now = datetime.now class Command(BaseCommand): help = 'Place deferred messages back in the queue...
import datetime from optparse import make_option from django.core.management.base import BaseCommand from ...models import Email try: from django.utils.timezone import now now = now except ImportError: now = datetime.now class Command(BaseCommand): help = 'Place deferred messages back in the queue...
mit
Python
43ae25ba55e0842490acf3835ab55868bb2c7c3a
add missing import
dionhaefner/veros,dionhaefner/veros
veros/backend.py
veros/backend.py
import numpy import warnings if numpy.__name__ == "bohrium": warnings.warn("Running veros with 'python -m bohrium' is discouraged (use '--backend bohrium' instead)") import numpy_force numpy = numpy_force try: import bohrium import bohrium.lapack except ImportError: warnings.warn("Could not im...
import numpy if numpy.__name__ == "bohrium": warnings.warn( "Running veros with 'python -m bohrium' is discouraged (use '--backend bohrium' instead)") import numpy_force numpy = numpy_force try: import bohrium import bohrium.lapack except ImportError: warnings.warn("Could not import Bo...
mit
Python
9e6cad12b0ee38c953c7f4facd55a19d6d61792e
Add method to query all the list of mirrors
pombredanne/mirrormanager2,Devyani-Divs/mirrormanager2,Devyani-Divs/mirrormanager2,pombredanne/mirrormanager2,Devyani-Divs/mirrormanager2,pombredanne/mirrormanager2,pombredanne/mirrormanager2,Devyani-Divs/mirrormanager2
mirrormanager2/lib/__init__.py
mirrormanager2/lib/__init__.py
# -*- coding: utf-8 -*- # # Copyright © 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed in t...
# -*- coding: utf-8 -*- # # Copyright © 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed in t...
mit
Python
062062f9eba9b6ef8c2a624cff0d3a54be719f17
Remove unnecessary coroutine declaration (#12602)
Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,Azure/azure-sdk-for-python
sdk/identity/azure-identity/tests/test_authn_client_async.py
sdk/identity/azure-identity/tests/test_authn_client_async.py
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import time from unittest.mock import Mock, patch from urllib.parse import urlparse import pytest from azure.core.credentials import AccessToken from azure.identity._co...
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import asyncio import time from unittest.mock import Mock, patch from urllib.parse import urlparse import pytest from azure.core.credentials import AccessToken from azu...
mit
Python
25866a8f6337fbda0659d1c0b967cfe654d9f878
Handle ValidationError with __all__.
devilry/devilry-django,devilry/devilry-django,devilry/devilry-django,devilry/devilry-django
devilry/rest/errorhandlers.py
devilry/rest/errorhandlers.py
""" Error handlers are functions that take an exception object as parameter, and returns a HTTP status code and error reponse data. """ from django.core.exceptions import ValidationError from error import ClientErrorBase def create_errordict(errormessages=[], fielderrors={}): """ Returns ``dict(errormessages=...
""" Error handlers are functions that take an exception object as parameter, and returns a HTTP status code and error reponse data. """ from django.core.exceptions import ValidationError from error import ClientErrorBase def create_errordict(errormessages=[], fielderrors={}): """ Returns ``dict(errormessages=...
bsd-3-clause
Python
dee956a45e09fe9c59795779355df06e937d346c
Change to easier to use many-to-many admin widget
uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers
cs4teachers/events/admin.py
cs4teachers/events/admin.py
"""Administration configuration for the events application.""" from django.contrib import admin from events.models import ( Event, Location, Session, Sponsor, Resource, ) class SessionAdmin(admin.ModelAdmin): exclude = ("slug",) list_display = ("name", "event") search_fields = ["name"...
"""Administration configuration for the events application.""" from django.contrib import admin from events.models import ( Event, Location, Session, Sponsor, Resource, ) class SessionAdmin(admin.ModelAdmin): exclude = ("slug",) list_display = ("name", "event") search_fields = ["name"...
mit
Python
047b920026b5c06f9d9b457555ead0ea39707c4c
update yaml loader to truncate names longer than 18 chars
mozilla-iam/sso-dashboard,mozilla-iam/sso-dashboard,mozilla-iam/sso-dashboard,mozilla-iam/sso-dashboard
dashboard/op/yaml_loader.py
dashboard/op/yaml_loader.py
"""File based loader. Will fetch connected apps from yml file instead.""" import os import yaml class Application(object): def __init__(self): self.config_file = self.__find("apps.yml", ".") self.apps = self.__load_data() self.__render_data() def __load_authorized(self, session): ...
"""File based loader. Will fetch connected apps from yml file instead.""" import os import yaml class Application(object): def __init__(self): self.config_file = self.__find("apps.yml", ".") self.apps = self.__load_data() def __load_authorized(self, session): pass def __load_data...
mpl-2.0
Python
16a87a0b0e3b4eb7ec57da2cfad328b093ba980d
bump version
CamDavidsonPilon/lifelines
lifelines/version.py
lifelines/version.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals __version__ = "0.24.0"
# -*- coding: utf-8 -*- from __future__ import unicode_literals __version__ = "0.23.9"
mit
Python
be2df66a6439cde7541976e0e134adcd0bee3a04
bump version to 0.2.0
randlet/django-listable,randlet/django-listable,randlet/django-listable
listable/__init__.py
listable/__init__.py
__version__ = '0.2.0'
__version__ = '0.1.4'
bsd-3-clause
Python
a11d9b6cb50901ea50bb358ad128fec2ca89b0b6
add api test
caneruguz/osf.io,chennan47/osf.io,TomBaxter/osf.io,laurenrevere/osf.io,acshi/osf.io,CenterForOpenScience/osf.io,zachjanicki/osf.io,felliott/osf.io,chennan47/osf.io,monikagrabowska/osf.io,adlius/osf.io,aaxelb/osf.io,kwierman/osf.io,cwisecarver/osf.io,emetsger/osf.io,SSJohns/osf.io,mluo613/osf.io,emetsger/osf.io,samchris...
api_tests/institutions/views/test_institution_list.py
api_tests/institutions/views/test_institution_list.py
from nose.tools import * # flake8: noqa from tests.base import ApiTestCase from tests.factories import InstitutionFactory from api.base.settings.defaults import API_BASE class TestInstitutionList(ApiTestCase): def setUp(self): super(TestInstitutionList, self).setUp() self.institution = Instituti...
from nose.tools import * # flake8: noqa from tests.base import ApiTestCase from tests.factories import InstitutionFactory from api.base.settings.defaults import API_BASE class TestInstitutionList(ApiTestCase): def setUp(self): super(TestInstitutionList, self).setUp() self.institution = Instituti...
apache-2.0
Python
5dc1ec3c0d3425e39e72066a86923cd15ca0ae54
change Github repo to local test repo
lobostome/jool,lobostome/jool
tests/conftest.py
tests/conftest.py
# -*- coding: utf-8 -*- import os import pytest from jool.utils import cd from jool.directory import Location from jool.git import Git @pytest.fixture() def gitrepo(): test_repo = "%s/%s" % (os.getcwd(), "testrepo.git/") cloned_repo = "jool" location = Location() location.directory = location.generat...
# -*- coding: utf-8 -*- import os import pytest from jool.utils import cd from jool.directory import Location from jool.git import Git @pytest.fixture() def gitrepo(): test_repo = "git@github.com:lobostome/jool.git" cloned_repo = "jool" location = Location() location.directory = location.generate_tem...
mit
Python
edefd3e5e96fe1957e4cdd296dc0191c5db85d8e
Update display name PI-95
edx/edx-ora2,Lektorium-LLC/edx-ora2,Stanford-Online/edx-ora2,Stanford-Online/edx-ora2,miptliot/edx-ora2,Edraak/edx-ora2,edx/edx-ora2,Edraak/edx-ora2,Edraak/edx-ora2,Stanford-Online/edx-ora2,miptliot/edx-ora2,miptliot/edx-ora2,miptliot/edx-ora2,Lektorium-LLC/edx-ora2,EDUlib/edx-ora2,EDUlib/edx-ora2,edx/edx-ora2,Stanford...
openassessment/xblock/lms_mixin.py
openassessment/xblock/lms_mixin.py
""" Fields and methods used by the LMS and Studio. """ from xblock.fields import String, Float, Scope, DateTime class LmsCompatibilityMixin(object): """ Extra fields and methods used by LMS/Studio. """ # Studio the default value for this field to show this XBlock # in the list of "Advanced Compon...
""" Fields and methods used by the LMS and Studio. """ from xblock.fields import String, Float, Scope, DateTime class LmsCompatibilityMixin(object): """ Extra fields and methods used by LMS/Studio. """ # Studio the default value for this field to show this XBlock # in the list of "Advanced Compon...
agpl-3.0
Python
6556c11eee5ef642aee21b0dfc780dc450c5ef35
Fix Executor tests re: new spec
mkusz/invoke,kejbaly2/invoke,pyinvoke/invoke,tyewang/invoke,singingwolfboy/invoke,pyinvoke/invoke,sophacles/invoke,pfmoore/invoke,mattrobenolt/invoke,pfmoore/invoke,mkusz/invoke,frol/invoke,mattrobenolt/invoke,kejbaly2/invoke,frol/invoke
tests/executor.py
tests/executor.py
from spec import Spec, eq_, skip from mock import Mock from invoke.context import Context from invoke.executor import Executor from invoke.collection import Collection from invoke.tasks import Task class Executor_(Spec): def setup(self): self.task1 = Task(Mock(return_value=7)) self.task2 = Task(M...
from spec import Spec, eq_, skip from mock import Mock from invoke.context import Context from invoke.executor import Executor from invoke.collection import Collection from invoke.tasks import Task class Executor_(Spec): def setup(self): self.task1 = Task(Mock(return_value=7)) self.task2 = Task(M...
bsd-2-clause
Python
ab9111edc9e8bf64df4f7ffcda8a253e9f340624
fix docs
pfnet/chainercv,chainer/chainercv,yuyu2172/chainercv,chainer/chainercv,yuyu2172/chainercv
chainercv/utils/testing/assertions/assert_is_image.py
chainercv/utils/testing/assertions/assert_is_image.py
import numpy as np def assert_is_image(img, color=True, check_range=True): """Checks if an image satisfies image format. This function checks if a given image satisfies image format or not. If the image does not satifiy the format, this function raises an :class:`AssertionError`. Args: i...
import numpy as np def assert_is_image(img, color=True, check_range=True): """Checks if an image satisfies image format. This function checks if a given image satisfies image format or not. If the image does not satifiy the format, this function raises an :class:`AssertionError`. Args: i...
mit
Python
b4249fa2df057d6742293dd79002c7c4fdb3cc48
Check the inherited config for the domain-name.
fugitifduck/py-junos-eznc,pklimai/py-junos-eznc,fugitifduck/py-junos-eznc,Juniper/py-junos-eznc,pklimai/py-junos-eznc,Juniper/py-junos-eznc,pklimai/py-junos-eznc,fugitifduck/py-junos-eznc,Juniper/py-junos-eznc,spidercensus/py-junos-eznc,spidercensus/py-junos-eznc,cmek/py-junos-eznc,spidercensus/py-junos-eznc,cmek/py-ju...
lib/jnpr/junos/facts/domain.py
lib/jnpr/junos/facts/domain.py
from jnpr.junos.utils.fs import FS from jnpr.junos.exception import RpcError from lxml.builder import E def facts_domain(junos, facts): """ The following facts are required: facts['hostname'] The following facts are assigned: facts['domain'] facts['fqdn'] """ try: ...
from jnpr.junos.utils.fs import FS from jnpr.junos.exception import RpcError from lxml.builder import E def facts_domain(junos, facts): """ The following facts are required: facts['hostname'] The following facts are assigned: facts['domain'] facts['fqdn'] """ try: ...
apache-2.0
Python
5b0f7412f88400e61a05e694d4883389d812f3d2
Add back in running of extra tests
maxcountryman/wtforms
tests/runtests.py
tests/runtests.py
#!/usr/bin/env python import os import sys from unittest import defaultTestLoader, TextTestRunner, TestSuite TESTS = ('form', 'fields', 'validators', 'widgets', 'webob_wrapper', 'translations', 'ext_csrf', 'ext_i18n') def make_suite(prefix='', extra=()): tests = TESTS + extra test_names = list(prefix + x for ...
#!/usr/bin/env python import os import sys from unittest import defaultTestLoader, TextTestRunner, TestSuite TESTS = ('form', 'fields', 'validators', 'widgets', 'webob_wrapper', 'translations', 'ext_csrf', 'ext_i18n') def make_suite(prefix='', extra=()): tests = TESTS + extra test_names = list(prefix + x for ...
bsd-3-clause
Python
e1a8bcbf610b33b490a6c07f84f1da2a77900492
Add line about tests/settings.py being a test data and a real settings file.
hasgeek/coaster
tests/settings.py
tests/settings.py
""" Note: This is a test config file used by test_app.py. """ SETTINGS_KEY = 'settings' ADMINS = ['test@example.com', ] DEFAULT_MAIL_SENDER = ('HasGeek', 'test@example.com') MAIL_SERVER = 'mail.example.com' MAIL_PORT = 587 MAIL_USERNAME = 'username' MAIL_PASSWORD = 'PASSWORD' SECRET_KEY = 'd vldvnvnvjn' SQLALCHEMY_DATA...
""" Configuration used by coaster test suite """ SETTINGS_KEY = 'settings' ADMINS = ['test@example.com', ] DEFAULT_MAIL_SENDER = ('HasGeek', 'test@example.com') MAIL_SERVER = 'mail.example.com' MAIL_PORT = 587 MAIL_USERNAME = 'username' MAIL_PASSWORD = 'PASSWORD' SECRET_KEY = 'd vldvnvnvjn' SQLALCHEMY_DATABASE_URI = 'p...
bsd-2-clause
Python
7ad9b6aa26ed67d32c2a346857f59ebaa7671cb3
fix plugin name in installed apps
jonasmcarson/cmsplugin-iframe,jonasmcarson/cmsplugin-iframe,satyrius/cmsplugin-iframe,satyrius/cmsplugin-iframe
tests/settings.py
tests/settings.py
LANGUAGE_CODE = 'en' SECRET_KEY = 'ji2r2iGkZqJVbWDhXrgDKDR2qG#mmtvBZXPXDugA4H)KFLwLHy' SITE_ID = 1 TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' NOSE_ARGS = ['--nologcapture', '--with-id'] MEDIA_ROOT = '/tmp/cmsplugin-comments/' ROOT_URLCONF = 'urls' DATABASES = { 'default': { 'ENGINE': 'django.db.back...
LANGUAGE_CODE = 'en' SECRET_KEY = 'ji2r2iGkZqJVbWDhXrgDKDR2qG#mmtvBZXPXDugA4H)KFLwLHy' SITE_ID = 1 TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' NOSE_ARGS = ['--nologcapture', '--with-id'] MEDIA_ROOT = '/tmp/cmsplugin-comments/' ROOT_URLCONF = 'urls' DATABASES = { 'default': { 'ENGINE': 'django.db.back...
mit
Python
b6c059333bca6669cf675b8cb13c6032e9537799
Add assertRaises
yukirin/skel_tornado,yukirin/skel_tornado,yukirin/skel_tornado,yukirin/skel_tornado
tests/test_app.py
tests/test_app.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import pathlib from test.support import EnvironmentVarGuard sys.path[0:0] = [str(pathlib.Path(__file__).parent.resolve() / '..' / 'app')] from tornado.testing import AsyncHTTPTestCase, gen_test from tornado.httpclient import HTTPError from main impo...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import pathlib from test.support import EnvironmentVarGuard sys.path[0:0] = [str(pathlib.Path(__file__).parent.resolve() / '..' / 'app')] from tornado.testing import AsyncHTTPTestCase, gen_test from main import TornadoApp from foremanenvparser impor...
mit
Python
3dbb78a51c48aeca726ed0695937c9c69b21253a
fix import on python 2.7
mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext
tests/test_cli.py
tests/test_cli.py
import pytest import os from shutil import copyfile import nbrmd from nbrmd.cli import convert, cli from utils import list_all_notebooks, filter_output_and_compare_notebooks @pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') + list_all_notebooks('.Rmd')) def test_cli_single_file(nb_file): assert cli...
import pytest import os from shutil import copyfile import nbrmd from nbrmd.cli import convert, cli from tests.utils import list_all_notebooks, filter_output_and_compare_notebooks @pytest.mark.parametrize('nb_file', list_all_notebooks('.ipynb') + list_all_notebooks('.Rmd')) def test_cli_single_file(nb_file): asse...
mit
Python
43744d009d978467988815886a1de7b8b31a9965
Test fields order
eriol/pypel
tests/test_cli.py
tests/test_cli.py
# coding: utf-8 """ Tests for pypel.cli. THIS SOFTWARE IS UNDER BSD LICENSE. Copyright (c) 2012-2015 Daniele Tricoli <eriol@mornie.org> Read LICENSE for more informations. """ import unittest from pypel.cli import Row, Table class RowTestCase(unittest.TestCase): def test_empty(self): row = Row() ...
# coding: utf-8 """ Tests for pypel.cli. THIS SOFTWARE IS UNDER BSD LICENSE. Copyright (c) 2012-2015 Daniele Tricoli <eriol@mornie.org> Read LICENSE for more informations. """ import unittest from pypel.cli import Row, Table class RowTestCase(unittest.TestCase): def test_empty(self): row = Row() ...
bsd-3-clause
Python
bf9d32020cb0c7b73dfcc7579f611e89258ee0e0
test search cli
planetlabs/planet-client-python,planetlabs/planet-client-python,lossyrob/planet-client-python
tests/test_cli.py
tests/test_cli.py
''' Command line specific tests - the client should be completely mocked and the focus should be on asserting any CLI logic prior to client method invocation lower level lib/client tests go in the test_mod suite ''' import os import json from click import ClickException from click.testing import CliRunner from mock...
''' Command line specific tests - the client should be completely mocked and the focus should be on asserting any CLI logic prior to client method invocation lower level lib/client tests go in the test_mod suite ''' import os import json from click import ClickException from click.testing import CliRunner from mock...
apache-2.0
Python
7edbbe67c6685264c40793e31a0191515bc8e19d
Test both cpu and gpu
toslunar/chainerrl,toslunar/chainerrl
tests/test_dqn.py
tests/test_dqn.py
import unittest from chainer import optimizers import q_function from dqn import DQN import random_seed import replay_buffer from simple_abc import ABC class TestDQN(unittest.TestCase): def setUp(self): pass def _test_abc(self, gpu): random_seed.set_random_seed(0) q_func = q_func...
import unittest import numpy as np import chainer from chainer import optimizers import q_function from dqn import DQN import delayed_xor import random_seed import replay_buffer from simple_abc import ABC class TestDQN(unittest.TestCase): def setUp(self): pass def test_abc(self): gpu = -1...
mit
Python
71e10d1dce23314cd745505d0c22960a9bfdbae5
update running hints in usage for raspberry pi 3
vsergeev/python-periphery
tests/test_led.py
tests/test_led.py
import sys import periphery from .asserts import AssertRaises if sys.version_info[0] == 3: raw_input = input led_name = None def test_arguments(): print("Starting arguments test...") # Invalid open types with AssertRaises(TypeError): periphery.LED("abc", "out") with AssertRaises(TypeErr...
import sys import periphery from .asserts import AssertRaises if sys.version_info[0] == 3: raw_input = input led_name = None def test_arguments(): print("Starting arguments test...") # Invalid open types with AssertRaises(TypeError): periphery.LED("abc", "out") with AssertRaises(TypeErr...
mit
Python
d3b9f28ca41febb5abb167d628975bfe3faf7f11
enable test_pil() on linux
ponty/pyscreenshot,ponty/pyscreenshot,ponty/pyscreenshot
tests/test_pil.py
tests/test_pil.py
from bt import backend_to_check from pyscreenshot.util import ( platform_is_linux, platform_is_osx, platform_is_win, use_x_display, ) ok = False if platform_is_osx() and not use_x_display(): ok = True if platform_is_linux() and use_x_display(): ok = True if platform_is_win(): ok = True if ...
from bt import backend_to_check from pyscreenshot.util import platform_is_linux if not platform_is_linux(): def test_pil(): backend_to_check("pil")
bsd-2-clause
Python
f559536d90ccea5e1be55477dba3a1644c98b68a
Add test for not overwriting existing copy
openclimatedata/pymagicc,openclimatedata/pymagicc
tests/test_run.py
tests/test_run.py
from os import remove from os.path import exists, join from subprocess import CalledProcessError import f90nml import pytest from mock import patch from pymagicc.compat import get_param from pymagicc.run import MAGICC @pytest.fixture(scope="module") def package(): p = MAGICC() p.create_copy() yield p ...
from os import remove from os.path import exists, join from subprocess import CalledProcessError import f90nml import pytest from mock import patch from pymagicc.compat import get_param from pymagicc.run import MAGICC @pytest.fixture(scope="module") def package(): p = MAGICC() p.create_copy() yield p ...
agpl-3.0
Python
818cac0c044336ded3f4f9b538817db45c301928
test auth
gawel/irc3
tests/test_web.py
tests/test_web.py
# -*- coding: utf-8 -*- import asyncio import pytest from irc3.plugins import web from aiohttp.test_utils import make_mocked_request class Payload: def __init__(self, data): self.data = data @asyncio.coroutine def readany(self): data = self.data self.data = b'' return dat...
# -*- coding: utf-8 -*- import asyncio import pytest from irc3.plugins import web from aiohttp.test_utils import make_mocked_request class Payload: def __init__(self, data): self.data = data @asyncio.coroutine def readany(self): data = self.data self.data = b'' return dat...
mit
Python
77cebf533f27c155149f5545b4bd28aa76456a55
Add test for Cho'Gall at minimum health
smallnamespace/fireplace,beheh/fireplace,jleclanche/fireplace,NightKev/fireplace,smallnamespace/fireplace
tests/test_wog.py
tests/test_wog.py
from utils import * def test_chogall(): game = prepare_game() footman = game.player1.give(GOLDSHIRE_FOOTMAN) fireball = game.player1.give("CS2_029") fireball2 = game.player1.give("CS2_029") assert not game.player1.spells_cost_health chogall = game.player1.give("OG_121") chogall.play() assert game.player1.mana...
from utils import * def test_chogall(): game = prepare_game() footman = game.player1.give(GOLDSHIRE_FOOTMAN) fireball = game.player1.give("CS2_029") fireball2 = game.player1.give("CS2_029") assert not game.player1.spells_cost_health chogall = game.player1.give("OG_121") chogall.play() assert game.player1.mana...
agpl-3.0
Python
e912f360ff66f2247223386e2b3600e1631a5a50
Add session and logging to test setup.
ib-lundgren/django-oauthlib
django_oauthlib/testrunner.py
django_oauthlib/testrunner.py
import logging import sys from django.conf import settings settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ROOT_URLCONF='django_oauthlib.urls', INSTALLED_APPS=( 'django.contrib.auth', 'django.contrib.contenttypes', ...
import sys from django.conf import settings settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ROOT_URLCONF='django_oauthlib.urls', INSTALLED_APPS=('django.contrib.auth', 'django.contrib.contenttypes', 'django_oauthlib',) ) def run_te...
bsd-3-clause
Python
9da839434216c58c0e0d71bd712f0d58c02fb7c0
fix read the docs, missing config var
m4rx9/rna-pdb-tools,m4rx9/rna-pdb-tools
rna_pdb_tools/rpt_config.py
rna_pdb_tools/rpt_config.py
SIMRNA_DATA_PATH = None RCHIE_PATH = None QRNAS_PATH = None VARNA_PATH = None VARNA_JAR_NAME = None RFAM_DB_PATH = None # path to Rfam.cm CONTEXTFOLD_PATH = None CPUS_CLUSTER = 1000 DIFF_TOOL = "diff" RNA_ROSETTA_RUN_ROOT_DIR_MODELING = "/home/magnus/rosetta-runs" RNA_ROSETTA_NSTRUC = 10000 EASY_CAT_PATH = "" impor...
SIMRNA_DATA_PATH = None RCHIE_PATH = None QRNAS_PATH = None VARNA_PATH = None RFAM_DB_PATH = None # path to Rfam.cm CONTEXTFOLD_PATH = None CPUS_CLUSTER = 1000 DIFF_TOOL = "diff" RNA_ROSETTA_RUN_ROOT_DIR_MODELING = "/home/magnus/rosetta-runs" RNA_ROSETTA_NSTRUC = 10000 EASY_CAT_PATH = "" import os try: PATH = o...
mit
Python
c272e73c0d3112425e0ba25c58448f7c1d492d11
Update search api filter out unwanted information
jghibiki/mopey,jghibiki/mopey,jghibiki/mopey,jghibiki/mopey,jghibiki/mopey
api/src/SearchApi.py
api/src/SearchApi.py
from apiclient.discovery import build import json # Set DEVELOPER_KEY to the API key value from the APIs & auth > Registered apps # tab of # https://cloud.google.com/console # Please ensure that you have enabled the YouTube Data API for your project. devKeyFile = open("search-api.key", "rb") DEVELOPER_KEY = devKeyF...
from apiclient.discovery import build import json # Set DEVELOPER_KEY to the API key value from the APIs & auth > Registered apps # tab of # https://cloud.google.com/console # Please ensure that you have enabled the YouTube Data API for your project. devKeyFile = open("search-api.key", "rb") DEVELOPER_KEY = devKeyF...
mit
Python
b51672169827794600cadb389eb2dd81d05e58b7
Fix linear epsilon annealing
kevinkepp/search-for-this
sft/eps/Linear.py
sft/eps/Linear.py
from sft.eps.Update import Update class Linear(Update): """Anneals linearly from 'start' to 'end' over 'steps' steps""" def __init__(self, start, end, steps): self.start = start self.end = end self._step_size = (end - start) / steps def get_value(self, epoch): e = self.start + self._step_size * epoch i...
from eps.Update import Update class Linear(Update): """Anneals linearly from 'start' to 'end' over 'steps' steps""" def __init__(self, start, end, steps): self.start = start self._step_size = (end - start) / steps def get_value(self, epoch): return self.start + self._step_size * epoch # custom update func...
mit
Python
fac9d9070d5b9884d57103e6afd5380f32462d45
add docstring to metadata function
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/grains/metadata_gce.py
salt/grains/metadata_gce.py
""" Grains from cloud metadata servers at 169.254.169.254 in google compute engine .. versionadded:: 3005.0 :depends: requests To enable these grains that pull from the http://169.254.169.254/computeMetadata/v1/ metadata server set `metadata_server_grains: True` in the minion config. .. code-block:: yaml metad...
""" Grains from cloud metadata servers at 169.254.169.254 in google compute engine .. versionadded:: 3005.0 :depends: requests To enable these grains that pull from the http://169.254.169.254/computeMetadata/v1/ metadata server set `metadata_server_grains: True` in the minion config. .. code-block:: yaml metad...
apache-2.0
Python
15070aefb649e0d9b72f29e8f9e7922170caedea
Add link to jwchat.
vignanl/Plinth,kkampardi/Plinth,jvalleroy/plinth-debian,freedomboxtwh/Plinth,harry-7/Plinth,kkampardi/Plinth,kkampardi/Plinth,vignanl/Plinth,vignanl/Plinth,jvalleroy/plinth-debian,jvalleroy/plinth-debian,vignanl/Plinth,jvalleroy/plinth-debian,vignanl/Plinth,harry-7/Plinth,kkampardi/Plinth,freedomboxtwh/Plinth,freedombo...
modules/installed/apps/apps.py
modules/installed/apps/apps.py
import cherrypy from gettext import gettext as _ from modules.auth import require from plugin_mount import PagePlugin from forms import Form from actions import superuser_run import cfg class Apps(PagePlugin): def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) self.regi...
import cherrypy from gettext import gettext as _ from modules.auth import require from plugin_mount import PagePlugin from forms import Form from actions import superuser_run import cfg class Apps(PagePlugin): def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) self.regi...
agpl-3.0
Python
0789d61cc683688ee432147d3fffbf5f638b7ebf
Test schedule_priority_jobs with diff queue names.
PyBossa/pybossa,inteligencia-coletiva-lsd/pybossa,OpenNewsLabs/pybossa,stefanhahmann/pybossa,inteligencia-coletiva-lsd/pybossa,geotagx/pybossa,stefanhahmann/pybossa,OpenNewsLabs/pybossa,Scifabric/pybossa,jean/pybossa,jean/pybossa,PyBossa/pybossa,Scifabric/pybossa,geotagx/pybossa
test/test_jobs/__init__.py
test/test_jobs/__init__.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa 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...
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa 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...
agpl-3.0
Python
300b6f331b72e0939fd9fcee15fa1ce9b97cd7a6
add support for changing EUI dialect used for all fields of this type
tubaman/django-macaddress,angvp/django-macaddress
macaddress/fields.py
macaddress/fields.py
from django.core.exceptions import ValidationError from django.db import models from netaddr import EUI, AddrFormatError, mac_unix from formfields import MACAddressField as MACAddressFormField # monkey patch EUI to work around https://github.com/drkjam/netaddr/issues/21 # we need this if we use unique=True def _eui_...
from django.core.exceptions import ValidationError from django.db import models from netaddr import EUI, AddrFormatError, mac_unix from formfields import MACAddressField as MACAddressFormField # monkey patch EUI to work around https://github.com/drkjam/netaddr/issues/21 # we need this if we use unique=True def _eui_...
bsd-3-clause
Python
007020e0d61a86bc55c15a21e7857fd457ca7dfb
Bump version to 0.8.1
rshipp/chaser,rshipp/chaser
chaser/__init__.py
chaser/__init__.py
__version__ = "0.8.1" import argparse import gettext gettext.bindtextdomain('chaser', '/usr/share/locale') gettext.install('chaser', '/usr/share/locale') gettext.textdomain('chaser') _ = gettext.gettext from chaser import chaser def main(): parser = argparse.ArgumentParser( description=_("Next-gener...
__version__ = "0.8" import argparse import gettext gettext.bindtextdomain('chaser', '/usr/share/locale') gettext.install('chaser', '/usr/share/locale') gettext.textdomain('chaser') _ = gettext.gettext from chaser import chaser def main(): parser = argparse.ArgumentParser( description=_("Next-generat...
bsd-3-clause
Python
126cf1350ca610c39f6d8accc3f4eff184bb2778
rephrase status command help
oVirt/ovirt-engine-cli,oVirt/ovirt-engine-cli
src/ovirtcli/command/status.py
src/ovirtcli/command/status.py
# # Copyright (c) 2010 Red Hat, 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 t...
# # Copyright (c) 2010 Red Hat, 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 t...
apache-2.0
Python