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
bf73d6d050f3ebbc3f090bb7fc4925c0c8ba9d99
Add timeout functionality to frog parsing
NLeSC/cptm,NLeSC/cptm
cptm/utils/frog.py
cptm/utils/frog.py
from pynlpl.clients.frogclient import FrogClient import logging import re import sys import signal logger = logging.getLogger(__name__) logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO) def get_frogclient(port=8020): try: frogclient = FrogClient('localhost', port) retu...
from pynlpl.clients.frogclient import FrogClient import logging import re import sys logger = logging.getLogger(__name__) logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO) def get_frogclient(port=8020): try: frogclient = FrogClient('localhost', port) return frogclient ...
apache-2.0
Python
f663c6ad7f5aa99b0486711ffe65cf450c23121b
Update maintenance/admin.py
steingrd/django-maintenance
maintenance/admin.py
maintenance/admin.py
from django.contrib import admin from models import Maintenance, MaintenanceFilter class MaintenanceFilterInline(admin.TabularInline): model = MaintenanceFilter class MaintenanceAdmin(admin.ModelAdmin): list_display = ('start_time', 'end_time', 'enabled') list_filter = ('start_time', 'end_time', 'enabled...
from django.contrib import admin from models import Maintenance, MaintenanceFilter class MaintenanceFilterInline(admin.StackedInline): model = MaintenanceFilter class MaintenanceAdmin(admin.ModelAdmin): list_display = ('start_time', 'end_time', 'enabled') list_filter = ('start_time', 'end_time', 'enabled...
bsd-3-clause
Python
f393619eaa6ee1508ed324adb1b88f421e55f92f
Bump version number
nabla-c0d3/nassl,nabla-c0d3/nassl,nabla-c0d3/nassl
nassl/__init__.py
nassl/__init__.py
__author__ = "Alban Diquet" __version__ = "4.0.1"
__author__ = "Alban Diquet" __version__ = "4.0.1b0"
agpl-3.0
Python
9597c8bc27be7ca44d503facb6a0cf3dfe76bcc3
Revert prior change to request timeout
OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops
nc/prime_cache.py
nc/prime_cache.py
#!/usr/bin/env python import argparse import logging import requests import urllib from django.core.urlresolvers import reverse logger = logging.getLogger(__name__) ENDPOINTS = ('stops', 'stops_by_reason', 'use_of_force', 'searches', 'contraband_hit_rate') def run(root, host=None): headers = dict() if host...
#!/usr/bin/env python import argparse import logging import requests import urllib from django.core.urlresolvers import reverse logger = logging.getLogger(__name__) ENDPOINTS = ('stops', 'stops_by_reason', 'use_of_force', 'searches', 'contraband_hit_rate') def run(root, host=None): headers = dict() if host...
mit
Python
8bdb5850a5318f1f6196d4800c7c1582caa9fcf4
Fix config
Gr1N/rpihelper,Gr1N/rpihelper
rpihelper/config.py
rpihelper/config.py
# -*- coding: utf-8 -*- import os import yaml from flask import Flask as BaseFlask, Config as BaseConfig from rpihelper.utils import make_dir, INSTANCE_FOLDER_PATH __all__ = ( 'Flask', ) class Config(BaseConfig): """ Flask config enhanced with a `from_yaml` method. """ def __init__(self, *ar...
# -*- coding: utf-8 -*- import os import yaml from flask import Flask as BaseFlask, Config as BaseConfig from rpihelper.utils import make_dir, INSTANCE_FOLDER_PATH __all__ = ( 'Flask', ) class Config(BaseConfig): """ Flask config enhanced with a `from_yaml` method. """ def __init__(self, *ar...
mit
Python
ab946a092d47fb99bfd08271cfcceed6dcc84f65
update version
theno/ctutlz,theno/ctutlz
ctutlz/_version.py
ctutlz/_version.py
__version__ = "0.8.3"
__version__ = "0.8.2"
mit
Python
ea269437fef6901920e74227e0706d10fb03e85c
bump to 1.0.5
alfredodeza/ceph-doctor
ceph_medic/__init__.py
ceph_medic/__init__.py
from collections import namedtuple class UnloadedConfig(object): """ This class is used as the default value for config.ceph so that if a configuration file is not successfully loaded then it will give a nice error message when values from the config are used. """ def __init__(self, error=None...
from collections import namedtuple class UnloadedConfig(object): """ This class is used as the default value for config.ceph so that if a configuration file is not successfully loaded then it will give a nice error message when values from the config are used. """ def __init__(self, error=None...
mit
Python
9a68fb81e252ecc852525f08b2dc4895c4bd6439
remove a useless double quote in the div content
starikan/pandas-highcharts,albahnsen/pandas-highcharts,gtnx/pandas-highcharts,spookylukey/pandas-highcharts
pandas_highcharts/display.py
pandas_highcharts/display.py
# -*- coding: utf-8 -*- """Functions to quickly display charts in a Notebook. """ import string import random from IPython.core import getipython from IPython.core.display import display, HTML from core import serialize HIGHCHARTS_SCRIPTS = """<script src="http://code.highcharts.com/highcharts.js"></script> <scri...
# -*- coding: utf-8 -*- """Functions to quickly display charts in a Notebook. """ import string import random from IPython.core import getipython from IPython.core.display import display, HTML from core import serialize HIGHCHARTS_SCRIPTS = """<script src="http://code.highcharts.com/highcharts.js"></script> <scri...
mit
Python
4616fdefc1c7df8acccdd89ea792fa24ecfa9ca6
Check environment variables before the tests are started
tisnik/fabric8-analytics-common,tisnik/fabric8-analytics-common,jpopelka/fabric8-analytics-common,tisnik/fabric8-analytics-common,jpopelka/fabric8-analytics-common,jpopelka/fabric8-analytics-common
perf-tests/src/perf-tests.py
perf-tests/src/perf-tests.py
import json import time import datetime import subprocess import os.path import sys import queue import threading from coreapi import * from jobsapi import * import benchmarks import graph def check_environment_variable(env_var_name): print("Checking: {e} environment variable existence".format( e=env_var...
def main(): pass if __name__ == "__main__": # execute only if run as a script main()
apache-2.0
Python
6d76cd9cb5e652507367c9559a9373ed7abec471
fix all_hosts decorator
pavel-paulau/perfrunner,hsharsha/perfrunner,dkao-cb/perfrunner,hsharsha/perfrunner,EricACooper/perfrunner,vmx/perfrunner,pavel-paulau/perfrunner,EricACooper/perfrunner,PaintScratcher/perfrunner,couchbase/perfrunner,dkao-cb/perfrunner,mikewied/perfrunner,thomas-couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perf...
perfrunner/helpers/remote.py
perfrunner/helpers/remote.py
from uuid import uuid4 from fabric.api import execute, get, run, parallel from fabric import state from logger import logger from perfrunner.helpers import Helper def all_hosts(task): def wrapper(self, *args, **kargs): return execute(parallel(task), self, *args, hosts=self.hosts, **kargs) return wra...
from uuid import uuid4 from fabric.api import execute, get, run, parallel from fabric import state from logger import logger from perfrunner.helpers import Helper def all_hosts(task): def wrapper(self, *args, **kargs): return execute(parallel(task), *args, hosts=self.hosts, **kargs) return wrapper ...
apache-2.0
Python
bc84fa7ee20ffc3ec40239d645a48f79863db33d
Remove access git revision
lewisodriscoll/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview
sasview/__init__.py
sasview/__init__.py
__version__ = "3.1.0" __build__ = "1"
__version__ = "3.1.0" __build__ = "1" try: import subprocess d = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']) __build__ = str(d).strip() except: import logging import sys logging.warning("Error while determining build number\n %s" % sys.exc_value)
bsd-3-clause
Python
6582bdc62891308359718de78e05066cfc0b9131
update nodal_stress() in its2D_3.py example
lokik/sfepy,lokik/sfepy,rc/sfepy,sfepy/sfepy,BubuLK/sfepy,vlukes/sfepy,BubuLK/sfepy,lokik/sfepy,vlukes/sfepy,vlukes/sfepy,rc/sfepy,sfepy/sfepy,rc/sfepy,lokik/sfepy,sfepy/sfepy,BubuLK/sfepy
examples/linear_elasticity/its2D_3.py
examples/linear_elasticity/its2D_3.py
r""" Diametrically point loaded 2-D disk with nodal stress calculation. See :ref:`sec-primer`. Find :math:`\ul{u}` such that: .. math:: \int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u}) = 0 \;, \quad \forall \ul{v} \;, where .. math:: D_{ijkl} = \mu (\delta_{ik} \delta_{jl}+\delta_{il} \delta_{j...
r""" Diametrically point loaded 2-D disk with nodal stress calculation. See :ref:`sec-primer`. Find :math:`\ul{u}` such that: .. math:: \int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u}) = 0 \;, \quad \forall \ul{v} \;, where .. math:: D_{ijkl} = \mu (\delta_{ik} \delta_{jl}+\delta_{il} \delta_{j...
bsd-3-clause
Python
0903a60041c9215d835f35f400e0175c43014636
Comment on versioning method in nose2._version
ptthiem/nose2,ptthiem/nose2
nose2/_version.py
nose2/_version.py
"""version information""" # taken from http://stackoverflow.com/a/17626524/1836144 # The following line *must* be the last in the module, exactly as formatted: # could also use advice from # https://packaging.python.org/guides/single-sourcing-package-version/ __version__ = '0.7.0'
"""version information""" # taken from http://stackoverflow.com/a/17626524/1836144 # The following line *must* be the last in the module, exactly as formatted: __version__ = '0.7.0'
bsd-2-clause
Python
13f7a5adf60d7e51938dc7efcfc475b9703a4859
Add a "missing column message"
njvack/scorify
scorify/datafile.py
scorify/datafile.py
# -*- coding: utf-8 -*- # Part of the scorify package # Copyright 2014 Board of Regents of the University of Wisconsin System """ Reads data files (or CSV objects) into datafile objects. Datafiles are iterable and indexable by column name. When reading, you pass in a scoresheet.LayoutSection, which tells you where da...
# -*- coding: utf-8 -*- # Part of the scorify package # Copyright 2014 Board of Regents of the University of Wisconsin System """ Reads data files (or CSV objects) into datafile objects. Datafiles are iterable and indexable by column name. When reading, you pass in a scoresheet.LayoutSection, which tells you where da...
mit
Python
f654cb58a2a609e3d16a723e9114448c8a17ab62
clean up script a little
ibrahimcesar/panda,ibrahimcesar/panda,PalmBeachPost/panda,ibrahimcesar/panda,pandaproject/panda,PalmBeachPost/panda,datadesk/panda,PalmBeachPost/panda,ibrahimcesar/panda,datadesk/panda,PalmBeachPost/panda,ibrahimcesar/panda,pandaproject/panda,PalmBeachPost/panda,pandaproject/panda,pandaproject/panda,datadesk/panda,pand...
scripts/check_po.py
scripts/check_po.py
#!/usr/bin/env python import os, os.path import re import sys placeholder_pat = re.compile("%\((.+?)\)(\w)") def extract_placeholders(s): return set(placeholder_pat.findall(s)) def check_file(fn): msgid = '' msgstr = '' workingon = 'msgid' mismatches = [] for line in open(fn): if lin...
#!/usr/bin/env python import os, os.path import re placeholder_pat = re.compile("%\((.+?)\)(\w)") def extract_placeholders(s): return set(placeholder_pat.findall(s)) def check_file(fn): msgid = '' msgstr = '' workingon = 'msgid' mismatches = [] for line in open(fn): if line.startswith(...
mit
Python
9dc1fd590e39a49789741d0dd171e6411a865640
adjust commands -> model where applicable
PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild
benchbuild/environments/adapters/repository.py
benchbuild/environments/adapters/repository.py
import abc import typing as tp import attr from benchbuild.environments.domain import events, model from benchbuild.environments.service_layer import buildah @attr.s class AbstractRegistry(abc.ABC): seen: tp.Set[model.Image] = attr.ib(default=attr.Factory(set)) def add(self, image: model.Image) -> None: ...
import abc import typing as tp import attr from benchbuild.environments.domain import commands, events, model from benchbuild.environments.service_layer import buildah @attr.s class AbstractRegistry(abc.ABC): seen: tp.Set[model.Image] = attr.ib(default=attr.Factory(set)) def add(self, image: model.Image) -...
mit
Python
76f61245e4b3e6bbcac624fe436d1655384660a8
remove .cur as image type
yanni4night/ursa2,yanni4night/ursa2
ursa2/proxy.py
ursa2/proxy.py
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' proxy.py changelog 2013-12-11[17:23:52]:created @info yinyong,osx-x64,Undefined,10.129.164.77,py,/Volumes/yinyong/ursa2/src @author yanni4night@gmail.com @version 0.0.1 @since 0.0.1 ''' import requests as R from urlparse import urlparse #import mimetypes import ...
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' proxy.py changelog 2013-12-11[17:23:52]:created @info yinyong,osx-x64,Undefined,10.129.164.77,py,/Volumes/yinyong/ursa2/src @author yanni4night@gmail.com @version 0.0.1 @since 0.0.1 ''' import requests as R from urlparse import urlparse #import mimetypes import ...
mit
Python
3fe775b6e9a3a96a0c2b71334867a4f4f34b8095
modify first_boot to account for new massive swap on tmp partitions.
DrXyzzy/smc,DrXyzzy/smc,tscholl2/smc,sagemathinc/smc,sagemathinc/smc,tscholl2/smc,sagemathinc/smc,DrXyzzy/smc,DrXyzzy/smc,sagemathinc/smc,tscholl2/smc,tscholl2/smc,tscholl2/smc
salvus/scripts/first_boot.py
salvus/scripts/first_boot.py
#!/usr/bin/env python # This script is run by /etc/rc.local when booting up. It does special configuration # depending on what images are mounted, etc. import os, socket # If hostname isn't "salvus-base", then setup /tmp and swap. if socket.gethostname() != "salvus-base": # Enable swap os.system("swapon /d...
#!/usr/bin/env python # This script is run by /etc/rc.local when booting up. It does special configuration # depending on what images are mounted, etc. import os if os.path.exists('/mnt/home/'): # Compute machine if not os.path.exists('/mnt/home/aquota.group'): os.system("quotacheck -cug /mnt/home")...
agpl-3.0
Python
90480fff4e2ad72efec8f2c97f01b3793b8dde42
Fix pylint warnings
dongjoon-hyun/electron,darwin/electron,jcblw/electron,d-salas/electron,astoilkov/electron,jsutcodes/electron,edulan/electron,webmechanicx/electron,chrisswk/electron,aaron-goshine/electron,twolfson/electron,systembugtj/electron,roadev/electron,shockone/electron,saronwei/electron,kazupon/electron,bwiggs/electron,gerhardb...
script/upload-windows-pdb.py
script/upload-windows-pdb.py
#!/usr/bin/env python import os import glob from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SYMBOLS_DIR = 'dist\\symbols' DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent' PDB_LIST = [ 'out\\Release\...
#!/usr/bin/env python import os import glob from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SYMBOLS_DIR = 'dist\\symbols' PDB_LIST = [ 'out\\Release\\atom.exe.pdb', 'vendor\\brightray\\vendor\\download\\libchromiumconten...
mit
Python
0968180fdbb91708115fcbc3187eef93943a912d
Fix crasher
astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin
astrobin_apps_platesolving/templatetags/astrobin_apps_platesolving_tags.py
astrobin_apps_platesolving/templatetags/astrobin_apps_platesolving_tags.py
# Django from django.contrib.contenttypes.models import ContentType from django.template import Library, Node # This app from astrobin_apps_platesolving.solver import Solver register = Library() @register.inclusion_tag( 'astrobin_apps_platesolving/inclusion_tags/platesolving_machinery.html', takes_context ...
# Django from django.contrib.contenttypes.models import ContentType from django.template import Library, Node # This app from astrobin_apps_platesolving.solver import Solver register = Library() @register.inclusion_tag( 'astrobin_apps_platesolving/inclusion_tags/platesolving_machinery.html', takes_context ...
agpl-3.0
Python
a2de3371b63654ea205af35314c46b5eb48921a9
update rules_proto digest to 5c8e443 (#1235)
googleapis/gapic-generator-typescript,googleapis/gapic-generator-typescript,googleapis/gapic-generator-typescript
repositories.bzl
repositories.bzl
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def gapic_generator_typescript_repositories(): maybe( http_archive, name = "build_bazel_rules_nodejs", sha256 = "c911b5bd8aee8b0498cc387cacdb5f917098ce477fb4182db07b0ef8a9e0...
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def gapic_generator_typescript_repositories(): maybe( http_archive, name = "build_bazel_rules_nodejs", sha256 = "c911b5bd8aee8b0498cc387cacdb5f917098ce477fb4182db07b0ef8a9e0...
apache-2.0
Python
407784fd00cdab3b9c09e56f89406955110438a9
solve the dependency in datasets and embedding
faneshion/MatchZoo,faneshion/MatchZoo
matchzoo/__init__.py
matchzoo/__init__.py
from pathlib import Path USER_DIR = Path.expanduser(Path('~')).joinpath('.matchzoo') if not USER_DIR.exists(): USER_DIR.mkdir() USER_DATA_DIR = USER_DIR.joinpath('datasets') if not USER_DATA_DIR.exists(): USER_DATA_DIR.mkdir() from .logger import logger from .version import __version__ from . import processo...
from pathlib import Path USER_DIR = Path.expanduser(Path('~')).joinpath('.matchzoo') if not USER_DIR.exists(): USER_DIR.mkdir() USER_DATA_DIR = USER_DIR.joinpath('datasets') if not USER_DATA_DIR.exists(): USER_DATA_DIR.mkdir() from .logger import logger from .version import __version__ from . import processo...
apache-2.0
Python
84ad932d4f7536dce6618de8a034880da389a3c0
Add missing docstring
juampi/algo1
pa1/inversions.py
pa1/inversions.py
#!/usr/bin/env python3 """ Implementation of the Merge Sort algorithm in order to count the number of inversions in a list of integers. """ import argparse def read_file(filename): with open(filename) as f: return [int(line) for line in f] def _merge_sort(A, B, begin, end): if end - begin < 2: ...
#!/usr/bin/env python3 """ """ import argparse def read_file(filename): with open(filename) as f: return [int(line) for line in f] def _merge_sort(A, B, begin, end): if end - begin < 2: return middle = begin + (end - begin)//2 _merge_sort(A, B, begin, middle) _merge_sort(A, B, mi...
mit
Python
9d39802ab6db8d4d65688aff7ed6af01ceb0cb07
Make pydocstyle happy
SublimeLinter/SublimeLinter-hlint
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Hardy Jones # Copyright (c) 2013 # # License: MIT # """This module exports the Hlint plugin class.""" from SublimeLinter.lint import Linter class Hlint(Linter): """Provides an interface to hlint.""" synta...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Hardy Jones # Copyright (c) 2013 # # License: MIT # """This module exports the Hlint plugin class.""" from SublimeLinter.lint import Linter class Hlint(Linter): """Provides an interface to hlint.""" synt...
mit
Python
aaaaa6858485962f1cfd52357b2d5f3964a368ad
Refactor tests with setUp
mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation
falcom/decorators/test_try_forever.py
falcom/decorators/test_try_forever.py
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from hamcrest import * import unittest from ..test.hamcrest import ComposedMatcher, evaluates_to, a_method from .try_forever import try_forev...
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from hamcrest import * import unittest from ..test.hamcrest import ComposedMatcher, evaluates_to, a_method from .try_forever import try_forev...
bsd-3-clause
Python
f86f0ce876c40e28480baf1da1f51c5f7cc5c74d
apply sorting before serialization of mscale collection
schocco/mds-web,schocco/mds-web
mds_website/views.py
mds_website/views.py
from django.views.generic.base import TemplateView from apps.muni_scales.api import MscaleResource from apps.auth.api import UserResource class HomeView(TemplateView): template_name = "index.html" def get_context_data(self, **kwargs): context = super(HomeView, self).get_context_data(**kwargs) ...
from django.views.generic.base import TemplateView from apps.muni_scales.api import MscaleResource from apps.auth.api import UserResource class HomeView(TemplateView): template_name = "index.html" def get_context_data(self, **kwargs): context = super(HomeView, self).get_context_data(**kwargs) ...
mit
Python
c6e392b724853c59684ec317da7063486a209c94
Change 'tempfile_suffix' and remove filename check.
likewise/SublimeLinter-contrib-xsvlog,BrunoJJE/SublimeLinter-contrib-xvhdl
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Bruno JJE # Copyright (c) 2015 Bruno JJE # # License: MIT # """This module exports the Xvhdl plugin class.""" from SublimeLinter.lint import Linter class Xvhdl(Linter): """Provides an interface to xvhdl (from...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Bruno JJE # Copyright (c) 2015 Bruno JJE # # License: MIT # """This module exports the Xvhdl plugin class.""" from SublimeLinter.lint import Linter class Xvhdl(Linter): """Provides an interface to xvhdl (from...
mit
Python
cb6a340ba2d0385ae3c406540eaf934c2cd6f454
Format string.
ryanc/mmmpaste,ryanc/mmmpaste
mmmpaste/filters.py
mmmpaste/filters.py
from flask import make_response from functools import update_wrapper, wraps from time import time as now from mmmpaste import app def runtime(f): """ Add a header that shows the runtime of the route. """ @wraps(f) def wrapper(*args, **kwargs): start = now() response = make_response...
from flask import make_response from functools import update_wrapper, wraps from time import time as now from mmmpaste import app def runtime(f): """ Add a header that shows the runtime of the route. """ @wraps(f) def wrapper(*args, **kwargs): start = now() response = make_response...
bsd-2-clause
Python
49df4cc72a5e424d3fad45b1679d4519b04e5916
Update models.py
Beeblio/django-vote
vote/models.py
vote/models.py
from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType try: from django.contrib.contenttypes.fields import GenericForeignKey except ImportError: from django.contrib.contenttypes.generic import GenericForeignKey from .compat import AU...
from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType try: from django.contrib.contenttypes.fields import GenericForeignKey except ImportError: from django.contrib.contenttypes.generic import GenericForeignKey from .compat import AU...
bsd-3-clause
Python
6bccabc3840438b6d9524a3bcbd097459171cc1b
Handle KeyboardInterrupt as nose does.
olivierverdier/nose-progressive,veo-labs/nose-progressive,erikrose/nose-progressive,pmclanahan/pytest-progressive
noseprogressive/runner.py
noseprogressive/runner.py
from time import time import nose.core from noseprogressive.result import ProgressiveResult class ProgressiveRunner(nose.core.TextTestRunner): """Test runner that makes a lot less noise than TextTestRunner""" def __init__(self, cwd, totalTests, stream, **kwargs): super(ProgressiveRunner, self).__in...
from time import time import nose.core from noseprogressive.result import ProgressiveResult class ProgressiveRunner(nose.core.TextTestRunner): """Test runner that makes a lot less noise than TextTestRunner""" def __init__(self, cwd, totalTests, stream, **kwargs): super(ProgressiveRunner, self).__in...
mit
Python
e6b80e478eb137f824c9bbc050ba363e24b48707
Improve twitter URL detection
JohnMaguire/Cardinal
plugins/twitter/plugin.py
plugins/twitter/plugin.py
import re from urllib.parse import urlparse import requests import twitter from twisted.internet import defer from twisted.internet.threads import deferToThread from cardinal.decorators import event from cardinal.exceptions import EventRejectedMessage class TwitterPlugin: def __init__(self, config): con...
import re from urllib.parse import urlparse import requests import twitter from twisted.internet import defer from twisted.internet.threads import deferToThread from cardinal.decorators import event from cardinal.exceptions import EventRejectedMessage class TwitterPlugin: def __init__(self, config): con...
mit
Python
08bd685fd7174c6e96f10eb517b9aa1e8916385a
add u24 keyword to rammbocklibrary
robotframework/Rammbock,samratashok87/Rammbock,robotframework/Rammbock,WamanAvadhani/Rammbock,WamanAvadhani/Rammbock,samratashok87/Rammbock
proto/src/RammbockLibrary.py
proto/src/RammbockLibrary.py
from Rammbock import Rammbock from robot.libraries.BuiltIn import BuiltIn class RammbockLibrary(Rammbock): def u8(self, name, value=None, align=None): self.uint(1, name, value, align) def u16(self, name, value=None, align=None): self.uint(2, name, value, align) def u24(self, name, value...
from Rammbock import Rammbock from robot.libraries.BuiltIn import BuiltIn class RammbockLibrary(Rammbock): def u8(self, name, value=None, align=None): self.uint(1, name, value, align) def u16(self, name, value=None, align=None): self.uint(2, name, value, align) def u32(self, name, value...
apache-2.0
Python
7f1933f9cae7cbb9b0be140671046c0b8919bd10
fix type
w495/python-video-shot-detector,w495/python-video-shot-detector
shot_detector/filters/slice_filter.py
shot_detector/filters/slice_filter.py
# -*- coding: utf8 -*- from __future__ import absolute_import, division, print_function import itertools import logging from shot_detector.filters import Filter class SliceFilter(Filter): """ Slice filter. """ __logger = logging.getLogger(__name__) def filter_objects(self, ...
# -*- coding: utf8 -*- from __future__ import absolute_import, division, print_function import itertools import logging from shot_detector.filters import Filter class SliceFilter(Filter): """ Slice filter. """ __logger = logging.getLogger(__name__) def filter_objects(self, ...
bsd-3-clause
Python
afc51d93271e48ed817400b03f43ae5a55ed7334
Delete excessive table counting
thombashi/SimpleSQLite,thombashi/SimpleSQLite
simplesqlite/loader/html/formatter.py
simplesqlite/loader/html/formatter.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import bs4 import dataproperty from ..constant import TableNameTemplate as tnt from ..data import TableData from ..error import InvalidDataError from ..formatter import TableFormatter class Htm...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import bs4 import dataproperty from ..constant import TableNameTemplate as tnt from ..data import TableData from ..error import InvalidDataError from ..formatter import TableFormatter class Htm...
mit
Python
df6de0eb5185ec88b828c5f08a93c697525a2c6a
add pin numbers for motor
banchee/pirobot,banchee/pirobot
TankController/tank.py
TankController/tank.py
import motor class tank(object): def __init__(self): self.left_motor = motor.motor(7,11) self.right_motor = motor.motor(12,13) self.actions = {'forward':False, 'reverse':False, 'left':False, 'right':False, 'stop':True} def forward(self): if not self.actions['forward']: self.left_motor.posit...
import motor class tank(object): def __init__(self): self.left_motor = motor.motor(11,15) self.right_motor = motor.motor(13,12) self.actions = {'forward':False, 'reverse':False, 'left':False, 'right':False, 'stop':True} def forward(self): if not self.actions['forward']: self.left_motor.posi...
mit
Python
7e49448019f8e47d773a86a5ad8b6d3e04a73884
Fix for sessions getting used up
rootio/rootio_web,rootio/rootio_web,rootio/rootio_web,rootio/rootio_web
telephony/podcast/rss_agent.py
telephony/podcast/rss_agent.py
import threading from time import sleep from rootio.config import DefaultConfig from rootio.content.models import ContentPodcast from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from rss_downloader import RSSDownloader class RSSAgent: def __init__(self, logger): self.__logger...
import threading from time import sleep from rootio.config import DefaultConfig from rootio.content.models import ContentPodcast from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from rss_downloader import RSSDownloader class RSSAgent: def __init__(self, logger): self.__logger...
agpl-3.0
Python
b4c8544617528576dfa1eae3c045735b0bbccfad
Fix darwin detecting
itaymendel/taurus,greyfenrir/taurus,Blazemeter/taurus,Blazemeter/taurus,itaymendel/taurus,Blazemeter/taurus,Blazemeter/taurus,Blazemeter/taurus,greyfenrir/taurus,Blazemeter/taurus,Blazemeter/taurus,Blazemeter/taurus,greyfenrir/taurus,greyfenrir/taurus,greyfenrir/taurus,greyfenrir/taurus,itaymendel/taurus,Blazemeter/tau...
bzt/__init__.py
bzt/__init__.py
""" Copyright 2015 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
""" Copyright 2015 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
apache-2.0
Python
c3d0577b4b6a486d6cc416d362787a836d5ddc08
fix case where song has no metadata
mutantmonkey/mmbar
mpdstatus.py
mpdstatus.py
import mpd import os.path class MpdStatusWidget(object): def __init__(self, server, timeout=10): self.server = server self.client = mpd.MPDClient() self.client.timeout = timeout self.client.connect(server, 6600) def output(self): try: song = self.client.cur...
import mpd class MpdStatusWidget(object): def __init__(self, server, timeout=10): self.server = server self.client = mpd.MPDClient() self.client.timeout = timeout self.client.connect(server, 6600) def output(self): song = self.client.currentsong() if song: ...
isc
Python
78c85e07f50b990b90e93cf8280ee47671d2f7e0
configure cronjob to run on the hour every hour
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
celeryconfig.py
celeryconfig.py
from datetime import timedelta from celery.schedules import crontab from django.conf import settings CELERY_ANNOTATIONS = { 'bluebottle.analytics.tasks.queue_analytics_record': {'rate_limit': '50/s'} } CELERYBEAT_SCHEDULE = { 'set_status_realised': { 'task': 'bluebottle.projects.tasks.set_status_rea...
from datetime import timedelta from celery.schedules import crontab from django.conf import settings CELERY_ANNOTATIONS = { 'bluebottle.analytics.tasks.queue_analytics_record': {'rate_limit': '50/s'} } CELERYBEAT_SCHEDULE = { 'set_status_realised': { 'task': 'bluebottle.projects.tasks.set_status_rea...
bsd-3-clause
Python
f509034ffbd4c218afbf62df9ec894bd01a20964
Remove commented pdb
praekelt/jmbo-chart,praekelt/jmbo-chart
chart/models.py
chart/models.py
from datetime import datetime from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from preferences.models import Preferences from jmbo.models import ModelBase from music.models import Track class Chart(ModelBase): @property def chartentries_permitted(...
from datetime import datetime from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from preferences.models import Preferences from jmbo.models import ModelBase from music.models import Track class Chart(ModelBase): @property def chartentries_permitted(...
bsd-3-clause
Python
7883b95433a35b0b4bfa3354454626473986b2a5
bump version number
CloverHealth/temporal-sqlalchemy
temporal_sqlalchemy/version.py
temporal_sqlalchemy/version.py
"""Version information.""" __version__ = '0.2.0'
"""Version information.""" __version__ = '0.1.0'
bsd-3-clause
Python
2ecaf44c0bc5117744ecda7bd0f8df2627e9a527
Change order of the tests
mcolom/ipolDevel,mcolom/ipolDevel,mcolom/ipolDevel,mcolom/ipolDevel
ci_tests/all.py
ci_tests/all.py
#!/usr/bin/python # -*- coding: utf-8 -*- import time import random from subprocess import Popen, PIPE import os system_test = '/home/ipol/ipolDevel/ci_tests/system.py' archive_test = '/home/ipol/ipolDevel/ipol_demo/modules/archive/test.py' blobs_test = '/home/ipol/ipolDevel/ipol_demo/modules/blobs/test.py' demoinfo_...
#!/usr/bin/python # -*- coding: utf-8 -*- import time import random from subprocess import Popen, PIPE import os system_test = '/home/ipol/ipolDevel/ci_tests/system.py' archive_test = '/home/ipol/ipolDevel/ipol_demo/modules/archive/test.py' blobs_test = '/home/ipol/ipolDevel/ipol_demo/modules/blobs/test.py' demoinfo_...
agpl-3.0
Python
76b047fcb2c80d8abad0b275710b8e01459daadd
Bump version to 0.20.4
thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader
pytablereader/__version__.py
pytablereader/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.20.4" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.20.3" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
mit
Python
948ccdf2864988f1463f901c6024a5a3df09fdba
Bump version to 0.30.0
thombashi/pytablewriter
pytablewriter/__version__.py
pytablewriter/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.30.0" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.29.0" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
mit
Python
3c2a426553072149710d976938918d837cd6c9ff
fix pos
PyThaiNLP/pythainlp
pythainlp/postaggers/text.py
pythainlp/postaggers/text.py
from __future__ import absolute_import,division,print_function from nine import nimport,str from pythainlp.segment import segment import pythainlp import os import nltk.tag, nltk.data json= nimport('json') codecs= nimport('codecs') reader = codecs.getreader("utf-8") templates_dir = os.path.join(os.path.dirname(pythainl...
from __future__ import absolute_import,division,print_function from nine import nimport,str from pythainlp.segment import segment import pythainlp import os json= nimport('json') import nltk.tag, nltk.data templates_dir = os.path.join(os.path.dirname(pythainlp.__file__), 'corpus') template_file = os.path.join(templates...
apache-2.0
Python
40adc641638e3efcf8e4e5af898deda9e40da161
Use NTP terms. Add comments.
rsmith-nl/scripts,rsmith-nl/scripts
ntpclient.py
ntpclient.py
#!/usr/bin/env python3 # file: ntpclient.py # vim:fileencoding=utf-8:fdm=marker:ft=python # # Author: R.F. Smith <rsmith@xs4all.nl> # Created: 2017-11-16 19:33:50 +0100 # Last modified: 2018-09-09T14:10:52+0200 """Simple NTP query program.""" from contextlib import closing from datetime import datetime from socket imp...
#!/usr/bin/env python3 # file: ntpclient.py # vim:fileencoding=utf-8:fdm=marker:ft=python # # Author: R.F. Smith <rsmith@xs4all.nl> # Created: 2017-11-16 19:33:50 +0100 # Last modified: 2018-05-13T12:15:28+0200 """Simple NTP query program.""" from contextlib import closing from datetime import datetime from socket imp...
mit
Python
2a4d78be3df2d068431fe007b6f2d73956dc23d4
Use feeds instead of rss
vjousse/viserlalune,vjousse/viserlalune,vjousse/viserlalune,vjousse/viserlalune
sitecontent/urls.py
sitecontent/urls.py
from django.conf.urls import patterns, url from sitecontent import views urlpatterns = patterns('', url("^feeds/(?P<format>.*)$", "sitecontent.views.blog_post_feed_richtext_filters", name="blog_post_feed_richtext_filters"), )
from django.conf.urls import patterns, url from sitecontent import views urlpatterns = patterns('', url("^rss/(?P<format>.*)$", "sitecontent.views.blog_post_feed_richtext_filters", name="blog_post_feed_richtext_filters"), )
mit
Python
097a057d289fc6a00c6841f26c5d4776b4a6ea48
Fix import.
rezoo/chainer,okuta/chainer,hvy/chainer,cupy/cupy,hvy/chainer,niboshi/chainer,keisuke-umezawa/chainer,jnishi/chainer,jnishi/chainer,niboshi/chainer,keisuke-umezawa/chainer,chainer/chainer,okuta/chainer,cupy/cupy,hvy/chainer,anaruse/chainer,pfnet/chainer,ysekky/chainer,niboshi/chainer,jnishi/chainer,wkentaro/chainer,cha...
tests/chainer_tests/functions_tests/pooling_tests/pooling_nd_helper.py
tests/chainer_tests/functions_tests/pooling_tests/pooling_nd_helper.py
import itertools import nose.tools import six from chainer import testing @nose.tools.nottest def pooling_patches(dims, ksize, stride, pad, cover_all): """Return tuples of slices that indicate pooling patches.""" # Left-top indexes of each pooling patch. if cover_all: xss = itertools.product( ...
import itertools import nose.tools import six import testing @nose.tools.nottest def pooling_patches(dims, ksize, stride, pad, cover_all): """Return tuples of slices that indicate pooling patches.""" # Left-top indexes of each pooling patch. if cover_all: xss = itertools.product( *[six...
mit
Python
72f763d9759438abd731585a1b5ef67e62e27181
Use version gathering logic from hydrachain
gsalgado/pyethapp,RomanZacharia/pyethapp,ethereum/pyethapp,RomanZacharia/pyethapp,ethereum/pyethapp,changwu-tw/pyethapp,changwu-tw/pyethapp,gsalgado/pyethapp
pyethapp/__init__.py
pyethapp/__init__.py
# -*- coding: utf-8 -*- # ############# version ################## from pkg_resources import get_distribution, DistributionNotFound import os.path import subprocess import re GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$') __version__ = None try: _dist = get_d...
# -*- coding: utf-8 -*- # ############# version ################## from pkg_resources import get_distribution, DistributionNotFound import os.path import subprocess try: _dist = get_distribution('pyethapp') # Normalize case for Windows systems dist_loc = os.path.normcase(_dist.location) here = os.path.n...
mit
Python
bc823de2236c02b0a5179b34134d712e176e39ae
Update test
BakeCode/performance-testing,BakeCode/performance-testing
tests/routine/test_tool.py
tests/routine/test_tool.py
import unittest from performance.routine import Tool, Config class ToolTestCase(unittest.TestCase): def setUp(self): self.host = 'http://www.google.com' self.config = Config(host=self.host) def test_init(self): tool = Tool(config=self.config) self.assertEqual(self.config, tool...
import unittest from performance.routine import Tool, Config class ToolTestCase(unittest.TestCase): def setUp(self): self.host = 'http://www.google.com' self.config = Config(host=self.host) def test_init(self): tool = Tool(config=self.config) self.assertEqual(self.config, tool...
mit
Python
faaa3898a0baf6b15696e651e2589cb60c032bd4
Improve docs.
yanikou19/pymatgen,migueldiascosta/pymatgen,sonium0/pymatgen,yanikou19/pymatgen,ctoher/pymatgen,rousseab/pymatgen,sonium0/pymatgen,migueldiascosta/pymatgen,Dioptas/pymatgen,Bismarrck/pymatgen,rousseab/pymatgen,ctoher/pymatgen,ctoher/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,migueldiascosta/pymat...
pymatgen/__init__.py
pymatgen/__init__.py
__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", "Rickard Armiento"]) __date__ = "May 12 2013" __versi...
__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", "Rickard Armiento"]) __date__ = "May 12 2013" __versi...
mit
Python
739aaf65d1ee45392c682a06958e7036fbcfda08
Fix RecTimer migration.
EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base,EricssonResearch/calvin-base
calvin/actorstore/systemactors/std/RecTimer.py
calvin/actorstore/systemactors/std/RecTimer.py
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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 ...
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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
acde8d6665f298627d0fee5e2e275fa786eb6bdb
fix manifest writing under py2
ownaginatious/fbchat-archive-parser,ownaginatious/fbchat-archive-parser
fbchat_archive_parser/writers/__init__.py
fbchat_archive_parser/writers/__init__.py
from __future__ import unicode_literals from datetime import datetime import io import os import shutil import six if six.PY2: FileNotFoundError = OSError from .json import JsonWriter from .pretty_json import PrettyJsonWriter from .csv import CsvWriter from .text import TextWriter from .yaml import YamlWriter ...
from datetime import datetime import io import os import shutil import six if six.PY2: FileNotFoundError = OSError from .json import JsonWriter from .pretty_json import PrettyJsonWriter from .csv import CsvWriter from .text import TextWriter from .yaml import YamlWriter _BUILTIN_WRITERS = { "json": JsonWrit...
mit
Python
4541605e27c9fef6cc23b245de50867ff22ea6aa
Test Case for accounting dimension
gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext
erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py
erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.accounts.doctype.journal_entry.tes...
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals # import frappe import unittest class TestAccountingDimension(unittest.TestCase): pass
agpl-3.0
Python
27112881583e53d790e66d31a2bb4d2a996ee405
Move import to top level to avoid import fail after fist time on sys.modules hack
JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp
python/sparknlp/functions.py
python/sparknlp/functions.py
from pyspark.sql.functions import udf from pyspark.sql.types import * from pyspark.sql import DataFrame from sparknlp.annotation import Annotation import sys import sparknlp def map_annotations(f, output_type: DataType): sys.modules['sparknlp.annotation'] = sparknlp # Makes Annotation() pickle serializable in t...
from pyspark.sql.functions import udf from pyspark.sql.types import * from pyspark.sql import DataFrame import sys import sparknlp def map_annotations(f, output_type: DataType): sys.modules['sparknlp.annotation'] = sparknlp # Makes Annotation() pickle serializable in top-level return udf( lambda con...
apache-2.0
Python
1d1854040751a67aa04399f13243299d3dd065b4
fix tabs->spaces
kived/python-for-android,kived/python-for-android,rnixx/python-for-android,wexi/python-for-android,germn/python-for-android,ibobalo/python-for-android,rnixx/python-for-android,kivy/python-for-android,kivy/python-for-android,cbenhagen/python-for-android,rnixx/python-for-android,kronenpj/python-for-android,inclement/pyth...
pythonforandroid/patching.py
pythonforandroid/patching.py
from os import uname def check_all(*callables): def check(**kwargs): return all(c(**kwargs) for c in callables) return check def check_any(*callables): def check(**kwargs): return any(c(**kwargs) for c in callables) return check def is_platform(platform): def is_x(**kwargs): ...
from os import uname def check_all(*callables): def check(**kwargs): return all(c(**kwargs) for c in callables) return check def check_any(*callables): def check(**kwargs): return any(c(**kwargs) for c in callables) return check def is_platform(platform): def is_x(**kwargs): return uname()[0] == platfo...
mit
Python
62e0ebb0eddf97437c41c9cfe4d8487236f141b4
Stop using 'with', which is illegal in Python < 2.5.
peterldowns/python-mustache,peterldowns/python-mustache
mustache/loading.py
mustache/loading.py
# coding: utf-8 from os.path import split, splitext, extsep, join, abspath, exists from utils import make_unicode DEFAULT_EXTENSION = 'html' DEFAULT_DIRECTORY = 'static/templates' DEFAULT_ENCODING = 'utf-8' DEFAULT_ERRORS = 'xmlcharrefreplace' def read(path): """ Return the contents of a file as a byte string. ""...
# coding: utf-8 from os.path import split, splitext, extsep, join, abspath, exists from utils import make_unicode DEFAULT_EXTENSION = 'html' DEFAULT_DIRECTORY = 'static/templates' DEFAULT_ENCODING = 'utf-8' DEFAULT_ERRORS = 'xmlcharrefreplace' def read(path): """ Return the contents of a file as a byte string. ""...
mit
Python
4ccdb3d5c4158db90445b2b767ce00ba6755635c
Add check for FORCE_LOCAL flag, similarly to FORCE_NOT_LOCAL. (#81)
google/fuzzbench,google/fuzzbench,google/fuzzbench,google/fuzzbench,google/fuzzbench
common/utils.py
common/utils.py
# Copyright 2020 Google LLC # # 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, ...
# Copyright 2020 Google LLC # # 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, ...
apache-2.0
Python
d4188ffb4b98d78ae9d2512b611e9ff88a8c14be
Update to python3
chin8628/Reg2Calendar,chin8628/Reg2Calendar
gcalendar_gen_class/genclass/views.py
gcalendar_gen_class/genclass/views.py
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render from .reg2cal_func import UploadText, convert2calendar, get_time, create_ical_download import csv import base64 def index(request): if request.method == 'POST': form = UploadText(request.POST) if form.is...
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render from .reg2cal_func import UploadText, convert2calendar, get_time, create_ical_download import csv import base64 def index(request): if request.method == 'POST': form = UploadText(request.POST) if form.is...
mit
Python
4c8d04fc39f8e15f88d69a1063313783e0a131b4
Change return to string
louismerlin/keyboard-games,louismerlin/keyboard-games
server.py
server.py
from flask import Flask from flask import request from tictactoe import * app = Flask(__name__) game = TicTacToe() @app.route("/") def hello(): return str(game.someone_won) @app.route("/key", methods=['POST']) def key(): print(request.get_json(silent=True)) return incYo() if __name__ == "__main__": ...
from flask import Flask from flask import request from tictactoe import * app = Flask(__name__) game = TicTacToe() @app.route("/") def hello(): return game.someone_won @app.route("/key", methods=['POST']) def key(): print(request.get_json(silent=True)) return incYo() if __name__ == "__main__": app....
mit
Python
7503367828da4f3fa1d6e5035261cf05773b6949
update version
romonzaman/newfies-dialer,Star2Billing/newfies-dialer,Star2Billing/newfies-dialer,Star2Billing/newfies-dialer,newfies-dialer/newfies-dialer,berinhard/newfies-dialer,saydulk/newfies-dialer,romonzaman/newfies-dialer,emartonline/newfies-dialer,saydulk/newfies-dialer,saydulk/newfies-dialer,emartonline/newfies-dialer,lapric...
newfies/__init__.py
newfies/__init__.py
# -*- coding: utf-8 -*- """Voice Broadcast Application""" # :copyright: (c) 2010 - 2011 by Arezqui Belaid. # :license: AGPL, see COPYING for more details. VERSION = (1, 1, 0, "b1") __version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:]) __author__ = "Arezqui Belaid" __contact__ = "info@star2billing.com...
# -*- coding: utf-8 -*- """Voice Broadcast Application""" # :copyright: (c) 2010 - 2011 by Arezqui Belaid. # :license: AGPL, see COPYING for more details. VERSION = (1, 1, 0, "a") __version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:]) __author__ = "Arezqui Belaid" __contact__ = "info@star2billing.com"...
mpl-2.0
Python
e726a91c2b8686a96f5d7155234a0eca3bbb72eb
Rename attachment file based on date.
phani00/tovp,mayapurmedia/tovp,mayapurmedia/tovp,mayapurmedia/tovp,phani00/tovp,phani00/tovp
tovp/attachments/models.py
tovp/attachments/models.py
import os from datetime import datetime from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.utils.translation import ugettext_lazy as _ from model_utils.models import TimeStampedModel from audit_log.models import AuthStamp...
import os from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.utils.translation import ugettext_lazy as _ from model_utils.models import TimeStampedModel from audit_log.models import AuthStampedModel class AttachmentManag...
mit
Python
c266f5171e875d8dc3abe924e4b6c9ed2a486422
Add test for non-member access
drcapulet/sentry,daevaorn/sentry,ifduyue/sentry,hongliang5623/sentry,Natim/sentry,wujuguang/sentry,jokey2k/sentry,korealerts1/sentry,llonchj/sentry,songyi199111/sentry,vperron/sentry,BayanGroup/sentry,BuildingLink/sentry,kevinlondon/sentry,fotinakis/sentry,imankulov/sentry,korealerts1/sentry,boneyao/sentry,jean/sentry,...
tests/sentry/web/frontend/test_organization_home.py
tests/sentry/web/frontend/test_organization_home.py
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.testutils import TestCase, PermissionTestCase class OrganizationHomePermissionTest(PermissionTestCase): def setUp(self): super(OrganizationHomePermissionTest, self).setUp() self.path = reverse('sentry...
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.testutils import TestCase, PermissionTestCase class OrganizationHomePermissionTest(PermissionTestCase): def setUp(self): super(OrganizationHomePermissionTest, self).setUp() self.path = reverse('sentry...
bsd-3-clause
Python
86fa5519164b2e70a7072ffaec0a394b07177631
make stopword removal optional
juanshishido/okcupid,juanshishido/okcupid
utils/textnormalization.py
utils/textnormalization.py
import re import nltk from nltk.corpus import stopwords from nltk.tokenize import regexp_tokenize def split_on_sentence(text): """Tokenize the text on sentences. Returns a list of strings (sentences). """ sent_tokenizer = nltk.data.load('tokenizers/punkt/english.pickle') return sent_tokenizer.tok...
import re import nltk from nltk.corpus import stopwords from nltk.tokenize import regexp_tokenize def split_on_sentence(text): """Tokenize the text on sentences. Returns a list of strings (sentences). """ sent_tokenizer = nltk.data.load('tokenizers/punkt/english.pickle') return sent_tokenizer.tok...
mit
Python
c12691a20370b0d30b0c84926694a26fc266ea11
Allow proper throw in compiler (#39)
tqchen/tvm,sxjscience/tvm,Laurawly/tvm-1,dmlc/tvm,Huyuwei/tvm,tqchen/tvm,Laurawly/tvm-1,tqchen/tvm,sxjscience/tvm,Laurawly/tvm-1,dmlc/tvm,tqchen/tvm,Laurawly/tvm-1,dmlc/tvm,Laurawly/tvm-1,dmlc/tvm,Huyuwei/tvm,Huyuwei/tvm,Laurawly/tvm-1,sxjscience/tvm,Laurawly/tvm-1,Huyuwei/tvm,dmlc/tvm,sxjscience/tvm,sxjscience/tvm,Huy...
vta/python/vta/__init__.py
vta/python/vta/__init__.py
"""VTA Package is a TVM backend extension to support VTA hardwares Besides the compiler toolchain. It also include utility functions to configure the hardware Environment and access remote through RPC """ from __future__ import absolute_import as _abs import sys from .bitstream import get_bitstream_path, download_b...
"""VTA Package is a TVM backend extension to support VTA hardwares Besides the compiler toolchain. It also include utility functions to configure the hardware Environment and access remote through RPC """ from __future__ import absolute_import as _abs __version__ = "0.1.0" from .bitstream import get_bitstream_path,...
apache-2.0
Python
9ddb5f7a31776b9e7e978d2a4fdc015acdc4670f
update dev version after 0.46.0 tag [ci skip]
desihub/desitarget,desihub/desitarget
py/desitarget/_version.py
py/desitarget/_version.py
__version__ = '0.46.0.dev4345'
__version__ = '0.46.0'
bsd-3-clause
Python
7aa47042d22ef1c51b9a545b6cdf6363b5d30df3
Correct author email
jlaska/pytest-github
pytest_github/__init__.py
pytest_github/__init__.py
"""Plugin for py.test that associates tests with github issues using a marker.""" __version__ = "0.3.0" __author__ = "James Laska" __author_email__ = "<jlaska@redhat.com>"
"""Plugin for py.test that associates tests with github issues using a marker.""" __version__ = "0.3.0" __author__ = "James Laska" __author_email__ = "<jlaska AT redhat.com>"
mit
Python
5ae24ac9ca357e34d652a926588a10dedff4d4da
fix to build
weinbe58/QuSpin,weinbe58/QuSpin,weinbe58/QuSpin,weinbe58/QuSpin
quspin/operators/setup.py
quspin/operators/setup.py
def cython_files(): import os,glob,numpy from Cython.Build import cythonize package_dir = os.path.dirname(os.path.realpath(__file__)) package_dir = os.path.expandvars(package_dir) cython_src = glob.glob(os.path.join(package_dir,"*.pyx")) include_dirs = [numpy.get_include()] include_dirs....
def cython_files(): import os,glob,numpy from Cython.Build import cythonize package_dir = os.path.dirname(os.path.realpath(__file__)) package_dir = os.path.expandvars(package_dir) cython_src = glob.glob(os.path.join(package_dir,"*.pyx")) include_dirs = [numpy.get_include()] include_dirs....
bsd-3-clause
Python
b87cfe7ee0c4318eaeeb36030c3500e614cd735e
Remove duplicate config registration
Plexxi/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2
st2reactor/st2reactor/timer/config.py
st2reactor/st2reactor/timer/config.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
Python
cd081f9ee5677b1e9031e1edfa8e4ef735017f24
Bump version 0.1.1
kenjhim/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting,kenjhim/django-accounting,dulaccc/django-accounting,dulaccc/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting
accounting/__init__.py
accounting/__init__.py
import os # Use 'final' as the 4th element to indicate # a full release VERSION = (0, 1, 1) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) # Append 3rd digit if > 0 if VERSION[2]: version = '%s.%s' % (versi...
import os # Use 'final' as the 4th element to indicate # a full release VERSION = (0, 1, 0, 'alpha', 1) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) # Append 3rd digit if > 0 if VERSION[2]: version = '%s....
mit
Python
7790b8b57aba48127c76bcf2f6ed0176b9b3bd16
Update __init__.py
markovmodel/adaptivemd,jrossyra/adaptivemd,jrossyra/adaptivemd,markovmodel/adaptivemd,jrossyra/adaptivemd,markovmodel/adaptivemd
adaptivemd/__init__.py
adaptivemd/__init__.py
############################################################################## # adaptiveMD: A Python Framework to Run Adaptive Molecular Dynamics (MD) # Simulations on HPC Resources # Copyright 2017 FU Berlin and the Authors # # Authors: Jan-Hendrik Prinz # Contributors: # # `adaptiveMD` is free software: ...
############################################################################## # adaptiveMD: A Python Framework to Run Adaptive Molecular Dynamics (MD) # Simulations on HPC Resources # Copyright 2017 FU Berlin and the Authors # # Authors: Jan-Hendrik Prinz # Contributors: # # `adaptiveMD` is free software: ...
lgpl-2.1
Python
783f247ba398395c8d885cd74a339f433b467339
remove unused import
chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
polling_stations/apps/uk_geo_utils/management/commands/import_cleaned_addresses.py
polling_stations/apps/uk_geo_utils/management/commands/import_cleaned_addresses.py
import os from django.db import connection from django.core.management.base import BaseCommand class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( 'cleaned_ab_path', help='The path to the folder containing the cleaned AddressBase CSVs' ) ...
import os import glob from django.db import connection from django.core.management.base import BaseCommand class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( 'cleaned_ab_path', help='The path to the folder containing the cleaned AddressBase CSVs' ...
bsd-3-clause
Python
5e2aae6070d60f2149c49e1137ab2a99f3966b3a
Add specific colors for heights
DarkAce65/rpi-led-matrix,DarkAce65/rpi-led-matrix
python/volumeBars.py
python/volumeBars.py
#!/usr/bin/env python from rgbmatrix import RGBMatrix from random import randint import numpy import math import time rows = 16 chains = 1 parallel = 1 ledMatrix = RGBMatrix(rows, chains, parallel) height = ledMatrix.height width = ledMatrix.width barWidth = width / 4 pi = numpy.pi barHeights = numpy.array([0, pi / 4...
#!/usr/bin/env python from rgbmatrix import RGBMatrix from random import randint import numpy import math import time rows = 16 chains = 1 parallel = 1 ledMatrix = RGBMatrix(rows, chains, parallel) height = ledMatrix.height width = ledMatrix.width barWidth = width / 4 pi = numpy.pi barHeights = numpy.array([0, pi / 4...
mit
Python
214d5f7e09e9b5e854e7471c6dc337456f428647
Add missing ensure_str for PY2
ChrisRx/quickavro,ChrisRx/quickavro
quickavro/_compat.py
quickavro/_compat.py
# -*- coding: utf-8 -*- import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 default_encoding = "UTF-8" def with_metaclass(meta, *bases): class metaclass(meta): __call__ = type.__call__ __init__ = type.__init__ def __new__(cls, name, this_bases, d): if this...
# -*- coding: utf-8 -*- import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 default_encoding = "UTF-8" def with_metaclass(meta, *bases): class metaclass(meta): __call__ = type.__call__ __init__ = type.__init__ def __new__(cls, name, this_bases, d): if this...
apache-2.0
Python
9e286b72d5ceb9b7242f0bf659bc8f6680d31d3a
Revert default value on the rating field in the OverallRating class.
GeoNode/geonode-ratings,GeoNode/geonode-ratings,GeoNode/geonode-ratings
agon_ratings/models.py
agon_ratings/models.py
import datetime from decimal import Decimal from django.db import models from django.conf import settings from django.contrib.auth.models import User from django.contrib.contenttypes.generic import GenericForeignKey from django.contrib.contenttypes.models import ContentType from agon_ratings.categories import RATI...
import datetime from decimal import Decimal from django.db import models from django.conf import settings from django.contrib.auth.models import User from django.contrib.contenttypes.generic import GenericForeignKey from django.contrib.contenttypes.models import ContentType from agon_ratings.categories import RATI...
bsd-3-clause
Python
d21b8e40c21cb701aada3b0e8e39bd583589f71c
update version to 0.2.2-dev (#129)
GoogleCloudPlatform/cloud-sql-python-connector,GoogleCloudPlatform/cloud-sql-python-connector
google/cloud/sql/connector/version.py
google/cloud/sql/connector/version.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Python
9804fbb527fb053296533c5cd4604afcb7043a28
Add unit_of_measurement to various Transmission sensors (#30037)
soldag/home-assistant,balloob/home-assistant,kennedyshead/home-assistant,FreekingDean/home-assistant,robbiet480/home-assistant,leppa/home-assistant,pschmitt/home-assistant,sdague/home-assistant,sdague/home-assistant,tboyce021/home-assistant,jawilson/home-assistant,balloob/home-assistant,lukas-hetzenecker/home-assistant...
homeassistant/components/transmission/const.py
homeassistant/components/transmission/const.py
"""Constants for the Transmission Bittorent Client component.""" DOMAIN = "transmission" SENSOR_TYPES = { "active_torrents": ["Active Torrents", "Torrents"], "current_status": ["Status", None], "download_speed": ["Down Speed", "MB/s"], "paused_torrents": ["Paused Torrents", "Torrents"], "total_torr...
"""Constants for the Transmission Bittorent Client component.""" DOMAIN = "transmission" SENSOR_TYPES = { "active_torrents": ["Active Torrents", None], "current_status": ["Status", None], "download_speed": ["Down Speed", "MB/s"], "paused_torrents": ["Paused Torrents", None], "total_torrents": ["Tot...
apache-2.0
Python
f8be56c94159814f9261bcafb6a75e8b2e2153f2
add 2.4.2 (#27094)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/r-withr/package.py
var/spack/repos/builtin/packages/r-withr/package.py
# Copyright 2013-2021 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 RWithr(RPackage): """Run Code 'With' Temporarily Modified Global State A set of funct...
# Copyright 2013-2021 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 RWithr(RPackage): """Run Code 'With' Temporarily Modified Global State A set of funct...
lgpl-2.1
Python
041f96b349b3291cce412a855b9cefe5cdffc76b
Update the texlive distro digest. (#2679)
krafczyk/spack,mfherbst/spack,lgarren/spack,lgarren/spack,skosukhin/spack,tmerrick1/spack,iulian787/spack,skosukhin/spack,EmreAtes/spack,krafczyk/spack,matthiasdiener/spack,LLNL/spack,LLNL/spack,mfherbst/spack,TheTimmy/spack,mfherbst/spack,skosukhin/spack,tmerrick1/spack,tmerrick1/spack,lgarren/spack,EmreAtes/spack,lga...
var/spack/repos/builtin/packages/texlive/package.py
var/spack/repos/builtin/packages/texlive/package.py
############################################################################## # Copyright (c) 2013-2016, 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-2016, 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
046861c4ef2825cebc2aacb82343537a5cc11208
add v 1.4.4 (#21981)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/xkbcomp/package.py
var/spack/repos/builtin/packages/xkbcomp/package.py
# Copyright 2013-2021 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 Xkbcomp(AutotoolsPackage, XorgPackage): """The X Keyboard (XKB) Extension essentially repl...
# Copyright 2013-2021 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 Xkbcomp(AutotoolsPackage, XorgPackage): """The X Keyboard (XKB) Extension essentially repl...
lgpl-2.1
Python
74948ad0998a61e6d0d87614d902b13442ebc9f9
Update makeid_file.py
nausheenfatma/embeddings,nausheenfatma/embeddings
gsoc2017-nausheen/HOLE/makeid_file.py
gsoc2017-nausheen/HOLE/makeid_file.py
f=open("standard_data/train.txt","r") id_dict={} relation_dict={} for line in f: line=line.strip() line_tokens=line.split() try: a=id_dict[line_tokens[0]] except: id_dict[line_tokens[0]]=0 try: a=id_dict[line_tokens[2]] except: id_dict[line_tokens[2]]=0 ...
f=open("train.txt","r") id_dict={} relation_dict={} for line in f: line=line.strip() line_tokens=line.split() try: a=id_dict[line_tokens[0]] except: id_dict[line_tokens[0]]=0 try: a=id_dict[line_tokens[2]] except: id_dict[line_tokens[2]]=0 try: ...
apache-2.0
Python
ac492068d99f52ec5f0852b31dd7156876d4e6a2
make imports more convenient
aliutkus/commonfate
commonfate/__init__.py
commonfate/__init__.py
from commonfate import decompose, model, transform __all__ = ["decompose", "model", "transform"] short_version = '0.1' version = '0.1.0'
#!/usr/bin/env python # -*- coding: utf-8 -*- """Version info""" short_version = '0.1' version = '0.1.0'
bsd-3-clause
Python
45c4efcd229c94603e287cb242ddb04c9963d758
use 2.0 api
fedspendingtransparency/data-act-build-tools,fedspendingtransparency/data-act-build-tools,fedspendingtransparency/data-act-build-tools
databricks/databricks-jobs.py
databricks/databricks-jobs.py
import sys import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning import json INSTANCE_ID = sys.argv[1] JOB_NAME = sys.argv[2] API_VERSION = '/api/2.0' print("----------RUNNING JOB " + JOB_NAME ) # Run Get request with api_command param # /jobs/list/ with api 2.0 returns all jobs, 2....
import sys import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning import json INSTANCE_ID = sys.argv[1] JOB_NAME = sys.argv[2] API_VERSION = '/api/2.1' print("----------RUNNING JOB " + JOB_NAME ) # Run Get request with api_command param # /jobs/list/ with api 2.0 returns all jobs, 2....
cc0-1.0
Python
49ad9f30982b2b7afcdc8704f317de2e329f594e
Hide paramiko logs
danielfrg/datasciencebox,danielfrg/datasciencebox,danielfrg/datasciencebox,danielfrg/datasciencebox
datasciencebox/core/logger.py
datasciencebox/core/logger.py
from __future__ import absolute_import, division, print_function import sys import logging import logging.handlers # Hide messages if we log before setting up handler logging.root.manager.emittedNoHandlerWarning = True logging.getLogger("paramiko").setLevel(logging.WARNING) def getLogger(): return logging.getL...
from __future__ import absolute_import, division, print_function import sys import logging import logging.handlers # Hide messages if we log before setting up handler logging.root.manager.emittedNoHandlerWarning = True def getLogger(): return logging.getLogger("datasciencebox") def setup_logging(log_level=log...
apache-2.0
Python
38f7074e4eaa6d87cbcd433c044a57408c34c182
Update request.py
slawek87/yql-finance
yql/request.py
yql/request.py
import requests class Request(object): """Class is responsible for prepare request query and sends it to YQL Yahoo API.""" parameters = { 'q': '', 'format': 'json', 'diagnostics': 'false', 'env': 'store://datatables.org/alltableswithkeys', 'callback': '' } api =...
import requests class Request(object): """Class is responsible for prepare request query and send reqest to YQL Yahoo API.""" parameters = { 'q': '', 'format': 'json', 'diagnostics': 'false', 'env': 'store://datatables.org/alltableswithkeys', 'callback': '' } ap...
bsd-3-clause
Python
e6303ec411181a6f593caa56de2d8dca643a9f0d
Update denorm command
barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore-django,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore
project/apps/api/management/commands/denormalize.py
project/apps/api/management/commands/denormalize.py
from django.core.management.base import ( BaseCommand, ) from apps.api.models import ( Convention, Contest, Contestant, Performance, Group, Person, Singer, Director, ) class Command(BaseCommand): help = "Command to denormailze data." def handle(self, *args, **options): ...
from django.core.management.base import ( BaseCommand, ) from apps.api.models import ( Convention, Contest, Contestant, Group, ) class Command(BaseCommand): help = "Command to denormailze data." def handle(self, *args, **options): cs = Contestant.objects.all() for c in cs...
bsd-2-clause
Python
87537f552eadda62839db4a1cf3220575a568db2
test against the return value of get_holiday instead of the function itself
bmintz/reactor-bot
reactor_bot/emoji.py
reactor_bot/emoji.py
#!/usr/bin/env python3 # encoding: utf-8 import re import string from datetime import date def get_poll_emoji(message): """generate the proper emoji to react to any poll message""" if message.count('\n') > 0: # ignore the first line, which is the command line for line in message.split('\n')[1:]: if not line...
#!/usr/bin/env python3 # encoding: utf-8 import re import string from datetime import date def get_poll_emoji(message): """generate the proper emoji to react to any poll message""" if message.count('\n') > 0: # ignore the first line, which is the command line for line in message.split('\n')[1:]: if not line...
mit
Python
7d177e9d8dbb90226174cf2b433ffd31faff79b5
Update Customer to inherit AbstractResource
aroncds/pagarme-python,pbassut/pagarme-python,mbodock/pagarme-python,pagarme/pagarme-python
pagarme/customer.py
pagarme/customer.py
# encoding: utf-8 from __future__ import unicode_literals from .resource import AbstractResource class Customer(AbstractResource): def __init__(self, api_key=None, name=None, document_number=None, email=None, address_street=None, address_neighborhood=None, address_zipcode=None, ...
# encoding: utf-8 from __future__ import unicode_literals class Customer(object): def __init__(self, name=None, document_number=None, email=None, address_street=None, address_neighborhood=None, address_zipcode=None, address_street_number=None, address_complement...
mit
Python
62a49d1f05b335779fd2aad2413cf84d656a869a
add Session error handle -> re_start session
DongjunLee/kino-bot
kino/bot.py
kino/bot.py
#coding: UTF-8 import asyncio import websockets import slack import utils # Send a message to channel (init) slackbot = slack.SlackerAdapter() config = utils.Config() MASTER_NAME = config.kino["MASTER_NAME"] BOT_NAME = config.kino["BOT_NAME"] hello_text = "{}님 안녕하세요! \n저는 개인비서 {} 라고 합니다.\n반갑습니다.".format(MASTER_NAME...
#coding: UTF-8 import asyncio import websockets import slack import utils # Send a message to channel (init) slackbot = slack.SlackerAdapter() config = utils.Config() MASTER_NAME = config.kino["MASTER_NAME"] BOT_NAME = config.kino["BOT_NAME"] hello_text = "{}님 안녕하세요! \n저는 {}님의 개인비서 {}입니다.\n반갑습니다.".format(MASTER_NAM...
mit
Python
a88eb2c7fc2c2d875836f0a4c201ede0c082aceb
Update the test model definitions.
affan2/django-selectable,affan2/django-selectable,mlavin/django-selectable,mlavin/django-selectable,affan2/django-selectable,mlavin/django-selectable
selectable/tests/__init__.py
selectable/tests/__init__.py
from django.db import models from django.utils.encoding import python_2_unicode_compatible from ..base import ModelLookup from ..registry import registry @python_2_unicode_compatible class Thing(models.Model): name = models.CharField(max_length=100) description = models.CharField(max_length=100) def __s...
from django.db import models from ..base import ModelLookup from ..registry import registry class Thing(models.Model): name = models.CharField(max_length=100) description = models.CharField(max_length=100) def __unicode__(self): return self.name def __str__(self): return self.name ...
bsd-2-clause
Python
2578241996f76eda87a769586fcbeab9e32dfda7
fix default value. test=develop
baidu/Paddle,tensor-tang/Paddle,baidu/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,chengduoZH/Paddle,luotao1/Paddle,luotao1/Paddle,baidu/Paddle,tensor-tang/Paddle,PaddlePaddle/Paddle,tensor-tang/Paddle,tensor-tang/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,chengduoZH/Paddle,chengduoZH/Paddle,luotao1/Paddle,luotao1/Pad...
python/paddle/fluid/tests/unittests/test_ir_memory_optimize_transformer.py
python/paddle/fluid/tests/unittests/test_ir_memory_optimize_transformer.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
Python
e3fcead75fc273fe7f69b2d3db7bbf2bc4ba722c
Fix dependency regression (fixes #194). (#196)
SergeyPirogov/testcontainers-python
testcontainers/core/generic.py
testcontainers/core/generic.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 # ...
# # 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 # ...
apache-2.0
Python
181b54b0303e38803b47696fbceb0ff1f9e0a0b5
change config tpl file name
echinopsii/net.echinopsii.ariane.community.core.mapping,echinopsii/net.echinopsii.ariane.community.core.mapping,echinopsii/net.echinopsii.ariane.community.core.mapping,echinopsii/net.echinopsii.ariane.community.core.mapping
distrib/installer/components/mapping/cuMappingRimManagedServiceProcessor.py
distrib/installer/components/mapping/cuMappingRimManagedServiceProcessor.py
# CC installer mapping rim managed service configuration unit # # Copyright (C) 2014 Mathilde Ffrench # # 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, ...
# CC installer mapping rim managed service configuration unit # # Copyright (C) 2014 Mathilde Ffrench # # 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, ...
agpl-3.0
Python
658f76ee6257cce8ab6f12d85a9a9472f925cc9d
print in a new location
natejgreene/pyTwinkle
pyTwinkle/light_strand.py
pyTwinkle/light_strand.py
import bluetooth import sys LIGHTS_NAME = "00651 36L RGB" class LightStrand: address = None port = None socket = None connected = False def __init__(self, address, port): self.address = address self.port = port def __del__(self): if self.socket: self.sock...
import bluetooth import sys LIGHTS_NAME = "00651 36L RGB" class LightStrand: address = None port = None socket = None connected = False def __init__(self, address, port): self.address = address self.port = port def __del__(self): if self.socket: self.sock...
mit
Python
c123e0b14dba7e893471a82e9c52b970b9884843
Fix py2.6 unicode output test cases
smalyshev/pywikibot-core,icyflame/batman,valhallasw/pywikibot-core,h4ck3rm1k3/pywikibot-core,jayvdb/pywikibot-core,magul/pywikibot-core,xZise/pywikibot-core,h4ck3rm1k3/pywikibot-core,PersianWikipedia/pywikibot-core,Darkdadaah/pywikibot-core,Darkdadaah/pywikibot-core,hasteur/g13bot_tools_new,VcamX/pywikibot-core,hasteur...
pywikibot/userinterfaces/terminal_interface_unix.py
pywikibot/userinterfaces/terminal_interface_unix.py
# -*- coding: utf-8 -*- # # (C) Pywikibot team, 2003-2014 # # Distributed under the terms of the MIT license. # __version__ = '$Id$' import sys from . import terminal_interface_base unixColors = { 'default': chr(27) + '[0m', # Unix end tag to switch back to default 'black': chr(27) + '[30m', ...
# -*- coding: utf-8 -*- # # (C) Pywikibot team, 2003-2014 # # Distributed under the terms of the MIT license. # __version__ = '$Id$' from . import terminal_interface_base unixColors = { 'default': chr(27) + '[0m', # Unix end tag to switch back to default 'black': chr(27) + '[30m', # Black sta...
mit
Python
0835e52fc950bd58be066c179f2bdf1f74da3c71
move to cloudstorage api
dart-lang/api.dart.dev,dart-lang/api.dart.dev
server/scripts/insertname.py
server/scripts/insertname.py
# Copyright (c) 2014, the Dart project authors. 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 re from webapp2 import * from google.appengine.api import memcache from redirector i...
# Copyright (c) 2014, the Dart project authors. 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 re from webapp2 import * from google.appengine.api import files, memcache from redir...
bsd-3-clause
Python
dc8bed4e91b53d1dcae87125e7c1c766da5ba3f6
Add some new InvItem types.
richardkiss/pycoin,richardkiss/pycoin
pycoin/message/InvItem.py
pycoin/message/InvItem.py
import functools from pycoin.serialize import b2h_rev from pycoin.serialize.bitcoin_streamer import parse_struct, stream_struct ITEM_TYPE_TX = 1 ITEM_TYPE_BLOCK = 2 ITEM_TYPE_MERKLEBLOCK = 3 INV_CMPCT_BLOCK = 4 INV_WITNESS_FLAG = 1 << 30 INV_TYPE_MASK = 0xffffffff >> 2 @functools.total_ordering class InvItem(objec...
import functools from pycoin.serialize import b2h_rev from pycoin.serialize.bitcoin_streamer import parse_struct, stream_struct ITEM_TYPE_TX, ITEM_TYPE_BLOCK, ITEM_TYPE_MERKLEBLOCK = (1, 2, 3) @functools.total_ordering class InvItem(object): def __init__(self, item_type, data, dont_check=False): if not ...
mit
Python
59e51a64ef4cc361e76f5146ce1052b80fc6b2a7
Bump version to 15.0.0a3
genialis/resolwe-bio,genialis/resolwe-bio,genialis/resolwe-bio,genialis/resolwe-bio
resolwe_bio/__about__.py
resolwe_bio/__about__.py
"""Central place for package metadata.""" # NOTE: We use __title__ instead of simply __name__ since the latter would # interfere with a global variable __name__ denoting object's name. __title__ = 'resolwe-bio' __summary__ = 'Bioinformatics pipelines for the Resolwe platform' __url__ = 'https://github.com/genial...
"""Central place for package metadata.""" # NOTE: We use __title__ instead of simply __name__ since the latter would # interfere with a global variable __name__ denoting object's name. __title__ = 'resolwe-bio' __summary__ = 'Bioinformatics pipelines for the Resolwe platform' __url__ = 'https://github.com/genial...
apache-2.0
Python
5bffdf7ec68934595c394910aafc25fe634b10b2
Update pylsy_test.py
gnithin/Pylsy,muteness/Pylsy,huiyi1990/Pylsy,gnithin/Pylsy,bcho/Pylsy,muteness/Pylsy,bcho/Pylsy,huiyi1990/Pylsy
pylsy/tests/pylsy_test.py
pylsy/tests/pylsy_test.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import unittest from pylsy import PylsyTable class PylsyTableTests(unittest.TestCase): def setUp(self): attributes = ["name", "age"] self.table = PylsyTable(attributes) def tearDown(self): self.table = None def test...
# -*- coding: utf-8 -*- from __future__ import absolute_import import unittest from pylsy import PylsyTable class PylsyTableTests(unittest.TestCase): def setUp(self): attributes = ["name", "age"] self.table = PylsyTable(attributes) def tearDown(self): self.table = None def test...
mit
Python
a9a98603d0170128dab627a17a6d525083f48c6a
change forever semantics; instead make it something run by crontab, so is much more robust than a daemon can possibly be.
sagemathinc/smc,tscholl2/smc,sagemathinc/smc,sagemathinc/smc,tscholl2/smc,tscholl2/smc,tscholl2/smc,DrXyzzy/smc,tscholl2/smc,DrXyzzy/smc,sagemathinc/smc,DrXyzzy/smc,DrXyzzy/smc
salvus/scripts/forever.py
salvus/scripts/forever.py
#!/usr/bin/env python # Ensure that system-wide daemons are running. # If <service> is not running, do "service <service> restart". # We do NOT just do "service <service> start" since that does # not work (it's just an observerable fact). # # Put this in a crontab, e.g., # # * * * * * /home/salvus/forever.py rethin...
#!/usr/bin/env python # Ensure that system-wide daemons stays running. # If <service> is not running, do "service <service> restart". # We do NOT just do "service <service> start" since that does # not work (it's just an observerable fact). import os, sys, time SERVICES = sys.argv[1:] if len(SERVICES) == 0 or len([x...
agpl-3.0
Python