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
12f2ef779728317ec34d2eb6d00ba7c1d3892e63
Add basic characters, descriptions for Dr Black, Miss Scarlet, Col.
tomviner/dojo-adventure-game
characters.py
characters.py
from adventurelib import Item, Bag class Man(Item): subject_pronoun = 'he' object_pronoun = 'him' class Woman(Item): subject_pronoun = 'she' object_pronoun = 'her' dr_black = the_victim = Man('Dr. Black', 'Dr Black', 'the victim') dr_black.def_name = 'the victim' dr_black.description = """\ Dr. Bl...
mit
Python
f9a7c28e660f228f5c584a2c1a4d473fb0e0d972
add clusterconfig
hgfeaon/simple-paxos
clusterconfig.py
clusterconfig.py
#! /usr/bin/env python class ClusterConfig: addrs = { 0 : ('127.0.0.1', 20000), 1 : ('127.0.0.1', 20001), 2 : ('127.0.0.1', 20002), 3 : ('127.0.0.1', 20003), 4 : ('127.0.0.1', 20004), 5 : ('127.0.0.1', 20005), 6 : ('127.0.0.1', 20006), 7 : ('127.0.0.1', 20007), 8 : ('127.0.0.1', 20008), ...
mit
Python
cffb8551169c18f68eb8eaa506a8565b8080dc54
Add tool to analyse MPEG-TS packets.
brendanlong/dash-ts-tools,brendanlong/dash-ts-tools
read_ts.py
read_ts.py
#!/usr/bin/env python3 from ts import * import sys pmt_pid = None pes_readers = {} for ts_packet in read_ts(sys.argv[1]): print(ts_packet) if ts_packet.pid == ProgramAssociationTable.PID: pat = ProgramAssociationTable(ts_packet.payload) input() print(pat) programs = list(pat.pro...
bsd-2-clause
Python
e3dc366a6c91feda8e46b35a57f9bb365cabb954
Create program to find differentials.
wei2912/idc,wei2912/idc,wei2912/idc,wei2912/idc,wei2912/aes-idc,wei2912/aes-idc
some_cipher/create_diff.py
some_cipher/create_diff.py
""" Given a list of impossible differentials, propagate in both directions by a few rounds and try to find a differential that works well for launching attacks. """ import math import pickle import networkx as nx import gen_graph def count(x): """ Count the number of active nibbles in a state. """ r...
mit
Python
22c58acbeef9921236ac6274f04266319f91a3bf
Create trending_python_tester.py
cclauss/Ten-lines-or-less
trending_python_tester.py
trending_python_tester.py
#!/usr/bin/env python3 import bs4 import requests ignore = ['python/cpython'] fmt = """git clone --depth=50 --branch=master {long} ~/{short} cd ~/{short} # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E901,E999,F821,F822,F823 --statistics # exit-zero treates all error...
apache-2.0
Python
bfc4d46292a2c2488124d56fd905e0299516a840
Add util module
fxstein/SentientHome
common/shutil.py
common/shutil.py
#!/usr/local/bin/python -u __author__ = 'Oliver Ratzesberger <https://github.com/fxstein>' __copyright__ = 'Copyright (C) 2014 Oliver Ratzesberger' __license__ = 'Apache License, Version 2.0' from collections import defaultdict # Helper function needed to convert an XML response to a Dictionary def etree_to_dict...
apache-2.0
Python
833728764750ae74f757ba313f2bb6adb0580804
Create conf.py
RonsenbergVI/trendpy,RonsenbergVI/trendpy
docs/conf.py
docs/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # trendpy documentation build configuration file, created by # sphinx-quickstart on Mon Jun 19 13:33:42 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # au...
mit
Python
53ebfd50aa673f208f222d72c7c52466753ea72f
Create setting.py
sgleilei/mailagent
setting.py
setting.py
#!/usr/bin/env python # coding=utf-8 import time smtp_enable = True smtp_bcc_sender = True smtp_receivers = ( 'aaa@xxx.com', 'bbb@yyy.com', 'ccc@zzz.com' ) def smtp_subject(): return u'this is an email subject.' def smtp_context(): return u''' Fellows: hello all! %s ''' %time.strftime('--...
bsd-2-clause
Python
852cab299fc1b568d6b178e3fd94d18c8e9effe8
Create ProportionalAllocation.py
Holisticnature/ArcNumerical-Tools
Scripts/Experiments/ProportionalAllocation.py
Scripts/Experiments/ProportionalAllocation.py
# -------------------------------- # Name: ProportionalAllocation.py # Purpose: This script is intended to provide a way to use sampling geography that will either calculate proportional # averages and sums based on the percentage of an intersection covered. # Current Owner: David Wasserman # Last Modified: 4/17/2021 ...
apache-2.0
Python
eb127e2e77de2375fe8944042f534ff239ffc261
Create pb_api.py
ChasL/pb_wrapper
pb_api.py
pb_api.py
import requests from pb_dicts import FORMATS, EXPIRES, PRIVACY def send_post(url, data): """ Responsible for converting data to utf8 and sending POST """ if data: payload = {x: str(y).encode("utf-8") for x,y in data.items()} else: payload = None r = requests.post(url, data=payload) ...
mit
Python
7451862d75fabdbead567db9c18aa02c45026162
Improve the help text for configdrive options
mahak/nova,openstack/nova,phenoxim/nova,Juniper/nova,cloudbase/nova,klmitch/nova,hanlind/nova,sebrandon1/nova,openstack/nova,rajalokan/nova,mikalstill/nova,klmitch/nova,vmturbo/nova,mikalstill/nova,Juniper/nova,phenoxim/nova,rajalokan/nova,rahulunair/nova,sebrandon1/nova,klmitch/nova,alaski/nova,gooddata/openstack-nova...
nova/conf/configdrive.py
nova/conf/configdrive.py
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
Python
adf80bfc06cff100019c94d7be9c938b9110060c
Use threading.Thread to call spam.busy
wking/cpython-extension,wking/cpython-extension
grab-cores.py
grab-cores.py
#!/usr/bin/env python import threading import spam def grab_cores(threads=1, count=int(1e9)): _threads = [] for i in range(threads): thread = threading.Thread(target=spam.busy, args=(count,)) _threads.append(thread) thread.start() for thread in _threads: thread.join() i...
cc0-1.0
Python
a9aacff5af3516e1ef430e0e20e845d792efca30
Create configuration.py
dddomodossola/remi,dddomodossola/remi,dddomodossola/gui,PURPORC/remi
configuration.py
configuration.py
PORT_NUMBER = 8080 IP_ADDR = "127.0.0.1" BASE_ADDRESS = "http://"+IP_ADDR+":" + str(PORT_NUMBER) + "/" MULTIPLE_INSTANCE = False runtimeInstances = list()
apache-2.0
Python
7c825b775bbdfec867d580417a2080865b88e3cd
rename scatterChart example
yelster/python-nvd3,pignacio/python-nvd3,Coxious/python-nvd3,pignacio/python-nvd3,vdloo/python-nvd3,oz123/python-nvd3,BibMartin/python-nvd3,yelster/python-nvd3,mgx2/python-nvd3,Coxious/python-nvd3,yelster/python-nvd3,mgx2/python-nvd3,mgx2/python-nvd3,oz123/python-nvd3,BibMartin/python-nvd3,liang42hao/python-nvd3,pignac...
examples/scatterChart.py
examples/scatterChart.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Examples for Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ from nvd3 imp...
mit
Python
670c05c688b478fe17a864f8a8365544790756f2
add a new test TestTaskDispatcher
TaiSakuma/AlphaTwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl
tests/unit/ConcurrentlySP/test_TaskDispatcher.py
tests/unit/ConcurrentlySP/test_TaskDispatcher.py
import unittest import os import stat import tempfile import shutil from AlphaTwirl.ConcurrentlySP import TaskDispatcher ##__________________________________________________________________|| run_py = """ #!/usr/bin/env python import time import sys time.sleep(float(sys.argv[1])) print ' '.join(sys.argv) """ run_py =...
bsd-3-clause
Python
fda963ccfb07b21819292bb9f3fd9ffbb7739d74
add script
ashumeow/MeowRTC,ashumeow/MeowRTC,ashumeow/MeowRTC,ashumeow/MeowRTC,ashumeow/MeowRTC,ashumeow/MeowRTC
MeowRTC/cloud/stack/python/scripts/tcp.py
MeowRTC/cloud/stack/python/scripts/tcp.py
import threading import socket class TCPThread( threading.Thread ): def __init__( self , operation , address=None ): threading.Thread.__init__( self ) if operation == 'send': self.send(address) elif operation =='accept': self.accept() def send( self , address ): print 'Send Operation' streamSock = ...
mit
Python
3fc5a6063445fb8db4527402df69f0938fc7a0f0
Add link to docs
xifle/home-assistant,justyns/home-assistant,varunr047/homefile,leppa/home-assistant,alexmogavero/home-assistant,tboyce021/home-assistant,kyvinh/home-assistant,LinuxChristian/home-assistant,adrienbrault/home-assistant,nnic/home-assistant,jabesq/home-assistant,lukas-hetzenecker/home-assistant,instantchow/home-assistant,f...
homeassistant/components/binary_sensor/nest.py
homeassistant/components/binary_sensor/nest.py
""" homeassistant.components.binary_sensor.nest ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for Nest Thermostat Binary Sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.nest/ """ import logging import socket import homeassista...
""" homeassistant.components.binary.nest ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for Nest Thermostat Binary Sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.nest/ """ import logging import socket import homeassistant.components.ne...
mit
Python
8b9ceeabd6796bbe01b1fd82d9ed958989be8572
Create __init__.py
NKPyo/kruskal
__init__.py
__init__.py
import kruskal from kruskal import ufds from kruskal
mit
Python
0f3509152124805f4bade1f6ce7275fbee7a9a65
Create __init__.py
SamGriffith3/hot_list
__init__.py
__init__.py
import time import scour def_scour(): time.sleep(360)
mit
Python
ef73e69e6fb450b4087eba9e34d68b1bc3bd14ff
Create __init__.py
jameskeaveney/ArduinoDUE-Data-Logger,jameskeaveney/ArduinoDUE-Data-Logger
__init__.py
__init__.py
mit
Python
e55e718277a65e7423f7b8b217604a4e22d69a36
Create leetcode-56.py
jeremykid/FunAlgorithm,jeremykid/FunAlgorithm,jeremykid/FunAlgorithm,jeremykid/FunAlgorithm
python_practice/leetCode/leetcode-56.py
python_practice/leetCode/leetcode-56.py
#Merge Intervals class Solution: def merge(self, intervals: List[Interval]) -> List[Interval]: #sortInterval if (not len(intervals)): return [] startSortedIntervals = sorted(intervals, key=self.sortByStartFunction) startIndex = 0 start = 0 ...
mit
Python
9e48b8ab65ad046dbddf513bce8ec9c34f74b2cd
make sure to strip comments from address
Jaesin/OctoPrint,foosel/OctoPrint,foosel/OctoPrint,Jaesin/OctoPrint,foosel/OctoPrint,foosel/OctoPrint,Jaesin/OctoPrint,Jaesin/OctoPrint
src/octoprint/util/net.py
src/octoprint/util/net.py
# coding=utf-8 from __future__ import absolute_import, division, print_function __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License" import socket import sys import netaddr import...
# coding=utf-8 from __future__ import absolute_import, division, print_function __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License" import socket import sys import netaddr import...
agpl-3.0
Python
961891b53630d95e83d726bdfb88187c9508961b
put back init?
nmih/ssbio,SBRG/ssbio,SBRG/ssbio,nmih/ssbio
__init__.py
__init__.py
import properties import tools
mit
Python
d152e84db7971cdf3c588c07f095f492f3b42ea6
Add the binary search and bisect algorithms
nitsas/py3algs
binary_search.py
binary_search.py
""" The binary search algorithm - search for an item inside a sorted list. Also includes the bisect algorithm: Return the insertion point for an item x in a list to maintain sorted order. (again in logarithmic time) Author: Christos Nitsas (nitsas) (chrisnitsas) Language: Python 3(.4) Date: November, 20...
mit
Python
5d360aaf0d619472026a1099e606043fe4910bcf
Add task to correctly set start/end dates based on active meetings for past / current learning circles
p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles
studygroups/management/commands/fix_start_end_dates.py
studygroups/management/commands/fix_start_end_dates.py
from django.core.management.base import BaseCommand, CommandError from studygroups.models import StudyGroup class Command(BaseCommand): help = 'Make sure all study groups with meetings have the correct start/end dates' def handle(self, *args, **options): for sg in StudyGroup.objects.active(): ...
mit
Python
5193f74745943dd84dce6706a1765f1415faf541
Create 7kyu_batman_quotes.py
Orange9000/Codewars,Orange9000/Codewars
Solutions/7kyu/7kyu_batman_quotes.py
Solutions/7kyu/7kyu_batman_quotes.py
class BatmanQuotes(object): @staticmethod def get_quote(quotes, hero): index = int(sorted(hero)[0]) return {'B':'Batman: ','R':'Robin: ','J':'Joker: '}[hero[0]] + quotes[index]
mit
Python
f540f024a99fb99e91b3cb38d88f211416c04d7c
Add migration to go with 04fcda3.
City-of-Helsinki/munigeo
munigeo/migrations/0002_auto_20150608_1607.py
munigeo/migrations/0002_auto_20150608_1607.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('munigeo', '0001_initial'), ] operations = [ migrations.AlterField( model_name='municipality', name='...
agpl-3.0
Python
eb81bf33d26923e5d79d87aa0e4c1db32eaf7c7c
Add start of a migration to add new groups for OSF Admin
Johnetordoff/osf.io,monikagrabowska/osf.io,brianjgeiger/osf.io,hmoco/osf.io,TomBaxter/osf.io,Johnetordoff/osf.io,mattclark/osf.io,HalcyonChimera/osf.io,cwisecarver/osf.io,cwisecarver/osf.io,caseyrollins/osf.io,erinspace/osf.io,monikagrabowska/osf.io,Nesiehr/osf.io,aaxelb/osf.io,crcresearch/osf.io,brianjgeiger/osf.io,sa...
admin/base/migrations/0002_groups.py
admin/base/migrations/0002_groups.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth.models import Group import logging logger = logging.getLogger(__file__) def add_groups(*args): group, created = Group.objects.get_or_create(name='nodes_and_users') if created: lo...
apache-2.0
Python
0442fd32eec275eb3dfabfb210c80b7911a7dc7a
Fix problem in combine-tests.py.
fabricedesre/rust,zubron/rust,aturon/rust,TheNeikos/rust,stepancheg/rust-ide-rust,ebfull/rand,dwillmer/rust,dwillmer/rust,mdinger/rust,richo/rust,pelmers/rust,aturon/rust,0x73/rust,ktossell/rust,zachwick/rust,sarojaba/rust-doc-korean,aneeshusa/rust,mdinger/rust,kimroen/rust,servo/rust,mdinger/rust,erickt/rust,bombless/...
src/etc/combine-tests.py
src/etc/combine-tests.py
#!/usr/bin/env python # this combines all the working run-pass tests into a single large crate so we # can run it "fast": spawning zillions of windows processes is our major build # bottleneck (and it doesn't hurt to run faster on other platforms as well). import sys, os, re, codecs def scrub(b): if sys.version_in...
#!/usr/bin/env python # this combines all the working run-pass tests into a single large crate so we # can run it "fast": spawning zillions of windows processes is our major build # bottleneck (and it doesn't hurt to run faster on other platforms as well). import sys, os, re, codecs def scrub(b): if sys.version_in...
apache-2.0
Python
cdafca7ad65ac4efb853bcb52adeedcc8af7bd92
Create helloworld.py
paper-squares/2017Challenges,paper-squares/2017Challenges,paper-squares/2017Challenges
challenge_0/python/paper-squares/helloworld.py
challenge_0/python/paper-squares/helloworld.py
print 'Hello World'
mit
Python
4a5e5d07f3510394ac1112727c66ddd122762aa9
Check out 'long-test' branch and reexecute self at long test startup.
pap/rethinkdb,tempbottle/rethinkdb,alash3al/rethinkdb,yaolinz/rethinkdb,Qinusty/rethinkdb,tempbottle/rethinkdb,wkennington/rethinkdb,wkennington/rethinkdb,sontek/rethinkdb,greyhwndz/rethinkdb,bpradipt/rethinkdb,scripni/rethinkdb,scripni/rethinkdb,eliangidoni/rethinkdb,lenstr/rethinkdb,eliangidoni/rethinkdb,captainpete/...
test/long_test.py
test/long_test.py
#!/usr/bin/python import sys from os import execv from optparse import OptionParser from cloud_retester import do_test, do_test_cloud, report_cloud, setup_testing_nodes, terminate_testing_nodes long_test_branch = "long-test" no_checkout_arg = "--no-checkout" def exec_self(args): execv("/usr/bin/env", ["python", s...
agpl-3.0
Python
ea2f91ddc5cd2e85aea7a75592b2bc57ca872aed
add resource pressure analyzer
googleinterns/vectio,googleinterns/vectio,googleinterns/vectio,googleinterns/vectio,googleinterns/vectio,googleinterns/vectio,googleinterns/vectio
analysis/ResourcePressureAnalyzer.py
analysis/ResourcePressureAnalyzer.py
import sys import numpy as np INPUT_FILE = sys.argv[1] num_active_msgs_receiver = [] num_active_msgs_sender = [] num_active_senders_per_receiver = [] num_active_receivers_per_sender = [] num_ooo_bytes = [] max_active_msgs_receiver = 0 max_active_msgs_sender = 0 max_active_senders_per_receiver = 0 max_active_receiver...
apache-2.0
Python
f77718558dd3d80b17d79140e07ec09caf506af7
add test init
larrybradley/photutils,astropy/photutils
photutils/psf/tests/__init__.py
photutils/psf/tests/__init__.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This packages contains affiliated package tests. """
bsd-3-clause
Python
e61d9f15f320e5372562b3e24ecb0a95e12c7ee5
Create auto_namedtuple.py
amorgun/python-trickery
auto_namedtuple.py
auto_namedtuple.py
# Python >= 3.5 from typing import Dict, NamedTuple class TaskMeta(type): def __new__(mcl, name, bases, dict_): if "__fields__" in dict_: base_namedtuple = NamedTuple(name, dict_["__fields__"]) dict_["__slots__"] = [] bases = bases + (base_namedtuple,) return su...
mit
Python
3d3b3c72fde5adc168665beaff3d5b87250506a3
Rename image files.
Jackson-Y/Machine-Learning,Jackson-Y/Machine-Learning
object_detection/rename_image_files.py
object_detection/rename_image_files.py
# Copyright 2018 CNKI Authors. All Rights Reserved. # # Date: 2018-03-13 #================================================================ r"""Rename the image files in the directory. To run, python rename_image_files.py python rename_image_files.py your_image_directory """ from __future__ import absolute_imp...
mit
Python
b04d46f8cf0ee4138b4704185e0e79a2d0b958d9
add missing trivial migration
c3nav/c3nav,c3nav/c3nav,c3nav/c3nav,c3nav/c3nav
src/c3nav/control/migrations/0003_auto_20171210_1452.py
src/c3nav/control/migrations/0003_auto_20171210_1452.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-12-10 14:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('control', '0002_userpermissions_access_all'), ] operations = [ migrations.A...
apache-2.0
Python
a8c1acc95d28915072508b881d2019cd132382ef
Add test for controller
ViderumGlobal/ckanext-orgdashboards,ViderumGlobal/ckanext-orgdashboards,ViderumGlobal/ckanext-orgdashboards,ViderumGlobal/ckanext-orgdashboards
ckanext/orgdashboards/tests/test_controller.py
ckanext/orgdashboards/tests/test_controller.py
import requests from routes import url_for from ckan.tests.helpers import reset_db from ckan import plugins from ckanext.orgdashboards.tests.helpers import (id_generator, create_mock_data, get_site_base_url) class Tes...
agpl-3.0
Python
62847a1723bb779296cae52dd67972629d02dcc4
Create tap_td_typedef.py
bigdig/vnpy,vnpy/vnpy,bigdig/vnpy,bigdig/vnpy,bigdig/vnpy,vnpy/vnpy
vnpy/api/tap/generator/tap_td_typedef.py
vnpy/api/tap/generator/tap_td_typedef.py
TAPISTR_10 = "string" TAPISTR_20 = "string" TAPISTR_30 = "string" TAPISTR_40 = "string" TAPISTR_50 = "string" TAPISTR_70 = "string" TAPISTR_100 = "string" TAPISTR_300 = "string" TAPISTR_500 = "string" TAPISTR_2000 = "string" TAPIAUTHCODE = "string" TAPIMACTYPE = "string" TAPISecondSerialIDType = "string" TAPICHAR = "ch...
mit
Python
4df2cd096d0503a8578de2609e6009f2b75a0ff8
add mouse config
saketkc/ribo-seq-snakemake,saketkc/ribo-seq-snakemake,saketkc/ribo-seq-snakemake
configs/config_HuR_Penalva_L_03222017.mouse.py
configs/config_HuR_Penalva_L_03222017.mouse.py
GENOMES_DIR='/media/data1/genomes' OUT_DIR = '/media/data2/HuR_human_mouse/mouse/ribo-seq' SRC_DIR = '/home/saket/github_projects/clip_seq_pipeline/scripts' RAWDATA_DIR ='/media/data1/HuR_human_mouse/mouse/ribo/Penalva_L_03222017' GENOME_BUILD = 'mm10' GENOME_FASTA = GENOMES_DIR + '/' + GENOME_BUILD + '/fasta/'+ GENOME...
bsd-3-clause
Python
e3d5b2e8da7e9bfd60af60252078cf188801d20e
Test if ids are some sort of int.
decvalts/landlab,ManuSchmi88/landlab,cmshobe/landlab,RondaStrauch/landlab,amandersillinois/landlab,csherwood-usgs/landlab,SiccarPoint/landlab,cmshobe/landlab,decvalts/landlab,ManuSchmi88/landlab,cmshobe/landlab,landlab/landlab,amandersillinois/landlab,Carralex/landlab,SiccarPoint/landlab,csherwood-usgs/landlab,Carralex...
landlab/grid/tests/test_raster_funcs/test_find_nearest_node.py
landlab/grid/tests/test_raster_funcs/test_find_nearest_node.py
import numpy as np from numpy.testing import assert_array_equal from nose import with_setup try: from nose.tools import assert_is, assert_is_instance except ImportError: from landlab.testing.tools import assert_is, assert_is_instance from nose.tools import (assert_equal, assert_raises) from landlab.grid import...
import numpy as np from numpy.testing import assert_array_equal from nose import with_setup try: from nose.tools import assert_is, assert_is_instance except ImportError: from landlab.testing.tools import assert_is, assert_is_instance from nose.tools import (assert_equal, assert_raises) from landlab.grid import...
mit
Python
0e11b7b99f4e414774189cd05ecb3b62ae6366d9
Add _version.py (#96)
google/latexify_py,google/latexify_py
src/latexify/_version.py
src/latexify/_version.py
"""Version specifier. DON'T TOUCH THIS FILE. This file is replaced during the release process. """ __version__ = "0.0.0a0"
apache-2.0
Python
0c24e4a2d7958c8eb10056cfe6f5b06520543f12
implement new muon fake calculator
morgenst/PyAnalysisTools,morgenst/PyAnalysisTools,morgenst/PyAnalysisTools
PyAnalysisTools/AnalysisTools/FakeCalculator.py
PyAnalysisTools/AnalysisTools/FakeCalculator.py
import ROOT import traceback from array import array from itertools import permutations from copy import copy, deepcopy from functools import partial from PyAnalysisTools.base import _logger, InvalidInputError, Utilities import PyAnalysisTools.PlottingUtils.PlottingTools as pt import PyAnalysisTools.PlottingUtils.HistT...
mit
Python
20c2aff945ac9174921ca12ab5fff2ab0179af50
Add function decoding
goodwinxp/ATFGenerator,goodwinxp/ATFGenerator,goodwinxp/ATFGenerator
pida_tfunction.py
pida_tfunction.py
from pida_abc_type import IdaTypes from pida_types import IDA_TYPES from pida_type_decoder import decode_step class IdaTFunctions(IdaTypes): def __init__(self, ida_type=IDA_TYPES['function']): value = { 'ret_type': {'idt': IDA_TYPES['void'], 'value': None}, 'args_type': [], ...
mit
Python
8e029355017ab2cb692c62fc6a2841e2a62ef6fd
Fix typo
ranjinidas/Axelrod,marcharper/Axelrod,ranjinidas/Axelrod,marcharper/Axelrod
axelrod/random_.py
axelrod/random_.py
import random def random_choice(p=0.5): """ Return 'C' with probability `p`, else return 'D' Emulates Python's random.choice(['C', 'D']) since it is not consistent across Python 2.7 to Python 3.4""" r = random.random() if r < p: return 'C' return 'D'
import random def random_choice(p=0.5): """ Return 'C' wit probability `p`, else return 'D' Emulates Python's random.choice(['C', 'D']) since it is not consistent across Python 2.7 to Python 3.4""" r = random.random() if r < p: return 'C' return 'D'
mit
Python
697f5fdc260157da86abbf4579cd3f5e04eb3c63
Create validator for CEI identifiers
poliquin/brazilnum
brazilnum/cei.py
brazilnum/cei.py
#!/usr/bin/env python import re import random from operator import mul """ Functions for working with Brazilian CEI identifiers. """ NONDIGIT = re.compile(r'[^0-9]') CEI_WEIGHTS = [7, 4, 1, 8, 5, 2, 1, 6, 3, 7, 4] def clean_cei(cei): """Takes a CEI and turns it into a string of only numbers.""" return NOND...
mit
Python
0528ee6f8170eac9bc928ea9d52c59f2cf4f8f26
Split the amsaves tests to focus on the second test function
eayoungs/DeltaMtrSvs,eayoungs/DeltaMtrSvs
test_3_amsaves.py
test_3_amsaves.py
#!/usr/bin/env python __author__ = "Eric Allen Youngson" __email__ = "eric@scneco.com" __copyright__ = "Copyright 2015, Succession Ecological Services" __license__ = "GNU Affero (GPLv3)" """ This module provides functions for requesting results from the DeltaMeter Services API * deltameterservices.com * """ impo...
agpl-3.0
Python
7deeddb22e5c88a7e547c3c411a64ce2cf0b2773
make cli tests
item4/ugoira
tests/cli_test.py
tests/cli_test.py
from ugoira.cli import ugoira def test_too_short_password(fx_clirunner, fx_too_short_id_pw): id, pw = fx_too_short_id_pw result = fx_clirunner.invoke( ugoira, ['--id', id, '--password', pw, '53239740', 'test.gif'] ) assert result.exit_code == 1 assert result.output.strip() == \ ...
mit
Python
6245c8bad908519fdf6840ac6359868a3451a24c
add workspace definitions file (#19)
bazelbuild/rules_foreign_cc,bazelbuild/rules_foreign_cc,bazelbuild/rules_foreign_cc,bazelbuild/rules_foreign_cc
workspace_definitions.bzl
workspace_definitions.bzl
all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])""" http_archive( name = "rules_foreign_cc", strip_prefix = "rules_foreign_cc-master", url = "https://github.com/bazelbuild/rules_foreign_cc/archive/master.zip", ) new_http_archive( name = "bazel_skylib"...
apache-2.0
Python
5501f9c85335adfab8cd75f19177a9078fd2587b
Add a missing migration
Rikuoja/kore,City-of-Helsinki/kore,City-of-Helsinki/kore,Rikuoja/kore
schools/migrations/0009_auto_20150605_0745.py
schools/migrations/0009_auto_20150605_0745.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('schools', '0008_archivedatalink'), ] operations = [ migrations.RenameField( model_name='archivedatalink', ...
agpl-3.0
Python
ac4292f60ed7c70a5efdd89afc15fb3cd8a3f231
add web.py frameworks example
MrKiven/gunicorn,keakon/gunicorn,elelianghh/gunicorn
examples/frameworks/webpyapp.py
examples/frameworks/webpyapp.py
# Run with # # $ gunicorn webpyapp:app # import web urls = ( '/', 'index' ) class index: def GET(self): return "Hello, world!" app = web.application(urls, globals()).wsgifunc()
mit
Python
81327ca67a463cdb97660f99b724a09f15a14b7b
add github integration module
bioconda/bioconda-utils,bioconda/bioconda-utils,bioconda/bioconda-utils
bioconda_utils/github_integration.py
bioconda_utils/github_integration.py
import github import os def _n(x): """ Easy conversion of None to NotSet object used by PyGithub; otherwise pass through unchanged. """ if x is None: return github.GithubObject.NotSet return x def update_status(user, repo, commit, state, context=None, description=None, ...
mit
Python
5fa9bbb5673aa1b5ecd0bd8a5fb117248147eec1
Add new unit tests
viniciuschiele/flask-webapi
tests/test_api.py
tests/test_api.py
from flask import Flask from flask_webapi import WebAPI, ViewBase, route from unittest import TestCase class TestWebAPI(TestCase): def setUp(self): self.app = Flask(__name__) self.client = self.app.test_client() def test_add_view_after_init_app(self): self.api = WebAPI() self....
mit
Python
58e22254e06b8112652b5875c02e69dcf46b8a63
Add script to collect metric results in a single dataset for a main group
jesusbriales/rgbd_benchmark_tools
src/rgbd_benchmark_tools/h5_collectSamples.py
src/rgbd_benchmark_tools/h5_collectSamples.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on Thu Sep 17 09:02:31 2015 @author: jesus """ import argparse import numpy as np import h5py if __name__ == '__main__': parser = argparse.ArgumentParser(description=''' This script collects the metrics and results from several samples of an experiment ...
bsd-2-clause
Python
af3dd33c16e14fc9fee9ad54606714636a90eb03
add router
Ircam-Web/mezzanine-organization,Ircam-Web/mezzanine-organization
sandbox/routers.py
sandbox/routers.py
class Router(object): """ A router to control all database operations between the 2 apps """ def db_for_read(self, model, **hints): if model._meta.app_label == 'eve': return 'eve' if model._meta.app_label == 'presta': return 'presta' return None def...
agpl-3.0
Python
9bd7c108889c1ef2607157df0a4edddafddfee15
update client manager and start rewriting AJAMClient
whardier/AMIty
test/request.py
test/request.py
import socket import logging import tornado.ioloop import amity.client if __name__ == "__main__": import sys logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format='%(asctime)s %(process)d %(filename)s %(lineno)d %(levelname)s #| %(message)s', datefmt='%H:%M:%S') #testingser...
mit
Python
cc6b602a10221b2b69adcbd73a3b9a720f6d9f8e
Add setupdb.py, it's time to work this!
Mic92/ParkAPI,offenesdresden/ParkAPI,Mic92/ParkAPI,offenesdresden/ParkAPI
setupdb.py
setupdb.py
import psycopg2 import configparser config = configparser.ConfigParser() config.read("config.ini") db_data = { "host": config["Database"]["host"], "name": config["Database"]["name"], "user": config["Database"]["user"], "pass": config["Database"]["pass"], "port": config["Database"]["port"] } conn ...
mit
Python
17075736a0ff4f8f677527664e37d55b39cbfe93
Add version 2.5.2.
tmerrick1/spack,mfherbst/spack,lgarren/spack,TheTimmy/spack,krafczyk/spack,mfherbst/spack,krafczyk/spack,EmreAtes/spack,krafczyk/spack,krafczyk/spack,lgarren/spack,mfherbst/spack,LLNL/spack,LLNL/spack,LLNL/spack,mfherbst/spack,iulian787/spack,EmreAtes/spack,TheTimmy/spack,skosukhin/spack,TheTimmy/spack,matthiasdiener/s...
var/spack/repos/builtin/packages/py-dateutil/package.py
var/spack/repos/builtin/packages/py-dateutil/package.py
from spack import * class PyDateutil(Package): """Extensions to the standard Python datetime module.""" homepage = "https://pypi.python.org/pypi/dateutil" url = "https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.4.0.tar.gz" version('2.4.0', '75714163bb96bedd07685cdb2071b...
from spack import * class PyDateutil(Package): """Extensions to the standard Python datetime module.""" homepage = "https://pypi.python.org/pypi/dateutil" url = "https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.4.0.tar.gz" version('2.4.0', '75714163bb96bedd07685cdb2071b...
lgpl-2.1
Python
89b30bea7f8a783e9d8a101e351e6c51bba2c309
Create new package. (#5499)
tmerrick1/spack,mfherbst/spack,skosukhin/spack,matthiasdiener/spack,krafczyk/spack,skosukhin/spack,EmreAtes/spack,lgarren/spack,mfherbst/spack,mfherbst/spack,skosukhin/spack,iulian787/spack,LLNL/spack,lgarren/spack,EmreAtes/spack,LLNL/spack,tmerrick1/spack,LLNL/spack,lgarren/spack,matthiasdiener/spack,matthiasdiener/sp...
var/spack/repos/builtin/packages/r-a4preproc/package.py
var/spack/repos/builtin/packages/r-a4preproc/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
0743c5bde6822115633f9fc698207b585aa784e4
Create new package (#6383)
matthiasdiener/spack,tmerrick1/spack,krafczyk/spack,mfherbst/spack,iulian787/spack,LLNL/spack,EmreAtes/spack,krafczyk/spack,tmerrick1/spack,mfherbst/spack,LLNL/spack,EmreAtes/spack,tmerrick1/spack,mfherbst/spack,matthiasdiener/spack,matthiasdiener/spack,matthiasdiener/spack,tmerrick1/spack,LLNL/spack,mfherbst/spack,Emr...
var/spack/repos/builtin/packages/r-crosstalk/package.py
var/spack/repos/builtin/packages/r-crosstalk/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
b0f8c48ce609784e779bf6a1846146765836d550
add trailing_slash.py
thinkAmi-sandbox/Bottle-sample,thinkAmi-sandbox/Bottle-sample
trailing_slash.py
trailing_slash.py
# -*- coding:utf-8 -*- from bottle import hook, request, route, run # from official recipe # http://bottlepy.org/docs/dev/recipes.html#ignore-trailing-slashes @hook("before_request") def strip_path(): request.environ["PATH_INFO"] = request.environ["PATH_INFO"].rstrip("/") @route("/slash") def slash(): ...
unlicense
Python
7797352ae628fb57aa16f432a177783a016c52ce
Create sys.py
jojoin/cutout,yangjiePro/cutout,MrZhengliang/cutout
cutout/sys.py
cutout/sys.py
#!/usr/bin/python #-*- coding:utf8 -*- import os ## 递归遍历 获取文件夹大小 def get_dir_size(dir): size = 0L for root, dirs, files in os.walk(dir): size += sum([os.path.getsize(os.path.join(root, name)) for name in files]) return size
mit
Python
00406815dd8fa813573a189069a98322f7f0c366
Create __init__.py
lakewik/storj-gui-client
UI/flask_ownstorj/ownstorj/controller/__init__.py
UI/flask_ownstorj/ownstorj/controller/__init__.py
from ownstorj import app from flask import render_template import ownstorj.controller.controller
mit
Python
c2dde1c0d88e1f94c9034013748b7bed727fed83
add tools for looking up authoritative ns records.
dlobue/powerupdater,geodelic/powerupdater
powerupdater/nslookup.py
powerupdater/nslookup.py
from pprint import pformat import logging logger = logging.getLogger(__name__) import dns.resolver import dns.name trusted_resolvers = ['4.2.2.2', '4.2.2.3', '4.2.2.4'] def walk_dns(target): stack = [] while 1: stack.append(target) try: target = target.parent() if no...
apache-2.0
Python
1b91b04a1b2ea1c2020ccfdc6e0696edb12b74d3
Create reborn.py
lucasberti/telegrao-py,prppedro/mercurium
reborn.py
reborn.py
# encoding=utf-8 import json import requests import logging import os logging.basicConfig(level=logging.INFO, handlers=[logging.FileHandler("log.log", "a", "utf-8")]) def msg_type(msg): """ Retorna se é texto, foto, áudio, vídeo """ if "text" in msg: return "text" elif "photo" in msg: re...
mit
Python
a0e07f998b388f0ecc7b7cf2256522f28482b285
Improve docstring for `tf.contrib.data.Counter`.
Bismarrck/tensorflow,kevin-coder/tensorflow-fork,nburn42/tensorflow,dongjoon-hyun/tensorflow,xzturn/tensorflow,manipopopo/tensorflow,ppwwyyxx/tensorflow,alshedivat/tensorflow,caisq/tensorflow,apark263/tensorflow,davidzchen/tensorflow,adit-chandra/tensorflow,meteorcloudy/tensorflow,ghchinoy/tensorflow,tensorflow/tensorf...
tensorflow/contrib/data/python/ops/counter.py
tensorflow/contrib/data/python/ops/counter.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
f527318cde19ca07ada84cbcc653c92459308f15
Create xstrings.py
elicn/xstrings
xstrings.py
xstrings.py
#!/usr/bin/env python ''' xstrings - print the strings of encoded printable characters in files. inspired by 'xorsearch' by didier stevens, http://blog.didierstevens.com/programs/xorsearch @author Eli Cohen-Nehemia ''' import re import argparse from string import printable from sys import stdin PROG_NAME = 'xstrin...
unlicense
Python
1ff676fde581825893237007e5b93cd587dece28
Add flask server
fahlmant/RhythmGenerator,fahlmant/RhythmGenerator
src/app.py
src/app.py
from flask import Flask from flask import render_template import os import sys import subprocess import generator app = Flask(__name__) @app.route('/') def hello_world(name=None): generator.main() subprocess.Popen('lilypond -f png something.ly', shell=True) return render_template('hello.html', name=name) ...
mit
Python
e582644d41f3422128dfc4d45c290ac51361b4aa
Add HAPSession used for encryption
postlund/pyatv,postlund/pyatv
pyatv/auth/hap_session.py
pyatv/auth/hap_session.py
"""Cryptograhpy routines used by HAP.""" from typing import Optional from pyatv.support.chacha20 import Chacha20Cipher class HAPSession: """Manages cryptography for a HAP session according to IP in specification. The HAP specification mandates that data is encrypted/decrypted in blocks of 1024 bytes. T...
mit
Python
ff03b9407b65ab77c0cf4c6c12f73f36925d0092
add test_telnet.py
dnsbob/pynet_testz
test_telnet.py
test_telnet.py
#!/usr/bin/env python # test_telnet.py import telnetlib import time TELNET_PORT=23 TELNET_TIMEOUT=6 def login(remote_conn, username, password): output=remote_conn.read_until("sername:", TELNET_TIMEOUT) remote_conn.write(username + '\n') output += remote_conn.read_until("ssword:", TELNET_TIMEOUT) remo...
apache-2.0
Python
67e77cb5a64a374ff42ebd7b6d84d71ba77e5fdd
Add rename script
pyohei/rirakkuma-crawller,pyohei/rirakkuma-crawller
tool/rename.py
tool/rename.py
#!/usr/local/bin/python # -*- coding: utf-8 -*- """ Rename file. Rename file to update time. """ import os import time FILE_DIR = 'save' def main(): files = os.listdir(FILE_DIR) for f in files: file_path = os.path.join(FILE_DIR, f) f_stat = os.stat(file_path) update_epoc = f_stat.s...
mit
Python
980f9b3620d6a27be2b2abd41a9a4db892a61f3a
Add crawler for devilbear
klette/comics,klette/comics,datagutten/comics,jodal/comics,jodal/comics,klette/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics
comics/crawler/crawlers/devilbear.py
comics/crawler/crawlers/devilbear.py
from comics.crawler.base import BaseComicCrawler from comics.crawler.meta import BaseComicMeta from comics.crawler.utils.lxmlparser import LxmlParser class ComicMeta(BaseComicMeta): name = 'The Devil Bear' language = 'en' url = 'http://www.thedevilbear.com/' start_date = '2009-01-01' history_capabl...
agpl-3.0
Python
555dcd9ca022f7479415a69dd5cffee46366e055
Add a script to retrieve logs from kafka
DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe
scripts/showlog.py
scripts/showlog.py
#!/usr/bin/python3 import sys import argparse from kafka import KafkaConsumer parser = argparse.ArgumentParser(description='Zoe Kafka log viewer') parser.add_argument('kafka_address', help='Address of the Kafka broker') parser.add_argument('--list-logs', action='store_true', help='List all the available service logs...
apache-2.0
Python
02a8745ddc0e9618f79e144a92258ff8ac3f35aa
Add tenant static files finder
jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
bluebottle/utils/staticfiles_finders.py
bluebottle/utils/staticfiles_finders.py
from django.utils._os import safe_join import os from django.conf import settings from django.contrib.staticfiles.finders import FileSystemFinder from bluebottle.clients.models import Client class TenantStaticFilesFinder(FileSystemFinder): def find(self, path, all=False): """ Looks for files in ...
bsd-3-clause
Python
fb5aab27cba926d99791dc20ec55dd01aa6bdb5c
Add gen_enums script
nicholasbishop/pyglsl_parser,nicholasbishop/pyglsl_parser
gen_enums.py
gen_enums.py
#! /usr/bin/env python """Generate pyglsl_parser/lexemes.py from glsl-parser/lexemes.h.""" from collections import OrderedDict from enum import Enum from keyword import iskeyword import re # TODO(nicholasbishop): operators class LexemeType(Enum): """GLSL lexeme categories.""" TYPE = 0, KEYWORD = 1, ...
mit
Python
44a023bb75a2f12a6df6303e4d5ec40afbeba03c
add jumeg_plot.py (devel version) container for plotting function
fboers/jumegX,fboers/jumeg,fboers/jumegX,jdammers/jumeg,pravsripad/jumeg
jumeg_plot.py
jumeg_plot.py
import os import numpy as np import matplotlib.pylab as pl import mne from jumeg.jumeg_base import jumeg_base ################################################################# # # plot_powerspectrum # ################################################################# def plot_powerspectrum(fname,raw=None,picks=None,di...
bsd-3-clause
Python
40ca1d78df864d73026be2af50cfa2ac5a0e22d0
Create setup2.py
rabrahm/zaspe,rabrahm/zaspe
setup2.py
setup2.py
from distutils.core import setup, Extension module =Extension('Cfunctions', sources = ['Cfunctions.c'],libraries=['gsl','gslcblas','m']) setup(name = 'Funciones creadas por Nestor: Extensiones de C/Python', version = '1.0', ext_modules = [module])
mit
Python
27895618fb0d1d31365d2680f4767dec9b63aea2
change updateter for work with enum status
gkbrk/WatchPeopleCode,eleweek/WatchPeopleCode,eleweek/WatchPeopleCode,eleweek/WatchPeopleCode,eleweek/WatchPeopleCode,WatchPeopleCode/WatchPeopleCode,paked/WPC-fix,WatchPeopleCode/WatchPeopleCode,gkbrk/WatchPeopleCode,WatchPeopleCode/WatchPeopleCode,gkbrk/WatchPeopleCode,gkbrk/WatchPeopleCode,jniebuhr/WatchPeopleCode,j...
update_state.py
update_state.py
from apscheduler.schedulers.blocking import BlockingScheduler from app import get_current_live_streams, db, Stream sched = BlockingScheduler() @sched.scheduled_job('interval', seconds=20) def update_state(): print "updating_state" for ls in Stream.query: if ls.status == 'live': ls.status ...
from apscheduler.schedulers.blocking import BlockingScheduler from app import get_current_live_streams, db, Stream sched = BlockingScheduler() @sched.scheduled_job('interval', seconds=20) def update_state(): print "updating_state" for ls in Stream.query: if ls.is_live: ls.is_completed = T...
mit
Python
5ab7c1e9ffa1d87cbb83efcab291370f6f0aaf1d
Create simple.py
scienceopen/piradar,scivision/piradar,scienceopen/piradar,scivision/piradar,scivision/piradar
simple.py
simple.py
#!/usr/bin/env python """ a very simple script to create a complex baseband binary phase coded PRN code. If you guys can transmit and receive this continuously in loopback mode without any glitches, then using the system for radar is not too far away. """ #!/usr/bin/env python import numpy as n import matplotlib.p...
agpl-3.0
Python
fc8467216fd237d8c48db3d2284f151a5840f6d0
Create tcpTest.py
task123/AutoTT,task123/AutoTT,task123/AutoTT
tcpTest.py
tcpTest.py
import TCP import time class R: def reciever_of_messages(self, message): print message r = R() connection = TCP.Connection(10.22.8.239, 12345, r); print "hei" while True: time.sleep(10)
mit
Python
5f8d13be1a653dd9bd03fa9b2cfe13790eaf3913
Create test_db.py
aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick,aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick,aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick
test_db.py
test_db.py
mit
Python
7b9fd483e0d3a3d72cae4cda5b51e10b6090f42e
Create testpic.py
liama482/Picture,liama482/Picture
testpic.py
testpic.py
#hey make something! #well...
mit
Python
87e4f56d61b2d5406639c2f6c138101ee7ee7a62
add script for clearing sandbox
nullzero/wp,nullzero/wp,nullzero/wp,nullzero/wp,nullzero/wp
clear_sandbox.py
clear_sandbox.py
# -*- coding: utf-8 -*- import wikipedia as pywikibot pywikibot.handleArgs(u"-log") vlist = [] vlist.append(u"วิกิพีเดีย:สอนการใช้งาน_(จัดรูปแบบ)/กระดาษทด") vlist.append(u"วิกิพีเดีย:สอนการใช้งาน_(แหล่งข้อมูลอื่น)/กระดาษทด") vlist.append(u"วิกิพีเดีย:สอนการใช้งาน_(แก้ไข)/กระดาษทด") vlist.append(u"วิกิพีเดีย:สอนการใช้...
mit
Python
da9edfb6222c7970676b0023034de4f6ba0669b8
Add client
yuyuyu101/wheatserver,yuyuyu101/wheatserver,yuyuyu101/wheatserver
client/client.py
client/client.py
#!/usr/bin/python import code import sys import socket def server_socket(port): s = socket.socket() s.connect(("127.0.0.1", port)) return s def construct_command(*args): return "\r\r%s$" % ("\n".join(args)) if __name__ == '__main__': print "Wheatserver admin client. Usage: ./client.py [port]" ...
bsd-3-clause
Python
c1c11c7a19ec9103b41f56f08854e5767dbf4b79
Add CLI parsing tests
pubres/pubres
pubres/tests/cli_test.py
pubres/tests/cli_test.py
from pubres.cli_arguments import make_parser p = make_parser() def test_command_line(): r = p.parse_args(['--host', 'localhost', '--port', '5678', '--loglevel', 'ERROR']) assert r.host == 'localhost' assert r.port == 5678 assert r.loglevel == 'ERROR' def test_default_command_line(): r = p.pars...
mit
Python
760036b5d32e3b6a33a122f0d6e7e8837d340d50
add a chinese handler
jasonwbw/jason_putils
putils/string/chinese.py
putils/string/chinese.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' This is a tool for opearation on chinese or english with chinese @Author : Jasonwbw@yahoo.com ''' import re def contain_english(s): return re.search(ur'[a-zA-Z]+', s) != None def contain_chinese(s): return re.search(ur'[\u4e00-\u9fa5]+', s) != None if __name__ =...
apache-2.0
Python
d4985e91dc34df8fcf562a10ebd3df2010b92b38
add orm.py
XiaoChengOMG/Practice
www/orm.py
www/orm.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- __author__ = "" ''' ''' import asyncio,logging import aiomysql def log(sql,args=()): logging.info('SQL: %s' % sql) async def create_pool(loop,**kw): logging.info('create database connection pool...') global _pool _pool = await aiomysql.create_pool( ...
apache-2.0
Python
dda477cb554d000f6a534848725629d20158aba7
Check if it's a ghost instance and download latest ghost release
MatonAnthony/ghost-update
main.py
main.py
#!/usr/bin/env python3 import sys import os.path import re import linecache import subprocess import urllib.request import zipfile if len(sys.argv) != 2: print ('''Invalid usage : Usage : ghost-update /path/to/your/ghost ''') sys.exit(1) ghostPath = sys.argv[1]; packageJson = os.path.join(gho...
mpl-2.0
Python
b05649bb6c99195542569c7d378991eba2187d58
Add alternate tsort solution - mergesort, with slightly modified merge procedure
sandy-8925/codechef
tsort_3.py
tsort_3.py
def merge(input_array, beg, mid, end): """Merge procedure for merge sort algorithm""" listA = input_array[beg:mid+1] listB = input_array[mid+1:end+1] current_position = beg while len(listA)>0 and len(listB)>0: if(listA[0] < listB[0]): input_array[current_position] = listA[0] listA.pop(0) e...
mit
Python
029e278286cb861901c9cb8e1b84855ec1640aac
Add ZeroMQ RPC test
hyperwang/bitcoin,bitcoinsSG/bitcoin,projectinterzone/ITZ,lbryio/lbrycrd,svost/bitcoin,nlgcoin/guldencoin-official,Friedbaumer/litecoin,destenson/bitcoin--bitcoin,jtimon/bitcoin,wiggi/huntercore,koharjidan/bitcoin,marlengit/hardfork_prototype_1_mvf-bu,marlengit/BitcoinUnlimited,Friedbaumer/litecoin,btc1/bitcoin,litecoi...
qa/rpc-tests/zmq_test.py
qa/rpc-tests/zmq_test.py
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test ZMQ interface # from test_framework.test_framework import BitcoinTestFramework from test_framework.u...
mit
Python
670cb12b8fa678c2ca6e747a3f3687af3d692f91
Implement one-time pad stream cipher
ElliotPenson/cryptography
stream.py
stream.py
#!/usr/local/bin/python """ stream.py @author Elliot and Erica """ import sys import random from cryptography_utilities import (string_to_binary, file_to_binary, binary_to_file) def psuedo_random_register_fn(key): """Provide a register function that gives the next bit in the keystream. In this case use ...
mit
Python
1ebed09254aa5601956af9038a3f6cb8591913c8
Add conceptual implementation of BaseCachedTask
tkf/buildlet
buildlet/task/cachedtask.py
buildlet/task/cachedtask.py
""" Tasks cached on data store. """ from .base import BaseTask class BaseCachedTask(BaseTask): datastore = None """ Data store instance. Child class **must** set this attribute. """ def is_finished(self): current = self.get_taskhash() cached = self.get_cached_taskhash() ...
bsd-3-clause
Python
9c0a4529c15cdc5f32b1d4718995092dfb9cb263
Remove unique constraint on users.name
alphagov/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin
migrations/versions/30_rm_unique_constraint.py
migrations/versions/30_rm_unique_constraint.py
from alembic import op revision = '30_rm_unique_constraint' down_revision = '20_initialise_data' def upgrade(): op.drop_constraint("users_name_key", "users") def downgrade(): op.create_unique_constraint("users_name_key", "users", ["name"])
mit
Python
dbd3095ee9d2a9e70e70ed586d3ba1daeaf29a7c
Create __init__.py
G10DRAS/JasperModules
client/__init__.py
client/__init__.py
# -*- coding: utf-8-*- # Copyright 2016 g10dras. __author__ = 'g10dras'
mit
Python
9dc8f5f1ec32de551c27da88521aa6d3ea66db09
move all_formats to base form
puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq
corehq/apps/receiverwrapper/forms.py
corehq/apps/receiverwrapper/forms.py
from corehq.apps.receiverwrapper.models import FormRepeater, RegisterGenerator from django import forms class GenericRepeaterForm(forms.Form): def __init__(self, *args, **kwargs): self.domain = kwargs.pop('domain') self.formats = RegisterGenerator.all_formats_by_repeater(self.repeater_class, for...
from corehq.apps.receiverwrapper.models import FormRepeater, RegisterGenerator from django import forms class GenericRepeaterForm(forms.Form): url = forms.URLField( required=True, label='URL to forward to', help_text='Please enter the full url, like http://www.example.com/forwarding/', ...
bsd-3-clause
Python
92724aa81b8d43a5e9968640792d9aba8c7042aa
divide list to 2 equal lists in sum
Alexgeni/Some-implementations
divideSets.py
divideSets.py
def divideSets(L):#linear splitting sets L.sort(reverse=True) set1=[] set2=[] for i in L: if sum(set1) < sum(set2): set1.append(i) else: set2.append(i) print("List : ",L,"Set 1 is ",set1,"\nSet 2 is ",set2) n=int(input("List's size")) L=[] for i in range(0,n): L.append(int(input())) #L=[1,2,2,4,1,5] div...
mit
Python
1dfbd9f95566c3e80166892637de410d0321a5fa
Add version file
crypto101/stanczyk
stanczyk/_version.py
stanczyk/_version.py
__version__ = "0.0.1"
isc
Python
33e23230315f7a922e50264948c42b2c68116cc2
Add tests for the possibly gcc miscompile error of LLVM in the mandel example.
numba/numba,gmarkall/numba,pombredanne/numba,pitrou/numba,pitrou/numba,IntelLabs/numba,numba/numba,ssarangi/numba,gmarkall/numba,stuartarchibald/numba,jriehl/numba,stefanseefeld/numba,numba/numba,pitrou/numba,GaZ3ll3/numba,stonebig/numba,pitrou/numba,shiquanwang/numba,stefanseefeld/numba,stuartarchibald/numba,stonebig/...
numba/tests/issues/test_potential_gcc_error.py
numba/tests/issues/test_potential_gcc_error.py
# This tests a potential GCC 4.1.2 miscompile of LLVM. # The problem is observed as a error in greedy register allocation pass, # which resulted as a segfault. # No such problem in GCC 4.4.6. from numba import * import numpy as np @jit(uint8[:,:](f8, f8, f8, f8, uint8[:,:], int32)) def create_fractal(min_x, max_x, m...
bsd-2-clause
Python
9d1d1f1a52e79b199731d6b30986e0b5d7cf1d3a
Create __init__.py
rizalasrul/python-pandas-data-analysis,rizalasrul/python-pandas-data-analysis
data-analysis/migrations/__init__.py
data-analysis/migrations/__init__.py
mit
Python
f9976a36bc1c0142e8c803b557859c35bee4d0a1
Improve time of upgrade
OCA/server-tools,OCA/server-tools,OCA/server-tools
auditlog/migrations/14.0.1.2.0/pre-migration.py
auditlog/migrations/14.0.1.2.0/pre-migration.py
# Copyright 2022 CreuBlanca # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openupgradelib import openupgrade field_spec = [ ( "name", "auditlog.log.line", "auditlog_log_line", "char", False, "auditlog", ), ( "model_id", "...
agpl-3.0
Python
e5b275a159f9325234530472e7fdcb60f70b7ada
Create youtube.py
geekpradd/search-python,geekpradd/search-python
youtube.py
youtube.py
'''YouTube Searcher for Windows Explorer and Command Prompt By Pradd Created By : geekpradd License : GPL V2 ''' import sys, os usage = "To search on Youtube enter the command python youtube.py [search term] " if len(sys.argv) <2: print usage sys.exit(0) filename = sys.argv[1].split("\\")[...
apache-2.0
Python