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
d4f0c98cb8642c206391272dc6995064a6a97dd6
Create test_delayed_assert.py
pr4bh4sh/python-delayed-assert
test_delayed_assert.py
test_delayed_assert.py
from delayed_assert import expect, assert_expectations import unittest class DelayedAssertTest(unittest.TestCase): def test_should_pass(self): expect(1 == 1, 'one is one') assert_expectations() def test_should_fail(self): expect(1 == 2) x = 1 y = 2 expect(x ...
unlicense
Python
d5831b40e174a69a6b13344ff7dd6defaef1909e
Add asset registry to insert, and create tests.
ericdill/databroker,ericdill/databroker
test_intake_bluesky.py
test_intake_bluesky.py
from bluesky import RunEngine from bluesky.plans import scan from bluesky.preprocessors import SupplementalData import intake from intake.conftest import intake_server from intake_bluesky import MongoInsertCallback from ophyd.sim import motor, det, img, direct_img import os import pymongo import pytest import shutil im...
bsd-3-clause
Python
01f36573b63800e40cb37e99a87be5b1e32b8d2d
Add site_info_doc.py
wiki-ai/revscoring,eranroz/revscoring,he7d3r/revscoring,aetilley/revscoring,ToAruShiroiNeko/revscoring
revscores/datasources/site_info_doc.py
revscores/datasources/site_info_doc.py
from .datasource import Datasource def process(session): doc = session.site_info.query(properties={'namespaces'}) return doc['query']
mit
Python
e966e0774ad1474335a654cbe8f594d61ee97c3d
Add a credit card number checker
jstewmon/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint
proselint/checks/misc/creditcard.py
proselint/checks/misc/creditcard.py
# -*- coding: utf-8 -*- """MSC: Credit card number printed. --- layout: post error_code: MSC source: ??? source_url: ??? title: credit card number printed date: 2014-06-10 12:31:19 categories: writing --- Credit card number printed. """ from proselint.tools import blacklist err = "MSC102" msg = u...
bsd-3-clause
Python
abfa1061966c48e9fb5da7e3bedb9902a7442f36
Add tests of new sparserag class
jni/useful-histories
sparserag-investigations.py
sparserag-investigations.py
# IPython log file from gala import agglo2, imio frag = imio.read_image_stack('tests/example-data/train-ws.lzf.h5') pr = imio.read_image_stack('tests/example-data/train-p1.lzf.h5') g = agglo2.SparseRAG(frag, pr, [tz.identity, np.square]) g.graph[1, 2] g.compute_feature_caches() from importlib import reload reload(agg...
bsd-3-clause
Python
3cd8409f5842a63dcd5432325165030852f1d9c0
Add message+level to MainHandler
adamrp/qiita,adamrp/qiita,antgonza/qiita,RNAer/qiita,josenavas/QiiTa,squirrelo/qiita,adamrp/qiita,josenavas/QiiTa,ElDeveloper/qiita,biocore/qiita,RNAer/qiita,ElDeveloper/qiita,biocore/qiita,squirrelo/qiita,ElDeveloper/qiita,josenavas/QiiTa,RNAer/qiita,wasade/qiita,antgonza/qiita,ElDeveloper/qiita,adamrp/qiita,wasade/qi...
qiita_pet/handlers/base_handlers.py
qiita_pet/handlers/base_handlers.py
from tornado.web import RequestHandler class BaseHandler(RequestHandler): def get_current_user(self): '''Overrides default method of returning user curently connected''' user = self.get_secure_cookie("user") if user is None: self.clear_cookie("user") return None ...
from tornado.web import RequestHandler class BaseHandler(RequestHandler): def get_current_user(self): '''Overrides default method of returning user curently connected''' user = self.get_secure_cookie("user") if user is None: self.clear_cookie("user") return None ...
bsd-3-clause
Python
f3af12fe61e8b8715556d496c5ca6c7f9fd053a1
Add crawler for 'manlyguys'
klette/comics,klette/comics,jodal/comics,jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,klette/comics,datagutten/comics,datagutten/comics
comics/comics/manlyguys.py
comics/comics/manlyguys.py
from comics.aggregator.crawler import CrawlerBase, CrawlerImage from comics.meta.base import MetaBase class Meta(MetaBase): name = 'Manly Guys Doing Manly Things' language = 'en' url = 'http://thepunchlineismachismo.com/' start_date = '2005-05-29' rights = 'Kelly Turnbull, CC BY-NC-SA 3.0' class C...
agpl-3.0
Python
86e20c7746f417360830374d40737f4495a569df
Add xml parser wrapper.
explosiveduck/ed2d,explosiveduck/ed2d
ed2d/xml.py
ed2d/xml.py
from xml.parsers import expat class TagStack(object): def __init__(self): self.tags = [] self.args = [] self.data = [] self.dataAdded = [] self.stackSize = 0 self.frameHasData = False def push(self, tag, args): self.tags.append(tag) self.args.ap...
bsd-2-clause
Python
fb2cfba6c78d27d1cab0a79810c52c6e65f2e624
Create neatList.py
CptDemocracy/Python
Puzzles/hackerrank/neatList.py
Puzzles/hackerrank/neatList.py
""" [ref.href] www.hackerrank.com/challenges/python-lists """ from __future__ import print_function cmds = { "insert" : list.insert, "remove" : list.remove, "append" : list.append, "sort" : list.sort, "pop" : list.pop, "reverse" : list.reverse, "print" : lambda L : print(L) } ...
mit
Python
725cc7f5744dad2cbf0a87ad02de33ccb98eaaab
test script for the logging module
hk310/parSpectral,JoyMonteiro/parSpectral
pspec/testNC.py
pspec/testNC.py
import numpy as np; import logData; xdim = 10; ydim = 10; filename = 'test.nc'; fields = ['pv', 'vort']; logger = logData.logData(filename, fields, ['xdim','ydim'], [xdim, ydim]); pvField = np.zeros((xdim,ydim)); vortField = np.zeros((xdim,ydim)); logger.writeData([pvField, vortField]); logger.writeData([pvField, v...
bsd-3-clause
Python
66aba1ea2696c9d0fa3479b72676ceb30a057bb3
Add a pytest folder
markrwilliams/tectonic
pytest/test_prefork.py
pytest/test_prefork.py
from tectonic import prefork def test_WorkerMetadata(): """ This is a simple test, as WorkerMetadata only holds data """ pid = 'pid' health_check_read = 100 last_seen = 'now' metadata = prefork.WorkerMetadata(pid=pid, health_check_read=health_check_re...
bsd-3-clause
Python
6f2f857528d5d1df227f56422222c8de72c2e012
Add functional test for service name aliases
pplu/botocore,boto/botocore
tests/functional/test_service_alias.py
tests/functional/test_service_alias.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
apache-2.0
Python
e96a8dd7854809e64e27f1b06cd380586a628da0
Add test for six.moves thread safety
pplu/botocore,boto/botocore
tests/functional/test_six_threading.py
tests/functional/test_six_threading.py
""" Regression test for six issue #98 (https://github.com/benjaminp/six/issues/98) """ from mock import patch import sys import threading import time from botocore.vendored import six _original_setattr = six.moves.__class__.__setattr__ def _wrapped_setattr(key, value): # Monkey patch six.moves.__setattr__ to s...
apache-2.0
Python
052167f69e4d6b89d2cd2de1483ec0412cebe8b6
Add mt.py
bamos/python-scripts,bamos/python-scripts
python2.7/mt.py
python2.7/mt.py
#!/usr/bin/env python2 import argparse import multitail parser = argparse.ArgumentParser() parser.add_argument('files', type=str, nargs='+') args = parser.parse_args() for fn, line in multitail.multitail(args.files): print("{}: {}".format(fn,line.strip()))
mit
Python
d83eedff99aa2b9594e89f4c585014efc151631b
Remove description from __openerp__.py now that it is in README.rst
diagramsoftware/sale-workflow,factorlibre/sale-workflow,Antiun/sale-workflow,acsone/sale-workflow,Endika/sale-workflow,BT-cserra/sale-workflow,akretion/sale-workflow,Eficent/sale-workflow,thomaspaulb/sale-workflow,akretion/sale-workflow,jabibi/sale-workflow,acsone/sale-workflow,ddico/sale-workflow,xpansa/sale-workflow,...
sale_pricelist_discount/__openerp__.py
sale_pricelist_discount/__openerp__.py
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
agpl-3.0
Python
65ff650cc240f563503988afc589b1a2e487fb5d
add me as maintainer
OCA/connector-interfaces,OCA/connector-interfaces
connector_importer_demo/__manifest__.py
connector_importer_demo/__manifest__.py
# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { "name": "Connector Importer Demo", "summary": """Demo module for Connector Importer.""", "version": "13.0.1.0.0", "depends": ["connector_importer"], "author": "Camptocamp, Odoo Community Association (OCA...
# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { "name": "Connector Importer Demo", "summary": """Demo module for Connector Importer.""", "version": "13.0.1.0.0", "depends": ["connector_importer"], "author": "Camptocamp, Odoo Community Association (OCA...
agpl-3.0
Python
52e47722a8661a6418fffc57eadfdf314b9de990
make urls.py imports django 1.6 compatible
gradel/django-generic-ratings,fedosov/django-generic-ratings,fedosov/django-generic-ratings,gradel/django-generic-ratings,atheiste/django-generic-ratings,atheiste/django-generic-ratings,fedosov/django-generic-ratings,gradel/django-generic-ratings,atheiste/django-generic-ratings
ratings/urls.py
ratings/urls.py
from django.conf.urls import patterns, url urlpatterns = patterns('ratings.views', url(r'^vote/$', 'vote', name='ratings_vote'), )
from django.conf.urls.defaults import patterns, url urlpatterns = patterns('ratings.views', url(r'^vote/$', 'vote', name='ratings_vote'), )
mit
Python
e85295567b054aea0c99059941a9ed6cbbc1d86a
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/061864b0c0568656c4fe03fa3f8aee60490ba57a.
tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_on...
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 = "061864b0c0568656c4fe03fa3f8aee60490ba57a" TFRT_SHA256 = "c28f0b4ff6d40a76f2b6b57a3b80...
"""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 = "29030315f1870da16ab4b8119954323224ec38a0" TFRT_SHA256 = "4872d2629e3fda81e4f8284a2462...
apache-2.0
Python
40f79d04de93eb76858d2a02e8fc386f7a45dea4
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0d3eb803f429f8bd6b2b9376bb1171aef338b697.
paolodedios/tensorflow,yongtang/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,yongtang/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,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 = "0d3eb803f429f8bd6b2b9376bb1171aef338b697" TFRT_SHA256 = "d61ef9a8bdbd28e8ff931b485685...
"""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 = "46ae453ad093a167086da61ecb53cd23fe3e8efa" TFRT_SHA256 = "f8a9410370aaed5305d3bcd19811...
apache-2.0
Python
5e43887b42b3b5b522a8996908ce724d38e8356e
Create regular_sale.py
kiryushah/test-selenium_first
regular_sale.py
regular_sale.py
# -*- coding: utf-8 -*- import unittest from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait class regularsale(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome("C://chromedriver/chromedriver.exe") #В скобках указываем путь к chromedriver.exe ...
apache-2.0
Python
67332fd62462c985b08b5aee794056038c943437
solve 914
arash16/prays,arash16/prays,arash16/prays,arash16/prays,arash16/prays,arash16/prays
UVA/vol-009/914.py
UVA/vol-009/914.py
from sys import stdin, stdout I = list(map(int, stdin.read().split())) primes = [2] maxP = 1000001 isP = [True] * maxP isP[0] = isP[1] = False for i in range(3, maxP, 2): if isP[i]: primes.append(i) for j in range(i*i, maxP, i): isP[j] = False for c in range(0, I[0]): [L, R] = I[2*c+1: 2*c+3] l =...
mit
Python
f96a20d6126c6378c198711a6aaad79bf2b52f4c
add url shortener plugin
anlutro/botologist,x89/botologist,moopie/botologist,x89/botologist
ircbot/plugin/urls.py
ircbot/plugin/urls.py
import ircbot.plugin from ircbot import log import urllib.request import urllib.error import socket import re url_shorteners = ( 'https?://bit\.ly', 'https?://goo\.gl', 'https?://is\.gd', 'https?://redd\.it', 'https?://t\.co', ) url_shorteners = '|'.join(url_shorteners) short_url_regex = re.compile(r'((' + url_...
mit
Python
0400dce44abca87cc0c0069b062f1f6942640125
Implement an integration test for cibopath info
hackebrot/cibopath
tests/test_cli_info.py
tests/test_cli_info.py
# -*- coding: utf-8 -*- import pytest COOKIECUTTER_DJANGO_INFO = """Name: cookiecutter-django Author: pydanny Repository: https://github.com/pydanny/cookiecutter-django Context: { "author_name": "Your Name", "description": "A short description of the project.", "domain_name": "example.com", "email": "...
bsd-3-clause
Python
50f5b536ce272c76f1a7899b033a27ac22f59595
add tests for fetching netnode data
williballenthin/python-idb
tests/test_contents.py
tests/test_contents.py
from fixtures import * import sys import struct import logging import datetime import binascii #logging.basicConfig(level=logging.DEBUG) def make_string_name_key(name): return b'N' + name.encode('utf-8') def make_int_name_key(name, wordsize=4): if wordsize == 4: return b'N' + struct.pack('<BI', 0...
apache-2.0
Python
69e3ab7856d7391e910e45396b7fa62c1348f53a
Add wind degrees to direction function
Harmon758/Harmonbot,Harmon758/Harmonbot
tests/test_location.py
tests/test_location.py
import unittest from hypothesis import assume, given from hypothesis.strategies import floats, uuids from units.location import wind_degrees_to_direction from units.errors import UnitExecutionError class TestWindDegreesToDirection(unittest.TestCase): @given(uuids()) def test_invalid_degrees_type(self, degrees):...
mit
Python
a98c80247b5ec978e811cd6444596010d67c6a45
Add simple test of GaussRV class
nansencenter/DAPPER,nansencenter/DAPPER
tests/test_randvars.py
tests/test_randvars.py
"""Tests of randvars module""" import numpy as np from dapper.tools.randvars import GaussRV def test_gauss_rv(): M = 4 nsamples = 5 grv = GaussRV(mu=0, C=0, M=M) assert (grv.sample(nsamples) == np.zeros((nsamples, M))).all() test_gauss_rv()
mit
Python
6ab93cfc86f1fdf714a9921fcefd8f0dc36d55d1
Add a test for i18n keys
YunoHost/moulinette
test/test_i18n_keys.py
test/test_i18n_keys.py
# -*- coding: utf-8 -*- import re import glob import json ############################################################################### # Find used keys in python code # ############################################################################### def find_expected...
agpl-3.0
Python
11d306a6baf6d3902564d77a0514cf92a943bb46
test for k-maxoids added
FZJ-IEK3-VSA/tsam
test/test_k_maxoids.py
test/test_k_maxoids.py
import os import time import pandas as pd import numpy as np import tsam.timeseriesaggregation as tsam def test_k_maxoids(): raw = pd.read_csv(os.path.join(os.path.dirname(__file__), '..', 'examples', 'testdata.csv'), index_col=0) starttime = time.time() aggregation1 = tsam.TimeSeriesAggregation(raw...
mit
Python
f12fefd4dabff91a71ac2ad63c39d4568e673b95
Add a script to install the configuration
jchaffraix/ConfigMisc,jchaffraix/ConfigMisc,jchaffraix/ConfigMisc
install.py
install.py
import os import subprocess import sys GITHUB="git@github.com:jchaffraix/ConfigMisc.git" # TODO: Allow customization. # This is hardcoded to match the bash_profile file for now. PATH="~/Tools/Scripts" def install_config(path, config, copy=False): # Check if the path exists. name = config.split("/")[-1] dst = pa...
bsd-2-clause
Python
c716abba62a1d6fa4366f2145fb4c869cc28ca17
add new module.
cellnopt/cellnopt,cellnopt/cellnopt
cno/io/validation.py
cno/io/validation.py
from cno import CNOGraph from cno import steady #Steady class Validation(object): def __init__(self, pknmodel, midas, preprocessing=True): print("Computing expected best score") self.preprocessing = preprocessing #self.c = CNOGraph(pknmodel, midas) #self.c.swap_edges(20) ...
bsd-2-clause
Python
d616adf1ec2a2326f15607cbb30fee14c8023af2
Add fix for CVE regex
rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo
dojo/db_migrations/0021_auto_20191102_0956.py
dojo/db_migrations/0021_auto_20191102_0956.py
# Generated by Django 2.2.4 on 2019-11-02 09:56 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dojo', '0020_system_settings_allow_anonymous_survey_repsonse'), ] operations = [ migrations.AlterField( ...
bsd-3-clause
Python
914a7f3997b7fc5977c3635ba5db4b532aee7da6
add an audio test with fft low pass filter
zpiman/MathIA
audioTest.py
audioTest.py
import numpy as np import matplotlib.pyplot as plt import scipy.io.wavfile as wav data = wav.read("data/test.wav") print data sampleRate = float(data[0]) audio = np.array(data[1], dtype=float) aud1 = audio.T[0].T aud2 = audio.T[1].T print aud1.shape freq = np.fft.rfftfreq(aud1.size, d=1./sampleRate) fft1 = np....
apache-2.0
Python
e060559746ce4235808f85278da642be1e8a877e
Create enumabc.py
jrlambea/ctf_tools,spageek/ctf_tools,jrlambea/ctf_tools,spageek/ctf_tools,spageek/ctf_tools,jrlambea/ctf_tools
crypto/classic/analysis/enumabc.py
crypto/classic/analysis/enumabc.py
#!/usr/bin/env python3 __author__ = "JR. Lambea" __copyright__ = "Copyright 2015" __credits__ = ["JR. Lambea"] __license__ = "GPL" __version__ = "1.0.0" __maintainer__ = "JR. Lambea" __email__ = "jr.lambea@yahoo.com" __status__ = "" import sys import argparse def main(): parser = argparse.ArgumentParser() parser....
mit
Python
21420f6c730fb7e4063cddd28de3e7580c6efb36
Add script to ensure semantic versions work with continuous build.
cneill/barbican,cneill/barbican,cloudkeep/barbican,openstack/barbican,jmvrbanac/barbican,cloudkeep/barbican,jmvrbanac/barbican,openstack/barbican,MCDong/barbican,MCDong/barbican
bin/versionbuild.py
bin/versionbuild.py
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013-2014 Rackspace, 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/licen...
apache-2.0
Python
ef7b26a87b1fa49a3acef151d644a10fb644c374
Create galaxy data importer
MorganR/gaussian-processes,MorganR/gaussian-processes
galaxies.py
galaxies.py
import numpy as np import struct import time def _import_data(list_to_add_to, filename): with open(filename, "rb") as image_file: num = struct.unpack(">I",image_file.read(4))[0] rows = struct.unpack(">I",image_file.read(4))[0] cols = struct.unpack(">I",image_file.read(4))[0] list_to_ad...
mit
Python
dbce93669ac638289e4b115f785088ea46f9e83b
add basic tests for osm plugin
CartoDB/mapnik,pramsey/mapnik,whuaegeanse/mapnik,naturalatlas/mapnik,mapnik/python-mapnik,cjmayo/mapnik,strk/mapnik,naturalatlas/mapnik,mbrukman/mapnik,qianwenming/mapnik,garnertb/python-mapnik,tomhughes/mapnik,lightmare/mapnik,mapnik/python-mapnik,qianwenming/mapnik,zerebubuth/mapnik,pramsey/mapnik,kapouer/mapnik,mapn...
tests/python_tests/osm_test.py
tests/python_tests/osm_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.tools import * from utilities import execution_path import os, mapnik def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) if 'osm' in mapnik.DatasourceCach...
lgpl-2.1
Python
ab142f01ec932faaed05441b74c4be760a963374
Add file for test of behaviour when rules are pass
PatrikValkovic/grammpy
tests/rules_tests/RulesTest.py
tests/rules_tests/RulesTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 15.08.2017 15:31 :Licence GNUv3 Part of grammpy """ from unittest import main, TestCase from grammpy import * class RulesTest(TestCase): pass if __name__ == '__main__': main()
mit
Python
7e97663eb29452769103684fce9166a0db17ab5a
Add a script for speed measurement.
fujimotos/fastcomp
speedtest.py
speedtest.py
#!/usr/bin/env python from fastcomp import compare import random import string def randomstr(minlen=5, maxlen=7): charset = '01' length = random.randint(minlen, maxlen) return ''.join(random.choice(charset) for i in range(length)) if __name__ == "__main__": import timeit # Set up conditions ...
mit
Python
1a9bc6ab3a4beaa4b1160be155a8514e0945dc84
Test the Location D-Bus properties
jku/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,jku/telepathy-gabble,community-ssu/telepathy-gabble,community-ssu/telepathy-gabble,community-ssu/telepathy-gabble,mlundblad/telepathy-gabble,community-ssu/telepathy-gabble,Ziemin/telepathy-gabble,Ziemin/telepathy-gabble,mlundbl...
tests/twisted/test-location.py
tests/twisted/test-location.py
from gabbletest import exec_test, make_result_iq from servicetest import call_async, EventPattern from twisted.words.xish import domish, xpath location_iface = \ 'org.freedesktop.Telepathy.Connection.Interface.Location.DRAFT' Rich_Presence_Access_Control_Type_Publish_List = 1 def test(q, bus, conn, stream): ...
from gabbletest import exec_test, make_result_iq from servicetest import call_async, EventPattern from twisted.words.xish import domish, xpath location_iface = \ 'org.freedesktop.Telepathy.Connection.Interface.Location.DRAFT' def test(q, bus, conn, stream): # hack import dbus conn.interfaces['Locatio...
lgpl-2.1
Python
910da6352b6ddc001b61ce8964106e258644589c
add file to get invpat csv
funginstitute/patentprocessor,yngcan/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor
get_invpat.py
get_invpat.py
from lib import alchemy import pandas as pd session_generator = alchemy.session_generator session = session_generator() #res = session.execute('select rawinventor.name_first, rawinventor.name_last, rawlocation.city, rawlocation.state, \ # rawlocation.country, rawinventor.sequence, patent.id, \ # ...
bsd-2-clause
Python
c9258e4a8a743f95f6052ae03095779f1b2d42b1
Add benchmarking script.
aaugustin/django-sequences
benchmark.py
benchmark.py
# Usage: # PYTHONPATH=. DJANGO_SETTINGS_MODULE=sequences.test_postgresql_settings django-admin migrate # PYTHONPATH=. DJANGO_SETTINGS_MODULE=sequences.test_postgresql_settings python benchmark.py import threading import time import django from django.db import connection from sequences import get_next_value django....
bsd-3-clause
Python
34531ef21bceee107990031213b2178979806995
ADD - test.py for User create
mingkim/QuesCheetah,mingkim/QuesCheetah,mingkim/QuesCheetah,mingkim/QuesCheetah
test/test.py
test/test.py
from django.test import TestCase from main.models import User class UserTestCase(TestCase): def setUp(self): User.objects.create(email="testcase@naver.com", username="mingkim") def test_animals_can_speak(self): user = User.objects.get(username="mingkim") self.assertEqual(user.get_full_...
mit
Python
25df2d5e492f66aa8f40833c20df1c38c8fdd155
Add first cut of unit test.
jasedit/pymmd,jasedit/pymmd,jasedit/pymmd
test/test.py
test/test.py
#!python # -*- coding: utf-8 -*- import unittest import textwrap import pymmd class TestLoading(unittest.TestCase): def test_valid(self): self.assertTrue(pymmd.valid_mmd()) def test_version(self): version = pymmd.version() self.assertTrue(version) major, minor, patch = [int(i...
mit
Python
724e991127f2c7124b0c9a4dfb22dd60d116b58e
Create models.py
dpgaspar/Flask-AppBuilder,qpxu007/Flask-AppBuilder,qpxu007/Flask-AppBuilder,qpxu007/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,rpiotti/Flask-AppBuilder,qpxu007/Flask-AppBuilder,rpiotti/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,rpiotti/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,zhounanshu/...
examples/contactsapp/app/models.py
examples/contactsapp/app/models.py
import datetime from flask import Markup from hashlib import md5 from app import db from flask.ext.appbuilder.models.mixins import AuditMixin, BaseMixin, FileColumn, ImageColumn from flask.ext.appbuilder.filemanager import ImageManager class Group(BaseMixin, db.Model): id = db.Column(db.Integer, primary_key=True)...
bsd-3-clause
Python
ec24304c90d70b9f41eca70fc85a680f8f6f340e
Create timelapse.py
ldv46/timelapse
timelapse.py
timelapse.py
# First test in image capture import time import picamera with picamera.PiCamera() as camera: camera.resolution = (1280, 720) camera.framerate = 30 # Give the camera's auto-exposure and auto-white-balance algorithms # some time to measure the scene and determine appropriate values camera.ISO = 200...
lgpl-2.1
Python
3d30ecdeb427856167169208f05f733186983c0e
Add sum.py
linpawslitap/mds_scaling,linpawslitap/mds_scaling,linpawslitap/mds_scaling,linpawslitap/mds_scaling,linpawslitap/mds_scaling,linpawslitap/mds_scaling
tools/sum.py
tools/sum.py
#!/usr/bin/python ######################################################################### # Author: Kai Ren # Created Time: 2013-04-18 16:07:45 # File Name: ./sum.py # Description: ######################################################################### import matplotlib matplotlib.use('Agg') import matplotlib.pypl...
bsd-3-clause
Python
902b0eaa5c42028f9b2ded1dbe39b76910e96490
Add mac_backtest_tearsheet to show example of how to use the Tearsheet Statistics for daily bars trading system.
mhallsmoore/qstrader
examples/mac_backtest_tearsheet.py
examples/mac_backtest_tearsheet.py
import click from qstrader import settings from qstrader.compat import queue from qstrader.price_parser import PriceParser from qstrader.price_handler.yahoo_daily_csv_bar import YahooDailyCsvBarPriceHandler from qstrader.strategy.moving_average_cross_strategy import MovingAverageCrossStrategy from qstrader.position_si...
mit
Python
d889e0b71beb12511b7fcc346113035e0115ef0c
add base for seq2seq finetuning
huggingface/pytorch-transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers
examples/run_seq2seq_finetuning.py
examples/run_seq2seq_finetuning.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018 Microsoft and The HuggingFace Inc. 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 ma...
apache-2.0
Python
f2396baa459c61fbbcd3c4889868f813a373d7e8
Add fixture for disconnected providers
pipermerriam/web3.py,shravan-shandilya/web3.py
tests/providers/conftest.py
tests/providers/conftest.py
import pytest from web3.web3.ipcprovider import IPCProvider from web3.web3.rpcprovider import TestRPCProvider, RPCProvider @pytest.fixture(params=['tester', 'rpc', 'ipc']) def disconnected_provider(request): """ Supply a Provider that's not connected to a node. (See also the web3 fixture.) """ i...
mit
Python
40eac4136154e1e886d37440d6acc3d815fe61d6
concatenate delta files
jgurtowski/ectools,jgurtowski/ectools
deltacat.py
deltacat.py
#!/usr/bin/env python #Concatenate delta files import sys import os if not len(sys.argv) >= 4: sys.exit("deltacat.py querypath 1.delta 2.delta [3.delta ...] \n") querypath = sys.argv[1] deltafiles = sys.argv[2:] noexist = filter(lambda p : not os.path.exists(p) , deltafiles) if bool(noexist): s = "Cannot...
bsd-3-clause
Python
d217e9762c5ddf26a85b00079cf9c979ae7309d0
add example for source and metadata
stoewer/nixpy,stoewer/nixpy
docs/source/examples/imageWithSource.py
docs/source/examples/imageWithSource.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Copyright © 2014 German Neuroinformatics Node (G-Node) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted under the terms of the BSD License. See LICENSE file in the root of the Project. Author: Ja...
bsd-3-clause
Python
824c591204c7939a854d1d618cf32358387dbff0
Add initial location unit tests
FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition
tests/test_location.py
tests/test_location.py
from SUASSystem import * import math import numpy import unittest from dronekit import LocationGlobalRelative class locationTestCase(unittest.TestCase): def setUp(self): self.position = Location(5, 12, 20) def test_get_lat(self): self.assertEquals(5, self.position.get_lat())
mit
Python
1c084e0d6ce1bb53bf8f2e9f72d8dc1a5b13294b
add initial south migration
dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq
corehq/ex-submodules/casexml/apps/phone/migrations/0001_initial.py
corehq/ex-submodules/casexml/apps/phone/migrations/0001_initial.py
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'OwnershipCleanlinessFlag' db.create_table(u'phone_ownershipcleanlinessflag', ( ...
bsd-3-clause
Python
dea7cb3772bb1f2563d27e641ad9b6e4cff7b0ae
Add check_javac_syntax.py
orezpraw/unnaturalcode,orezpraw/unnaturalcode,naturalness/unnaturalcode,naturalness/unnaturalcode,naturalness/unnaturalcode,orezpraw/unnaturalcode,orezpraw/unnaturalcode,naturalness/unnaturalcode,naturalness/unnaturalcode,orezpraw/unnaturalcode,naturalness/unnaturalcode,orezpraw/unnaturalcode,naturalness/unnaturalcode,...
unnaturalcode/check_javac_syntax.py
unnaturalcode/check_javac_syntax.py
#!/usr/bin/python # Copyright 2017 Dhvani Patel # # This file is part of UnnaturalCode. # # UnnaturalCode is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
agpl-3.0
Python
c5ba411a19f8574e31a0604c9c6d3ca6faea77ea
Add views and urls.py to expose our schedule in an XML / FOSDEM format
toulibre/cdl-site,toulibre/cdl-site
cdl/views.py
cdl/views.py
import datetime from django.http import HttpResponse from django.utils.html import escape from django.utils.text import slugify from symposion.schedule.models import Room, Presentation def schedule_xml(request): result = """<?xml version="1.0" encoding="UTF-8"?> <schedule> <conference> <title>Capitole du...
mit
Python
aa7ad5e92f60aa2244374762acac0861ad33b203
Create get_lookup_lotto_number.py
password123456/lotto
get_lookup_lotto_number.py
get_lookup_lotto_number.py
#!/usr/local/bin/python2.7 # -*- coding: utf-8 -*- __author__ = 'https://github.com/password123456/' import random import numpy as np import time import sys reload(sys) sys.setdefaultencoding('utf-8') time_now = time.strftime('%Y-%m-%d %H:%M:%S') def computer_random(): """컴퓨터가 1-45 사이 번호 6개를 뽑는다.""" ok = Fal...
apache-2.0
Python
0a5faf39487752157a449ce67f5b9e4b627cf8d1
Add sample configuration file
rolandgeider/pk15-orakel
pk15/settings_sample.py
pk15/settings_sample.py
# -*- coding: utf-8 -*- # This file is part of PK15 Orakel # # PK15 Orakel is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # P...
agpl-3.0
Python
5c126943ac86b3a17cb8cb25adbe5fbbd504505b
add functions for handling labels as lists
braysia/labeledarray
labeledarray/utils.py
labeledarray/utils.py
import numpy as np def sort_labels_and_arr(labels, arr=[]): ''' >>> labels = [['a', 'B', '1'], ['a', 'A', '1'], ['b', 'A', '3'], ['b', 'B', '2']] >>> sort_labels_and_arr(labels) [['a', 'A', '1'], ['a', 'B', '1'], ['b', 'A', '3'], ['b', 'B', '2']] >>> labels = [['a', 'B', '1'], ['prop'], ['aprop'],...
mit
Python
195fd53713910cd1d5560bf32f677394ee9f1632
Add a basic integration test for locale module
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/integration/modules/locale.py
tests/integration/modules/locale.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import # Import Salt Testing libs from salttesting import skipIf from salttesting.helpers import ( ensure_in_syspath, requires_salt_modules, requires_system_grains, destructiveTest, ) ensure_in_syspath('../../') # Import sal...
apache-2.0
Python
bffa83069a3ad29ed68651c92a191dc929f5f514
Create blpapiwrapper.py
alex314159/blpapiwrapper
blpapiwrapper.py
blpapiwrapper.py
import blpapi import datetime import pandas class BLP(): def __init__(self): self.session = blpapi.Session() self.session.start() self.session.openService('//BLP/refdata') self.refDataSvc = self.session.getService('//BLP/refdata') def bdp(self, strSecurity='US900123AL40 Govt', strData='PX_LAST', strOverrid...
apache-2.0
Python
f056c73087703130a91d2114cae21a656b707671
add an example test file
alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl
tests/unit/examples/test_unicode.py
tests/unit/examples/test_unicode.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals def test_one(): s = '深入 Python' assert len(s) == 9
bsd-3-clause
Python
86eac50d0abf298fdda13ab2d3fecc269030beeb
Add BinarizedMNIST conversion module
lamblin/fuel,orhanf/fuel,hantek/fuel,dwf/fuel,ejls/fuel,orhanf/fuel,laurent-dinh/fuel,markusnagel/fuel,udibr/fuel,rizar/fuel,dhruvparamhans/fuel,jbornschein/fuel,EderSantana/fuel,dmitriy-serdyuk/fuel,udibr/fuel,mila-udem/fuel,dribnet/fuel,EderSantana/fuel,rizar/fuel,dwf/fuel,janchorowski/fuel,glewis17/fuel,mjwillson/fu...
fuel/converters/binarized_mnist.py
fuel/converters/binarized_mnist.py
import os import fuel import h5py import numpy default_directory = os.path.join(fuel.config.data_path, 'binarized_mnist') default_save_path = os.path.join(default_directory, 'binarized_mnist.hdf5') def convert(directory=default_directory, save_path=default_save_path): """Converts the binarized MNIST dataset to ...
mit
Python
12eab4680b8bfd65a28e2cfaa3ac36b56c77c7dd
Add mixin function.
fusionbox/django-decoratormixins
__init__.py
__init__.py
def DecoratorMixin(decorator): """ Converts a decorator written for a function view into a mixin for a class-based view. :: LoginRequiredMixin = DecoratorMixin(login_required) class MyView(LoginRequiredMixin): pass class SomeView(DecoratorMixin(some_decorator), ...
bsd-2-clause
Python
0fe1f27cd8c127bc74288e24f81eb01fdc49c51c
Add Riak Plugin.
disqus/porkchop
share/plugins/riak.py
share/plugins/riak.py
import json import urllib2 from porkchop.plugin import PorkchopPlugin num_keys = [ "executing_mappers", "mem_allocated", "mem_total", "node_get_fsm_time_100", "node_get_fsm_time_95", "node_get_fsm_time_99", "node_get_fsm_time_mean", "node_get_fsm_time_median", "node_gets_total", "node_put_fsm_time...
apache-2.0
Python
5acf7ecf8e4902faaae96d698ca27b822036f56b
add cleaner abstract class
pfjel7/housing-insights,pfjel7/housing-insights,codefordc/housing-insights
python/housinginsights/ingestion/CleanerBase.py
python/housinginsights/ingestion/CleanerBase.py
from abc import ABCMeta, abstractclassmethod, abstractmethod from datetime import datetime class CleanerBase(object, metaclass=ABCMeta): def __init__(self, meta, cleaned_csv='', removed_csv=''): self.meta = meta self.cleaned_csv = cleaned_csv self.removed_csv = removed_csv @staticmetho...
mit
Python
9b661aeb623a09b2ece6f67e2ba367496df7e26a
work on regex intent classifier
RasaHQ/rasa_nlu,PHLF/rasa_nlu,RasaHQ/rasa_nlu,PHLF/rasa_nlu,beeva-fernandocerezal/rasa_nlu,beeva-fernandocerezal/rasa_nlu,RasaHQ/rasa_nlu
rasa_nlu/classifiers/regex_intent_classifier.py
rasa_nlu/classifiers/regex_intent_classifier.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import map from typing import Any from typing import Dict from typing import Text import re from rasa_nlu.components import Component class RegExIntentCla...
apache-2.0
Python
a7d8442482b7862b96adf3c8f40015072221f600
Add custom style which imitates the offical coloring
dscorbett/pygments,pygments/pygments,dscorbett/pygments,pygments/pygments,pygments/pygments,dscorbett/pygments,dscorbett/pygments,dscorbett/pygments,dscorbett/pygments,dscorbett/pygments,pygments/pygments,dscorbett/pygments,dscorbett/pygments,pygments/pygments,dscorbett/pygments,dscorbett/pygments,dscorbett/pygments,ds...
pygments/styles/igor.py
pygments/styles/igor.py
from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic class IgorStyle(Style): default_style = "" styles = { Comment: 'italic #FF0000', Keyword: '#0000FF', Name.Function: ...
bsd-2-clause
Python
3fcea684179da92e304e8eb2caafae80311e8507
Move the application version number to a separate file per PEP 396.
parallaxinc/Cloud-Session,parallaxinc/Cloud-Session
app/__version__.py
app/__version__.py
#!/usr/bin/env python """ Change Log 1.3.0 Update all packages to current releases. Refactor to support Python 3.7 1.1.7 Update application logging to separate application events from those logged by the uwsgi servivce 1.1.6 Add email address detail for various authenticati...
mit
Python
34193de158b9ba0eee7b9eb372b6278ca615e6f3
Update yaml parser for handling environment variables (#1967)
alexmogavero/home-assistant,devdelay/home-assistant,mKeRix/home-assistant,deisi/home-assistant,betrisey/home-assistant,Julian/home-assistant,Julian/home-assistant,shaftoe/home-assistant,hmronline/home-assistant,LinuxChristian/home-assistant,leoc/home-assistant,robbiet480/home-assistant,kyvinh/home-assistant,jamespcole/...
homeassistant/util/yaml.py
homeassistant/util/yaml.py
"""YAML utility functions.""" import logging import os from collections import OrderedDict import yaml from homeassistant.exceptions import HomeAssistantError _LOGGER = logging.getLogger(__name__) # pylint: disable=too-many-ancestors class SafeLineLoader(yaml.SafeLoader): """Loader class that keeps track of li...
"""YAML utility functions.""" import logging import os from collections import OrderedDict import yaml from homeassistant.exceptions import HomeAssistantError _LOGGER = logging.getLogger(__name__) # pylint: disable=too-many-ancestors class SafeLineLoader(yaml.SafeLoader): """Loader class that keeps track of li...
mit
Python
16b0f26cba278662d7dce2cde29a5888dc59a80f
Add esporter to isomiRs
miRTop/mirtop,miRTop/mirtop
mirtop/exporter/isomirs.py
mirtop/exporter/isomirs.py
""" Read GFF files and output isomiRs compatible format""" import traceback import os.path as op import os import re import shutil from collections import defaultdict from mirtop.libs import do from mirtop.libs.utils import file_exists import mirtop.libs.logger as mylog from mirtop.mirna import fasta, mapper from mir...
mit
Python
7389b8c4742b05a1b3df585dad1fc4273ba5e48d
Add config file for container register & test cloud settings
world-federation-of-advertisers/common-jvm,world-federation-of-advertisers/common-jvm
build/variables.bzl
build/variables.bzl
# Copyright 2020 The Measurement System Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
Python
aaae9048599378da8c4e51aeb25d4c59fa01ee8e
add subloci class
LinkageIO/LocusPocus
locuspocus/subloci.py
locuspocus/subloci.py
class SubLoci(): # A restricted list interface to subloci def __init__(self,loci=None): self._loci = loci @property def empty(self) -> bool: if self._loci is None: return True else: return False def __eq__(self, other) -> bool: if len(self)...
mit
Python
ae4648f9672cbe17f3d17e3b3fdbdd0da9750f3f
add a tool to process models to be published
open-mmlab/mmdetection,open-mmlab/mmdetection
tools/publish_model.py
tools/publish_model.py
import argparse import subprocess import torch def parse_args(): parser = argparse.ArgumentParser( description='Process a checkpoint to be published') parser.add_argument('in_file', help='input checkpoint filename') parser.add_argument('out_file', help='output checkpoint filename') args = pars...
apache-2.0
Python
0f6436c3ff828e5b12cc2f96978fc6a27f65060f
add missing component.py
Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide
component.py
component.py
# -*- coding: utf-8 -*- # # Copyright (c) 2009 Olivier Guilyardi <olivier@samalyse.com> # # This file is part of TimeSide. # TimeSide is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the Li...
agpl-3.0
Python
88a673c402b60e3212e2a60477a854b756ae5e9a
Add initial definition of specific event item
leaffan/pynhldb
db/specific_event.py
db/specific_event.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # import uuid from db.common import Base from db.common import session_scope class SpecificEvent(): @classmethod def find_by_event_id(self, event_id): # retrieving table name for specific event table_name = self.__tablename__ # finding ...
mit
Python
ad8cdbdb31c3603886a1d2fb9217cb0376bb3fc7
add ex32
Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python
lpthw/ex32.py
lpthw/ex32.py
#!/usr/bin/env python # Exercise 32: Loops and Lists the_count = [1, 2, 3, 4, 5] fruits = ['apples', 'oranges', 'pears', 'apricots'] change = [1, 'pennies', 2, 'dimes', 3, 'quarters'] # this first kind of for-loop goes through a list for number in the_count: print "This is count %d" % number # same as above for...
mit
Python
166d616c8f817655627554bfb639b8b42a25bd32
Add small benchmark script for numexpr testing
rmsare/scarplet,stgl/scarplet
bench/benchmark.py
bench/benchmark.py
""" Benchmarks for basic operations in scarplet code """ import dem import scarplet from WindowedTemplate import Scarp import numpy as np import numexpr #import pyfftw #from pyfftw.interfaces.numpy_fft import fft2, ifft2, fftshift from timeit import default_timer as timer if __name__ == "__main__": data = dem.D...
mit
Python
9aeebde15b5ad2d6526c9b62ab37cf0d890d167d
Add script to run PBS jobs to create fragment database
DrrDom/crem,DrrDom/crem
pbs/gen.py
pbs/gen.py
#!/usr/bin/env python3 #============================================================================== # author : Pavel Polishchuk # date : 19-08-2018 # version : # python_version : # copyright : Pavel Polishchuk 2018 # license : #===========================================...
bsd-3-clause
Python
9c7d0fed27bbbe900ced65470fe53e3d91ab2127
Add pickle module to formats
Zsailer/phylogenetics,Zsailer/phylo_tools_2
phylogenetics/dataio/formats/pickle.py
phylogenetics/dataio/formats/pickle.py
import pickle def write(object_data): """ Write data as pickle string. """ output = pickle.dumps(object_data) return output def read(data): """ Read pickle string and convert to object. """ object_data = pickle.loads(data) return object_data
unlicense
Python
ec117d0397173415dce662733de861d193504d16
add simple nagios network device check script
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
nagios/check_tcptraffic.py
nagios/check_tcptraffic.py
"""Wrote my own tcptraffic nagios script, sigh""" from __future__ import print_function import sys import datetime import json import os import getpass def compute_rate(old, new, seconds): """Compute a rate that makes sense""" delta = new - old if delta < 0: delta = new return delta / seconds ...
mit
Python
1208f86c8c5ba677bd6001442129d49f28c22764
Add test cases for DictParameter
jamesmcm/luigi,samepage-labs/luigi,jw0201/luigi,h3biomed/luigi,humanlongevity/luigi,riga/luigi,Wattpad/luigi,dlstadther/luigi,javrasya/luigi,edx/luigi,Magnetic/luigi,adaitche/luigi,foursquare/luigi,dlstadther/luigi,linsomniac/luigi,samuell/luigi,Houzz/luigi,Houzz/luigi,PeteW/luigi,ContextLogic/luigi,PeteW/luigi,ehdr/lu...
test/dict_parameter_test.py
test/dict_parameter_test.py
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify 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 law...
apache-2.0
Python
d008bd260864e1177d0aa30bb92b189f5443f711
Add __main__.py
botify-labs/simpleflow,botify-labs/simpleflow
simpleflow/__main__.py
simpleflow/__main__.py
from simpleflow.command import cli if __name__ == '__main__': cli()
mit
Python
f39c33a773df818407637ab81a023ed38260fe7a
Store NIDM constants in a separate file
cmaumet/nidm-results_afni,cmaumet/nidm-results_fsl,incf-nidash/nidm-results_afni,jbpoline/nidm-results_fsl,incf-nidash/nidm-results_fsl,incf-nidash/nidmresults-fsl,cmaumet/nidmresults-fsl
constants.py
constants.py
'''Python implementation of NI-DM (for statistical results) - constants @author: Camille Maumet <c.m.j.maumet@warwick.ac.uk> @copyright: University of Warwick 2013-2014 ''' from prov.model import Namespace NIDM = Namespace('nidm', "http://www.incf.org/ns/nidash/nidm#") NIIRI = Namespace("niiri", "http://iri.nidash.o...
mit
Python
aadc19505b59920b9b1e671c44aa6ffaad4ee738
Add migration for control_controls
kr41/ggrc-core,NejcZupec/ggrc-core,j0gurt/ggrc-core,hyperNURb/ggrc-core,selahssea/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,jmakov/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,prasannav7/ggrc-core,jmakov/ggrc-core,edofic/ggrc-core,prasannav7/ggrc-core,andrei-karalionak/ggrc-core,uskudnik/ggrc-core,VinnieJohns/ggr...
src/ggrc/migrations/versions/20150511142405_32e064034091_migrate_control_controls_to_.py
src/ggrc/migrations/versions/20150511142405_32e064034091_migrate_control_controls_to_.py
### end Alembic commands ### # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com """Migrate control_controls to relationships Revi...
apache-2.0
Python
45f8f8e582a99f28170af5936f01f747e2943e8c
add pipereader, used for passing information back from commands to the worker.
fedora-conary/rmake-2,fedora-conary/rmake-2,fedora-conary/rmake-2,fedora-conary/rmake-2
rmake/lib/pipereader.py
rmake/lib/pipereader.py
# # Copyright (c) 2007 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licen...
apache-2.0
Python
f2c979fc2ae7981dfb786450dec390175968d86a
add initial script for linking dotfiles
ChrisTM/dotfiles-linker
link.py
link.py
#! /bin/env python import argparse import os from os.path import abspath, dirname, join, expanduser def link_dotfiles(src_dir, dst_dir): """ Populate `dst_dir` with links for the the dotfiles contained in `src_dir`. """ src_dir = abspath(src_dir) dst_dir = abspath(dst_dir) for dotfile_name ...
mit
Python
e05e0d1f772cf5e9fbf741fa147afcc9086fc9e3
add bg_carbon_cache
yunstanford/GraphiteSetup,yunstanford/GraphiteSetup
bg_carbon_cache.py
bg_carbon_cache.py
import subprocess import sys import string import os def start_carbon_cache_instance(name): path = os.path.realpath(__file__) subprocess.call(["python", "{0}/bg-carbon-cache".format(os.path.dirname(path)), "--instance={0}".format(name), "start"]) def stop_carbon_cache_instance(name): path = os.path.realpath(__fil...
mit
Python
2d6a9e3a6c4590685510ba735f1c3bf861d19002
add pre-save validators to the User model
ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM,ResearchSoftwareInstitute/MyHPOM
myhpom/models/user.py
myhpom/models/user.py
from django.db import models from django.contrib.auth.models import User from myhpom import validators def user_pre_save_receiver(sender, instance, **kwargs): validators.name_validator(instance.first_name) validators.name_validator(instance.last_name) validators.email_validator(instance.email) if inst...
bsd-3-clause
Python
90eee6e2d1c6b831116859dc7a2ee0fab05f7fc7
add disable close button example
codingsnippets/Gooey,jschultz/Gooey,partrita/Gooey,chriskiehl/Gooey
gooey/_tmp/example_disable_stop.py
gooey/_tmp/example_disable_stop.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import sys from time import sleep from gooey import Gooey, GooeyParser @Gooey(progress_regex=r"^progress: (\d+)%$", disable_stop_button=True) def main(): parser = GooeyParser(prog="e...
mit
Python
446cead11c709901681867b4f86adefce3854701
Revert "Removed the setup.py"
Jumpercables/Wave
docs/source/setup.py
docs/source/setup.py
# -*- coding: utf-8 -*- try: from setuptools import setup, find_packages except ImportError: import distribute_setup distribute_setup.use_setuptools() from setuptools import setup, find_packages import os import sys from distutils import log import breathe long_desc = ''' Breathe is an extension to r...
mit
Python
ce929da100303a56ca5d1e4c5ca3982c314d8696
Solve Code Fights simple composition problem
HKuz/Test_Code
CodeFights/simpleComposition.py
CodeFights/simpleComposition.py
#!/usr/local/bin/python # Code Fights Simple Composition Problem from functools import reduce import math def compose(f, g): return lambda x: f(g(x)) def simpleComposition(f, g, x): return compose(eval(f), eval(g))(x) # Generic composition of n functions: def compose_n(*functions): return reduce(lamb...
mit
Python
adc98039d48ba4da004893c91e4adeca7b5ef20c
Add script for reproducing bug #119
kotamat/pyspotify,jodal/pyspotify,kotamat/pyspotify,jodal/pyspotify,kotamat/pyspotify,felix1m/pyspotify,jodal/pyspotify,mopidy/pyspotify,mopidy/pyspotify,felix1m/pyspotify,felix1m/pyspotify
tests/regression/bug_119.py
tests/regression/bug_119.py
from __future__ import print_function import logging import sys import threading import time import spotify if len(sys.argv) != 3: sys.exit('Usage: %s USERNAME PASSWORD' % sys.argv[0]) username, password = sys.argv[1], sys.argv[2] def login(session, username, password): logged_in_event = threading.Event(...
apache-2.0
Python
d05e695cf2a244d1903936ff24d4269fd62844b3
add some useful logging
messense/wechat-bot,tdautc19841202/wechat-bot,JackonYang/wechat-bot
handlers.py
handlers.py
#coding=utf-8 import logging import wechat import ai from hashlib import sha1 from tornado import web from tornado.options import options class WechatHandler(web.RequestHandler): def get(self): echostr = self.get_argument('echostr', '') if self.check_signature(): self.write(echostr) ...
#coding=utf-8 import logging import wechat import ai from hashlib import sha1 from tornado import web from tornado.options import options class WechatHandler(web.RequestHandler): def get(self): echostr = self.get_argument('echostr', '') if self.check_signature(): self.write(echostr) ...
mit
Python
5098640a2d39b99da23e814d1e4cff8c8c78463b
Add module file
jaj42/GraPhysio,jaj42/dyngraph,jaj42/GraPhysio
dyngraph/__init__.py
dyngraph/__init__.py
__all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils']
isc
Python
b58fc31236e0c2226d31f7c846cc6a6392c98d52
Add an experimental test for a single referencew
shexSpec/grammar,shexSpec/grammar,shexSpec/grammar
parsers/python/tests/test_single_reference.py
parsers/python/tests/test_single_reference.py
import unittest from jsonasobj import as_json from pyshexc.parser_impl.generate_shexj import parse shex = """<http://a.example/S0> @<http://a.example/S1> <http://a.example/S1> { <http://a.example/p1> . }""" shexj = """{ "type": "Schema", "shapes": [ "http://a.example/S1", { "type": "Shap...
mit
Python
621b37edd13a2f8580c9037a03bb30b9f0bf8875
Add module urllib/error.py
olemis/brython,brython-dev/brython,jonathanverner/brython,jonathanverner/brython,molebot/brython,Hasimir/brython,kikocorreoso/brython,jonathanverner/brython,kikocorreoso/brython,jonathanverner/brython,brython-dev/brython,molebot/brython,molebot/brython,kikocorreoso/brython,Hasimir/brython,olemis/brython,brython-dev/bry...
www/src/Lib/urllib/error.py
www/src/Lib/urllib/error.py
class HTTPError(Exception):pass
bsd-3-clause
Python
46f8389f79ad7aae6c038a2eef853eb0652349c7
Add example for auto update of a widget using .after()
lawsie/guizero,lawsie/guizero,lawsie/guizero
examples/auto_update_example.py
examples/auto_update_example.py
from guizero import * import random def read_sensor(): return random.randrange(3200, 5310, 10) / 100 def update_label(): text.set(read_sensor()) # recursive call text.after(1000, update_label) if __name__ == '__main__': app = App(title='Sensor Display!', height=100, ...
bsd-3-clause
Python
97fa3b5b6a05481fc68e2053d53dfa7f7db4aaef
add hc.parse
sorki/hacked_cnc,sorki/hacked_cnc,hackerspace/hacked_cnc,hackerspace/hacked_cnc
hc/parse.py
hc/parse.py
import re from . import vars from .error import ParseError probe_re = re.compile(r'Z:([^\s]+) C:([^\s]+)') # designator regexp # X123.12 = ('X', 123.12) # G0 = ('G', 0) des_re = r'([{}])(\d+\.?\d*)' axes_re = re.compile(des_re.format(''.join(vars.axes_designators))) def probe(x): """ Parse probe result: 'Z...
bsd-3-clause
Python
8dbce56b1b595a761fdc29c8730ad5e11e40a203
Add a test for search saces.
bsamorodov/selenium-py-training-samorodov
php4dvd/test_searchfilm.py
php4dvd/test_searchfilm.py
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys import unittest class searchFilm(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.implicitly_wait(1...
bsd-2-clause
Python
48f2c64c7050b4b74f6ec0cefb582ac9e3788fe3
Add Lecture 2-1
geojames/Dart_EnvGIS
Week2-1_Lists_Lecture.py
Week2-1_Lists_Lecture.py
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # Name: Week2-1_Lists_Lecture.py # Purpose: Example and Notes for Lists # # Compatibility: Python 3.5 # # Author: James Dietrich, Dartmouth College # james.t.dietrich@dartmouth.edu # ...
mit
Python