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
4145b48b69722364f3f6f1af797676c1688c0603
Remove unused test in lut
MOLSSI-BSE/basis_set_exchange
basis_set_exchange/tests/test_lut.py
basis_set_exchange/tests/test_lut.py
""" Tests for lookups of elemental data """ import pytest from basis_set_exchange import lut _all_elements = list(range(1, 119)) _all_elements_str = [str(x) for x in _all_elements] _all_elements.extend(_all_elements_str) _all_am = list(range(1, 13)) @pytest.mark.parametrize('Z', _all_elements) def test_element_data...
""" Tests for lookups of elemental data """ import pytest from basis_set_exchange import lut _all_elements = list(range(1, 119)) _all_elements_str = [str(x) for x in _all_elements] _all_elements.extend(_all_elements_str) _all_am = list(range(1, 13)) @pytest.mark.parametrize('Z', _all_elements) def test_element_data...
bsd-3-clause
Python
c719cb5b73e12c0f1c3c23d98e5ccb2ffd57e500
update default iterations
jeremy-miller/life-python
life/main.py
life/main.py
#!/usr/bin/python """This module runs the Life game.""" import logging from life.logger import LoggerClass from life.game import GameClass class MainClass(object): # pylint: disable=R0903 """This class runs the Life game.""" def __init__(self): """This method initializes the Life game. Attributes: ...
#!/usr/bin/python """This module runs the Life game.""" import logging from life.logger import LoggerClass from life.game import GameClass class MainClass(object): # pylint: disable=R0903 """This class runs the Life game.""" def __init__(self): """This method initializes the Life game. Attributes: ...
mit
Python
d4a4f7a5eee29d009cb419f8e8994779b388faf2
Improve profiler logging
openstack/mistral,openstack/mistral
mistral/utils/profiler.py
mistral/utils/profiler.py
# Copyright 2016 - Brocade Communications Systems, 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 b...
# Copyright 2016 - Brocade Communications Systems, 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 b...
apache-2.0
Python
47ce5dd4ae419653e4346e9c8b197a73ace6c026
Add rbd support
makefu/bepasty-server,bepasty/bepasty-server,makefu/bepasty-server,bepasty/bepasty-server,bepasty/bepasty-server,bepasty/bepasty-server,makefu/bepasty-server
bepasty/storage/ceph/lowlevel/rbd.py
bepasty/storage/ceph/lowlevel/rbd.py
import collections from ctypes import ( CDLL, c_char_p, c_void_p, c_int, c_uint64, POINTER, ) from . import errcheck _librbd = CDLL('librbd.so.1') # int rbd_create3(rados_ioctx_t io, const char *name, uint64_t size, # uint64_t features, int *order, # u...
bsd-2-clause
Python
81cce2ca6749d4ea4a763006a1f1b96cbe202ff3
Add __all__ to NDDataBase
larrybradley/astropy,funbaker/astropy,mhvk/astropy,bsipocz/astropy,stargaser/astropy,tbabej/astropy,MSeifert04/astropy,tbabej/astropy,DougBurke/astropy,larrybradley/astropy,lpsinger/astropy,StuartLittlefair/astropy,AustereCuriosity/astropy,stargaser/astropy,dhomeier/astropy,saimn/astropy,kelle/astropy,mhvk/astropy,joer...
astropy/nddata/nddatabase.py
astropy/nddata/nddatabase.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module implements the base NDDataBase class. from __future__ import (absolute_import, division, print_function, unicode_literals) from abc import ABCMeta, abstractproperty, abstractmethod from ..extern import six __all__ ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module implements the base NDDataBase class. from __future__ import (absolute_import, division, print_function, unicode_literals) from abc import ABCMeta, abstractproperty, abstractmethod from ..extern import six @six.ad...
bsd-3-clause
Python
3d228d5861d4a5ce34ded0cdc7163b7ee4760fca
set starting values for rubiks_solver
deepakiam/bot,deepakiam/bot,deepakiam/bot,IEEERobotics/bot,IEEERobotics/bot,IEEERobotics/bot
bot/activity_solver/rubiks_solver.py
bot/activity_solver/rubiks_solver.py
import bot.lib.lib as lib import bot.hardware.servo as servo_mod import bbb as bbb_mod class RubiksSolver(object): def __init__(self): self.config = lib.get_config() self.logger = lib.get_logger() self.servo_pwm = self.config["rubiks"]["servo_pwm"] self.rev_n...
import bot.lib.lib as lib import bot.hardware.servo as servo_mod import bbb as bbb_mod class RubiksSolver(object): def __init__(self): self.config = lib.get_config() self.logger = lib.get_logger() self.servo_pwm = self.config["rubiks"]["servo_pwm"] self.rev_n...
bsd-2-clause
Python
1e31e9de1025693d763a95eb99d5fe498bd6612b
Fix version issue
openstack/python-congressclient
congressclient/__init__.py
congressclient/__init__.py
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
apache-2.0
Python
16e2688901adf126482223faa236a2a9eb4e4e38
upgrade version to 0.5.0
agile-geoscience/welly,agile-geoscience/welly
welly/_version.py
welly/_version.py
""" Version. Doing it this way provides for access in setup.py and via __version__ """ __version__ = "0.5.0"
""" Version. Doing it this way provides for access in setup.py and via __version__ """ __version__ = "0.4.10"
apache-2.0
Python
fab0f7b45829de3d74297bfe191cea1a950e9394
Switch to 0.6.0-dev because 0.5.0 has been released.
MjnMixael/knossos,MjnMixael/knossos,MjnMixael/knossos,MjnMixael/knossos,MjnMixael/knossos
knossos/center.py
knossos/center.py
## Copyright 2017 Knossos authors, see NOTICE file ## ## 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...
## Copyright 2017 Knossos authors, see NOTICE file ## ## 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...
apache-2.0
Python
743da234f2c1a5c48b1c0165af28ecd01fa8588f
Bump version
njvack/masterfile
masterfile/_metadata.py
masterfile/_metadata.py
# -*- coding: utf-8 -*- # flake8: noqa: E501 from __future__ import absolute_import, unicode_literals author = 'Nate Vack' email = 'njvack@wisc.edu' version = '0.5.1' license = 'MIT license' copyright = 'Copyright (c) 2020 Board of Regents of the University of Wisconsin System' url = 'https://github.com/uwmadison-chm/...
# -*- coding: utf-8 -*- # flake8: noqa: E501 from __future__ import absolute_import, unicode_literals author = 'Nate Vack' email = 'njvack@wisc.edu' version = '0.5.0' license = 'MIT license' copyright = 'Copyright (c) 2020 Board of Regents of the University of Wisconsin System' url = 'https://github.com/uwmadison-chm/...
mit
Python
d6a7fff314285031f8b100a0333d08c1f49ace4b
Return title added
abinashmeher999/pymediawiki
wiki_linkshere.py
wiki_linkshere.py
# Find all pages that link to the given pages. from pprint import pprint import requests base_url = "https://en.wikipedia.org/w/api.php" payload = { 'action': 'query', 'prop': 'linkshere', 'pageids': None, 'format': 'json', 'lhprop': 'pageid|title|redirect', 'lhlimit': 'max', 'lhcontinue':...
# Find all pages that link to the given pages. from pprint import pprint import requests base_url = "https://en.wikipedia.org/w/api.php" payload = { 'action': 'query', 'prop': 'linkshere', 'pageids': None, 'format': 'json', 'lhprop': 'pageid|title|redirect', 'lhlimit': 'max', 'lhcontinue':...
mit
Python
3e8e967a48ffb2f48db0de37860e5c6b47dff2e9
update to latest changes
NLeSC/PattyAnalytics
scripts/transform.py
scripts/transform.py
#!/usr/bin/env python2.7 """Apply transformation to pointcloud. The transformations (if given) are applied in the following order: 1. rotation 2. scaling 3. offset Usage: transform.py [-o <origin>] [-r <rot>] [-t <translate>] [-s <scaling>] <source> <target> Positional arguments: source Source pointcl...
#!/usr/bin/env python2.7 """Apply transformation to pointcloud. The transformations (if given) are applied in the following order: 1. rotation 2. scaling 3. offset Usage: transform.py [-r <rot>][-o <rot_origin>] [-t <translate>] [-s <scaling>] <source> <target> Positional arguments: source Source poin...
apache-2.0
Python
73b0423846d16c5b75729792400135ac6c99cacb
Add capwords to massage_names
texastribune/scuole,texastribune/scuole,texastribune/scuole,texastribune/scuole
scuole/core/utils.py
scuole/core/utils.py
# -*- coding: utf-8 -*- import re import string def string_replace(text, key_dict): """ A function to convert text in a string to another string if it matches any of the keys in the provided pattern dictionary. Usage: from core.utils import string_replace KEY_DICT = { 'Isd': 'ISD', ...
# -*- coding: utf-8 -*- import re def string_replace(text, key_dict): """ A function to convert text in a string to another string if it matches any of the keys in the provided pattern dictionary. Usage: from core.utils import string_replace KEY_DICT = { 'Isd': 'ISD', } s =...
mit
Python
58849a417dae8d962d76a65d646164b8cc6fde6c
read netrc at startup again
longaccess/longaccess-client,longaccess/longaccess-client,longaccess/longaccess-client
lacli/registry.py
lacli/registry.py
import os from urlparse import urlparse from netrc import netrc from lacli.log import getLogger from lacli.decorators import cached_property API_URL = 'https://www.longaccess.com/api/v1/' class LaRegistry(object): cache = None prefs = None session = None def __init__(self, cache, prefs, cmd): ...
import os from urlparse import urlparse from netrc import netrc from lacli.log import getLogger from lacli.decorators import cached_property API_URL = 'https://www.longaccess.com/api/v1/' class LaRegistry(object): cache = None prefs = None session = None def __init__(self, cache, prefs, cmd): ...
apache-2.0
Python
ba959d67192f5d45e617fbf32d40c8e5fcc960f2
fix make_cnn filter sizes
yandexdataschool/crayimage
crayimage/nn/layers/cnn.py
crayimage/nn/layers/cnn.py
from lasagne import * def make_cnn(input_layer, depth = 3, initial_filters=8, filter_size=(3, 3), **conv_kwargs): net = input_layer for i in range(depth): net = layers.Conv2DLayer( net, num_filters=initial_filters * (2 ** i), filter_size=filter_size, **conv_kwargs ) ...
from lasagne import * def make_cnn(input_layer, depth = 3, initial_filters=8, filter_size=(3, 3), **conv_kwargs): net = input_layer for i in range(depth): net = layers.Conv2DLayer( net, num_filters=initial_filters ** (i + 1), filter_size=filter_size, **conv_kwargs ) ...
mit
Python
dc0914b8a5966b70bcaf647fca6f8c92d3c8c26d
allow getting session_info as non-authenticated
ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo
addons/web/models/ir_http.py
addons/web/models/ir_http.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import json from odoo import models from odoo.http import request import odoo class Http(models.AbstractModel): _inherit = 'ir.http' def webclient_rendering_context(self): return { 'menu_...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import json from odoo import models from odoo.http import request import odoo class Http(models.AbstractModel): _inherit = 'ir.http' def webclient_rendering_context(self): return { 'menu_...
agpl-3.0
Python
1472669f40aaff633756b28378aa2ebee3b445ab
Fix schools migrations
znick/anytask,znick/anytask,znick/anytask,znick/anytask
anytask/schools/migrations/0003_school_is_active.py
anytask/schools/migrations/0003_school_is_active.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-03-04 16:41 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('schools', '0002_auto_20210228_1721'), ] operations = [ migrations.AddField...
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-03-04 16:41 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('schools', '0002_auto_20210228_1721'), ] operations = [ migrations.AddField...
mit
Python
15071bd44294b5bac78e83f19ad12f84810942d2
Fix import statement in basic-chart.py example
ccxt/ccxt,ccxt/ccxt,ccxt/ccxt,ccxt/ccxt,ccxt/ccxt
examples/py/basic-chart.py
examples/py/basic-chart.py
# -*- coding: utf-8 -*- import os import sys from asciichart import plot # ----------------------------------------------------------------------------- this_folder = os.path.dirname(os.path.abspath(__file__)) root_folder = os.path.dirname(os.path.dirname(this_folder)) sys.path.append(root_folder + '/python') sys.p...
# -*- coding: utf-8 -*- import os import sys from asciichartpy import plot # ----------------------------------------------------------------------------- this_folder = os.path.dirname(os.path.abspath(__file__)) root_folder = os.path.dirname(os.path.dirname(this_folder)) sys.path.append(root_folder + '/python') sys....
mit
Python
a50d85bd2300d218bfc4072abac35e1bd5ef045d
Update test_api_geo.py
unicef/rhizome,unicef/rhizome,unicef/rhizome,unicef/rhizome
rhizome/tests/test_api_geo.py
rhizome/tests/test_api_geo.py
import json from tastypie.test import ResourceTestCase from django.contrib.auth.models import User from setup_helpers import TestSetupHelpers from pandas import read_csv, notnull, to_datetime from rhizome.models import * from pandas import read_csv, notnull, to_datetime, DataFrame, Series from rhizome.cache_meta impor...
import json from tastypie.test import ResourceTestCase from django.contrib.auth.models import User from setup_helpers import TestSetupHelpers from pandas import read_csv, notnull, to_datetime from rhizome.models import * from pandas import read_csv, notnull, to_datetime, DataFrame, Series from rhizome.cache_meta impor...
agpl-3.0
Python
1181c983971eab4e584b0472379cdc7ac48b487b
Update example to use new lumberjack.
alexrudy/Cauldron
examples/read_write_zmq.py
examples/read_write_zmq.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Demonstrate REDIS read-write ability. """ import time, threading from lumberjack.config import configure from logging import getLogger configure('stream') log = getLogger("example.zmq") # Get ready! from Cauldron.api import use use("zmq") from Cauldron import DFW de...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Demonstrate REDIS read-write ability. """ import time from lumberjack import setup_logging, setup_warnings_logger from logging import getLogger setup_logging(mode='stream', level=5) setup_warnings_logger("") log = getLogger("example.zmq") # Get ready! from Cauldron.ap...
bsd-3-clause
Python
0bb03312fc796e807821146b965eec7d68531c7d
simplify renderer_floor.py into a single kernel while being able to reproduce the problem
yuanming-hu/taichi,yuanming-hu/taichi,yuanming-hu/taichi,yuanming-hu/taichi
examples/renderer_floor.py
examples/renderer_floor.py
import taichi as ti ret = ti.var(dt=ti.f32, shape=()) ti.cfg.arch = ti.cuda @ti.kernel def test(): if True: d = 1e-3 n = ti.Vector([0.0, 0.0, 0.0]) p = ti.Vector([0.0, 0.0, 0.0]) for i in ti.static(range(3)): inc = p dec = p inc[i] += d dec[i] -= d n[i] = (0.5 / d) * (...
import taichi as ti res = 1280, 720 ret = ti.var(dt=ti.f32, shape=()) dist_limit = 100 # ti.runtime.print_preprocessed = True # ti.cfg.print_ir = True ti.cfg.arch = ti.cuda @ti.func def sdf(o): return o[1] - 0.027 inf = 1e10 @ti.func def ray_march(p, d): j = 0 dist = 0.0 limit = 200 while j < limit and ...
apache-2.0
Python
dd9ccee6d60d4d5b5af5f80fb66acf354e33cd78
Update comment
sigopt/sigopt-python,sigopt/sigopt-python
examples/run_experiment.py
examples/run_experiment.py
import threading import time from sigopt.interface import Connection # Just fill these in with your credentials CLIENT_TOKEN = 'XXXXXXXXXX' USER_TOKEN = 'YYYYYYYYY' CLIENT_ID = 0 EXPERIMENT_ID = 0 class ExampleRunner(threading.Thread): def __init__(self, worker_id): threading.Thread.__init__(self) self.wor...
import threading import time from sigopt.interface import Connection # Just fill these in with your credentials CLIENT_TOKEN = 'XXXXXXXXXX' USER_TOKEN = 'YYYYYYYYY' CLIENT_ID = 0 EXPERIMENT_ID = 0 class ExampleRunner(threading.Thread): def __init__(self, worker_id): threading.Thread.__init__(self) self.wor...
mit
Python
bb4e751cfe6abb2f544f0fcb93609b38c4011a34
set development status to production
OCA/l10n-belgium,OCA/l10n-belgium
companyweb_base/__manifest__.py
companyweb_base/__manifest__.py
# Copyright 2021 ACSONE SA/NV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Companyweb", "summary": ( "Know who you are dealing with. " "Enhance Odoo partner data from companyweb.be." ), "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "website...
# Copyright 2021 ACSONE SA/NV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Companyweb", "summary": ( "Know who you are dealing with. " "Enhance Odoo partner data from companyweb.be." ), "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "website...
agpl-3.0
Python
baae1eaf64981b97ca391530d50b29ac59b91caa
Fix migration dependency issue
rkhleics/wagtailmenus,ababic/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus
wagtailmenus/tests/migrations/0012_linkpage.py
wagtailmenus/tests/migrations/0012_linkpage.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-05-17 22:17 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('tests', '0011_auto_20170106_2355'), ] operations =...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-05-17 22:17 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0032_add_bulk_delete_page_permission'), ...
mit
Python
95dbbe036950478f897a337a5e8e47e257d61a92
Test failed curve loading
npmccallum/python-rubenesque
rubenesque/curves/__init__.py
rubenesque/curves/__init__.py
# pylint: disable=line-too-long # # Copyright (c) 2015, Red Hat, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, t...
# pylint: disable=line-too-long # # Copyright (c) 2015, Red Hat, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, t...
bsd-2-clause
Python
518d61d923d90a09ebb5ddade7ee8f59c2a0ef0c
Update middleware.py
jespino/django-lot,ABASystems/django-lot
lot/middleware.py
lot/middleware.py
import json from django.conf import settings from django.contrib.auth import authenticate, login from .models import LOT class LOTMiddleware(object): def process_request(self, request): lot_uuid = request.GET.get(settings.LOT_MIDDLEWARE_PARAM_NAME, None) if lot_uuid: try: ...
import simplejson from django.conf import settings from django.contrib.auth import authenticate, login from .models import LOT class LOTMiddleware(object): def process_request(self, request): lot_uuid = request.GET.get(settings.LOT_MIDDLEWARE_PARAM_NAME, None) if lot_uuid: try: ...
bsd-3-clause
Python
541a266e0e472826f63e16bd124be11b4174c710
test commit + push
rapidsms/rapidsms-contrib-apps-dev,dimagi/rapidsms-contrib-apps-dev,rapidsms/rapidsms-contrib-apps-dev,dimagi/rapidsms-contrib-apps-dev
__init__.py
__init__.py
bsd-3-clause
Python
f7c441062911537313af4ed59b94885a9afd884d
add hack
guillermooo-forks/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle,guillermooo/dart-sublime-bundle
__init__.py
__init__.py
# Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details. # All rights reserved. Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file.) import logging import os import sublime # If we don't do this, logging will fail sometimes. :-/ logging....
# Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details. # All rights reserved. Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file.) import logging import os import sublime class PluginLogger(object): """A logger intented to be used ...
bsd-3-clause
Python
69fce785e69d40df756199ae405496770efb8655
Simplify console colors
kursion/proxy_crawler
__init__.py
__init__.py
__all__ = ["crawler"] if __name__ == '__main__': import crawler import py_console.colors as console proxies = [] for page in range(1, 5): console.success("Getting page %i on nntime.com" % (page)) proxies = proxies+proxy_crawler.getProxies(page) print(proxies) console.header("Re...
__all__ = ["crawler"] if __name__ == '__main__': import crawler import py_console.colors as consoleColors console = consoleColors proxies = [] for page in range(1, 5): console.success("Getting page %i on nntime.com" % (page)) proxies = proxies+proxy_crawler.getProxies(page) pri...
mit
Python
ca25aeb8ebcee9808e9f2ead00586a1907a21f1b
Bump to 3.3.0a2.
pypa/setuptools,pypa/setuptools,pypa/setuptools
__init__.py
__init__.py
"""distutils The main package for the Python Module Distribution Utilities. Normally used from a setup script as from distutils.core import setup setup (...) """ # Distutils version # # Updated automatically by the Python release process. # #--start constants-- __version__ = "3.3.0a2" #--end constants--
"""distutils The main package for the Python Module Distribution Utilities. Normally used from a setup script as from distutils.core import setup setup (...) """ # Distutils version # # Updated automatically by the Python release process. # #--start constants-- __version__ = "3.3.0a1" #--end constants--
mit
Python
9e81e7571d7ff9c48175ce5dbe187f26dab5443a
remove errors kwarg
SalesforceFoundation/CumulusCI,SalesforceFoundation/CumulusCI
cumulusci/utils/logging.py
cumulusci/utils/logging.py
import os import re import sys import contextlib import logging from logging.handlers import RotatingFileHandler from pathlib import Path @contextlib.contextmanager def tee_stdout_stderr(args, logger, tempfile): """Tee stdout and stderr so that they're also routed to a log file. Add the current command argume...
import os import re import sys import contextlib import logging from logging.handlers import RotatingFileHandler from pathlib import Path @contextlib.contextmanager def tee_stdout_stderr(args, logger, tempfile): """Tee stdout and stderr so that they're also routed to a log file. Add the current command argume...
bsd-3-clause
Python
c8931cb0f5a12997af2853585144ea02dd888317
Tweak non-GPU LPU scaling experiment.
cerrno/neurokernel
examples/timing/run_lpu.py
examples/timing/run_lpu.py
#!/usr/bin/env python """ Run timing test (non-GPU) scaled over number of LPUs. """ import numpy as np import csv import re import subprocess import sys script_name = 'timing_demo.py' w = csv.writer(sys.stdout) for lpus in xrange(2, 9): average_step_sync_time_list = [] average_throughput_list = [] tota...
#!/usr/bin/env python """ Run timing test (non-GPU) scaled over number of LPUs. """ import numpy as np import csv import re import subprocess import sys script_name = 'timing_demo.py' w = csv.writer(sys.stdout) for lpus in xrange(2, 9): average_step_sync_time_list = [] average_throughput_list = [] tota...
bsd-3-clause
Python
cff1c9e2a9ee75de504943ee82336fcbb483a90c
Update version.py
eerimoq/cantools,cantools/cantools
cantools/version.py
cantools/version.py
__version__ = '36.7.0'
__version__ = '36.6.0'
mit
Python
72a7230243b662fca765bfaf95f5a9803a5868e2
fix for Django 1.6
morlandi/django-workflows,morlandi/django-workflows
workflows/urls.py
workflows/urls.py
from django.conf.urls import * # URL patterns for django-workflows urlpatterns = patterns('django-workflows.views', # Add url patterns here )
from django.conf.urls.defaults import * # URL patterns for django-workflows urlpatterns = patterns('django-workflows.views', # Add url patterns here )
bsd-3-clause
Python
fc1c17b8dc37325d6321defc5899b4363fe08053
convert datetime objects to strings
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/modules/twilio_notify.py
salt/modules/twilio_notify.py
# -*- coding: utf-8 -*- ''' Module for notifications via Twilio .. versionadded:: 2014.7.0 :depends: - twilio python module :configuration: Configure this module by specifying the name of a configuration profile in the minion config, minion pillar, or master config. For example: .. code-block:: yaml ...
# -*- coding: utf-8 -*- ''' Module for notifications via Twilio .. versionadded:: 2014.7.0 :depends: - twilio python module :configuration: Configure this module by specifying the name of a configuration profile in the minion config, minion pillar, or master config. For example: .. code-block:: yaml ...
apache-2.0
Python
fdd48dfbd63d912a20288d4569c6b01eac410562
add overwrite prompt for makekey
limodou/uliweb,wwfifi/uliweb,wwfifi/uliweb,limodou/uliweb,wwfifi/uliweb,wwfifi/uliweb,limodou/uliweb,limodou/uliweb
uliweb/contrib/secretkey/commands.py
uliweb/contrib/secretkey/commands.py
import os from uliweb.core.commands import Command from optparse import make_option class MakeKeyCommand(Command): name = 'makekey' help = 'Make secret key to to a file.' option_list = ( make_option('-o', dest="output", help='Output key file name.'), ) has_options = True ...
import os from uliweb.core.commands import Command from optparse import make_option class MakeKeyCommand(Command): name = 'makekey' help = 'Make secret key to to a file.' option_list = ( make_option('-o', dest="output", help='Output key file name.'), ) has_options = True ...
bsd-2-clause
Python
c17d2616245c59c7c31a01db8fed6771604a4d2c
Enable twill importing in Downloader.py
muslih/alfanous,muslih/alfanous,muslih/alfanous,muslih/alfanous,muslih/alfanous,muslih/alfanous,muslih/alfanous
src/alfanous-import/Downloader.py
src/alfanous-import/Downloader.py
#!/usr/bin/env python # coding: utf-8 ## Copyright (C) 2009-2012 Assem Chelli <assem.ch [at] gmail.com> ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU Affero General Public License as published by ## the Free Software Foundation, either version...
#!/usr/bin/env python # coding: utf-8 ## Copyright (C) 2009-2012 Assem Chelli <assem.ch [at] gmail.com> ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU Affero General Public License as published by ## the Free Software Foundation, either version...
agpl-3.0
Python
d6c7cebdf0d209ead671754f06ad7e8b23894fd0
Modify assertion to make it more performant
raviqqe/shakyo
xorcise/line.py
xorcise/line.py
import text_unidecode import unicodedata from .character import Character class Line: """ A immutable class which represents one-line text on console. """ SPACES_PER_TAB = 4 ASCIIZE = False def __init__(self, *chars): assert all(isinstance(char, Character) for char in chars) self.__chars = cha...
import text_unidecode import unicodedata from .character import Character class Line: """ A immutable class which represents one-line text on console. """ SPACES_PER_TAB = 4 ASCIIZE = False def __init__(self, *chars): assert all(map(lambda char: isinstance(char, Character), chars)) self.__char...
unlicense
Python
a4b0a707c7da6c18b29e3a1863d6889b8e3f205b
Remove assumption about by elections
DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative
ynr/apps/sopn_parsing/helpers/extract_pages.py
ynr/apps/sopn_parsing/helpers/extract_pages.py
from official_documents.models import OfficialDocument from sopn_parsing.helpers.pdf_helpers import SOPNDocument from sopn_parsing.helpers.text_helpers import NoTextInDocumentError def extract_pages_for_ballot(ballot, manual_upload=False): """ Try to extract the page numbers for the latest SOPN document relat...
from official_documents.models import OfficialDocument from sopn_parsing.helpers.pdf_helpers import SOPNDocument from sopn_parsing.helpers.text_helpers import NoTextInDocumentError def extract_pages_for_ballot(ballot, manual_upload=False): """ Try to extract the page numbers for the latest SOPN document relat...
agpl-3.0
Python
d57844d1d6b2172fe196db4945517a5b3a68d343
Check explicit that next step is None
taedori81/satchless
satchless/process/__init__.py
satchless/process/__init__.py
class InvalidData(Exception): """ Raised for by step validation process """ pass class Step(object): """ A single step in a multistep process """ def validate(self): raise NotImplementedError() # pragma: no cover class ProcessManager(object): """ A multistep process ...
class InvalidData(Exception): """ Raised for by step validation process """ pass class Step(object): """ A single step in a multistep process """ def validate(self): raise NotImplementedError() # pragma: no cover class ProcessManager(object): """ A multistep process ...
bsd-3-clause
Python
221a84d52e5165013a5c7eb0b00c3ebcae294c8a
Add support for configuring data views and reports
Linaro/lava-server,OSSystems/lava-server,OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server
dashboard_app/extension.py
dashboard_app/extension.py
from lava_server.extension import LavaServerExtension class DashboardExtension(LavaServerExtension): @property def app_name(self): return "dashboard_app" @property def name(self): return "Dashboard" @property def main_view_name(self): return "dashboard_app.views.bund...
from lava_server.extension import LavaServerExtension class DashboardExtension(LavaServerExtension): @property def app_name(self): return "dashboard_app" @property def name(self): return "Dashboard" @property def main_view_name(self): return "dashboard_app.views.bund...
agpl-3.0
Python
0902194eb89b59f55f551d6597ff05364d64a175
Fix import
audiolion/django-shibauth-rit,audiolion/django-shibauth-rit
shibauth_rit/urls.py
shibauth_rit/urls.py
# -*- coding: utf-8 -*- # Third Party Library Imports from django.conf.urls import include, url from shibauth_rit.conf import settings # Local Imports from .views import ShibLoginView, ShibLogoutView, ShibView shibauth_urlpatterns = [ url(r'^login/$', ShibLoginView.as_view(), name='shibauth_login'), url(r'^l...
# -*- coding: utf-8 -*- # Third Party Library Imports from django.conf.urls import include, url # Local Imports from .views import ShibLoginView, ShibLogoutView, ShibView shibauth_urlpatterns = [ url(r'^login/$', ShibLoginView.as_view(), name='shibauth_login'), url(r'^logout/$', ShibLogoutView.as_view(), nam...
mit
Python
f23722f2dd7a14fc3164bab15e1c64c6998bc857
add paramenter
wbcustc/Vintageous,xushuwei202/Vintageous,himacro/Vintageous,himacro/Vintageous,guillermooo-forks/Vintageous,denim2x/Vintageous,wbcustc/Vintageous,zhangtuoparis13/Vintageous,zhangtuoparis13/Vintageous,guillermooo-forks/Vintageous,himacro/Vintageous,xushuwei202/Vintageous,guillermooo-forks/Vintageous,gerardroche/Vintage...
vi/sublime.py
vi/sublime.py
# An assortment of utilities. from contextlib import contextmanager @contextmanager def restoring_sels(view): old_sels = list(view.sel()) yield view.sel().clear() for s in old_sels: # XXX: If the buffer has changed in the meantime, this won't work well. view.sel().add(s) ...
# An assortment of utilities. from contextlib import contextmanager @contextmanager def restoring_sels(view): old_sels = list(view.sel()) yield view.sel().clear() for s in old_sels: # XXX: If the buffer has changed in the meantime, this won't work well. view.sel().add(s) ...
mit
Python
088fd3d8a3e9b801406a0ed9c79d4731f7da925d
Make Money picklable
suutari-ai/shoop,suutari/shoop,shawnadelic/shuup,hrayr-artunyan/shuup,shoopio/shoop,shoopio/shoop,suutari-ai/shoop,suutari/shoop,hrayr-artunyan/shuup,hrayr-artunyan/shuup,shoopio/shoop,suutari/shoop,shawnadelic/shuup,shawnadelic/shuup,suutari-ai/shoop
shoop/utils/money.py
shoop/utils/money.py
# This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from . import numbers class Money(numbers.UnitedDecimal): """ Money value with currency. ...
# This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from . import numbers class Money(numbers.UnitedDecimal): """ Money value with currency. ...
agpl-3.0
Python
a47a83abb4f3fa9f8fb3bbca1641bb8b1760a81b
Fix Ask plugin subdomain selector based on HTML update
mrnfrancesco/yass
yass/plugins.py
yass/plugins.py
# YASS, Yet Another Subdomainer Software # Copyright 2015-2019 Francesco Marano (@mrnfrancesco) and individual contributors. # # 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.apa...
# YASS, Yet Another Subdomainer Software # Copyright 2015-2019 Francesco Marano (@mrnfrancesco) and individual contributors. # # 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.apa...
apache-2.0
Python
8f36c0de7280169a7498303035fc88b6521f33e3
Add static/ url routing (which was somehow missing before, though working eroneously through the MEDIA_URL)
cellcounter/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,haematologic/cellcounter,haematologic/cellcounter,haematologic/cellcounter,cellcounter/cellcounter
cellcounter/urls.py
cellcounter/urls.py
from django.conf.urls import patterns, include, url from django.conf import settings from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from django.contrib.auth.views import login, logout from cellcounter.main...
from django.conf.urls import patterns, include, url from django.conf import settings from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from django.contrib.auth.views import login, logout from cellcounter.main...
mit
Python
2b8c2b980f5d6eb56ecf9ed18683118fe4483aaa
Update qutebrowser config
masa0x80/dotfiles,masa0x80/dotfiles,masa0x80/dotfiles,masa0x80/dotfiles
.qutebrowser/config.py
.qutebrowser/config.py
config.load_autoconfig() config.set('content.javascript.enabled', True, 'file://*') config.set('content.javascript.enabled', True, 'chrome://*/*') config.set('content.javascript.enabled', True, 'qute://*/*') c.messages.timeout = 5000 c.completion.shrink = True c.tabs.position = 'right' c.tabs.width = '8%' c.colors....
config.load_autoconfig() config.set('content.javascript.enabled', True, 'file://*') config.set('content.javascript.enabled', True, 'chrome://*/*') config.set('content.javascript.enabled', True, 'qute://*/*') c.messages.timeout = 5000 c.completion.shrink = True c.tabs.position = 'right' c.tabs.width = '8%' c.colors....
mit
Python
a24860784ef5b8b660b61dc736bb5c65dacdd0c5
Fix small bug in interactions where a primitive interaction would not have a name set.
Beskhue/enactive-agents,Beskhue/enactive-agents,Beskhue/enactive-agents
enactiveagents/model/interaction/interaction.py
enactiveagents/model/interaction/interaction.py
""" Model to hold interaction classes. """ class Interaction: def __init__(self, name): self.name = name def get_name(self): """ Get the name of this interaction. :return: The name of this interaction. """ return self.name def unwrap(self): raise No...
""" Model to hold interaction classes. """ class Interaction: def __init__(self, name): self.name = name def get_name(self): """ Get the name of this interaction. :return: The name of this interaction. """ return self.name def unwrap(self): raise No...
mit
Python
3179de70d95486b6f61ab092f1eb372922fb252e
Change base OAI Url
erinspace/scrapi,CenterForOpenScience/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,erinspace/scrapi,fabianvf/scrapi
scrapi/harvesters/utaustin.py
scrapi/harvesters/utaustin.py
""" Harvester for UTAustin for the SHARE project """ from __future__ import unicode_literals from scrapi.base import OAIHarvester class UTAustinHarvester(OAIHarvester): short_name = 'utaustin' long_name = 'University of Texas at Austin Digital Repository' url = 'https://repositories.lib.utexas.edu' ...
""" Harvester for UTAustin for the SHARE project """ from __future__ import unicode_literals from scrapi.base import OAIHarvester class UTAustinHarvester(OAIHarvester): short_name = 'utaustin' long_name = 'University of Texas at Austin Digital Repository' url = 'https://repositories.lib.utexas.edu' ...
apache-2.0
Python
09ce6071834931314bd7b2672ff941e5da224c9d
Add test for interface complete implementation
ZhukovAlexander/skiplist-python
skiplist-py/tests.py
skiplist-py/tests.py
import unittest import collections from skiplist import Skiplist, NIL from iterators import LevelNodeIterator, AllNodesIterator class DataStructTestCase(unittest.TestCase): def test_nil_always_false(self): self.assertFalse(NIL()) class InterfaceTestCase(unittest.TestCase): def test_interface_method...
import unittest from skiplist import Skiplist, NIL from iterators import LevelNodeIterator, AllNodesIterator class DataStructTestCase(unittest.TestCase): def test_nil_always_false(self): self.assertFalse(NIL()) class SkipListTestCase(unittest.TestCase): def test_insert(self): sl = Skiplist...
mit
Python
4e54b8b4f84f1b723f21d487c2a5d5b5bd54b369
use POST instead of GET to schedule builds on Jenkins
litl/leeroy,litl/leeroy
leeroy/jenkins.py
leeroy/jenkins.py
# Copyright 2012 litl, LLC. Licensed under the MIT license. import logging import requests build_path = "/job/{job_name}/buildWithParameters"\ "?GIT_BASE_REPO={git_base_repo}" \ "&GIT_HEAD_REPO={git_head_repo}" \ "&GIT_SHA1={git_sha1}" \ "&GITHUB_URL={github_url}" def get_jenkins_auth(app, repo_con...
# Copyright 2012 litl, LLC. Licensed under the MIT license. import requests build_path = "/job/{job_name}/buildWithParameters"\ "?GIT_BASE_REPO={git_base_repo}" \ "&GIT_HEAD_REPO={git_head_repo}" \ "&GIT_SHA1={git_sha1}" \ "&GITHUB_URL={github_url}" def get_jenkins_auth(app, repo_config): user ...
mit
Python
9e0629d916496908636fdff2a58cf8eb278a5b03
Fix bad method call in message.
kuujo/vertigo-python,kuujo/vertigo-python
src/main/resources/vertigo/message.py
src/main/resources/vertigo/message.py
# Copyright 2013 the original author or authors. # # 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 a...
# Copyright 2013 the original author or authors. # # 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 a...
apache-2.0
Python
3ff0d76f8509aade63f8392a676801a10cbf4741
fix pylint issues
scylladb/scylla-cluster-tests,scylladb/scylla-cluster-tests,scylladb/scylla-cluster-tests,scylladb/scylla-longevity-tests,scylladb/scylla-cluster-tests,scylladb/scylla-longevity-tests,scylladb/scylla-longevity-tests,scylladb/scylla-cluster-tests
unit_tests/lib/remoter_recorder.py
unit_tests/lib/remoter_recorder.py
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be usefu...
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be usefu...
agpl-3.0
Python
4ae831ccc5e8d6b0592d36a0ca450a48513a7990
fix bug at midnight
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
scripts/current/today_gust.py
scripts/current/today_gust.py
# Generate analysis of Peak Wind Gust import sys, os, random sys.path.append("../lib/") import iemplot import mx.DateTime now = mx.DateTime.now() from pyIEM import iemdb i = iemdb.iemdb() iem = i['iem'] # Compute normal from the climate database sql = """ select s.station, s.network, x(s.geom) as lon, y(s.geom) a...
# Generate analysis of Peak Wind Gust import sys, os, random sys.path.append("../lib/") import iemplot import mx.DateTime now = mx.DateTime.now() from pyIEM import iemdb i = iemdb.iemdb() iem = i['iem'] # Compute normal from the climate database sql = """ select s.station, s.network, x(s.geom) as lon, y(s.geom) a...
mit
Python
de0cfa15d04d040662dfce5e9354822caa435993
convert event to dict directly before saving
eventifyio/eventify,eventifyio/eventify,morissette/eventify
eventify/persist/__init__.py
eventify/persist/__init__.py
""" Persist Helper Module """ from __future__ import print_function from datetime import datetime import asyncio import asyncpg import json import os from eventify.exceptions import EventifySanityError async def persist_event(topic, event, pool): """ Track event to prevent duplication of work and potent...
""" Persist Helper Module """ from __future__ import print_function from datetime import datetime import asyncio import asyncpg import json import os from eventify.exceptions import EventifySanityError async def persist_event(topic, event, pool): """ Track event to prevent duplication of work and potent...
mit
Python
3a2f1d0eefdcc23bf063c603c81806098b1b4bb9
Add colored board to utils and commented enumeration
igormartire/esii
chess/core/utils.py
chess/core/utils.py
from chess.core.models import Piece o = Piece.NONE P = Piece.WHITE_PAWN B = Piece.WHITE_BISHOP N = Piece.WHITE_KNIGHT R = Piece.WHITE_ROOK Q = Piece.WHITE_QUEEN K = Piece.WHITE_KING p = Piece.BLACK_PAWN b = Piece.BLACK_BISHOP n = Piece.BLACK_KNIGHT r = Piece.BLACK_ROOK q = Piece.BLACK_QUEEN k = Piece.BLACK_KING INITI...
from chess.core.models import Piece o = Piece.NONE P = Piece.WHITE_PAWN B = Piece.WHITE_BISHOP N = Piece.WHITE_KNIGHT R = Piece.WHITE_ROOK Q = Piece.WHITE_QUEEN K = Piece.WHITE_KING p = Piece.BLACK_PAWN b = Piece.BLACK_BISHOP n = Piece.BLACK_KNIGHT r = Piece.BLACK_ROOK q = Piece.BLACK_QUEEN k = Piece.BLACK_KING INITI...
mit
Python
54f4afc320a579317694177f8ac0ef877876c333
Fix doc build with newer versions of sphinx.
ipython/ipython,ipython/ipython
docs/do_sphinx.py
docs/do_sphinx.py
#!/usr/bin/env python """Script to build documentation using Sphinx. """ import fileinput,os,sys def oscmd(c): os.system(c) # html manual. oscmd('sphinx-build -d build/doctrees source build/html') if sys.platform != 'win32': # LaTeX format. oscmd('sphinx-build -b latex -d build/doctrees source build/lat...
#!/usr/bin/env python """Script to build documentation using Sphinx. """ import fileinput,os,sys def oscmd(c): os.system(c) # html manual. oscmd('sphinx-build -d build/doctrees source build/html') if sys.platform != 'win32': # LaTeX format. oscmd('sphinx-build -b latex -d build/doctrees source build/lat...
bsd-3-clause
Python
9d07d5aab0f04ecd5bada6a39182ff87b628152a
update to 0.20.1
DeadSix27/python_cross_compile_script
packages/dependencies/gettext.py
packages/dependencies/gettext.py
{ 'repo_type' : 'archive', 'download_locations' : [ { 'url' : 'https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.xz', 'hashes' : [ { 'type' : 'sha256', 'sum' : '53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800' }, ], }, { 'url' : 'https://fossies.org/linux/misc/gettext-0.20.1.tar.xz', 'hashes...
{ 'repo_type' : 'archive', 'download_locations' : [ { 'url' : 'https://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.8.1.tar.xz', 'hashes' : [ { 'type' : 'sha256', 'sum' : '105556dbc5c3fbbc2aa0edb46d22d055748b6f5c7cd7a8d99f8e7eb84e938be4' }, ], }, { 'url' : 'https://fossies.org/linux/misc/gettext-0.19.8.1.tar.xz', 'ha...
mpl-2.0
Python
dca10d68df383fde3849f2753737155a262bc086
Support mongo replica set
pathwar/api.pathwar.net
pathwar_api/settings.py
pathwar_api/settings.py
import os from resources import DOMAIN # MAIL if 'SMTP_PORT_25_TCP_ADDR' in os.environ: MAIL_SERVER = os.environ['SMTP_PORT_25_TCP_ADDR'] MAIL_PORT = os.environ['SMTP_PORT_25_TCP_PORT'] MAIL_USE_TLS = False MAIL_USE_SSL = False MAIL_DEBUG = True MAIL_USERNAME = None MAIL_PASSWORD = None # FIXME: try to put a...
import os from resources import DOMAIN # MAIL if 'SMTP_PORT_25_TCP_ADDR' in os.environ: MAIL_SERVER = os.environ['SMTP_PORT_25_TCP_ADDR'] MAIL_PORT = os.environ['SMTP_PORT_25_TCP_PORT'] MAIL_USE_TLS = False MAIL_USE_SSL = False MAIL_DEBUG = True MAIL_USERNAME = None MAIL_PASSWORD = None # FIXME: try to put a...
mit
Python
0003ee31f78d7861713a2bb7daacb9701b26a1b9
Initialize osprofiler in WSGI application
Datera/cinder,phenoxim/cinder,mahak/cinder,openstack/cinder,j-griffith/cinder,Datera/cinder,j-griffith/cinder,mahak/cinder,openstack/cinder,phenoxim/cinder
cinder/wsgi/wsgi.py
cinder/wsgi/wsgi.py
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # di...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # di...
apache-2.0
Python
9eb73b3ba7b13ea1b0b877febf0c3f862f048104
Make queries framework-agnostic
alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api
app/main/views/frameworks.py
app/main/views/frameworks.py
from flask import jsonify from sqlalchemy.types import String from sqlalchemy import func import datetime from .. import main from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent @main.route('/frameworks', methods=['GET']) def list_frameworks(): frameworks = Fr...
from flask import jsonify from sqlalchemy.types import String from sqlalchemy import func import datetime from .. import main from ...models import db, Framework, DraftService, Service, User, Supplier, SelectionAnswers, AuditEvent @main.route('/frameworks', methods=['GET']) def list_frameworks(): frameworks = Fr...
mit
Python
34a1d596bafe5e42653e75640aa32ad132f7f68b
Fix botogram/objects/__init__.py
pietroalbini/botogram,pietroalbini/botogram
botogram/objects/__init__.py
botogram/objects/__init__.py
# Copyright (c) 2015-2017 The Botogram Authors (see AUTHORS) # # 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, mod...
# Copyright (c) 2015-2017 The Botogram Authors (see AUTHORS) # # 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, mod...
mit
Python
ffe5d9e59d69c1200e2893f9b9b565d683fb26b0
fix "TypeError: '>=' not supported between instances of 'NoneType' and 'int'"
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/export/utils.py
corehq/apps/export/utils.py
from __future__ import absolute_import from __future__ import unicode_literals from corehq.apps.accounting.utils import domain_has_privilege from corehq.privileges import EXCEL_DASHBOARD, DAILY_SAVED_EXPORT import six def is_occurrence_deleted(last_occurrences, app_ids_and_versions): is_deleted = True for a...
from __future__ import absolute_import from __future__ import unicode_literals from corehq.apps.accounting.utils import domain_has_privilege from corehq.privileges import EXCEL_DASHBOARD, DAILY_SAVED_EXPORT import six def is_occurrence_deleted(last_occurrences, app_ids_and_versions): is_deleted = True for a...
bsd-3-clause
Python
a94c4fd87c86a6c5650d4a51a9ddd07b07b1cd09
Bump globus-sdk requirement to 3.5.0
pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus
packages/pegasus-worker/setup.py
packages/pegasus-worker/setup.py
import os import subprocess from setuptools import find_packages, setup src_dir = os.path.dirname(__file__) home_dir = os.path.abspath(os.path.join(src_dir, "../..")) install_requires = [ "six>=1.9.0", "boto3>1.12", "globus-sdk>=3.5.0", ] # # Utility function to read the pegasus Version.in file # def r...
import os import subprocess from setuptools import find_packages, setup src_dir = os.path.dirname(__file__) home_dir = os.path.abspath(os.path.join(src_dir, "../..")) install_requires = [ "six>=1.9.0", "boto3>1.12", "globus-sdk>=3.1.0", ] # # Utility function to read the pegasus Version.in file # def r...
apache-2.0
Python
6e0a7fe8a2479d7f12c2d9c24168ddfe8ebe52b1
Add unit tests in persisten_dict_test.py
graveljp/smugcli
persistent_dict_test.py
persistent_dict_test.py
from os import path import json from parameterized import parameterized import persistent_dict import shutil import tempfile import unittest class TestPersistentDict(unittest.TestCase): def setUp(self): self._test_dir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self._test_dir) def test_non...
from os import path import json import persistent_dict import shutil import tempfile import unittest class TestPersistentDict(unittest.TestCase): def setUp(self): self._test_dir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self._test_dir) def test_non_existing_file(self): filename = path...
mit
Python
6bb7310bbe0d68912e19f65fafa54a7c7047160e
Fix cli version to be 3.9.4
twosigma/Cook,twosigma/Cook,twosigma/Cook
cli/cook/version.py
cli/cook/version.py
VERSION = '3.9.4'
VERSION = '3.9.4-SNAPSHOT'
apache-2.0
Python
8f3d4d6fa73ac77ea3bef95bdc683debffc69ee3
Add __future__.
AdamGagorik/pydarkstar,LegionXI/pydarkstar
pydarkstar/__init__.py
pydarkstar/__init__.py
from __future__ import absolute_import __version__ = 0.1 import pydarkstar.logutils import logging pydarkstar.logutils.setError() try: import sqlalchemy except ImportError as e: logging.exception(e.__class__.__name__) logging.error('pip install sqlalchemy') exit(-1) try: import pymysql except Im...
__version__ = 0.1 import pydarkstar.logutils import logging pydarkstar.logutils.setError() try: import sqlalchemy except ImportError as e: logging.exception(e.__class__.__name__) logging.error('pip install sqlalchemy') exit(-1) try: import pymysql except ImportError as e: logging.exception(e...
mit
Python
7175943932822d0e46603472ff40e90b168f4f8b
Bump development version
mistalaba/djangocms-blog,marty3d/djangocms-blog,motleytech/djangocms-blog,DjangoBeer/djangocms-blog,nephila/djangocms-blog,kriwil/djangocms-blog,nephila/djangocms-blog,kriwil/djangocms-blog,britny/djangocms-blog,marty3d/djangocms-blog,nephila/djangocms-blog,jedie/djangocms-blog,skirsdeda/djangocms-blog,dapeng0802/djang...
djangocms_blog/__init__.py
djangocms_blog/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Iacopo Spalletti' __email__ = 'i.spalletti@nephila.it' __version__ = '0.3.0.c1'
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Iacopo Spalletti' __email__ = 'i.spalletti@nephila.it' __version__ = '0.3.0.b3'
bsd-3-clause
Python
08c1da985e8e07d9df6db96fb621c144297ace08
print request URL for debugging
djw8605/cvmfs,Moliholy/cvmfs,MicBrain/cvmfs,reneme/cvmfs,djw8605/cvmfs,trshaffer/cvmfs,reneme/cvmfs,alhowaidi/cvmfsNDN,DrDaveD/cvmfs,MicBrain/cvmfs,reneme/cvmfs,cvmfs/cvmfs,Gangbiao/cvmfs,cvmfs/cvmfs,Moliholy/cvmfs,DrDaveD/cvmfs,DrDaveD/cvmfs,MicBrain/cvmfs,MicBrain/cvmfs,cvmfs/cvmfs,reneme/cvmfs,cvmfs-testing/cvmfs,Dr...
cvmfs/webapi/cvmfs-api.wsgi
cvmfs/webapi/cvmfs-api.wsgi
#! /usr/bin/env python import os, sys, re import cvmfs_api pattern = re.compile('^/([^/]*)/(v[^/]*)/([^/]*)/(.*)$') def application(environ, start_response): request_url = environ['PATH_INFO'] match_result = pattern.search(request_url) if not match_result: return cvmfs_api.bad_request(start_res...
#! /usr/bin/env python import os, sys, re import cvmfs_api pattern = re.compile('^/([^/]*)/(v[^/]*)/([^/]*)/(.*)$') def application(environ, start_response): match_result = pattern.search(environ['PATH_INFO']) if not match_result: return cvmfs_api.bad_request(start_response, 'malformed api URL') repo_...
bsd-3-clause
Python
6b9674f9ffc928d7a734a8e42437982ab719ba5f
Remove url
martindisch/Bot
urlbot.py
urlbot.py
import os, sys, urllib savepath = 'urldata/' urlspath = savepath + 'urls.txt' def getChanges(): errormsg = '%s: No such file or directory' for path in savepath, urlspath: if not os.path.exists(path): print errormsg % path sys.exit(0) urlfile = open(urlspath, 'r').readlines(...
import os, sys, urllib savepath = 'urldata/' urlspath = savepath + 'urls.txt' def getChanges(): errormsg = '%s: No such file or directory' for path in savepath, urlspath: if not os.path.exists(path): print errormsg % path sys.exit(0) urlfile = open(urlspath, 'r').readlines(...
mit
Python
49f68e7232d143f28d9fcaf963270c567f122ebc
adjust finish message
ohumbel/rtc2git,cwill747/rtc2git,akchinSTC/rtc2git,jacobilsoe/rtc2git,rtcTo/rtc2git,WtfJoke/rtc2git
migration.py
migration.py
import os import sys from rtcFunctions import ImportHandler from rtcFunctions import WorkspaceHandler from rtcFunctions import RTCInitializer from gitFunctions import Initializer, Differ from gitFunctions import Commiter import configuration import shouter def initialize(): config = configuration.get() direc...
import os import sys from rtcFunctions import ImportHandler from rtcFunctions import WorkspaceHandler from rtcFunctions import RTCInitializer from gitFunctions import Initializer, Differ from gitFunctions import Commiter import configuration import shouter def initialize(): config = configuration.get() direc...
mit
Python
f6f16d006d2f61385b1ba1aca3b5d185d225ecb5
add a function to trim to a specific length strings by removing characters from left side.
enthought/pikos,enthought/pikos,enthought/pikos
pikos/_internal/util.py
pikos/_internal/util.py
import inspect def is_context_manager(obj): """ Check if the obj is a context manager """ # FIXME: this should work for now. return hasattr(obj, '__enter__') and hasattr(obj, '__exit__') def trim_left(value, max_length): """ Trim the left side of the string so that the lenght is at most max_length. ...
import inspect def is_context_manager(obj): """ Check if the obj is a context manager """ # FIXME: this should work for now. return hasattr(obj, '__enter__') and hasattr(obj, '__exit__')
bsd-3-clause
Python
c0731a5ade7b6c71ecfeb30bbc6ef1a1e8666759
fix location of configure
simbuerg/benchbuild,simbuerg/benchbuild
benchbuild/projects/benchbuild/tcc.py
benchbuild/projects/benchbuild/tcc.py
from benchbuild.project import wrap from benchbuild.projects.benchbuild.group import BenchBuildGroup from benchbuild.utils.compiler import lt_clang from benchbuild.utils.downloader import Wget from benchbuild.utils.run import run from plumbum import local from benchbuild.utils.cmd import make, mkdir, tar from os impo...
from benchbuild.project import wrap from benchbuild.projects.benchbuild.group import BenchBuildGroup from benchbuild.utils.compiler import lt_clang from benchbuild.utils.downloader import Wget from benchbuild.utils.run import run from plumbum import local from benchbuild.utils.cmd import make, mkdir, tar from os impo...
mit
Python
85fe5cf48790d320d671e47296110d4b36fffd0a
Increase sitemap priority for collections
NeuroVault/NeuroVault,chrisfilo/NeuroVault,NeuroVault/NeuroVault,NeuroVault/NeuroVault,NeuroVault/NeuroVault,chrisfilo/NeuroVault,chrisfilo/NeuroVault,NeuroVault/NeuroVault,chrisfilo/NeuroVault,chrisfilo/NeuroVault
neurovault/api/sitemap.py
neurovault/api/sitemap.py
from django.contrib.sitemaps import Sitemap from django.db.models.aggregates import Count from neurovault.apps.statmaps.models import Image, Collection, \ CognitiveAtlasTask, StatisticMap class BaseSitemap(Sitemap): priority = 0.5 limit = 5000 def lastmod(self, obj): return obj.modify_date ...
from django.contrib.sitemaps import Sitemap from django.db.models.aggregates import Count from neurovault.apps.statmaps.models import Image, Collection, \ CognitiveAtlasTask, StatisticMap class BaseSitemap(Sitemap): priority = 0.5 limit = 5000 def lastmod(self, obj): return obj.modify_date ...
mit
Python
29168bcfdce8058a8dbb850e98b2960fcad5f5d7
Simplify urls.py.
1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow
oneflow/landing/urls.py
oneflow/landing/urls.py
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ urlpatterns = patterns( 'oneflow.landing.views', url(r'^$', 'home', name='landing_home'), url(_(r'^thanks/(?P<already_registered>\w+)?$'), 'thanks', name='landing_thanks'), )
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ import views urlpatterns = patterns( 'oneflow.landing', url(r'^$', views.home, name='landing_home'), url(_(r'^thanks/(?P<already_registered>\w+)?$'), views.thanks, name='landi...
agpl-3.0
Python
d53b10b8f638a368b45c4a541a123837ed87bbc0
fix zkbreaker
hubo1016/vlcp,hubo1016/vlcp,hubo1016/vlcp,hubo1016/vlcp
misc/zkbreaker.py
misc/zkbreaker.py
''' Created on 2016/10/25 :author: hubo ''' from vlcp.config import config from vlcp.protocol.zookeeper import ZooKeeper import vlcp.protocol.zookeeper from random import random from vlcp.event.core import syscall_clearqueue from logging import getLogger _logger = getLogger(__name__) @config('protocol.zookeeper')...
''' Created on 2016/10/25 :author: hubo ''' from vlcp.config import config from vlcp.protocol.zookeeper import ZooKeeper import vlcp.protocol.zookeeper from random import random from vlcp.event.core import syscall_clearqueue from logging import getLogger _logger = getLogger(__name__) @config('zookeeper') class Br...
apache-2.0
Python
f16acaed9a2c3480cba7bc833cd57a1e78f0d564
switch to relative import
texastribune/armstrong.hatband,texastribune/armstrong.hatband,texastribune/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband
armstrong/hatband/options.py
armstrong/hatband/options.py
from django.contrib import admin from django.db import models from . import widgets RICH_TEXT_DBFIELD_OVERRIDES = { models.TextField: {'widget': widgets.RichTextWidget}, } class ModelAdmin(admin.ModelAdmin): formfield_overrides = RICH_TEXT_DBFIELD_OVERRIDES class StackedInline(admin.StackedInline): for...
from django.contrib import admin from django.db import models from armstrong.hatband import widgets RICH_TEXT_DBFIELD_OVERRIDES = { models.TextField: {'widget': widgets.RichTextWidget}, } class ModelAdmin(admin.ModelAdmin): formfield_overrides = RICH_TEXT_DBFIELD_OVERRIDES class StackedInline(admin.Stacked...
apache-2.0
Python
d4dafbce2f88194026d04039722c30eff650cdbe
set default suffix
alexis-roche/nireg,bthirion/nipy,alexis-roche/niseg,alexis-roche/nireg,alexis-roche/nipy,arokem/nipy,nipy/nireg,alexis-roche/register,arokem/nipy,bthirion/nipy,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/nipy,alexis-roche/nipy,alexis-roche/niseg,nipy/nireg,alexis-roche/register,alexis-roche/register,nipy/nipy-labs,bt...
lib/data/cache.py
lib/data/cache.py
""" Create and destroy a per-process cache. """ import tempfile, atexit, shutil suffix = 'nipy' dirname = tempfile.mkdtemp(suffix=suffix) def cleanup(): """ Delete the nipy cache directory neuroimaging.cache.dirname, registered with atexit. """ shutil.rmtree(dirname, ignore_errors=True) def cached()...
""" Create and destroy a per-process cache. """ import tempfile, atexit, shutil suffix = '' dirname = tempfile.mkdtemp(suffix=suffix) def cleanup(): """ Delete the nipy cache directory neuroimaging.cache.dirname, registered with atexit. """ shutil.rmtree(dirname, ignore_errors=True) def cached(): ...
bsd-3-clause
Python
bfd9f14bf0c9317fe776b81a4193f117e08b2d40
Fix static path
webkom/noetikon,webkom/noetikon
noetikon/settings/base.py
noetikon/settings/base.py
""" Django settings for noetikon project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
""" Django settings for noetikon project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
mit
Python
a0afd17209f284eb76b2e6e0893f58de8ff6b596
remove pprint
Florents-Tselai/PyPocketExplore
pypocketexplore/api.py
pypocketexplore/api.py
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- __author__ = 'Florents Tselai' from flask import Flask, jsonify, request from .parser import PocketTopicScraper from pprint import pprint from pypocketexplore.config import MONGO_URI from redis import StrictRedis from pymongo import MongoClient from rq import Queue fr...
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- __author__ = 'Florents Tselai' from flask import Flask, jsonify, request from .parser import PocketTopicScraper from pprint import pprint from pypocketexplore.config import MONGO_URI from redis import StrictRedis from pymongo import MongoClient from rq import Queue fr...
mit
Python
ef50e82c3c1f49d63d013ac538d932d40c430a46
Handle import error on older python versions
crashmaster/pyradiator
pyradiator/endpoint.py
pyradiator/endpoint.py
try: import queue except ImportError: import Queue import threading class Producer(object): def __init__(self, period_in_seconds, queue, function): self._period_in_seconds = period_in_seconds self._queue = queue self._function = function self._event = threading.Event() ...
import queue import threading class Producer(object): def __init__(self, period_in_seconds, queue, function): self._period_in_seconds = period_in_seconds self._queue = queue self._function = function self._event = threading.Event() self._thread = threading.Thread(target=se...
mit
Python
91556f15e64f2407d77ab6ea35d74abccc9f1984
Add functionality to build the DMCColors set.
nanaze/pystitch,nanaze/pystitch
pystitch/dmc_colors.py
pystitch/dmc_colors.py
import csv import os import color def _GetDataDirPath(): return os.path.join(os.path.dirname(__file__), 'data') def _GetCsvPath(): return os.path.join(_GetDataDirPath(), 'dmccolors.csv') def _GetCsvString(): with open(_GetCsvPath()) as f: return f.read().strip() def _CreateDmcColorFromRow(row): number =...
import csv import os import color def _GetDataDirPath(): return os.path.join(os.path.dirname(__file__), 'data') def _GetCsvPath(): return os.path.join(_GetDataDirPath(), 'dmccolors.csv') def _GetCsvString(): with open(_GetCsvPath()) as f: return f.read().strip() def _CreateDmcColorFromRow(row): print ro...
apache-2.0
Python
2df25228329d61d638d1764e11ea75d6e8ee7a4b
Add missing sleep in wotd plugin
ningirsu/taemin,ningirsu/taemin
taemin/plugins/wotd/plugin.py
taemin/plugins/wotd/plugin.py
""" Send a new ord every day """ import csv import os import threading import datetime import time import random from taemin import plugin class WOTDCron(threading.Thread): """ Thread which send a word every day """ def __init__(self, wotd_plugin): super().__init__() self.wotd_plugin = wotd_...
""" Send a new ord every day """ import csv import os import threading import datetime import time import random from taemin import plugin class WOTDCron(threading.Thread): """ Thread which send a word every day """ def __init__(self, wotd_plugin): super().__init__() self.wotd_plugin = wotd_...
mit
Python
a8712209948d42baab108296343193fe06d14044
add deps to setup
tikitu/dripfeed
dripfeed/setup.py
dripfeed/setup.py
# -*- coding: utf-8 -*- import re import sys from setuptools import setup from setuptools.command.test import test as TestCommand REQUIRES = [ 'docopt', 'simplejson', 'portalocker', 'requests', 'lxml', 'feedparser', 'PyRSS2Gen', ] class PyTest(TestCommand): def finalize_options(self):...
# -*- coding: utf-8 -*- import re import sys from setuptools import setup from setuptools.command.test import test as TestCommand REQUIRES = [ 'docopt', 'simplejson', 'portalocker', 'requests', 'lxml', ] class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_optio...
mit
Python
3f3eb9ee504045a5dfa6d3d6f673c14640c4856e
Update the docs since we've moved them back to the colo
teodesson/Bookie,bookieio/Bookie,wangjun/Bookie,GreenLunar/Bookie,pombredanne/Bookie,bookieio/Bookie,GreenLunar/Bookie,wangjun/Bookie,adamlincoln/Bookie,skmezanul/Bookie,adamlincoln/Bookie,teodesson/Bookie,GreenLunar/Bookie,skmezanul/Bookie,pombredanne/Bookie,skmezanul/Bookie,pombredanne/Bookie,skmezanul/Bookie,GreenLu...
Bookie/fabfile/docs.py
Bookie/fabfile/docs.py
from fabric.api import local, hosts from fabric.contrib.project import rsync_project docs_host = 'rharding@bmark.us' docs_location = '/home/bmark.us/www' def build_docs(clean="no", browse="no"): """Run the sphinx build on the docs""" if clean.lower() in ["yes", "y"]: c_flag = "clean " else: ...
from fabric.api import local, hosts from fabric.contrib.project import rsync_project docs_host = 'ubuntu@bmark' docs_location = '/var/www/' def build_docs(clean="no", browse="no"): """Run the sphinx build on the docs""" if clean.lower() in ["yes", "y"]: c_flag = "clean " else: c_flag = "" ...
agpl-3.0
Python
10f6ef4a9c5a5ddf3223d3063703e3baa4c6f0cf
Set higher bound on Tensorflow_Datasets due to https://github.com/tensorflow/datasets/issues/2199
GoogleCloudPlatform/tensorflow-gcp-tools
python/dependencies.py
python/dependencies.py
# Lint as: python3 # Copyright 2020 Google LLC. 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 ...
# Lint as: python3 # Copyright 2020 Google LLC. 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 ...
apache-2.0
Python
dd34649a8c268455a8330849a28826eb8be01c83
make sure gsm vdd gpio is unexported
contactless/wirenboard,contactless/wirenboard,contactless/wirenboard,contactless/wirenboard,contactless/wirenboard,contactless/wirenboard,contactless/wirenboard
examples/test_suite/wb5_func_test/wb5_modrtc.py
examples/test_suite/wb5_func_test/wb5_modrtc.py
# coding: utf-8 import os import unittest import subprocess import time import datetime from gpio import GPIO class TestModGSMRTC(unittest.TestCase): rtc_root = "/sys/class/rtc/rtc0" GSM_POWER_GPIO = 17 @staticmethod def _enable_rtc(): subprocess.call("wb-hwconf-helper init wb55-gsm wb56-mod...
# coding: utf-8 import os import unittest import subprocess import time import datetime from gpio import GPIO class TestModGSMRTC(unittest.TestCase): rtc_root = "/sys/class/rtc/rtc0" GSM_POWER_GPIO = 17 @staticmethod def _enable_rtc(): subprocess.call("wb-hwconf-helper init wb55-gsm wb56-mod...
mit
Python
0cb2ba0affa379b42930c4af0bef1d57a78b83ce
add numpy 1.13 legacy print option to test_doc.py
PyWavelets/pywt,PyWavelets/pywt,rgommers/pywt,grlee77/pywt,grlee77/pywt,rgommers/pywt,rgommers/pywt,rgommers/pywt
pywt/tests/test_doc.py
pywt/tests/test_doc.py
from __future__ import division, print_function, absolute_import import doctest import glob import os import unittest try: import numpy as np np.set_printoptions(legacy='1.13') except TypeError: pass pdir = os.path.pardir docs_base = os.path.abspath(os.path.join(os.path.dirname(__file__), ...
from __future__ import division, print_function, absolute_import import doctest import glob import os import unittest pdir = os.path.pardir docs_base = os.path.abspath(os.path.join(os.path.dirname(__file__), pdir, pdir, "doc", "source")) files = glob.glob(os.path.join(docs_base, "*.rst")...
mit
Python
66530bf58dabcc842dc3bf73190f549c8c543df5
Use a queryset iterator for choices
blancltd/blanc-basic-assets
blanc_basic_assets/fields.py
blanc_basic_assets/fields.py
from itertools import groupby from django.db import models from django.forms.models import ModelChoiceField, ModelChoiceIterator class GroupedModelChoiceField(ModelChoiceField): def __init__(self, queryset, group_by_field='category', group_label=None, *args, **kwargs): """ group_by_field is the n...
from itertools import groupby from django.db import models from django.forms.models import ModelChoiceField, ModelChoiceIterator class GroupedModelChoiceField(ModelChoiceField): def __init__(self, queryset, group_by_field='category', group_label=None, *args, **kwargs): """ group_by_field is the n...
bsd-3-clause
Python
fd28c8806b6f3805194a37df2b8b95f7b076ce74
Fix LearnedPositionalEmbedding
pytorch/fairseq,pytorch/fairseq,pytorch/fairseq
fairseq/modules/learned_positional_embedding.py
fairseq/modules/learned_positional_embedding.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # import torch from torch.autograd...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # import torch from torch.autograd...
mit
Python
511a133599b86deae83d9ad8a3f7a7c5c45e07bf
Clear the contact form after it has been successfully posted.
PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari
core/views.py
core/views.py
from django.shortcuts import render from django.http import Http404 from django.contrib.messages import success from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page from .models import HomePage, StaticPage from category.models import Category from .forms import ContactFo...
from django.shortcuts import render from django.http import Http404 from django.contrib.messages import success from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page from .models import HomePage, StaticPage from category.models import Category from .forms import ContactFo...
bsd-3-clause
Python
4cd57a7523eb8f1eedf68db562e089346e1bf56f
Fix Typo
seatgeek/businesstime
businesstime/holidays/usa.py
businesstime/holidays/usa.py
import datetime from businesstime.holidays import Holidays class USFederalHolidays(Holidays): """ List from http://www.opm.gov/policy-data-oversight/snow-dismissal-procedures/federal-holidays/ """ rules = [ dict(name="New Year's Day", month=1, day=1), dict(name="Birthday of Martin Lut...
import datetime from businesstime.holidays import Holidays class USFederalHolidays(Holidays): """ List from http://www.opm.gov/policy-data-oversight/snow-dismissal-procedures/federal-holidays/ """ rules = [ dict(name="New Year's Day", month=1, day=1), dict(name="Birthday of Martin Lut...
bsd-2-clause
Python
edbd20a23ad9cc8bfc07ddb5b40a9a00a4649dd2
Fix url in setup.py and add license
SpotlightKid/micropython-stm-lib
picoredis/setup.py
picoredis/setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name='picoredis', version='0.1.0', description='A very minimal Python Redis client library (not only) for MicroPython', author='Christopher Arndt', author_email='chris@chrisarndt.de', license='MIT...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name='picoredis', version='0.1.0', description='A very minimal Python Redis client library (not only) for MicroPython', author='Christopher Arndt', author_email='chris@chrisarndt.de', url='https:/...
mit
Python
6cd682c288efca04748234081ce452bdf5f1970a
Deal with the case when the leap days cause a date outside the vanilla date range.
jwg4/calexicon,jwg4/qual
calexicon/internal/julian.py
calexicon/internal/julian.py
from datetime import date as vanilla_date, timedelta from ..constants import number_of_days_in_400_gregorian_years from .gregorian import is_gregorian_leap_year from .exception import InvalidDate def _number_of_extra_leap_days(end, start=vanilla_date(200, 3, 1)): count = 0 for x in range(start.year, end.yea...
from datetime import date as vanilla_date, timedelta from .gregorian import is_gregorian_leap_year from .exception import InvalidDate def _number_of_extra_leap_days(end, start=vanilla_date(200, 3, 1)): count = 0 for x in range(start.year, end.year + 1, 100): if not is_gregorian_leap_year(x): ...
apache-2.0
Python
844e7cd21d0a01bf54767f1d0310b2113b4ce910
Add remote browser (#18)
elliterate/capybara.py,elliterate/capybara.py,elliterate/capybara.py
capybara/selenium/browser.py
capybara/selenium/browser.py
from selenium import webdriver def get_browser(browser_name, capabilities=None, **options): """ Returns an instance of the given browser with the given capabilities. Args: browser_name (str): The name of the desired browser. capabilities (Dict[str, str | bool], optional): The desired capa...
from selenium import webdriver def get_browser(browser_name, capabilities=None, **options): """ Returns an instance of the given browser with the given capabilities. Args: browser_name (str): The name of the desired browser. capabilities (Dict[str, str | bool], optional): The desired capa...
mit
Python
cb7d1f67f384089fea96a25db32b1747a20ce043
Test that we're loading all uic objects for PyQt5 and PyQt4
goanpeca/qtpy,davvid/qtpy,goanpeca/qtpy,spyder-ide/qtpy,davvid/qtpy
qtpy/tests/test_uic.py
qtpy/tests/test_uic.py
import os import sys import contextlib from qtpy import QtWidgets from qtpy.QtWidgets import QComboBox from qtpy import uic from qtpy.uic import loadUi QCOMBOBOX_SUBCLASS = """ from qtpy.QtWidgets import QComboBox class _QComboBoxSubclass(QComboBox): pass """ @contextlib.contextmanager def enabled_qcombobox_sub...
import os import sys import contextlib from qtpy import QtWidgets from qtpy.QtWidgets import QComboBox from qtpy.uic import loadUi QCOMBOBOX_SUBCLASS = """ from qtpy.QtWidgets import QComboBox class _QComboBoxSubclass(QComboBox): pass """ @contextlib.contextmanager def enabled_qcombobox_subclass(tmpdir): ""...
mit
Python
7831cd93b4085f261858b5f73dfc398b2f3f84dd
simplify compare
slackapi/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient,slackhq/python-slackclient
slackclient/_user.py
slackclient/_user.py
class User(object): def __init__(self, server, name, user_id, real_name, tz): self.tz = tz self.name = name self.real_name = real_name self.server = server self.id = user_id def __eq__(self, compare_str): if compare_str in (self.id, self.name): return...
class User(object): def __init__(self, server, name, user_id, real_name, tz): self.tz = tz self.name = name self.real_name = real_name self.server = server self.id = user_id def __eq__(self, compare_str): if self.id == compare_str or self.name == compare_str: ...
mit
Python
7cb68f6a749a38fef9820004a857e301c12a3044
Fix in-place os.walk() dirs modification
mcgid/morenines,mcgid/morenines
morenines/util.py
morenines/util.py
import os import hashlib def get_files(index): paths = [] for dirpath, dirnames, filenames in os.walk(index.headers['root_path']): # Remove ignored directories dirnames[:] = [d for d in dirnames if not index.ignores.match(d)] for filename in (f for f in filenames if not index.ignores...
import os import hashlib from fnmatch import fnmatchcase def get_files(index): paths = [] for dirpath, dirnames, filenames in os.walk(index.headers['root_path']): # Remove ignored directories dirnames = [d for d in dirnames if not index.ignores.match(d)] for filename in (f for f in ...
mit
Python
8b40e844ec53b6d5641e94cd614066a299858f33
Improve comment.
morepath/morepath,faassen/morepath,taschini/morepath
morepath/setup.py
morepath/setup.py
from .app import global_app from .config import Config import morepath.directive from morepath import generic from .error import LinkError from .app import App from .request import Request, Response from .traject import traject_consumer import morepath from reg import Lookup assert morepath.directive # we need to mak...
from .app import global_app from .config import Config import morepath.directive from morepath import generic from .error import LinkError from .app import App from .request import Request, Response from .traject import traject_consumer import morepath from reg import Lookup assert morepath.directive # we need to mak...
bsd-3-clause
Python
52e024d00191af2992f7f8fb49cd618b90fc448e
rename APIRoot router
EBI-Metagenomics/emgapi,EBI-Metagenomics/emgapi,EBI-Metagenomics/emgapi,EBI-Metagenomics/emgapi,EBI-Metagenomics/emgapi
emgcli/routers.py
emgcli/routers.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 EMBL - European Bioinformatics Institute # # 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/LICEN...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 EMBL - European Bioinformatics Institute # # 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/LICEN...
apache-2.0
Python