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 |
|---|---|---|---|---|---|---|---|---|
b39fe701b98a98dde8e7aca475ec2409de9c465a | Handle the data directory not existing | falconkirtaran/ArchiveBot,ArchiveTeam/ArchiveBot,ArchiveTeam/ArchiveBot,falconkirtaran/ArchiveBot,ArchiveTeam/ArchiveBot,ArchiveTeam/ArchiveBot,falconkirtaran/ArchiveBot,falconkirtaran/ArchiveBot,falconkirtaran/ArchiveBot,ArchiveTeam/ArchiveBot | pipeline/archivebot/seesaw/monitoring.py | pipeline/archivebot/seesaw/monitoring.py | import functools
import hashlib
import os
import socket
import sys
import time
import psutil
import tornado.ioloop
def pipeline_id():
hostname = socket.gethostname()
fqdn = socket.getfqdn()
pid = os.getpid()
pipeline_id_input = "%s:%s:%s" % (hostname, fqdn, pid)
m = hashlib.md5()
m.update(pi... | import functools
import hashlib
import os
import socket
import sys
import time
import psutil
import tornado.ioloop
def pipeline_id():
hostname = socket.gethostname()
fqdn = socket.getfqdn()
pid = os.getpid()
pipeline_id_input = "%s:%s:%s" % (hostname, fqdn, pid)
m = hashlib.md5()
m.update(pi... | mit | Python |
46594f8adbfe754cab3144a700fd86fd84c8890c | Add a Results class, and commit/optimize methods | pixbuffer/sunburnt-spatial,rlskoeser/sunburnt,anmar/sunburnt,tow/sunburnt,anmar/sunburnt,qmssof/sunburnt,pixbuffer/sunburnt-spatial,rlskoeser/sunburnt | sunburnt.py | sunburnt.py | from __future__ import absolute_import
import cgi
import urllib
import httplib2
from lxml.builder import ElementMaker
from lxml import etree
import simplejson
h = httplib2.Http(".cache")
E = ElementMaker()
def force_utf8(s):
if isinstance(s, str):
return s
else:
return s.encode('utf-8')
cl... | from __future__ import absolute_import
import cgi
import urllib
import httplib2
from lxml.builder import ElementMaker
from lxml import etree
import simplejson
h = httplib2.Http(".cache")
E = ElementMaker()
def force_utf8(s):
if isinstance(s, str):
return s
else:
return s.encode('utf-8')
cl... | mit | Python |
1fbcf903d19e842c9a08576c5198417478bcf6da | bump version to 0.3.3 | SexualHealthInnovations/callisto-core,project-callisto/callisto-core,project-callisto/callisto-core,SexualHealthInnovations/callisto-core | callisto/delivery/__init__.py | callisto/delivery/__init__.py | __version__ = '0.3.3'
| __version__ = '0.3.2'
| agpl-3.0 | Python |
ce75e9fe72ad1117894d06a282512d4b6120d05b | add tests for the new atropos report parsing | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | test/modules_report/test_cutadapt.py | test/modules_report/test_cutadapt.py | from sequana import sequana_data
from sequana.modules_report.cutadapt import CutadaptModule
from sequana.utils import config
from sequana import bedtools, sequana_data
def test_cutadapt_module(tmpdir):
directory = tmpdir.mkdir('test_module')
config.output_dir = str(directory)
config.sample_name = 'JB40984... | from sequana import sequana_data
from sequana.modules_report.cutadapt import CutadaptModule
from sequana.utils import config
from sequana import bedtools, sequana_data
def test_cutadapt_module(tmpdir):
directory = tmpdir.mkdir('test_module')
config.output_dir = str(directory)
config.sample_name = 'JB40984... | bsd-3-clause | Python |
76a33f37dbc8b2dd7c33648cc75d7ddd647d44ff | Add some more tests | vrs01/mopidy,pacificIT/mopidy,vrs01/mopidy,jodal/mopidy,rawdlite/mopidy,swak/mopidy,bacontext/mopidy,ali/mopidy,diandiankan/mopidy,rawdlite/mopidy,mopidy/mopidy,ali/mopidy,jcass77/mopidy,jmarsik/mopidy,bencevans/mopidy,bencevans/mopidy,pacificIT/mopidy,hkariti/mopidy,SuperStarPL/mopidy,tkem/mopidy,dbrgn/mopidy,bencevan... | tests/gstreamer_test.py | tests/gstreamer_test.py | import multiprocessing
import unittest
from tests import SkipTest
# FIXME Our Windows build server does not support GStreamer yet
import sys
if sys.platform == 'win32':
raise SkipTest
from mopidy import settings
from mopidy.gstreamer import GStreamer
from mopidy.utils.path import path_to_uri
from tests import p... | import multiprocessing
import unittest
from tests import SkipTest
# FIXME Our Windows build server does not support GStreamer yet
import sys
if sys.platform == 'win32':
raise SkipTest
from mopidy import settings
from mopidy.gstreamer import GStreamer
from mopidy.utils.path import path_to_uri
from tests import p... | apache-2.0 | Python |
d2678e587aa6c1c49247aea2986a6d8167bb9a8e | remove 'ceph' from being installed as it will no longer make sense | branto1/ceph-deploy,codenrhoden/ceph-deploy,zhouyuan/ceph-deploy,ceph/ceph-deploy,ddiss/ceph-deploy,shenhequnying/ceph-deploy,ceph/ceph-deploy,osynge/ceph-deploy,Vicente-Cheng/ceph-deploy,ddiss/ceph-deploy,ghxandsky/ceph-deploy,Vicente-Cheng/ceph-deploy,isyippee/ceph-deploy,alfredodeza/ceph-deploy,codenrhoden/ceph-depl... | ceph_deploy/util/constants.py | ceph_deploy/util/constants.py | from os.path import join
from collections import namedtuple
# Base Path for ceph
base_path = '/var/lib/ceph'
# Base run Path
base_run_path = '/var/run/ceph'
tmp_path = join(base_path, 'tmp')
mon_path = join(base_path, 'mon')
mds_path = join(base_path, 'mds')
osd_path = join(base_path, 'osd')
# Default package co... | from os.path import join
from collections import namedtuple
# Base Path for ceph
base_path = '/var/lib/ceph'
# Base run Path
base_run_path = '/var/run/ceph'
tmp_path = join(base_path, 'tmp')
mon_path = join(base_path, 'mon')
mds_path = join(base_path, 'mds')
osd_path = join(base_path, 'osd')
# Default package co... | mit | Python |
cdbfb70b801c1a57d6018c6a84877334636b0d19 | Add docstrings | sedders123/phial | phial/errors.py | phial/errors.py | """phial's custom errors."""
class ArgumentValidationError(Exception):
"""Exception indicating argument validation has failed."""
pass
class ArgumentTypeValidationError(Exception):
"""Exception indicating argument type validation has failed."""
pass
| class ArgumentValidationError(Exception):
pass
class ArgumentTypeValidationError(Exception):
pass
| mit | Python |
c9bf1d212f0f60589a100306ad981c68f665c643 | Remove empty line | globality-corp/microcosm-flask,globality-corp/microcosm-flask | microcosm_flask/metrics.py | microcosm_flask/metrics.py | """
Metrics extensions for routes.
"""
try:
from microcosm_metrics.classifier import Classifier
except ImportError:
raise Exception("Route metrics require 'microcosm-metrics'")
from microcosm_flask.audit import parse_response
from microcosm_flask.errors import extract_status_code
class StatusCodeClassifier... |
"""
Metrics extensions for routes.
"""
try:
from microcosm_metrics.classifier import Classifier
except ImportError:
raise Exception("Route metrics require 'microcosm-metrics'")
from microcosm_flask.audit import parse_response
from microcosm_flask.errors import extract_status_code
class StatusCodeClassifie... | apache-2.0 | Python |
19bf87c039187b8c68b4698729b278dc7b07e364 | Fix test data | netbek/chrys,netbek/chrys,netbek/chrys | tests/py/utils_tests.py | tests/py/utils_tests.py | import unittest
from chrys.utils import best_color_contrast
class BestColorContrastTests(unittest.TestCase):
def test_black_on_red(self):
self.assertEqual(best_color_contrast('#ff0000', ['#000000', '#ffffff']), '#000000')
| import unittest
from chrys.utils import best_color_contrast
class BestColorContrastTests(unittest.TestCase):
def test_black_on_red(self):
self.assertEqual(best_color_contrast('#f00000', ['#000000', '#ffffff']), '#000000')
| bsd-3-clause | Python |
200280cb4d9db902d812eea3047ba53a9454da4b | fix utf-8 encoding problem | fonorobert/mailforward | mailfwd.py | mailfwd.py | #!/usr/bin/env python3
import sys
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.parser import Parser
from configparser import ConfigParser
from email.utils import parseaddr
#Parse config
config = ConfigParser()
config.read('/home/fonorobert/scripts/mailf... | #!/usr/bin/env python3
import sys
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.parser import Parser
from configparser import ConfigParser
from email.utils import parseaddr
#Parse config
config = ConfigParser()
config.read('/home/fonorobert/scripts/mailf... | mit | Python |
eac78bcb95e2c34a5c2de75db785dd6532306819 | Add draft of DeVos solar cell power function | jrsmith3/tec,jrsmith3/ibei,jrsmith3/tec | ibei/main.py | ibei/main.py | # -*- coding: utf-8 -*-
import numpy as np
from astropy import constants
from astropy import units
from sympy.mpmath import polylog
def uibei(order, energy_lo, temp, chem_potential):
"""
Upper incomplete Bose-Einstein integral.
"""
kT = temp * constants.k_B
reduced_energy_lo = energy_lo / kT
... | # -*- coding: utf-8 -*-
import numpy as np
from astropy import constants
from astropy import units
from sympy.mpmath import polylog
def uibei(order, energy_lo, temp, chem_potential):
"""
Upper incomplete Bose-Einstein integral.
"""
kT = temp * constants.k_B
reduced_energy_lo = energy_lo / kT
... | mit | Python |
791de25117257159a981d3220e492f17ff808186 | Use gettext.dgettext replace locale.dgettext | ueno/ibus,ibus/ibus-cros,ibus/ibus,ibus/ibus-cros,j717273419/ibus,ibus/ibus-cros,j717273419/ibus,j717273419/ibus,fujiwarat/ibus,ueno/ibus,phuang/ibus,Keruspe/ibus,luoxsbupt/ibus,ibus/ibus,phuang/ibus,luoxsbupt/ibus,Keruspe/ibus,ibus/ibus-cros,fujiwarat/ibus,j717273419/ibus,fujiwarat/ibus,Keruspe/ibus,luoxsbupt/ibus,ibu... | ibus/lang.py | ibus/lang.py | # vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of ... | # vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of ... | lgpl-2.1 | Python |
2fb3beeaf1215a1be4a7bc97097ef6a33fd65aeb | Fix error message and format with python/black (#1025) | TheAlgorithms/Python | dynamic_programming/climbing_stairs.py | dynamic_programming/climbing_stairs.py | #!/usr/bin/env python3
def climb_stairs(n: int) -> int:
"""
LeetCdoe No.70: Climbing Stairs
Distinct ways to climb a n step staircase where
each time you can either climb 1 or 2 steps.
Args:
n: number of steps of staircase
Returns:
Distinct ways to climb a n step staircase
... | def climb_stairs(n: int) -> int:
"""
LeetCdoe No.70: Climbing Stairs
Distinct ways to climb a n step staircase where
each time you can either climb 1 or 2 steps.
Args:
n: number of steps of staircase
Returns:
Distinct ways to climb a n step staircase
Raises:
AssertionError: n not po... | mit | Python |
6350c50d44a57291a2f8c80c4004fee418c8b850 | add dataloder | PKU-Dragon-Team/Datalab-Utilities | mobile_cluster/__init__.py | mobile_cluster/__init__.py | """the package for clustering mobile_data
"""
import json
import math
import numbers
import typing as tg
import numpy as np
import pandas as pd
import pymysql
class NumpyAndPandasEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, (np.ndarray, np.matrix)):
return [self.defau... | """the package for clustering mobile_data
"""
import json
import math
import numbers
import typing as tg
import numpy as np
import pandas as pd
class NumpyAndPandasEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, (np.ndarray, np.matrix)):
return [self.default(x) for x in ... | mit | Python |
b74f9c13a0dfd63f167182440dd1c886c49a9e85 | Fix url_json | innogames/igcollect | src/url_json.py | src/url_json.py | from argparse import ArgumentParser
from time import time
from urllib.request import urlopen
import json
def parse_args():
parser = ArgumentParser()
parser.add_argument('--prefix', default='url_json')
parser.add_argument('--url', default='http://localhost/')
parser.add_argument(
'--key',
... | from argparse import ArgumentParser
from time import time
from urllib.request import urlopen
import json
def parse_args():
parser = ArgumentParser()
parser.add_argument('--prefix', default='url_json')
parser.add_argument('--url', default='http://localhost/')
parser.add_argument(
'--key',
... | mit | Python |
5d64545fdba1fef92a4853f2145c8dcde829ce2a | Remove users application urlpatterns | FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management,FreeCodeCampRoma/precision_school-management | config/urls.py | config/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
# Django Admin, use {% url 'admin:index' %}
url... | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='page... | mit | Python |
5de1e4e0fccf6a65eade92793ef9222c3d10c845 | move member admin from default location | PhillyDSA/phillydsa-com,PhillyDSA/phillydsa-com,PhillyDSA/phillydsa-com,PhillyDSA/phillydsa-com | config/urls.py | config/urls.py | # -*- coding: utf-8 -*-
"""URL configuration for main site."""
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from search import views as search_views
from wagtail.contrib.wagtailsitemaps.views import sitemap
from wagtail.wagtailadmi... | # -*- coding: utf-8 -*-
"""URL configuration for main site."""
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from search import views as search_views
from wagtail.contrib.wagtailsitemaps.views import sitemap
from wagtail.wagtailadmi... | agpl-3.0 | Python |
580095babdd6038b28a2fbe9677cfe354c26c98c | Save as a mp4 video | M2-AAIS/BAD | plot_s_curve.py | plot_s_curve.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from numpy import array, log
import sys
import os
import matplotlib.animation as animation
fig = plt.figure()
inpath = sys.argv[1]
if os.path.isfile(inpath):
print('Visiting {}'.format(inpath))
filenames = [inpath]
else:
_fil... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from numpy import array, log
import sys
import os
import matplotlib.animation as animation
fig = plt.figure()
inpath = sys.argv[1]
if os.path.isfile(inpath):
print('Visiting {}'.format(inpath))
filenames = [inpath]
else:
_fil... | mit | Python |
ec7e77b177177a67b1744ce606407be389d5b953 | add error handler | aipescience/django-daiquiri-app,aipescience/django-daiquiri-app | config/urls.py | config/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from daiquiri.core.views import home
urlpatterns = [
url(r'^$', home, name='home'),
url(r'^accounts/', include('daiquiri.auth.urls_accounts')),
url(r'^archive/', include('daiquiri.archive.urls', namespace='archive')),
url(r'^... | from django.conf.urls import include, url
from django.contrib import admin
from daiquiri.core.views import home
urlpatterns = [
url(r'^$', home, name='home'),
url(r'^accounts/', include('daiquiri.auth.urls_accounts')),
url(r'^archive/', include('daiquiri.archive.urls', namespace='archive')),
url(r'^... | apache-2.0 | Python |
abf26b0a93216fec9fe4d4aa904e9fa94d85a366 | Print pytest command | lhupfeldt/multiconf | test/run.py | test/run.py | import sys, os, subprocess
from os.path import join as jp
import pytest
import tenjin
from tenjin.helpers import *
_here = os.path.abspath(os.path.dirname(__file__))
def main(args):
print("Running tests, args:", args)
if args and args != ['-v']:
return pytest.main(['--capture=sys'] + args)
en... | import sys, os, subprocess
from os.path import join as jp
import pytest
import tenjin
from tenjin.helpers import *
_here = os.path.abspath(os.path.dirname(__file__))
def main(args):
print("Running tests, args:", args)
if args and args != ['-v']:
return pytest.main(['--capture=sys'] + args)
en... | bsd-3-clause | Python |
64a6202ea124db6cab2d5b8030a3b97b511d5c53 | Add gst MESSAGE_* constansts to BaseOutput | glogiotatidis/mopidy,vrs01/mopidy,kingosticks/mopidy,kingosticks/mopidy,mokieyue/mopidy,glogiotatidis/mopidy,SuperStarPL/mopidy,quartz55/mopidy,jmarsik/mopidy,jcass77/mopidy,liamw9534/mopidy,bencevans/mopidy,SuperStarPL/mopidy,bencevans/mopidy,hkariti/mopidy,pacificIT/mopidy,rawdlite/mopidy,priestd09/mopidy,dbrgn/mopid... | mopidy/outputs/__init__.py | mopidy/outputs/__init__.py | import pygst
pygst.require('0.10')
import gst
import logging
logger = logging.getLogger('mopidy.outputs')
class BaseOutput(object):
"""Base class for providing support for multiple pluggable outputs."""
MESSAGE_EOS = gst.MESSAGE_EOS
MESSAGE_ERROR = gst.MESSAGE_ERROR
MESSAGE_WARNING = gst.MESSAGE_WAR... | import pygst
pygst.require('0.10')
import gst
import logging
logger = logging.getLogger('mopidy.outputs')
class BaseOutput(object):
"""Base class for providing support for multiple pluggable outputs."""
def __init__(self, gstreamer):
self.gstreamer = gstreamer
self.bin = self.build_bin()
... | apache-2.0 | Python |
5c7c27a6172bb83878ca2e16033e2af78b8aaf3a | load modules#2 | ITOO-UrFU/open-programs,ITOO-UrFU/open-programs,ITOO-UrFU/open-programs | open_programs/apps/uni/management/commands/load_modules.py | open_programs/apps/uni/management/commands/load_modules.py | from django.core.management.base import BaseCommand
import os
import json
from django.conf import settings
from modules.models import Module
class Command(BaseCommand):
help = "Загрузка справочника модулей"
def handle(self, *args, **options):
def update_if_none(m, field, json_val=None):
i... | from django.core.management.base import BaseCommand
import os
import json
from django.conf import settings
from modules.models import Module
class Command(BaseCommand):
help = "Загрузка справочника модулей"
def handle(self, *args, **options):
def update_if_none(m, field, json_val=None):
i... | unlicense | Python |
4ab04e8fb7aba84c1b0717a423d15a759253dea5 | make tests pass, but this is a horrible solution REMEMBER TO CHECK WHY THE TEST ORDER MATTERS | leerssej/freebase-python,gagoel/freebase-python,gagoel/freebase-python,gagoel/freebase-python,leerssej/freebase-python,leerssej/freebase-python | test/runtests.py | test/runtests.py | import unittest
import os
import os.path
import freebase
def main():
created = False
passwordfile = "test/.password.txt"
# setup password stuff
if not os.path.isfile(passwordfile):
created = True
USERNAME, PASSWORD = "", ""
print "RUNTESTSIn order to run the tests, we nee... | import unittest
import os
import os.path
import freebase
def main():
created = False
passwordfile = "test/.password.txt"
# setup password stuff
if not os.path.isfile(passwordfile):
created = True
USERNAME, PASSWORD = "", ""
print "RUNTESTSIn order to run the tests, we nee... | bsd-2-clause | Python |
7b39758ba7aaba00802069337cd0cc1c137f5aa8 | fix type error on python2 | mordred-descriptor/mordred,mordred-descriptor/mordred | mordred/_constitutional.py | mordred/_constitutional.py | from rdkit import Chem
from . import _atomic_property
from ._base import Descriptor
class ConstitutionalSum(Descriptor):
r"""sum of constitutional descriptor.
.. math::
S_p = \sum^A_{i=1} \frac{p_i}{p_{\rm C}}
where
:math:`p_i` is atomic property of i-th atom,
:math:`p_{\rm C}` is atomi... | from rdkit import Chem
from . import _atomic_property
from ._base import Descriptor
class ConstitutionalSum(Descriptor):
r"""sum of constitutional descriptor.
.. math::
S_p = \sum^A_{i=1} \frac{p_i}{p_{\rm C}}
where
:math:`p_i` is atomic property of i-th atom,
:math:`p_{\rm C}` is atomi... | bsd-3-clause | Python |
a08f1089a1e231846979828857f7316721fc7a5b | Update to use the new APIs. | python-postgres/fe,python-postgres/fe | postgresql/test/perf_copy_io.py | postgresql/test/perf_copy_io.py | ##
# copyright 2009, James William Pye
# http://python.projects.postgresql.org
##
# Copy I/O: To and From performance
##
import os, sys, random, time
if __name__ == '__main__':
with open('/usr/share/dict/words', mode='brU') as wordfile:
Words = wordfile.readlines()
else:
Words = [b'/usr/share/dict/words', b'is', b... | ##
# copyright 2009, James William Pye
# http://python.projects.postgresql.org
##
# Copy I/O: To and From performance
##
import os, sys, gc, random, time
if __name__ == '__main__':
Words = open('/usr/share/dict/words').readlines()
else:
Words = ['/usr/share/dict/words', 'is', 'read', 'in', '__main__']
wordcount = le... | bsd-3-clause | Python |
e4e0b4591c48adab4505be1595d08ea02500f50c | remove utf-8 hack | xflows/clowdflows-backend,xflows/clowdflows-backend,xflows/clowdflows-backend,xflows/clowdflows-backend | mothra/__local_settings.py | mothra/__local_settings.py | # Local settings for mothra project.
LOCAL_SETTINGS = True
from .settings import *
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': os.path.join(PROJECT_DIR, 'mothra.db'), # Or path to database file... | # Local settings for mothra project.
LOCAL_SETTINGS = True
from .settings import *
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': os.path.join(PROJECT_DIR, 'mothra.db'), # Or path to database file... | mit | Python |
66cde5286451e12988fe150c6c6b53effb45c2da | add global src_uri property | PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild | pprof/projects/pprof/leveldb.py | pprof/projects/pprof/leveldb.py | #!/usr/bin/evn python
# encoding: utf-8
from pprof.project import ProjectFactory
from pprof.projects.pprof.group import PprofGroup
from os import path
from plumbum import FG, local
class LevelDB(PprofGroup):
src_uri = "https://github.com/google/leveldb"
class Factory:
def create(self, exp):
... | #!/usr/bin/evn python
# encoding: utf-8
from pprof.project import ProjectFactory
from pprof.projects.pprof.group import PprofGroup
from os import path
from plumbum import FG, local
class LevelDB(PprofGroup):
class Factory:
def create(self, exp):
return LevelDB(exp, "leveldb", "database")
... | mit | Python |
cacdbe382142356534855a6a2d092122f728429b | fix syntax error | vcoque/consul-ri | consulrest/keyvalue.py | consulrest/keyvalue.py | import json
import re
import requests
class KeyValue(object):
def __init__(self, url):
self._url = "%s/kv" % url
def _get(self, key, recurse=None, keys=None):
url = self._url + '/' + key
params = dict()
if recurse is not None:
params['recurse'] = True
if k... | import json
import re
import requests
class KeyValue(object):
def __init__(self, url):
self._url = "%s/kv" % url
def _get(self, key, recurse=None, keys=None):
url = self._url + '/' + key
params = dict()
if recurse is not None:
params['recurse'] = True
if k... | mit | Python |
c7bd81a66dfc6d510e54a7e7e661c8a9784970ab | Set posts to display in descending order by date | siketh/TRBlog,siketh/TRBlog,siketh/TRBlog,siketh/TRBlog | app/views.py | app/views.py | from flask import render_template, redirect, url_for
from app import app, models
from datetime import date
from config import POSTS_PER_PAGE
@app.route('/')
@app.route('/index')
def index():
return redirect(url_for('blog'))
@app.route('/blog')
@app.route('/blog/<int:page_index>')
def blog(page_index=1):
posts = mod... | from flask import render_template, redirect, url_for
from app import app, models
from datetime import date
from config import POSTS_PER_PAGE
@app.route('/')
@app.route('/index')
def index():
return redirect(url_for('blog'))
@app.route('/blog')
@app.route('/blog/<int:page_index>')
def blog(page_index=1):
posts = mod... | mit | Python |
8377bbca8b49a7a973d5521795d6df238774db8b | Fix for empty lines in data sets | mariocesar/namegenerator | codenamegenerator/__init__.py | codenamegenerator/__init__.py | from typing import List
import csv
import os
import random
DICT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "dicts")
def dictionary_sample(name: str, sample: int = 1) -> List[str]:
# TODO: Cache counting, and use file.seek to speed file reading.
fname = os.path.join(DICT_DIR, f"{name}.cs... | from typing import List
import csv
import os
import random
DICT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "dicts")
def dictionary_sample(name: str, sample: int = 1) -> List[str]:
# TODO: Cache counting, and use file.seek to speed file reading.
fname = os.path.join(DICT_DIR, f"{name}.cs... | mit | Python |
a6f7d7dc990bac28f0301486eb7081127f8985d7 | Bump version to 0.2.3 | pmart123/security_id,pmart123/cymbology | cymbology/_version.py | cymbology/_version.py | version_info = (0, 2, 3)
__version__ = '.'.join(map(str, version_info))
| version_info = (0, 2, 2)
__version__ = '.'.join(map(str, version_info))
| bsd-2-clause | Python |
1650c9d9620ba9b9262598d3a47208c6c8180768 | Make shows and episodes only appear if published is true. | frequencyasia/website,frequencyasia/website | app/views.py | app/views.py | from flask import render_template, jsonify
from app import app
from models import Show, Episode
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
@app.route("/api/new-episodes/")
def new_episodes():
# Return all episodes with showcase set to True.
data = {
"items... | from flask import render_template, jsonify
from app import app
from models import Show, Episode
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
@app.route("/api/new-episodes/")
def new_episodes():
data = {
"items": []
}
for episode in Episode.query.filter_b... | mit | Python |
205b61cd1d0debcf994bfe346cde91597b0ecb4e | fix error | abonte/southtyrolean-healthservices-waitingtimes,abonte/southtyrolean-healthservices-waitingtimes,abonte/southtyrolean-healthservices-waitingtimes | app/views.py | app/views.py | from flask import render_template
from app import app
import requests
import demjson
from .forms import SearchForm
import json
@app.route('/', methods=('GET', 'POST'))
@app.route('/index', methods=('GET', 'POST'))
def index():
form = SearchForm()
r = requests.get('http://daten.buergernetz.bz.it/services/WaitL... | from flask import render_template
from app import app
import requests
import demjson
from .forms import SearchForm
import json
@app.route('/', methods=('GET', 'POST'))
@app.route('/index', methods=('GET', 'POST'))
def index():
form = SearchForm()
r = requests.get('http://daten.buergernetz.bz.it/services/WaitL... | mit | Python |
28b6ffd6e790de9ff2cdb2a20b649eddc5d223f8 | update recognition.py | ManasiKhapke/Project,faizankshaikh/Project | project/packages/recognition.py | project/packages/recognition.py | #TODO Write module 2 here
# Import all modules
import random
import pylab
import pickle as pkl
import numpy as np
import pandas as pd
from scipy.misc import imread, imresize
from lasagne import layers
from theano.tensor.nnet import softmax
from nolearn.lasagne import NeuralNet
from nolearn.lasagne import BatchIterator
... | #TODO Write module 2 here
| mit | Python |
b49de8ad507a59f29052b0a54d6756105da6d5c5 | remove a silly todo | ashbc/tgrsite,ashbc/tgrsite,ashbc/tgrsite | statics/urls.py | statics/urls.py | from django.conf.urls import url
from . import views
from django.views.generic import TemplateView
urlpatterns = [
url(r'^schedule/$', TemplateView.as_view(template_name='statics/schedule.html'), name='schedule'),
url(r'^gallery/$', TemplateView.as_view(template_name='statics/gallery.html'), name='gallery'),
url(r'... | from django.conf.urls import url
from . import views
# todo: apply this everywhere
from django.views.generic import TemplateView
urlpatterns = [
url(r'^schedule/$', TemplateView.as_view(template_name='statics/schedule.html'), name='schedule'),
url(r'^gallery/$', TemplateView.as_view(template_name='statics/gallery.h... | isc | Python |
edcf8f45ba15009c54fec1bd0ba7b5ef74a7e5ea | Check for digitness | r-barnes/waterviz,r-barnes/waterviz,HydroLogic/waterviz,HydroLogic/waterviz,HydroLogic/waterviz,r-barnes/waterviz,HydroLogic/waterviz,r-barnes/waterviz | data/save_historic.py | data/save_historic.py | #!/usr/bin/env python
import glob
import csv
import psycopg2
import psycopg2.extras
import scipy.stats
import numpy as np
conn = psycopg2.connect("dbname='rivers' user='nelson' host='localhost' password='NONE'")
cur = conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor)
cur.execute("SELECT site_no, array_to_... | #!/usr/bin/env python
import glob
import csv
import psycopg2
import psycopg2.extras
import scipy.stats
import numpy as np
conn = psycopg2.connect("dbname='rivers' user='nelson' host='localhost' password='NONE'")
cur = conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor)
cur.execute("SELECT site_no, array_to_... | bsd-3-clause | Python |
969fcac775b628c0b392525ae05be1a54c9c4590 | convert exception handling to Py3 style | bbaja42/NIPAP,ettrig/NIPAP,SpriteLink/NIPAP,ettrig/NIPAP,SoundGoof/NIPAP,ettrig/NIPAP,garberg/NIPAP,garberg/NIPAP,SpriteLink/NIPAP,ettrig/NIPAP,ettrig/NIPAP,plajjan/NIPAP,garberg/NIPAP,SoundGoof/NIPAP,fredsod/NIPAP,SoundGoof/NIPAP,garberg/NIPAP,ettrig/NIPAP,plajjan/NIPAP,SpriteLink/NIPAP,bbaja42/NIPAP,SpriteLink/NIPAP,... | nipap/nipap/nipapconfig.py | nipap/nipap/nipapconfig.py | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | mit | Python |
4d8fca81b6256111f18f39a7553cb7f3d640ab9d | fix a typo | zhijian-liu/auto-triage,zhijian-liu/auto-triage | src/data.py | src/data.py | import os, cv2, tqdm
import numpy as np
def load_data(FLAGS):
X, Y = {}, {}
for set in ["train", "valid", "test"]:
if os.path.exists("../data/" + set + ".npz"):
files = np.load(open("../data/" + set + ".npz", "r"))
X[set], Y[set] = [files["X0"], files["X1"]], files["Y"]
else:
X[set], Y[se... | import os, cv2, tqdm
import numpy as np
def load_data(FLAGS):
X, Y = {}, {}
for set in ["train", "valid", "test"]:
if os.path.exists("../data/" + set + ".npz"):
files = np.load(open("../data/" + set + ".npz", "r"))
X[set], Y[set] = [files["X0"], files["X1"]], files["Y"]
else:
X[set], Y[se... | mit | Python |
63655fb7abba1e59c4bd937bf6d66fb1c3b0a842 | comment out sqlite on test settings due to a sqlite syntax error on empty inserts | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | test_settings.py | test_settings.py | from gem.settings import * # noqa: F401, F403
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': 'gem_test.db',
# }
# }
LOGGING = {
'version': 1,
'handlers': {
'console': {
'level': 'WARNING',
'class': 'logging.StreamHandl... | from gem.settings import * # noqa: F401, F403
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'gem_test.db',
}
}
LOGGING = {
'version': 1,
'handlers': {
'console': {
'level': 'WARNING',
'class': 'logging.StreamHandler',
... | bsd-2-clause | Python |
d6bd599eebd797ae48f5d4bd2ac90a0f5f6b1b25 | Check that image data folder exists. | mgunyho/kiltiskahvi | compvis/label_data_web/app.py | compvis/label_data_web/app.py | """
A simple flask server for labeling pictures and storing the labels in a
database. For details, see README.md
Note that in our special case, the pictures are cropped (using HTML/css). If
you don't want this, you can simply remove the "cropped" wrapper div from
label-data.html.
"""
from utils import DBManager
from f... | """
A simple flask server for labeling pictures and storing the labels in a
database. For details, see README.md
Note that in our special case, the pictures are cropped (using HTML/css). If
you don't want this, you can simply remove the "cropped" wrapper div from
label-data.html.
"""
from utils import DBManager
from f... | mit | Python |
c322082ff8b4bbb175d686b6b1f827ede0d359c8 | Update note list for my tests | pnomolos/greatbigcrane,pnomolos/greatbigcrane | greatbigcrane/buildout_manage/tests.py | greatbigcrane/buildout_manage/tests.py | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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 agre... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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 agre... | apache-2.0 | Python |
f32685ef4ad847bd237845da6b5b8c44dac0ea9b | Fix travis, make sure skipif condition resolves to a bool | audreyr/cookiecutter,dajose/cookiecutter,kkujawinski/cookiecutter,hackebrot/cookiecutter,venumech/cookiecutter,vintasoftware/cookiecutter,pjbull/cookiecutter,lucius-feng/cookiecutter,ramiroluz/cookiecutter,venumech/cookiecutter,0k/cookiecutter,christabor/cookiecutter,hackebrot/cookiecutter,Vauxoo/cookiecutter,Springerl... | tests/skipif_markers.py | tests/skipif_markers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
skipif_markers
--------------
Contains pytest skipif markers to be used in the suite.
"""
import pytest
import os
try:
os.environ[u'TRAVIS']
except KeyError:
travis = False
else:
travis = True
try:
os.environ[u'DISABLE_NETWORK_TESTS']
except KeyErr... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
skipif_markers
--------------
Contains pytest skipif markers to be used in the suite.
"""
import pytest
import os
try:
travis = os.environ[u'TRAVIS']
except KeyError:
travis = False
try:
no_network = os.environ[u'DISABLE_NETWORK_TESTS']
except KeyError... | bsd-3-clause | Python |
68ee2248b679464e65487e69a985702324d322ce | remove duplicate processing | thombashi/pytablewriter | pytablewriter/writer/_sqlite.py | pytablewriter/writer/_sqlite.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import simplesqlite
import tabledata
from ._interface import BinaryWriterInterface
from ._table_writer import AbstractTableWriter
class SqliteTableWriter(AbstractTable... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import simplesqlite
import tabledata
from ._interface import BinaryWriterInterface
from ._table_writer import AbstractTableWriter
class SqliteTableWriter(AbstractTable... | mit | Python |
114a6eb827c0e3dd4557aee8f76fde1bbd111bb9 | Update indentation to 4 spaces | imrehg/archalice | archalice.py | archalice.py | #!/usr/bin/env python
import os
import re
import time
import sys
from threading import Thread
class testit(Thread):
def __init__ (self,ip):
Thread.__init__(self)
self.ip = ip
self.status = -1
self.responsetime = -1
def run(self):
pingaling = os.popen("ping -q -c2 "+sel... | #!/usr/bin/env python
import os
import re
import time
import sys
from threading import Thread
class testit(Thread):
def __init__ (self,ip):
Thread.__init__(self)
self.ip = ip
self.status = -1
self.responsetime = -1
def run(self):
pingaling = os.popen("ping -q -c2 "+self.ip,"r")
... | mit | Python |
8ea4b055bda2e0656c7922e7f9165858adc6a1a3 | Remove advanced starred expression for Python 3.4 support | Z2PackDev/TBmodels,Z2PackDev/TBmodels | tests/test_cli_slice.py | tests/test_cli_slice.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Dominik Gresch <greschd@gmx.ch>
import os
import pytest
import tempfile
from click.testing import CliRunner
import tbmodels
from tbmodels._cli import cli
from parameters import SAMPLES_DIR
@pytest.mark.parametrize('slice_idx', [
(3, 1, 2),
(0, 1, 4,... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Dominik Gresch <greschd@gmx.ch>
import os
import pytest
import tempfile
from click.testing import CliRunner
import tbmodels
from tbmodels._cli import cli
from parameters import SAMPLES_DIR
@pytest.mark.parametrize('slice_idx', [
(3, 1, 2),
(0, 1, 4,... | apache-2.0 | Python |
296201c0479b0cd997164064f2d4a70a8b10b876 | Fix CI | yuanming-hu/taichi,yuanming-hu/taichi,yuanming-hu/taichi,yuanming-hu/taichi | python/taichi/tools/messager.py | python/taichi/tools/messager.py | import taichi as tc
import smtplib
import os
import socket
import atexit
gmail_sender = 'taichi.messager@gmail.com'
gmail_passwd = '6:L+XbNOp^'
def send_crash_report(message,
receiver=None):
if receiver is None:
receiver = os.environ.get('TC_MONITOR_EMAIL', None)
if receiver is None:
... | import taichi as tc
import smtplib
import os
import socket
import atexit
gmail_sender = 'taichi.messager@gmail.com'
gmail_passwd = '6:L+XbNOp^'
def send_crash_report(message,
receiver=os.environ['TC_MONITOR_EMAIL']):
tc.warning('Emailing {}'.format(receiver))
TO = receiver
SUBJECT = ... | apache-2.0 | Python |
f2c50eb6d5404dbfb0c34f1a029405578059a3c8 | update test python cv | ORNL-CEES/Cap,dalg24/Cap,Rombur/Cap,ORNL-CEES/Cap,dalg24/Cap,dalg24/Cap,ORNL-CEES/Cap,Rombur/Cap,Rombur/Cap | python/test/test_voltammetry.py | python/test/test_voltammetry.py | from pycap import PropertyTree,EnergyStorageDevice,CyclicVoltammetry
from pycap import initialize_data
from numpy import array,testing,linspace
import unittest
ptree=PropertyTree()
ptree.put_string('type','SeriesRC')
ptree.put_double('series_resistance',40e-3)
ptree.put_double('capacitance',3)
device=EnergyStorageDevi... | from pycap import PropertyTree,EnergyStorageDevice,CyclicVoltammetry
from pycap import initialize_data
from numpy import array,testing
import unittest
ptree=PropertyTree()
ptree.put_string('type','SeriesRC')
ptree.put_double('series_resistance',40e-3)
ptree.put_double('capacitance',3)
device=EnergyStorageDevice(ptree)... | bsd-3-clause | Python |
60118662ff441b2bab6f61e5d319ddbb856a70cc | delete question-view page | saurabh6790/ON-RISAPP,Suninus/erpnext,saurabh6790/omnit-app,Drooids/erpnext,gmarke/erpnext,suyashphadtare/vestasi-erp-final,indictranstech/trufil-erpnext,saurabh6790/med_app_rels,gangadhar-kadam/laganerp,shft117/SteckerApp,hatwar/Das_erpnext,gangadharkadam/verveerp,gangadhar-kadam/adb-erp,saurabh6790/aimobilize,mbauska... | erpnext/patches/jan_mar_2012/sync_ref_db.py | erpnext/patches/jan_mar_2012/sync_ref_db.py | import webnotes
sql = webnotes.conn.sql
from webnotes.model import delete_doc
def execute():
del_rec = {
'DocType' : ['Update Series', 'File', 'File Browser Control', 'File Group',
'Tag Detail', 'DocType Property Setter', 'Company Group', 'Widget Control',
'Update Delivery Date Detail', 'Update Delivery Date... | import webnotes
sql = webnotes.conn.sql
from webnotes.model import delete_doc
def execute():
del_rec = {
'DocType' : ['Update Series', 'File', 'File Browser Control', 'File Group',
'Tag Detail', 'DocType Property Setter', 'Company Group', 'Widget Control',
'Update Delivery Date Detail', 'Update Delivery Date... | agpl-3.0 | Python |
605641cb810cf06c56649ee66521d8ddbf341fac | Remove doctest from md5 | kesre/slask,joshshadowfax/slask | plugins/hash.py | plugins/hash.py | """!md5 <phrase> return an md5 hash for <phrase>"""
import md5
import re
def on_message(msg, server):
text = msg.get("text", "")
match = re.findall(r"!md5 (.*)", text)
if not match: return
return md5.md5(match[0]).hexdigest()
| """!md5 <phrase> return an md5 hash for <phrase>"""
import md5
import re
def on_message(msg, server):
"""
>>> on_message({"text": "!md5 asdf"}, None)
'912ec803b2ce49e4a541068d495ab570'
"""
text = msg.get("text", "")
match = re.findall(r"!md5 (.*)", text)
if not match: return
return ... | mit | Python |
7ddd11384c787994b085f9f90213d21e82c48e99 | Remove duplicate definition of call_offset_get | Yelp/kafka-utils,anthonysandrin/kafka-utils,anthonysandrin/kafka-utils,Yelp/kafka-utils | tests/acceptance/steps/offset_get.py | tests/acceptance/steps/offset_get.py | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ... | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ... | apache-2.0 | Python |
f99b5496e4988253d5d62682f53ccb972ba29f56 | Add `PUT` objects tests | bobisjan/django-shanghai | tests/integration/actions/objects.py | tests/integration/actions/objects.py | from tests.test_cases import TestCase
class GetObjectsTestCase(TestCase):
def test_app_should_respond_with_articles(self):
response = self.client.get('/api/articles/1,2')
self.assertEqual(response.status_code, 200)
articles = response.document.get('articles', None)
self.assertI... | from tests.test_cases import TestCase
class GetObjectsTestCase(TestCase):
def test_app_should_respond_with_articles(self):
response = self.client.get('/api/articles/1,2')
self.assertEqual(response.status_code, 200)
articles = response.document.get('articles', None)
self.assertI... | mit | Python |
b63bda37aa2e9b5251cf6c54d59785d2856659ca | Update random number generator test | sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet | tests/python/unittest/test_random.py | tests/python/unittest/test_random.py | import os
import mxnet as mx
import numpy as np
def same(a, b):
return np.sum(a != b) == 0
def check_with_device(device):
with mx.Context(device):
a, b = -10, 10
mu, sigma = 10, 2
for i in range(5):
shape = (100 + i, 100 + i)
mx.random.seed(128)
ret1... | import os
import mxnet as mx
import numpy as np
def same(a, b):
return np.sum(a != b) == 0
def check_with_device(device):
with mx.Context(device):
a, b = -10, 10
mu, sigma = 10, 2
shape = (100, 100)
mx.random.seed(128)
ret1 = mx.random.normal(mu, sigma, shape)
u... | apache-2.0 | Python |
221413b5715286bb7b61e18f8e678f2ca097a5e1 | Add set_position method to Rover | authentik8/rover | rover.py | rover.py | class Rover:
compass = ['N', 'E', 'S', 'W']
def __init__(self, x=0, y=0, direction='N'):
self.x = x
self.y = y
self.direction = direction
@property
def position(self):
return self.x, self.y, self.direction
def set_position(self, x, y, direction):
self.x = ... | class Rover:
compass = ['N', 'E', 'S', 'W']
def __init__(self, x=0, y=0, direction='N'):
self.x = x
self.y = y
self.direction = direction
@property
def position(self):
return self.x, self.y, self.direction
| mit | Python |
64038fad35e7a1b9756921a79b6b13d59925e682 | Expand test on URL endpoints in API client | soccermetrics/soccermetrics-client-py | tests/test_endpoints.py | tests/test_endpoints.py | import unittest
from soccermetrics.rest import SoccermetricsRestClient
class ClientEndpointTest(unittest.TestCase):
"""
Test endpoints of API resources in client.
"""
def setUp(self):
self.client = SoccermetricsRestClient(account="APP_ID",api_key="APP_KEY")
def test_service_root(self):
... | import unittest
from soccermetrics.rest import SoccermetricsRestClient
class ClientEndpointTest(unittest.TestCase):
"""
Test endpoints of API resources in client.
"""
def setUp(self):
self.client = SoccermetricsRestClient(account="APP_ID",api_key="APP_KEY")
def test_service_root(self):
... | mit | Python |
238494a1323d82a791b244a84af64eda3d9be750 | Solve deprecation warning from Traitlets | simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote | tests/services/test_reverse_proxy.py | tests/services/test_reverse_proxy.py | from unittest.mock import Mock
from jupyterhub import orm
from remoteappmanager.services.reverse_proxy import ReverseProxy
from tornado import gen, testing
class TestReverseProxy(testing.AsyncTestCase):
@testing.gen_test
def test_reverse_proxy_operations(self):
coroutine_out = None
@gen.coro... | from unittest.mock import Mock
from jupyterhub import orm
from remoteappmanager.services.reverse_proxy import ReverseProxy
from tornado import gen, testing
class TestReverseProxy(testing.AsyncTestCase):
@testing.gen_test
def test_reverse_proxy_operations(self):
coroutine_out = None
@gen.coro... | bsd-3-clause | Python |
dac770314da39c5494ff6c1ccd46d507ff1b2540 | Add tests for slow requests reporting configuration | lucius-feng/tg2,lucius-feng/tg2 | tests/test_errorware.py | tests/test_errorware.py | from tg.error import ErrorReporter
from tg.error import SlowReqsReporter
def simple_app(environ, start_response):
status = '200 OK'
headers = [('Content-type', 'text/plain')]
start_response(status, headers)
return ['HELLO']
class TestErrorReporterConfig(object):
def test_disable_all(self):
... | from tg.error import ErrorReporter
def simple_app(environ, start_response):
status = '200 OK'
headers = [('Content-type', 'text/plain')]
start_response(status, headers)
return ['HELLO']
class TestErrorReporterConfig(object):
def test_disable_all(self):
app = ErrorReporter(simple_app, {})... | mit | Python |
3e56787686a3a0275966a8ccae9c8ca13ca525ee | Update tests for new logger | Rafiot/PyCIRCLean,CIRCL/PyCIRCLean,CIRCL/PyCIRCLean,Rafiot/PyCIRCLean | tests/test_filecheck.py | tests/test_filecheck.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import pytest
from tests.logging import save_logs
try:
from bin.filecheck import KittenGroomerFileCheck, File, main
NODEPS = False
except ImportError:
NODEPS = True
fixture = pytest.fixture
skip = pytest.mark.skip
skipif_nodeps = pyte... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import pytest
from tests.logging import save_logs
try:
from bin.filecheck import KittenGroomerFileCheck, File, main
NODEPS = False
except ImportError:
NODEPS = True
skipif_nodeps = pytest.mark.skipif(NODEPS,
... | bsd-3-clause | Python |
c1bb165b5038362d09d4b8ad5c1800bd49699c8f | Add test factories for products, partners and stockrecords | josesanch/django-oscar,bnprk/django-oscar,monikasulik/django-oscar,QLGu/django-oscar,taedori81/django-oscar,dongguangming/django-oscar,nickpack/django-oscar,vovanbo/django-oscar,anentropic/django-oscar,Bogh/django-oscar,saadatqadri/django-oscar,michaelkuty/django-oscar,lijoantony/django-oscar,spartonia/django-oscar,dja... | oscar/test/newfactories.py | oscar/test/newfactories.py | """
Factories using factory boy.
Using a silly module name as I don't want to mix the old and new
implementations of factories, but I do want to allow importing both from the
same place.
In 2020, when all tests use the new factory-boy factories, we can rename this
module to factories.py and drop the old ones.
"""
imp... | """
Factories using factory boy.
Using a silly module name as I don't want to mix the old and new
implementations of factories, but I do want to allow importing both from the
same place.
In 2020, when all tests use the new factory-boy factories, we can rename this
module to factories.py and drop the old ones.
"""
imp... | bsd-3-clause | Python |
c6e1f22c44aef15f11b71a97a68864146e4078e6 | Update default CAS URL | aaxelb/SHARE,CenterForOpenScience/SHARE,aaxelb/SHARE,CenterForOpenScience/SHARE,CenterForOpenScience/SHARE,aaxelb/SHARE | osf_oauth2_adapter/apps.py | osf_oauth2_adapter/apps.py | import os
from django.apps import AppConfig
class OsfOauth2AdapterConfig(AppConfig):
name = 'osf_oauth2_adapter'
# staging by default so people don't have to run OSF to use this.
osf_api_url = os.environ.get('OSF_API_URL', 'https://staging-api.osf.io').rstrip('/') + '/'
osf_accounts_url = os.environ.... | import os
from django.apps import AppConfig
class OsfOauth2AdapterConfig(AppConfig):
name = 'osf_oauth2_adapter'
# staging by default so people don't have to run OSF to use this.
osf_api_url = os.environ.get('OSF_API_URL', 'https://staging-api.osf.io').rstrip('/') + '/'
osf_accounts_url = os.environ.... | apache-2.0 | Python |
98afa47f04010c8bb946188607b6005deb38a167 | debug tool bar | IT-PM-OpenAdaptronik/Webapp,IT-PM-OpenAdaptronik/Webapp,IT-PM-OpenAdaptronik/Webapp | rattler/settings/development.py | rattler/settings/development.py | from .base import *
print('HSLOO')
# DEBUG = True equals Development-Mode
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'dqfc+6=p^h_qo0^j_bs4yb1q%6r%$)=y8)c_q)7s_b$qp4ldx$'
ALLOWED_HOSTS = ['*']
# Adding the debug_toolbar to the Installed_Apps
INSTALLED_APPS += [
#... | from .base import *
print('HSLOO')
# DEBUG = True equals Development-Mode
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'dqfc+6=p^h_qo0^j_bs4yb1q%6r%$)=y8)c_q)7s_b$qp4ldx$'
ALLOWED_HOSTS = ['*']
# Adding the debug_toolbar to the Installed_Apps
INSTALLED_APPS += [
'... | mit | Python |
fcb13ef9035bc6e4e189ca631de54fcd81982a5e | Add riak_ip_address to populate_dist db | Rhizomatica/rccn,Rhizomatica/rccn,Rhizomatica/rccn,Rhizomatica/rccn,Rhizomatica/rccn | rccn/populate_distributed_db.py | rccn/populate_distributed_db.py | ############################################################################
#
# Copyright (C) 2015 tele <tele@rhizomatica.org>
#
# RCCN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License as published by
# the Free Software Foundation, either version 3 of the L... | ############################################################################
#
# Copyright (C) 2015 tele <tele@rhizomatica.org>
#
# RCCN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License as published by
# the Free Software Foundation, either version 3 of the L... | agpl-3.0 | Python |
e13995cc0a81b235d5021ddf74a561bff5669dea | Update compare controller to make repo_path configurable, fixes #41 | OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api | controllers/compare.py | controllers/compare.py | import os
import time
import json
import api_utils
@request.restful()
def v1():
"The OpenTree API v1"
response.view = 'generic.json'
def GET(base,head,jsoncallback=None,callback=None,_=None,**kwargs):
"OpenTree API methods relating to comparing commits"
# support JSONP request from anothe... | import os
import time
import json
from api_utils import authenticate
@request.restful()
def v1():
"The OpenTree API v1"
response.view = 'generic.json'
def GET(base,head,jsoncallback=None,callback=None,_=None,**kwargs):
"OpenTree API methods relating to comparing commits"
# support JSONP r... | bsd-2-clause | Python |
335b90e36c3ce72747cc945df98f31760c724ef5 | Use perl 5.16 and remove cruft | OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api | controllers/default.py | controllers/default.py | import os
import time
from pygit2 import Repository
from pygit2 import Signature
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson... | import os
from pygit2 import Repository
from pygit2 import Signature
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson of study_id... | bsd-2-clause | Python |
6b9cc519deaecd093087d5190888b97b7b7eaf02 | Remove vestigial hard coded production settings. These should be defined in a dotenv file, now. | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | icekit/project/settings/_production.py | icekit/project/settings/_production.py | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | from ._base import *
SITE_PUBLIC_PORT = None # Default: SITE_PORT
# DJANGO ######################################################################
CACHES['default'].update({
# 'BACKEND': 'django_redis.cache.RedisCache',
'BACKEND': 'redis_lock.django_cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
... | mit | Python |
a15ba2e8ed3b829f7c493f0c35e0cc99d0595b3b | Fix 'Unknown Command' message. | Jake0720/XChat-Scripts | Randomkick.py | Randomkick.py | __module_name__ = 'Random Kick Plugin'
__module_version__ = '0.2'
__module_description__ = 'Kicks the designated user with a random kick reason, or a random user and kick reason.'
__module_author__ = 'Jake0720 with help from Liam Stanley'
import xchat
from random import choice as select
c = '\x02\x0303'
help = '%sTyp... | __module_name__ = 'Random Kick Plugin'
__module_version__ = '0.2'
__module_description__ = 'Kicks the designated user with a random kick reason, or a random user and kick reason.'
__module_author__ = 'Jake0720 with help from Liam Stanley'
import xchat
from random import choice as select
c = '\x02\x0303'
help = '%sTyp... | mit | Python |
280bcddddf39b8ca13449c06cde3954c126caab4 | create Microservice class | aclef/microservices,aclef/microservices,viatoriche/microservices,viatoriche/microservices,aclef/microservices,viatoriche/microservices,viatoriche/microservices,aclef/microservices | microservices/rest/service.py | microservices/rest/service.py | # coding=utf-8
from flask.ext.api import FlaskAPI, settings
from flask.ext.api.renderers import JSONRenderer
from flask.ext.api.parsers import BaseParser
from flask._compat import text_type
from flask_api import exceptions
import xmltodict
class MicroserviceXMLParser(BaseParser):
media_type = 'application/xml'
... | # coding=utf-8
from flask.ext.api import FlaskAPI
from flask.ext.api.renderers import JSONRenderer, BrowsableAPIRenderer
from flask.ext.api.parsers import BaseParser
from flask._compat import text_type
from flask_api import exceptions
import xmltodict
from flask.ext.api import status
from flask import request
from flas... | mit | Python |
06019c7636595654285433584a7e05ab86be41e8 | Update __main__.py | rogersprates/word2vec-financial-sentiment | pmi/__main__.py | pmi/__main__.py | from pmi import pmi_weekly
from pmi_odds import pmi_odds_weekly
def main():
pmi_weekly()
pmi_daily()
pmi_odds_daily()
pmi_odds_weekly()
if __name__ == "__main__":
main()
| from pmi import pmi_weekly
from pmi_odds import pmi_odds_weekly
def main():
pmi_weekly()
pmi_odds_weekly()
if __name__ == "__main__":
main()
| mit | Python |
96d798685c53f4568edaaf990b0bbe8e2e10e24a | Update JSMA test tutorial constant | cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,openai/cleverhans,carlini/cleverhans,cihangxie/cleverhans,cleverhans-lab/cleverhans,carlini/cleverhans,fartashf/cleverhans | tests_tf/test_mnist_tutorial_jsma.py | tests_tf/test_mnist_tutorial_jsma.py | import unittest
class TestMNISTTutorialJSMA(unittest.TestCase):
def test_mnist_tutorial_jsma(self):
from tutorials import mnist_tutorial_jsma
# Run the MNIST tutorial on a dataset of reduced size
# and disable visualization.
jsma_tutorial_args = {'train_start': 0,
... | import unittest
class TestMNISTTutorialJSMA(unittest.TestCase):
def test_mnist_tutorial_jsma(self):
from tutorials import mnist_tutorial_jsma
# Run the MNIST tutorial on a dataset of reduced size
# and disable visualization.
jsma_tutorial_args = {'train_start': 0,
... | mit | Python |
e170b627597925ac2d8ac489e898603a5dd7a2cf | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/a1cb76fd4d7f20d625c5c62cfd0ac6a6e9029299. | yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_m... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "a1cb76fd4d7f20d625c5c62cfd0ac6a6e9029299"
TFRT_SHA256 = "73b0f7cbe4c7032c0c7d62fb492b36e4ad8ad6f5483546... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "306d9ccf3da91de23ff4e0d60bf363f42f9f553a"
TFRT_SHA256 = "7d478926ee7f7af15d9d5e0a18fc38aeb746140e6e1564... | apache-2.0 | Python |
5d1b96437668071e4e705cb5859916089df59d9f | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/33e04436c6b3dba5e7644b0b73c568c764300c5f. | tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "33e04436c6b3dba5e7644b0b73c568c764300c5f"
TFRT_SHA256 = "f626eff672413640362fd143c953... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "fdaa472000b3923c52d4492f2b1c174701abc45c"
TFRT_SHA256 = "fbfee91c428d4e8f47dd71b3b0b9... | apache-2.0 | Python |
c0494d60ef159c974e6e990641eb0e85a81b13a3 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/cf9d74f7f1b83eb890dce4cf1f6b210195bb272b. | Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,karllessard... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "cf9d74f7f1b83eb890dce4cf1f6b210195bb272b"
TFRT_SHA256 = "a3d7f9489a2591af57cbda83f382... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "3c7bc70c25c5d305e5c17357d58ed5f1370cc28d"
TFRT_SHA256 = "4fe2d7e7d7bfa317b3e6bfebdf20... | apache-2.0 | Python |
c8db3866a8d64801e9c5a53399f60a2f7db6fa33 | make Minecraft object an instance variable | kevinkjt2000/discord-minecraft-server-status | src/main.py | src/main.py | from discord.ext import commands
from discord.ext.commands.core import Command
from src.Minecraft import Minecraft
class Bot(commands.Bot):
def __init__(self):
super().__init__(
command_prefix=commands.when_mentioned_or('!'),
description='A bot for querying the status of a minecraf... | from discord.ext import commands
from discord.ext.commands.core import Command
from src.Minecraft import Minecraft
class Bot(commands.Bot):
def __init__(self):
super().__init__(
command_prefix=commands.when_mentioned_or('!'),
description='A bot for querying the status of a minecraf... | mit | Python |
fc25349a9e02b2b4a2ac9a79892317c17dea8dc5 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/3d153038f2c3f46592f2342ae163dfa005c09625. | Intel-tensorflow/tensorflow,yongtang/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,karllessard/tenso... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "3d153038f2c3f46592f2342ae163dfa005c09625"
TFRT_SHA256 = "ef7a226d23dd57192434c87dbb2d561a0a6428f10f714b... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "d0b489dc5538a344ffa95e2749dee6153e779476"
TFRT_SHA256 = "6e3c42eacce0db0523a858d5d295513d590528e0fbe26e... | apache-2.0 | Python |
e19b11c8598fe7a7e68640638a3489c05002f968 | Delete the jobs in tearDown() in tests | linostar/SuperCron | tests/test_supercron.py | tests/test_supercron.py | #!/usr/bin/env python
import sys
import os
import unittest
from subprocess import Popen, PIPE
ROOT_DIR = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(ROOT_DIR)
from supercron import SuperCron
class RunTests(unittest.TestCase):
"""class that tests supercron for behavior correctness"""
def setUp... | #!/usr/bin/env python
import sys
import os
import unittest
from subprocess import Popen, PIPE
ROOT_DIR = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(ROOT_DIR)
from supercron import SuperCron
class RunTests(unittest.TestCase):
"""class that tests supercron for behavior correctness"""
def setUp... | bsd-3-clause | Python |
e99f105291140a51e92e0cf1a0ac734b41efe65e | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/ef3f3b88a5e86931ee87f698a0fe56a820c80328. | Intel-tensorflow/tensorflow,paolodedios/tensorflow,frreiss/tensorflow-fred,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ef3f3b88a5e86931ee87f698a0fe56a820c80328"
TFRT_SHA256 = "e44d8179ed265b84eb17d2566511fe28da91a24dc2e8e8... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "1f511ce538548f0789b97354bab247ba96cdd956"
TFRT_SHA256 = "f419ad2fe736c180b4121a7c7470c38e89a8b33f772326... | apache-2.0 | Python |
dcf77352037fabbde7dc75da8030e2074ee64553 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/516ed2b62321536f690653e0184690e05b7f3fca. | tensorflow/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tenso... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "516ed2b62321536f690653e0184690e05b7f3fca"
TFRT_SHA256 = "24f4c50f361b33fa1aca1c7a6153... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "d8a2d7648f3f6b50c7096f217ff16194a53378ef"
TFRT_SHA256 = "5f5ab4271b4d7b25779acf1dfc0e... | apache-2.0 | Python |
51ec4b06860fb7fe03b8ca884fb9a3424b5c39ef | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/08c585655cee669fab082f26440c42f4ca33ff87. | gautam1858/tensorflow,paolodedios/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,frreiss/tensorflow-fred,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,karlle... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "08c585655cee669fab082f26440c42f4ca33ff87"
TFRT_SHA256 = "48ca3910a1d7f1bc74a629bc99b457c20f70045db71d57... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "1235de9de3f628b9e73e700e28c1501ade8d4719"
TFRT_SHA256 = "1409ab0bfb45d70317026810099693e12f76832c53a5f9... | apache-2.0 | Python |
851ac455a69c031968527fcaaf80dc367a208490 | Add TicTacToe tests | davidrobles/mlnd-capstone-code | tests/test_tictactoe.py | tests/test_tictactoe.py | import sys
sys.path.insert(0, '/home/drobles/projects/mlnd-capstone-code/src/')
import unittest
from games import TicTacToe
class TestTicTacToe(unittest.TestCase):
def setUp(self):
self.game = TicTacToe()
def test_legal_moves_start(self):
actual = self.game.legal_moves()
expected = [1... | mit | Python | |
ee62dbd6d71243c0d7c79123f6b34d26cc048599 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/a9802751de4d4152f5c37fd73c32e7a029978308. | tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,tensorflow/tensorflow,yongta... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "a9802751de4d4152f5c37fd73c32e7a029978308"
TFRT_SHA256 = "eb7326c7c3584c378671f78853f4... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "d322476b66cabc0c3a26eae7e67af3a85fe1370b"
TFRT_SHA256 = "80edc073441b08f0440ff001f0f9... | apache-2.0 | Python |
33dd206c7cb995745bf1a5f64e88a427fb70b077 | Add a test for empty count_total_hours | WhiteHatCP/seclab-timecard,WhiteHatCP/seclab-timecard | test_app.py | test_app.py | import app
from datetime import datetime
import pytest
def log_generator():
yield '2017/01/01 15:13:06 Seclab listener started\n'
yield '2017/01/01 15:13:07 Received request: close\n'
yield '2017/01/01 15:13:08 Received request: open\n'
yield '2017/01/01 15:13:09 Received request: open\n'
yield '2... | import app
from datetime import datetime
import pytest
def log_generator():
yield '2017/01/01 15:13:06 Seclab listener started\n'
yield '2017/01/01 15:13:07 Received request: close\n'
yield '2017/01/01 15:13:08 Received request: open\n'
yield '2017/01/01 15:13:09 Received request: open\n'
yield '2... | mit | Python |
5162233658fa0beeee05db01e27bf8b6481385be | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0ab97f199d1f2638e470153b94ecf41e59560994. | karllessard/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_opti... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "0ab97f199d1f2638e470153b94ecf41e59560994"
TFRT_SHA256 = "9e132f4e073e281afa7c0fb0d600... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "2deb9fdfeb1d490427f0d1df45d8e01d40d98b45"
TFRT_SHA256 = "e1af7517abe8573d424c8dec118e... | apache-2.0 | Python |
5d2de78eec377ee2ea9ba80bf7f17a4d6cdc3880 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/77cf318c16d65e220873ba7be5690d0638d5e0fa. | tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pyw... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "77cf318c16d65e220873ba7be5690d0638d5e0fa"
TFRT_SHA256 = "9750756da4fe651a8292a66817ac... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "d344b51badfd4d4f08e9042a80b8e302accf6ddc"
TFRT_SHA256 = "37f9ff2c4086d25aea20e0fbd2ab... | apache-2.0 | Python |
09fec9532b6761f90b52fb3f4ac595f689d2780b | Add some more invalid username test samples | theskumar/python-usernames | tests/test_usernames.py | tests/test_usernames.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from usernames import is_safe_username
def test_usernames():
unsafe_words = [
'!',
'#',
'',
'()',
'-',
'-hello',
'.',
'.hello',
'_',
'a@!/',
'fuck',
'hel... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from usernames import is_safe_username
def test_usernames():
unsafe_words = [
'!',
'#',
'',
'()',
'-',
'-hello',
'.',
'.hello',
'_',
'a@!/',
'fuck',
'hel... | mit | Python |
919469079734436a902633012df689a42342fc5f | Reduce time.sleep to 0.5 | somehume/namebench | tools/check_nameserver_popularity.py | tools/check_nameserver_popularity.py | #!/usr/bin/env python
import os
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -syslog -"4.2.2.1" -site:cqcounter.com -site:flow.n... | #!/usr/bin/env python
import os
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -syslog -"4.2.2.1" -site:cqcounter.com -site:flow.n... | apache-2.0 | Python |
23ad2cbafbdcb53d454b4d81edf08055c442d167 | Add corpwiki/iptool | mirek2580/namebench | tools/check_nameserver_popularity.py | tools/check_nameserver_popularity.py | #!/usr/bin/env python
import os
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -site:sitedossier.com -mx -site:dataopedia.com -sit... | #!/usr/bin/env python
import os
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -site:sitedossier.com -mx -site:dataopedia.com -sit... | apache-2.0 | Python |
5d972f1a80611169c198c9561440928eeb74a5a0 | update author email | duggan/pontoon,duggan/pontoon | pontoon/meta.py | pontoon/meta.py | # -*- coding: utf-8 -*-
__name__ = 'pontoon'
__description__ = 'A Python CLI for Digital Ocean'
__version__ = '0.2.3'
__author__ = 'Ross Duggan'
__author_email__ = 'ross@duggan.ie'
__url__ = 'https://github.com/duggan/pontoon'
__copyright__ = 'Copyright Ross Duggan 2016'
| # -*- coding: utf-8 -*-
__name__ = 'pontoon'
__description__ = 'A Python CLI for Digital Ocean'
__version__ = '0.2.3'
__author__ = 'Ross Duggan'
__author_email__ = 'ross.duggan@acm.org'
__url__ = 'https://github.com/duggan/pontoon'
__copyright__ = 'Copyright Ross Duggan 2016'
| mit | Python |
9e2c892ead83959671b1532549e7d9c245a4a826 | Add order to tables | alzkun/crypto-data | crypto_data.py | crypto_data.py | import sys
import argparse
from kraken_interface import KrakenInterface
from poloniex_interface import PoloniexInterface
from prettytable import PrettyTable
def amount(argv, data):
ratio_btc = float(data['BTC_EUR'][0])
coins = {
'BTC': [argv.btc, float(1.0)],
'LTC': [argv.ltc, float(... | import sys
import argparse
from kraken_interface import KrakenInterface
from poloniex_interface import PoloniexInterface
from prettytable import PrettyTable
def amount(argv, data):
ratio_btc = float(data['BTC_EUR'][0])
coins = {
'BTC': [argv.btc, float(1.0)],
'LTC': [argv.ltc, float(... | mit | Python |
41af90f055f9caf204b0b61c9717eda99bc04952 | Update PP-ASR (#5661) | PaddlePaddle/models,PaddlePaddle/models,PaddlePaddle/models | modelcenter/PP-ASR/APP/app.py | modelcenter/PP-ASR/APP/app.py | import gradio as gr
import os
from paddlespeech.cli.asr.infer import ASRExecutor
from paddlespeech.cli.text.infer import TextExecutor
import librosa
import soundfile as sf
os.system("wget -c 'https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav'")
asr = ASRExecutor()
text_punc = TextExecutor()
tmp_result = asr(audio_... | import gradio as gr
import os
from paddlespeech.cli.asr.infer import ASRExecutor
from paddlespeech.cli.text.infer import TextExecutor
import librosa
import soundfile as sf
def model_inference(audio):
asr = ASRExecutor()
text_punc = TextExecutor()
if not isinstance(audio, str):
audio = str(audio.na... | apache-2.0 | Python |
b0b2c03f04a5f29e11dc01558d272e27665555ce | Update Django requirement to latest LTS | lamby/django-append-url-to-sql | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-append-url-to-sql',
description="Appends the request URL to SQL statements in Django.",
version='1.0.1',
url='https://chris-lamb.co.uk/projects/django-append-url-to-sql',
author='Chris Lamb',
author_email='c... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-append-url-to-sql',
description="Appends the request URL to SQL statements in Django.",
version='1.0.1',
url='https://chris-lamb.co.uk/projects/django-append-url-to-sql',
author='Chris Lamb',
author_email='c... | bsd-3-clause | Python |
bb3b122287e4d7c68619f3c2f0a4b4651e9f9d50 | update setup.cfg | 0kim/bccard_email_parser | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name="BC Card Email Parser",
version='0.1.1',
py_modules=['bccard_email_parser/BccardParser'],
author='youngkim',
author_email='me@younghun.kim',
url='https://github.com/0kim/bccard_email_parser',
description="Parse authorization mail fro... | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name="BC Card Email Parser",
version='0.1.1',
py_modules=['bccard_email_parser'],
author='youngkim',
author_email='me@younghun.kim',
url='https://github.com/0kim/bccard_email_parser',
description="Parse authorization mail from BC Card"
) | mit | Python |
cf52e079d811714875d3a44586d9a3cfb65b8b3f | update version for docs | Deepwalker/pundler | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
import os.path
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return ''
setupconf = dict(
name='pundle',
version='0.8.4',
license='BSD',
url='https://github.com/Deepw... | #!/usr/bin/env python
from setuptools import setup
import os.path
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return ''
setupconf = dict(
name='pundle',
version='0.8.3',
license='BSD',
url='https://github.com/Deepw... | bsd-2-clause | Python |
cf7acf40ef091fddfa2bb38898c867e7fd2dae62 | Update version to 1.0.8 | Xuanwo/qingcloud-sdk-python,markduan/qingcloud-sdk-python,yunify/qingcloud-sdk-python | setup.py | setup.py | # coding:utf-8
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info < (2, 6):
error = 'ERROR: qingcloud-sdk requires Python Version 2.6 or above.'
print >> sys.stderr, error
sys.exit(1)
setup(
name = 'qingcloud-sdk',
versio... | # coding:utf-8
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info < (2, 6):
error = 'ERROR: qingcloud-sdk requires Python Version 2.6 or above.'
print >> sys.stderr, error
sys.exit(1)
setup(
name = 'qingcloud-sdk',
versio... | apache-2.0 | Python |
4fd8ab3d6ff9de3f80fc9d36f3a669ac27d0bc9a | change psycopg2 to psycopg2-binary | the4thdoctor/pg_chameleon,the4thdoctor/pg_chameleon | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
from distutils.sysconfig import get_python_lib
def readme():
with open('README.rst') as f:
return f.read()
python_lib=get_python_lib()
package_data = ('%s/pg_chameleon' % python_lib, ['LICENSE.txt'])
sql_up_path = 'sql/upgrade... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
from distutils.sysconfig import get_python_lib
def readme():
with open('README.rst') as f:
return f.read()
python_lib=get_python_lib()
package_data = ('%s/pg_chameleon' % python_lib, ['LICENSE.txt'])
sql_up_path = 'sql/upgrade... | bsd-2-clause | Python |
9b8b63f26d12ad3f2df9c9e4d88ce8ac1d7703ab | add Python3 classifier | overcastcloud/trollius,overcastcloud/trollius,overcastcloud/trollius | setup.py | setup.py | # Release procedure:
# - run maybe update_tulip.sh
# - run unit tests with concurrent.futures
# - run unit tests without concurrent.futures
# - run unit tests without ssl: set sys.modules['ssl']=None at startup
# - test examples
# - update version in setup.py (version) and doc/conf.py (version, release)
# - set ... | # Release procedure:
# - run maybe update_tulip.sh
# - run unit tests with concurrent.futures
# - run unit tests without concurrent.futures
# - run unit tests without ssl: set sys.modules['ssl']=None at startup
# - test examples
# - update version in setup.py (version) and doc/conf.py (version, release)
# - set ... | apache-2.0 | Python |
e592032b1f5987b176b14daf990ad4baaa4c6b99 | Add description. | nai-central/django-avatar,stellalie/django-avatar,bazerk/django-avatar,Mapiarz/django-avatar,e4c5/django-avatar,robertour/django-avatar,imgmix/django-avatar,ericroberts/django-avatar,z4r/django-avatar,grantmcconnaughey/django-avatar,nai-central/django-avatar,integricho/django-avatar,aptwebapps/django-avatar,e4c5/django... | setup.py | setup.py | import codecs
import re
from os import path
from setuptools import setup, find_packages
def read(*parts):
filename = path.join(path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
... | import codecs
import re
from os import path
from setuptools import setup, find_packages
def read(*parts):
filename = path.join(path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
... | bsd-3-clause | Python |
6b11ff9fb49aaaa9ae8703dada9e92e9a01f3892 | Set version to 1.1.0 | avian2/jsonmerge | setup.py | setup.py | #!/usr/bin/python
# vim:ts=4 sw=4 expandtab softtabstop=4
from setuptools import setup
setup(name='jsonmerge',
version='1.1.0',
description='Merge a series of JSON documents.',
license='MIT',
long_description=open("README.rst").read(),
author='Tomaz Solc',
author_email='tomaz.solc@tablix.org',... | #!/usr/bin/python
# vim:ts=4 sw=4 expandtab softtabstop=4
from setuptools import setup
setup(name='jsonmerge',
version='1.0.0',
description='Merge a series of JSON documents.',
license='MIT',
long_description=open("README.rst").read(),
author='Tomaz Solc',
author_email='tomaz.solc@tablix.org',... | mit | Python |
9e69459f35f1beca7913f0bf9711f7a3070406e8 | Bump up the version no. to 0.2.0. | Chennaipy/hangman | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(name='gallows',
version='0.2.0',
description=("The word game Hangman based on 'Invent Your "
"Own Computer Games with Python'."),
author='Vijay Kumar B.',
author_email='vijaykumar@bravegnu.org',
url='http://githu... | #!/usr/bin/env python
from setuptools import setup
setup(name='gallows',
version='0.1.0',
description=("The word game Hangman based on 'Invent Your "
"Own Computer Games with Python'."),
author='Vijay Kumar B.',
author_email='vijaykumar@bravegnu.org',
url='http://githu... | bsd-2-clause | Python |
2607b284e505b27dad332308c6b5505c6331b9bb | add limit for restframework version | uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup
README = """
See the README on `GitHub
<https://github.com/uw-it-aca/canvas_sis_provisioner>`_.
"""
version_path = 'sis_provisioner/VERSION'
VERSION = open(os.path.join(os.path.dirname(__file__), version_path)).read()
VERSION = VERSION.replace("\n", "")
#... | #!/usr/bin/env python
import os
from setuptools import setup
README = """
See the README on `GitHub
<https://github.com/uw-it-aca/canvas_sis_provisioner>`_.
"""
version_path = 'sis_provisioner/VERSION'
VERSION = open(os.path.join(os.path.dirname(__file__), version_path)).read()
VERSION = VERSION.replace("\n", "")
#... | apache-2.0 | Python |
64ebb1428f7e0aec08faae6ef28932baa664fd7e | Bump version number. | ProjetPP/PPP-QuestionParsing-Grammatical,ProjetPP/PPP-QuestionParsing-Grammatical | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='ppp_questionparsing_grammatical',
version='0.4.6',
description='Natural language processing module for the PPP.',
url='https://github.com/ProjetPP/PPP-QuestionParsing-Grammatical',
author='Projet Pensées Profondes',
... | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='ppp_questionparsing_grammatical',
version='0.4.5',
description='Natural language processing module for the PPP.',
url='https://github.com/ProjetPP/PPP-QuestionParsing-Grammatical',
author='Projet Pensées Profondes',
... | agpl-3.0 | Python |
2abd1aeb3986a3082c4af51cc510ad9547b470a3 | Add metadata to setup.py. | ambitioninc/django-entity-subscription | setup.py | setup.py | # import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215)
import multiprocessing
assert multiprocessing
import re
from setuptools import setup, find_packages
def get_version():
"""
Extracts the version number from the version.py file.
"""
VERSION_FILE = 'entity_subscript... | # import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215)
import multiprocessing
assert multiprocessing
import re
from setuptools import setup, find_packages
def get_version():
"""
Extracts the version number from the version.py file.
"""
VERSION_FILE = 'entity_subscript... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.