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
d10505678fd5624e5e88f72ac7852109f149b264
Add new kcov package (#14574)
LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack
var/spack/repos/builtin/packages/kcov/package.py
var/spack/repos/builtin/packages/kcov/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Kcov(CMakePackage): """Code coverage tool for compiled programs, Python and Bash which use...
lgpl-2.1
Python
a6e65ac7378b12cc6889199cac602a8fbee4b6e8
add nagios check on autoplot metrics
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
nagios/check_autoplot.py
nagios/check_autoplot.py
"""Check autoplot stats""" from __future__ import print_function import sys import psycopg2 def main(): """Go Main Go""" pgconn = psycopg2.connect(database='mesosite', host='iemdb', user='nobody') cursor = pgconn.cursor() cursor.execute(""" select count(*), avg(t...
mit
Python
b39eeea0b25e1e5bcec1d762a041e5ecf465885c
add solution for Reorder List
zhyu/leetcode,zhyu/leetcode
src/reorderList.py
src/reorderList.py
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param head, a ListNode # @return nothing def reorderList(self, head): if head is None or head.next is None: return slow = fa...
mit
Python
68e056459dd3818ebb0c5dbdc8b4f1089bec9f07
Add a few behavior tests for selection
photoshell/photoshell,SamWhited/photoshell,campaul/photoshell
tests/selection_test.py
tests/selection_test.py
import os import pytest import yaml from photoshell.selection import Selection @pytest.fixture def sidecar(tmpdir): tmpdir.join("test.sidecar").write(yaml.dump({ 'developed_path': os.path.join(tmpdir.strpath, "test.jpeg"), 'datetime': '2014-10-10 00:00' }, default_flow_style=False)) retur...
mit
Python
63a34000402f4253f16221b11d620e65e1786447
add solution for Reverse Bits
zhyu/leetcode,zhyu/leetcode
src/reverseBits.py
src/reverseBits.py
class Solution: # @param n, an integer # @return an integer def reverseBits(self, n): return int(bin(n)[2:].zfill(32)[::-1], 2)
mit
Python
f81a612eabf5972d15a5b3f11d12897530cbf155
Add dump-tree command (wip)
ustuehler/git-cvs,ustuehler/git-cvs
cvsgit/command/dump-tree.py
cvsgit/command/dump-tree.py
"""Command to dump the full state of the source tree at a certain point in time.""" import re import subprocess from subprocess import PIPE import sys from cvsgit.cvs import split_cvs_source from cvsgit.i18n import _ from cvsgit.main import Command, Conduit from cvsgit.utils import Tempdir, stripnl class dump_tree(C...
isc
Python
ff2c4b68a5eace4451eeef4fd6ca84d37435c556
Add fields to privatemessage for network invitations.
ProjectFacet/facet,ProjectFacet/facet,ProjectFacet/facet,ProjectFacet/facet,ProjectFacet/facet
project/editorial/migrations/0087_auto_20180226_1409.py
project/editorial/migrations/0087_auto_20180226_1409.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-02-26 22:09 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('editorial', '0086_auto_20180102_2145'), ] operatio...
mit
Python
136dd3f0b5dd9d8eecb6e7bc20c25d4d2c131ad6
add new tool to list shared libraries deps
AlertMe/cerbero,jackjansen/cerbero,ford-prefect/cerbero,atsushieno/cerbero,freedesktop-unofficial-mirror/gstreamer__cerbero,nirbheek/cerbero,shoreflyer/cerbero,OptoFidelity/cerbero,OptoFidelity/cerbero,freedesktop-unofficial-mirror/gstreamer__sdk__cerbero,ylatuya/cerbero,brion/cerbero,justinjoy/cerbero,ford-prefect/cer...
cerbero/tools/depstracker.py
cerbero/tools/depstracker.py
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2013 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
Python
e23b53a6326dbdb9df1e0f8d6711be1a9563c885
Add tests for processes
jcpeterson/Dallinger,jcpeterson/Dallinger,suchow/Wallace,Dallinger/Dallinger,Dallinger/Dallinger,suchow/Wallace,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,berkeley-cocosci/Wallace,berkeley-cocosci/Wallace,berkeley-cocosci/Wallace,suchow/Wallace,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dalli...
tests/test_processes.py
tests/test_processes.py
from wallace import processes, networks, agents, db class TestProcesses(object): def setup(self): self.db = db.init_db(drop_all=True) def teardown(self): self.db.rollback() self.db.close() def test_random_walk_from_source(self): net = networks.Network(self.db) ...
mit
Python
73084b964f964c05cb948be3acaa6ba68d62dc30
test plotting particles
mufid/berkilau,mufid/berkilau
ws/CSUIBotClass2014/test/test_plot_particles.py
ws/CSUIBotClass2014/test/test_plot_particles.py
#!/usr/bin/python # @author: vektor dewanto # @obj: demonstrate how to plot particles in an occupancy grid map, _although_, for now, all positions are valid import matplotlib.pyplot as plt import numpy as np import math import matplotlib.cm as cmx from matplotlib import colors # Construct the occupancy grid map grid...
mit
Python
6342c6cab9b5dd0b34ca5de575ef82592474e1d5
add mvnsite.py to build site without javadocs or test run
steveloughran/clusterconfigs,steveloughran/clusterconfigs
bin/mvnsite.py
bin/mvnsite.py
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lice...
apache-2.0
Python
598d937f3f180e22a1b4793644ffdb1b9a26f261
update crawler_main.py
CSnowstar/zhihu_crawler,SmileXie/zhihu_bigdata,SmileXie/zhihu_crawler
crawler_main.py
crawler_main.py
""" crawler study code Author: smilexie1113@gmail.com """ import urllib.request import os import re from collections import deque ERROR_RETURN = "ERROR: " def retrun_is_error(return_str): return return_str[0 : len(ERROR_RETURN)] == ERROR_RETURN def python_cnt(str): return str.count("python") de...
""" crawler study code Author: smilexie1113@gmail.com """ import urllib.request import os import re from collections import deque from filecmp import cmp ERROR_RETURN = "ERROR:" def retrun_is_error(return_str): return return_str[0 : len(ERROR_RETURN)] == ERROR_RETURN def python_cnt(str): return s...
mit
Python
e904341eb7b426ea583e345689249d7f13451dc9
Add biome types.
mcedit/pymclevel,arruda/pymclevel,ahh2131/mchisel,mcedit/pymclevel,arruda/pymclevel,ahh2131/mchisel
biome_types.py
biome_types.py
biome_types = { -1: "Will be computed", 0: "Ocean", 1: "Plains", 2: "Desert", 3: "Extreme Hills", 4: "Forest", 5: "Taiga", 6: "Swampland", 7: "River", 8: "Hell", 9: "Sky", 10: "FrozenOcean", 11: "FrozenRiver", 12: "Ice Plains", 13: "Ice Mountains", 14: "Mu...
isc
Python
0a0b322ca7d42d28ba495b7786cd2bd92c0bfd34
Add test_register.py
nineties/py-videocore
tests/test_assembler/test_register.py
tests/test_assembler/test_register.py
'Test of videocore.Register' from nose.tools import raises from videocore.assembler import Register, AssembleError, REGISTERS def test_register_names(): for name in REGISTERS: assert name == REGISTERS[name].name assert name == str(REGISTERS[name]) @raises(AssembleError) def test_pack_of_accumula...
mit
Python
12266ffcb7fcb809ec0e0a3102077581e64eb9e0
Update migrations
petertrotman/adventurelookup,petertrotman/adventurelookup,petertrotman/adventurelookup,petertrotman/adventurelookup
server/adventures/migrations/0002_auto_20160909_1901.py
server/adventures/migrations/0002_auto_20160909_1901.py
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-09 19:01 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('adventures', '0001_initial'), ] operations = [ ...
mit
Python
6dc1abdb92d1226071ea84e6352389ad01d21fe6
Create sequencer_scripting.py
kitelightning/UnrealEnginePython,kitelightning/UnrealEnginePython,kitelightning/UnrealEnginePython,getnamo/UnrealEnginePython,20tab/UnrealEnginePython,20tab/UnrealEnginePython,getnamo/UnrealEnginePython,20tab/UnrealEnginePython,20tab/UnrealEnginePython,kitelightning/UnrealEnginePython,Orav/UnrealEnginePython,getnamo/Un...
examples/sequencer_scripting.py
examples/sequencer_scripting.py
import unreal_engine as ue from unreal_engine.classes import MovieSceneAudioTrack, LevelSequenceFactoryNew, MovieSceneSkeletalAnimationTrack, Character, SkeletalMesh, MovieScene3DTransformTrack, CineCameraActor import time from unreal_engine.structs import FloatRange, FloatRangeBound from unreal_engine import FTransfo...
mit
Python
df9b7cd8d1b34f8c29c372589ad9efd3a5435d0f
Implement TwitchWordsCounterBot class.
sergeymironov0001/twitch-chat-bot
twitchbot/twitch_words_counter_bot.py
twitchbot/twitch_words_counter_bot.py
import irc.bot import irc.strings from .words_counter import WordsCounter class TwitchWordsCounterBot(irc.bot.SingleServerIRCBot): def __init__(self, channel, nickname, password, server, port=6667): irc.bot.SingleServerIRCBot.__init__(self, [(server, port, password)], nickname, nickname) self.ser...
mit
Python
6136eef341f1ac5ce0be278c3ab78192192d0efa
check if OS is UNIX-y
marshki/pyWipe,marshki/pyWipe
posix.py
posix.py
#!/bin/py from sys import platform def osCheck(): # Check if OS is UNIX-y if "darwin" or "linux" in platform.lower(): print platform osCheck()
mit
Python
2a0724922bde4cdd5219c721cdfd5460a2e5f3ed
Create Timely_Tweeter.py
B13rg/Timely-Tweeter
Timely_Tweeter.py
Timely_Tweeter.py
#-=- Coding: Python UTF-8 -=- import tweepy, time, sys argfile = str(sys.argv[1]) #Twitter Account info #Place Keys and Tokens bewteen the quotes CONSUMER_KEY = '' #The Consumer Key (API Key) CONSUMER_SECRET = '' #The Consumer Secret (API Secret) ACCESS_KEY = '' #The Access Token ACCESS_SECRET = '' #The Access ...
mit
Python
9c0750ef401870e0187e3b7f0e4e39cf3d7e3944
Make sure the profile data is unmarshallable as profile data.
edisongustavo/asv,giltis/asv,airspeed-velocity/asv,ericdill/asv,giltis/asv,pv/asv,mdboom/asv,edisongustavo/asv,waylonflinn/asv,cpcloud/asv,mdboom/asv,cpcloud/asv,giltis/asv,waylonflinn/asv,spacetelescope/asv,pv/asv,qwhelan/asv,airspeed-velocity/asv,ericdill/asv,ericdill/asv,spacetelescope/asv,airspeed-velocity/asv,wayl...
test/test_benchmarks.py
test/test_benchmarks.py
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import os import pstats import pytest import six from asv import benchmarks from asv import config from asv import envi...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import os import pytest import six from asv import benchmarks from asv import config from asv import environment BENCH...
bsd-3-clause
Python
d1ecc996269a801c65d3b88791f7f5546c8af1b8
add setup.py
odanado/daria
setup.py
setup.py
from setuptools import setup setup( name='daria', version='0.0.1', description='pytorch trainer', author='odanado', author_email='odan3240@gmail.com', url='https://github.com/odanado/daria', license='MIT License', packages=['daria'], tests_require=['mock'], test_suite='tests', )...
mit
Python
db92ed5e523eafb7ccba553f1ee25365cc254798
add setup.py
pachi/epbdcalc
setup.py
setup.py
#!/usr/bin/env python #encoding: utf-8 # # Programa epbdcalc: Cálculo de la eficiencia energética ISO/DIS 52000-1:2015 # # Copyright (C) 2015 Rafael Villar Burke <pachi@ietcc.csic.es> # Daniel Jiménez González <danielj@ietcc.csic.es> # # This program is free software; you can redist...
mit
Python
38bf3ce6db844999fe5903dad91e991c6fea57c7
Add setup
Axik/trafaret,rrader/trafaret,rrader/trafaret,Deepwalker/trafaret,Deepwalker/trafaret,Axik/trafaret,rrader/trafaret,Axik/trafaret,Deepwalker/trafaret
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setupconf = dict( name = 'contract', version = '0.3', license = 'BSD', url = 'https://github.com/Deepwalker/contract/', author = 'Barbuza, Deepwalker', author_email = 'krivushinme@gmail.com', description = ('Validation and ...
bsd-2-clause
Python
ea7d55fa309d592669e86dae826b7cc08323de16
update setup.py version to 0.2
thegooglecodearchive/mpmath,thegooglecodearchive/mpmath,upiterbarg/mpmath,tectronics/mpmath,Alwnikrotikz/mpmath,Alwnikrotikz/mpmath,upiterbarg/mpmath,tectronics/mpmath
setup.py
setup.py
from distutils.core import setup setup(name='mpmath', description = 'Python library for arbitrary-precision floating-point arithmetic', version='0.2', url='http://mpmath.googlecode.com', author='Fredrik Johansson', author_email='fredrik.johansson@gmail.com', license = 'BSD',...
from distutils.core import setup setup(name='mpmath', description = 'Python library for arbitrary-precision floating-point arithmetic', version='0.1', url='http://mpmath.googlecode.com', author='Fredrik Johansson', author_email='fredrik.johansson@gmail.com', license = 'BSD',...
bsd-3-clause
Python
12ece36bf0355ad619635675b419d9d0e7163cf4
Add setup.py file
lamby/django-cache-toolbox,playfire/django-cache-toolbox,lamby/django-sensible-caching,thread/django-sensible-caching
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='django-cache-relation', description="Non-magical object caching for Django.", version='0.1', url='http://code.playfire.com/', author='Playfire.com', author_email='tech@playfire.com', license='BSD', package...
bsd-3-clause
Python
30d3f42b4910b84b2a3419e43ea6e5e6da2ab7a0
Add setup
shervinea/enzynet
setup.py
setup.py
from setuptools import setup setup(name = 'enzynet', description = 'EnzyNet: enzyme classification using 3D convolutional neural networks on spatial representation', author = 'Afshine Amidi and Shervine Amidi', author_email = '<author1-lastname>@mit.edu, <author2-firstname>@stanford.edu', licen...
mit
Python
45e624fe5176dd59b8f42636b777a1b6a6106dca
Add initial setuptools integration, required by click
georgeyk/loafer
setup.py
setup.py
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 from setuptools import setup setup( name='loafer', version='0.0.1', entry_points=''' [console_scripts] loafer=loafer.cli:cli ''', )
mit
Python
81e7e9ed4b3b0f6840e11adc5c73648471f606ef
Add setup.py
orangain/scrapy-slotstats
setup.py
setup.py
# coding: utf-8 from __future__ import print_function, unicode_literals import sys from setuptools import setup install_requires = [] if sys.version_info[0] == 2: install_requires.append('statistics') setup( name='scrapy-slotstats', version='0.1', license='MIT License', description='Scrapy exte...
mit
Python
21380bcf76a8144d182166c3441d308af2eda417
Add first pass at setup.py
JDReutt/BayesDB,poppingtonic/BayesDB,JDReutt/BayesDB,poppingtonic/BayesDB,JDReutt/BayesDB,poppingtonic/BayesDB,JDReutt/BayesDB,poppingtonic/BayesDB,poppingtonic/BayesDB,JDReutt/BayesDB
setup.py
setup.py
#!/usr/bin/python import os from distutils.core import setup, Extension ext_modules = [] packages = ['bayesdb', 'bayesdb.tests'] setup( name='BayesDB', version='0.1', author='MIT.PCP', author_email = 'bayesdb@mit.edu', url='probcomp.csail.mit.edu/bayesdb', long_descript...
apache-2.0
Python
374e27087d6d432ba01a0ef65c4109be84e50dcf
Add setup.py
RJMetrics/RJMetrics-py
setup.py
setup.py
import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup try: from distutils.command.build_py import build_py_2to3 as build_py except ImportError: from distutils.command.build_py import build_py path, script = os.path.split(sys.argv[0]) os.chdir(os.p...
apache-2.0
Python
9c05031446d0d17bdc207b00ebf47d9769f96d33
Add a setup.py for owebunit to be able to obtain ocookie via pip
p/ocookie
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup(name='ocookie', version='0.1', description='Comprehensive cookie library', author='Oleg Pudeyev', author_email='oleg@bsdpower.com', url='http://github.com/p/ocookie', packages=['ocookie'], )
bsd-2-clause
Python
431acaabf7a3e77b416a57998bfadcb2d3864555
Add a setup.py
mozillazg/bustard-httpbin,krissman/httpbin,nkhuyu/httpbin,phouse512/httpbin,gvangool/httpbin,scottydelta/httpbin,vscarpenter/httpbin,habibmasuro/httpbin,luhkevin/httpbin,luhkevin/httpbin,SunGuo/httpbin,paranoiasystem/httpbin,marinehero/httpbin,kennethreitz/httpbin,luosam1123/httpbin,logonmy/httpbin,nkhuyu/httpbin,ewdur...
setup.py
setup.py
from setuptools import setup, find_packages import codecs import os import re setup( name="httpbin", version="0.1.0", description="HTTP Request and Response Service", # The project URL. url='https://github.com/kennethreitz/httpbin', # Author details author='Kenneth Reitz', author_emai...
isc
Python
82b8651c9eed0c19224c8a7b53a0bedae81337a3
Add a setup.py.
mikeboers/WebStar
setup.py
setup.py
from setuptools import setup, find_packages setup( name = "WebStar", version = "0.1b", author="Mike Boers", author_email="webstar@mikeboers.com", license="BSD-3" )
bsd-3-clause
Python
d157b4e1f4709b0205d5de31df65a5308f926d49
Add setup.py
ushuz/autumn
setup.py
setup.py
#!/usr/bin/env python # coding: utf-8 import re try: from setuptools import setup except ImportError: from distutils.core import setup version = "" with open("autumn.py", "r") as f: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) ...
mit
Python
a2bfe07ba67e902870dd366626b23dbb5e6e2696
Create messageMode.py
hongfeioo/messagemodule
messageMode.py
messageMode.py
#!/usr/bin/python #coding=utf-8 #filename: messageMode.py import telnetlib import os,sys,commands,multiprocessing import smtplib import time from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.image import MIMEImage import urllib2 #---init--- begintime = time.strfti...
apache-2.0
Python
3d020f09332093807f70a1bca5360e1418633bb4
Add setup.py.
znick/anytask,znick/anytask,znick/anytask,znick/anytask
setup.py
setup.py
from setuptools import setup, find_packages setup(name='Anytask', packages=find_packages(), )
mit
Python
b38eb4f8a7b8e3400ea09c600e241d8c4a9d0846
Add setup so sgfs can install this to test with
westernx/sgsession
setup.py
setup.py
from distutils.core import setup setup( name='sgsession', version='0.1-dev', description='Shotgun ORM/Session.', url='http://github.com/westernx/sgsession', packages=['sgsession'], author='Mike Boers', author_email='sgsession@mikeboers.com', license='BSD-3', classifie...
bsd-3-clause
Python
5263a684d4bd111b903456a8da2c92ddb25e7811
Add migration
stefanw/seriesly,stefanw/seriesly
seriesly/series/migrations/0002_auto_20180127_0718.py
seriesly/series/migrations/0002_auto_20180127_0718.py
# Generated by Django 2.0 on 2018-01-27 13:18 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('series', '0001_initial'), ] operations = [ migrations.AlterField( model_name='show', name...
agpl-3.0
Python
874fbb6749d60ea3fcf078d25d7911d7ac314ab1
Add a setup.py file for use with python install tools.
iestynpryce/file-validator
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': 'File validator', 'author': 'Iestyn Pryce', 'url': '', 'download_url': '', 'author_email': 'iestyn.pryce@gmail.com', 'version': '0.1', 'install_requires': ['nose'], '...
mit
Python
3258a5ba8c748ce079082c34d13b231f157b1463
Add experimental top-level copy of setup.py
daviddrysdale/python-phonenumbers,dongguangming/python-phonenumbers,daviddrysdale/python-phonenumbers,agentr13/python-phonenumbers,shikigit/python-phonenumbers,SergiuMir/python-phonenumbers,titansgroup/python-phonenumbers,gencer/python-phonenumbers,daodaoliang/python-phonenumbers,daviddrysdale/python-phonenumbers,roube...
setup.py
setup.py
#!/usr/bin/env python # Original libphonenumber Java code: # Copyright (C) 2009-2011 The Libphonenumber 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/li...
apache-2.0
Python
58dd2d188aab1fbf30ff843307eecf5ca685527c
Add setup
shudmi/ngx-task
setup.py
setup.py
from setuptools import find_packages, setup setup( name='ngx-task', version='0.1', description='Testimonial for candidates to show up their code-foo', author='Dmitry Shulyak', author_email='dmitri.shulyak@gmail.com', url='https://github.com/shudmi/ngx-task', classifiers=[ 'License :...
apache-2.0
Python
90746eba08c67c4f62462ed74d08566cafa18724
Add setup.py
graypawn/wrenet
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='wrenet', version='0.1', description='Network configurations viewer in the Windows Registry', author='graypawn', author_email='choi.pawn' '@gmail.com', url='https://github.com/graypawn/wrenet', license='Apache Li...
apache-2.0
Python
50742b6e629e6f54a9f3784a3c1495eb9d82c238
Add start of processed package
brightway-lca/brightway
brightway_projects/processing/processed_package.py
brightway_projects/processing/processed_package.py
from ..errors import InconsistentFields, NonUnique def greedy_set_cover(data, exclude=None): """Find unique set of attributes that uniquely identifies each element in ``data``. Feature selection is a well known problem, and is analogous to the `set cover problem <https://en.wikipedia.org/wiki/Set_cover_probl...
bsd-3-clause
Python
c68cda0549bb9c47be0580ecd43f55966e614b31
Add Pascal's Triangle/nCr Table
PlattsSEC/HackerRank,PlattsSEC/HackerRank,PlattsSEC/HackerRank,PlattsSEC/HackerRank,PlattsSEC/HackerRank,PlattsSEC/HackerRank
mathematics/combinatorics/ncr_table/kevin.py
mathematics/combinatorics/ncr_table/kevin.py
#!/usr/bin/env python # https://www.hackerrank.com/challenges/ncr-table def get_number(): return int(input().strip()) def nCr(row_number): rows = [[1], [1, 1], [1, 2, 1]] while row_number >= len(rows): # 1 # 1 1 # 1 2 1 # 1 4 4 1 # ....... row = [(rows[-1...
mit
Python
842869063ead9b2e6a1e22d11c9901072f2319aa
Add script to self generate docs for recurring data types
vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks
docs/generate_spec.py
docs/generate_spec.py
# -*- encoding: utf-8 -*- # # This script is to be used to automagically generate the recurring data types # documentation based on the API specification. # # to run it just do: # # $ python generate_spec.py > outputfile.md # # :authors: Arturo Filastò # :licence: see LICENSE import inspect from globaleaks.rest.mes...
agpl-3.0
Python
7d23ad49da0044d83f781105cb01addb1a4aa41c
Add catalog.wsgi file
caasted/aws-flask-catalog-app,caasted/aws-flask-catalog-app
catalog.wsgi
catalog.wsgi
#!/usr/bin/python import sys sys.path.insert(0,"/var/www/html/catalog/") from catalog import app as application application.secret_key = 'super_secret_key'
mit
Python
c16fae0519068e40d7b1ed988f49460198f6fd43
Create decode_diameter.py
eriwoon/ShellScriptCollect,eriwoon/ShellScriptCollect,eriwoon/ShellScriptCollect,eriwoon/ShellScriptCollect,eriwoon/ShellScriptCollect,eriwoon/ShellScriptCollect,eriwoon/ShellScriptCollect,eriwoon/ShellScriptCollect
decode_diameter.py
decode_diameter.py
#------------------------------------------------------------------------------- # Name: Decode Diameter # Purpose: # # Author: XIAO Zhen # # Created: 08/10/2014 # Copyright: (c) XIAO Zhen 2014 # Licence: MIT License #------------------------------------------------------------------------------- ...
mit
Python
8968251b7e1b89171b285e377d17dae299019cd0
Test that '--checks' accepts notebooks either before or after the check command (#887)
mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext,mwouts/jupytext
tests/test_cli_check.py
tests/test_cli_check.py
import pytest from nbformat.v4.nbbase import new_code_cell, new_notebook from jupytext import write from jupytext.cli import jupytext from .utils import requires_black @pytest.fixture def non_black_notebook(python_notebook): return new_notebook(metadata=python_notebook.metadata, cells=[new_code_cell("1+1")]) ...
mit
Python
4694f6bf2405d0aae5e6c3fc393f8a839e8aac07
Add tests for converter.Line and converter.Generator.
rbarrois/uconf
tests/test_converter.py
tests/test_converter.py
# coding: utf-8 # Copyright (c) 2010-2012 Raphaël Barrois import unittest from confmgr import converter class LineTestCase(unittest.TestCase): def test_repr(self): self.assertEqual("Line('foo', 'bar')", repr(converter.Line('foo', 'bar'))) def test_equality(self): self.assert...
bsd-2-clause
Python
a37640d107d1dd58ba4f9db3e043020ad76cd25d
Create cam_control.py
mic100/Raspberry_Pi
cam_control.py
cam_control.py
#!/usr/bin/python # -*- coding: utf-8 -*- from cv2 import * import MySQLdb as ms import time import _mysql_exceptions as M import os def get_image(): cam1 = VideoCapture(0) cam2 = VideoCapture(1) s1, img1 = cam1.read() s2, img2 = cam2.read() if s1: imwrite("test1.jpg",img) if s2: ...
mit
Python
d2a283856a9e2559a131c5aaa2407477be993af0
add file to help gather all the data we need
hahnicity/ecs251-final-project,hahnicity/ecs251-final-project
collate.py
collate.py
import csv from glob import glob def collate_from_breath_meta(cohort): """ Gets all breath_meta.csv files in our specific cohort and then gets all the data from these files and stores them in a dictionary. """ if cohort not in ["ardscohort", "controlcohort"]: raise Exception("Input must ei...
mit
Python
d2667faded6dfdd1fb2992ec188b8fed12bb2723
Add ncurses 5.9
BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild
packages/ncurses.py
packages/ncurses.py
class NcursesPackage (GnuPackage): def __init__ (self): GnuPackage.__init__ (self, 'ncurses', '5.9') self.sources.extend ([ 'https://trac.macports.org/export/136235/trunk/dports/devel/ncurses/files/hex.diff', 'https://trac.macports.org/export/136235/trunk/dports/devel/ncurses/files/ungetch_guard.diff',...
mit
Python
00bfd02f921a42d4f288254d1accb7546d8df2c5
Add hbase consistency check throw hbase hbck command, easily can be added some checks like backups servers or region servers
keedio/nagios-hadoop,keedio/nagios-hadoop
check_hbase.py
check_hbase.py
#!/usr/bin/env python # vim: ts=4:sw=4:et:sts=4:ai:tw=80 from utils import krb_wrapper,StringContext import os import argparse import nagiosplugin import re import subprocess html_auth = None def parser(): version="0.1" parser = argparse.ArgumentParser(description="Checks datanode") parser.add_argument('-...
apache-2.0
Python
f865bf2d7365ccecec07be7e51e8d81676f3aae2
Add check_cycles tests module
danforthcenter/plantcv,danforthcenter/plantcv,danforthcenter/plantcv
tests/plantcv/morphology/test_check_cycles.py
tests/plantcv/morphology/test_check_cycles.py
import cv2 from plantcv.plantcv import outputs from plantcv.plantcv.morphology import check_cycles def test_check_cycles(morphology_test_data): # Clear previous outputs outputs.clear() mask = cv2.imread(morphology_test_data.ps_mask, -1) _ = check_cycles(mask) assert outputs.observations['default']...
mit
Python
1ab296398aaa796a9a5b620c4281d9376ada8b3e
Add short script which prints the entire CMIP6 MIP experiment list #197.
goord/ece2cmor3,goord/ece2cmor3
ece2cmor3/scripts/mip-experiment-list.py
ece2cmor3/scripts/mip-experiment-list.py
#!/usr/bin/env python # Thomas Reerink # # Run example: # python mip-experiment-list.py # # Looping over all MIPs and within each MIP over all its MIP experiments. # Printing the MIP experiment list with some additional info. # from dreqPy import dreq dq = dreq.loadDreq() mip_list_file= open( 'mip-experiment-list.tx...
apache-2.0
Python
97eabd4e33086c66372b0e15dd1eeda12e99f427
Create createfile.py
thewhitetulip/SamplePythonScripts
createfile.py
createfile.py
import os #creates file on the go on the entries of a tuple ports=[20,21,23,25,43,49,53,69,70,79,80,109,110,115,137,139,143,161,194,389,443,444,458,546,547,1080] path=raw_input('Enter the path you want to create the files: ') try: os.chdir(path) except: print "Invalid Path" try: for i in ports: for i...
mit
Python
6d50dc3c266f4a1b7f517935b961cfb20602011b
add benchmark.py
bowlofstew/capstone,bughoho/capstone,pyq881120/capstone,bSr43/capstone,zuloloxi/capstone,bowlofstew/capstone,dynm/capstone,krytarowski/capstone,sigma-random/capstone,bowlofstew/capstone,xia0pin9/capstone,07151129/capstone,bughoho/capstone,zuloloxi/capstone,capturePointer/capstone,AmesianX/capstone,bSr43/capstone,Amesia...
suite/benchmark.py
suite/benchmark.py
#!/usr/bin/python # Simple benchmark for Capstone by disassembling random code. By Nguyen Anh Quynh, 2014 from capstone import * from time import time from random import randint def random_str(size): lst = [str(randint(0, 255)) for _ in xrange(size)] return "".join(lst) def cs(md, data): insns = md.di...
bsd-3-clause
Python
78aea51f508a14bb1b03b49933576c84b56a7459
Add an example for the new dropdowns
Rapptz/discord.py,Harmon758/discord.py,Harmon758/discord.py,rapptz/discord.py
examples/views/dropdown.py
examples/views/dropdown.py
import typing import discord from discord.ext import commands # Defines a custom Select containing colour options # that the user can choose. The callback function # of this class is called when the user changes their choice class Dropdown(discord.ui.Select): def __init__(self): # Set the options that wi...
mit
Python
bcb6c0780aacf77069a08f8d5b44d295881d9b9d
Create solution to swap odd even characters
laxmena/CodeKata,laxmena/CodeKata
swapOddEvenChar.py
swapOddEvenChar.py
#Python3 word = list(input().strip()) for i in range(0,len(word),2): if(i+1>=len(word)): break word[i],word[i+1] = word[i+1],word[i] print(''.join(word))
mit
Python
7bde47d48f4e80b4449049a8b05767b30eb2c516
Add stupid CSV export example
SoundGoof/NIPAP,plajjan/NIPAP,SpriteLink/NIPAP,bbaja42/NIPAP,ettrig/NIPAP,bbaja42/NIPAP,fredsod/NIPAP,SoundGoof/NIPAP,fredsod/NIPAP,ettrig/NIPAP,SpriteLink/NIPAP,ettrig/NIPAP,SoundGoof/NIPAP,bbaja42/NIPAP,fredsod/NIPAP,fredsod/NIPAP,fredsod/NIPAP,garberg/NIPAP,bbaja42/NIPAP,garberg/NIPAP,SpriteLink/NIPAP,plajjan/NIPAP,...
utilities/export-csv.py
utilities/export-csv.py
#!/usr/bin/python import os import csv import sys sys.path.append('../pynipap') import pynipap class Export: def __init__(self, xmlrpc_uri): self.xmlrpc_uri = xmlrpc_uri def write(self, output_file, schema_name): """ """ f = open(output_file, "w+") writer = csv.writer(f, quoting=csv.QUOTE_MINIMAL) p...
mit
Python
9b6eddb88f5de1b7c44d42e1d4a3dc1c90180862
Implement deck.
cwahbong/onirim-py
onirim/deck.py
onirim/deck.py
import random class Deck: def __init__(self, cards): self._undrawn = list(cards) self._discarded = [] self._limbo = [] def draw(self, n=1): """Draw n cards.""" if n > len(self._undrawn) or n < 0: raise ValueError() drawn, self._undrawn = self._undra...
mit
Python
f5711401b79433f5b52e675cec67b63f6511836a
add tests file
aloverso/loanbot
tests.py
tests.py
#!flask/bin/python import unittest from server import app def add(a, b): return a+b class TestCase(unittest.TestCase): def setUp(self): app.config['TESTING'] = True self.app = app.test_client() def tearDown(self): pass def test_add(self): self.assertEqual(add(1, 2), 3...
mit
Python
e9d87a087a0f0102157d7c718a048c72f655c54a
Store registered refs as plugin metadata
marshmallow-code/apispec,Nobatek/apispec,marshmallow-code/smore,gorgias/apispec,jmcarp/smore
smore/ext/marshmallow.py
smore/ext/marshmallow.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from marshmallow.compat import iteritems from marshmallow import class_registry from smore import swagger from smore.apispec.core import Path from smore.apispec.utils import load_operations_from_docstring def schema_definition_helper(spec, name, schema, ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from marshmallow.compat import iteritems from marshmallow import class_registry from smore import swagger from smore.apispec.core import Path from smore.apispec.utils import load_operations_from_docstring def schema_definition_helper(name, schema, **kwar...
mit
Python
e4734cb85458475ad4fd2cf66db456b7924d6fe0
Add : LFI Exploit tool
m101/m101-tools
exploit-lfi.py
exploit-lfi.py
#!/usr/bin/python import argparse import base64 import re import requests import sys def scrap_results (content): # regexp regexp_start = re.compile ('.*STARTSTART.*') regexp_end = re.compile ('.*ENDEND.*') # results results = list() # result start and end found_start = False found_end...
agpl-3.0
Python
3654817845e1d22a5b0e648a79d0bf6db12c2704
add run_sql shell command
jgraham/treeherder,tojonmz/treeherder,gbrmachado/treeherder,glenn124f/treeherder,jgraham/treeherder,sylvestre/treeherder,tojon/treeherder,glenn124f/treeherder,gbrmachado/treeherder,tojonmz/treeherder,KWierso/treeherder,glenn124f/treeherder,kapy2010/treeherder,jgraham/treeherder,adusca/treeherder,akhileshpillai/treeherd...
treeherder/model/management/commands/run_sql.py
treeherder/model/management/commands/run_sql.py
import MySQLdb from optparse import make_option from django.core.management.base import BaseCommand from treeherder.model.models import Datasource from django.conf import settings class Command(BaseCommand): help = ("Runs an arbitrary sql statement or file" " on a number of databases.") option_...
mpl-2.0
Python
31924096f82954e87b33fcb4af2e7ea46a5c6336
add map estimate of gaussian case
catniplab/vLGP
vlgp/gmap.py
vlgp/gmap.py
import click # import jax import numpy as onp import jax.numpy as np from jax.numpy import linalg from .evaluation import timer from .gp import sekernel from .preprocess import get_config, get_params, initialize, fill_params, fill_trials from .util import cut_trials def make_prior(trials, n_factors, dt, var, scale):...
mit
Python
5b20a487afa90c0d91a43d4d29526d352511316f
add utils.py with utilities
enricobacis/cineca-scopus
utils.py
utils.py
from csv import DictReader import re def read_csv(filename): with open(filename) as csvfile: return list(DictReader(csvfile, dialect='excel')) def split_name(string): surname, name = re.search(r'^([A-Z\'\.\s]+)\s(.+)$', string).groups() return name, surname def iterate_names(name, surname): y...
mit
Python
89d8e6a8a422bade352d3bf94f2c59c1d0dc601b
Create dictionary.py
joshavenue/python_notebook
dictionary.py
dictionary.py
x = {'job': 'teacher', 'color': 'blue'} // Create a dictionary, list with defination print(x['job']) // You will see 'teacher' y = {'emotion': 'happy', 'reason': {'action': 'playing game', 'platform': 'PC'}} print(y['reason']['action']) // You will see 'playing game'
unlicense
Python
b08341d2822ad266e07d4104a45604ad9d5b504a
add unit test for text_analyzer
misssoft/Fan.Python
src/text_analyzer.py
src/text_analyzer.py
import os import unittest def analyze_text(filename): lines = 0 chars = 0 with open(filename, 'r') as f: for line in f: lines += 1 chars += len(line) return (lines, chars) class TextAnalysisTests(unittest.TestCase): """Test for the ``analyze_test()`` function""" d...
mit
Python
e1aa02badee2951f4f4aeeb09f37be030466e711
Add pyupgrades.py
streeter/dotfiles,streeter/dotfiles
bin/pyupgrades.py
bin/pyupgrades.py
#!/usr/bin/env python import xmlrpclib import pip import argparse import re from pkg_resources import parse_version def version_number_compare(version1, version2): return cmp(parse_version(version1), parse_version(version2)) def normalize(v): return [int(x) for x in re.sub(r'(\.0+)*$','', v).spli...
mit
Python
7b09a44c7df8b2aa28e45c5382626c2f8c4bf61b
Add a script to convert from rst style files to markdown
kenhys/redpen-doc,kenhys/redpen-doc
bin/run_redpen.py
bin/run_redpen.py
#!/usr/bin/python import os import re import shutil from optparse import OptionParser def main(): parser = OptionParser(usage="usage: %prog [options]", version="%prog 1.0") parser.add_option("-i", "--inputdir", action="store", dest="indir",...
apache-2.0
Python
30c368f1794f7bbc4121f732143ac07e7148a3ca
Create KevinAndExpectation.py
tejasnikumbh/Algorithms,tejasnikumbh/Algorithms,tejasnikumbh/Algorithms
Probability/KevinAndExpectation.py
Probability/KevinAndExpectation.py
# Importing standard libraries import sys from math import sqrt # Parsing functions def parseInt(stream): return int(stream.readline().rstrip()) ''' Dynamically precomputing the summation series for N < 10^6 so that each test case is solved in constnat time for any N less than 10^6. There fore for Ta...
bsd-2-clause
Python
53b0d93a7a29121e9d24058bfe4b7ee3bd33f7ca
Add info for version 2.16 (#3601)
skosukhin/spack,matthiasdiener/spack,lgarren/spack,iulian787/spack,TheTimmy/spack,EmreAtes/spack,lgarren/spack,krafczyk/spack,skosukhin/spack,EmreAtes/spack,mfherbst/spack,TheTimmy/spack,matthiasdiener/spack,EmreAtes/spack,skosukhin/spack,LLNL/spack,iulian787/spack,krafczyk/spack,lgarren/spack,LLNL/spack,iulian787/spac...
var/spack/repos/builtin/packages/ack/package.py
var/spack/repos/builtin/packages/ack/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
d0d182605389ec73773df35b9e06455b9f9a2923
add get_posts
Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python
facebook/get_posts.py
facebook/get_posts.py
""" A simple example script to get all posts on a user's timeline. Originally created by Mitchell Stewart. <https://gist.github.com/mylsb/10294040> """ import facebook import requests def some_action(post): """ Here you might want to do something with each post. E.g. grab the post's message (post['message']) ...
mit
Python
419ca7099bf47ed00ede73d9de14690a643a3943
Add data for integration testing of basic csv and crosstab formats
henrykironde/deletedret,goelakash/retriever,henrykironde/deletedret,goelakash/retriever
test/test_integration.py
test/test_integration.py
"""Integrations tests for EcoData Retriever""" import os import shutil from retriever import HOME_DIR simple_csv = {'name': 'simple_csv', 'raw_data': "a,b,c\n1,2,3\n4,5,6", 'script': "shortname: simple_csv\ntable: simple_csv, http://example.com/simple_csv.txt", 'expect_out': ...
mit
Python
465fbc1657e90134323fd05ee4216da5af110ee4
add tools
pengmeng/PyCrawler,ymero/PyCrawler,pengmeng/PyCrawler
pycrawler/utils/tools.py
pycrawler/utils/tools.py
__author__ = 'mengpeng' import time def gethash(string, cap=0xffffffff): return hash(string) & cap def timestamp(): return time.strftime("%H:%M:%S", time.localtime(time.time())) def datastamp(): return time.strftime("%Y-%m-%d", time.localtime(time.time())) def fullstamp(): return time.strftime("...
mit
Python
1983e84e41f6dfe8b54e4a7d7535d0b89f9dd58a
add an example of a client for a change
teepark/greenhouse
examples/parallel_client.py
examples/parallel_client.py
'''a bunch of examples of how to get a list of urls in parallel each of them uses a different greenhouse api to retrieve a list of urls in parallel and return a dictionary mapping urls to response bodies ''' import urllib2 import greenhouse # urllib2 obviously doesn't explicitly use greenhouse sockets, but we can #...
bsd-3-clause
Python
d8fc66417860e634bbb2a6d860628b645811d62c
Add WIP for Python example
intel-iot-devkit/upm,Propanu/upm,nitirohilla/upm,kissbac/upm,kissbac/upm,nitirohilla/upm,kissbac/upm,jontrulson/upm,skiselev/upm,kissbac/upm,pylbert/upm,nitirohilla/upm,malikabhi05/upm,g-vidal/upm,pylbert/upm,g-vidal/upm,spitfire88/upm,skiselev/upm,andreivasiliu2211/upm,Jon-ICS/upm,Propanu/upm,stefan-andritoiu/upm,g-vi...
examples/python/curieimu.py
examples/python/curieimu.py
#!/usr/bin/python # Author: Ron Evans (@deadprogram) # Copyright (c) 2016 Intel Corporation. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limita...
mit
Python
b78fb81cba34992bb84ed3814aae04ce05ef913f
Add del-uri.py example script
ufcg-lsd/python-hpOneView,HewlettPackard/python-hpOneView,miqui/python-hpOneView,andreadean5/python-hpOneView,HewlettPackard/python-hpOneView,danielreed/python-hpOneView
examples/scripts/del-uri.py
examples/scripts/del-uri.py
#!/usr/bin/env python3 ### # (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limit...
mit
Python
5cf3ff125226ddbf2edfad9d3c0d6ea2d59618ce
add missing file
mmarkov/pygraphviz,mmarkov/pygraphviz
pygraphviz/tests/test.py
pygraphviz/tests/test.py
#!/usr/bin/env python import sys from os import path,getcwd def run(verbosity=1,doctest=False,numpy=True): """Run PyGraphviz tests. Parameters ---------- verbosity: integer, optional Level of detail in test reports. Higher numbers provide more detail. doctest: bool, optional True to...
bsd-3-clause
Python
2af53a39096c0eab9d95c304c802281fe3c580ae
Make JAX CompiledFunction objects pickle-able.
google/jax,google/jax,google/jax,google/jax
tests/pickle_test.py
tests/pickle_test.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
c4ee6bb374e07a07bac8b8f52cf94d7d474e0e33
Fix typo in test comment
rhizolab/rhizo
tests/test_config.py
tests/test_config.py
import os from pathlib import Path from rhizo.config import load_config def check_config(config): assert config.output_path == '/foo/bar' assert config.sub_config.a == 'test' assert config.sub_config.b == 2 assert round(config.sub_config.c - 3.14, 4) == 0 def _load_test_config(filename, use_environ...
import os from pathlib import Path from rhizo.config import load_config def check_config(config): assert config.output_path == '/foo/bar' assert config.sub_config.a == 'test' assert config.sub_config.b == 2 assert round(config.sub_config.c - 3.14, 4) == 0 def _load_test_config(filename, use_environ...
mit
Python
8006d142a00a6dae70850b3c9d816f745f252260
create settings file with parent_separator setting
noxan/django-mini-cms
cms/settings.py
cms/settings.py
from django.conf import settings PARENT_SEPARATOR = getattr(settings, 'MINICMS_PARENT_SEPARATOR', '/')
bsd-3-clause
Python
7c8d43b16d6b47555caeb00234590bc8d335ed71
test markup
willmcgugan/rich
tests/test_markup.py
tests/test_markup.py
import pytest from rich.markup import MarkupError, _parse, render from rich.text import Span def test_parse(): result = list(_parse("[foo]hello[/foo][bar]world[/][[escaped]]")) expected = [ (None, "[foo]"), ("hello", None), (None, "[/foo]"), (None, "[bar]"), ("world", ...
mit
Python
93b2972c41855511cddf57029ab8fce0dccd9265
add hashtable using open addressing
haandol/algorithm_in_python
ds/hash.py
ds/hash.py
'''HashTable using open addressing''' class HashTable(object): def __init__(self): self.size = 11 self.keys = [None] * self.size self.data = [None] * self.size def hash(self, key): return key % self.size def rehash(self, key): return (key + 1) % self.size def...
mit
Python
256e1bb8dd543051fe51b3b669ab4a10c0556f40
add back pytext
Kaggle/docker-python,Kaggle/docker-python
tests/test_pytext.py
tests/test_pytext.py
import unittest from pytext.config.field_config import FeatureConfig from pytext.data.featurizer import InputRecord, SimpleFeaturizer class TestPyText(unittest.TestCase): def test_tokenize(self): featurizer = SimpleFeaturizer.from_config( SimpleFeaturizer.Config(), FeatureConfig() ) ...
apache-2.0
Python
ea0b0e3b3ca2b3ad51ae9640f7f58d9f2737f64c
Split out runner
emonty/dox,stackforge/dox,coolsvap/dox,emonty/dox
dox/runner.py
dox/runner.py
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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
af75f727e5ec22020c8d91af6a0302ea0e4bda74
Support for http://docs.oasis-open.org/security/saml/Post2.0/sstc-request-initiation-cd-01.html in the metadata.
tpazderka/pysaml2,tpazderka/pysaml2,Runscope/pysaml2,Runscope/pysaml2
src/saml2/extension/reqinit.py
src/saml2/extension/reqinit.py
#!/usr/bin/env python # # Generated Thu May 15 13:58:36 2014 by parse_xsd.py version 0.5. # import saml2 from saml2 import md NAMESPACE = 'urn:oasis:names:tc:SAML:profiles:SSO:request-init' class RequestInitiator(md.EndpointType_): """The urn:oasis:names:tc:SAML:profiles:SSO:request-init:RequestInitiator ...
bsd-2-clause
Python
cfa5b544c3d44a7440feca006c01bbd72ecc0286
Test arena constants
ntruessel/qcgc,ntruessel/qcgc,ntruessel/qcgc
test/test_arena.py
test/test_arena.py
from support import lib,ffi from qcgc_test import QCGCTest class ArenaTestCase(QCGCTest): def test_size_calculations(self): exp = lib.QCGC_ARENA_SIZE_EXP size = 2**exp bitmap = size / 128 effective_cells = (size - 2 * bitmap) / 16 self.assertEqual(size, lib.qcgc_arena_size) ...
mit
Python
12270bc14b44343b4babef3b6445074685b59bd7
Create histogram.py
vosmann/miniutils,vosmann/miniutils,vosmann/miniutils
python/histogram.py
python/histogram.py
import sys histogram = dict() bin_width = 5 max_index = 0 for line in sys.stdin: if not line: continue number = int(line) bin_index = number / bin_width if bin_index not in histogram: histogram[bin_index] = 0 histogram[bin_index] = histogram[bin_index] + 1 if bin_index > max_...
apache-2.0
Python
8b6b30997816bae1255c3e035851b8e6edb5e4c7
add a test
h4ki/couchapp,diderson/couchapp,h4ki/couchapp,couchapp/couchapp,diderson/couchapp,flimzy/couchapp,diderson/couchapp,dustin/couchapp,couchapp/couchapp,diderson/couchapp,flimzy/couchapp,h4ki/couchapp,flimzy/couchapp,couchapp/couchapp,dustin/couchapp,benoitc/erica,couchapp/couchapp,h4ki/couchapp,dustin/couchapp,flimzy/cou...
python/test/test.py
python/test/test.py
import unittest import os import couchapp.utils class CouchAppTest(unittest.TestCase): def testInCouchApp(self): dir_, file_ = os.path.split(__file__) if dir_: os.chdir(dir_) startdir = os.getcwd() try: os.chdir("in_couchapp") os.chdir("install...
apache-2.0
Python
952438d97fc0c96afaf505469cc7b9cb0c9f287d
Add config file with the list of relays availables
pahumadad/raspi-relay-api
relay_api/conf/config.py
relay_api/conf/config.py
# List of available relays relays = [ { "id": 1, "gpio": 20, "name": "relay 1" }, { "id": 2, "gpio": 21, "name": "relay 2" } ]
mit
Python
b5083af1cce5fb5b9c7bb764b18edce8640bd3a1
add utilLogger.py from toLearn/ and update to v0.4
yasokada/python-151113-lineMonitor,yasokada/python-151113-lineMonitor
utilLogger.py
utilLogger.py
import os.path import datetime ''' v0.4 2015/11/30 - comment out test run - add from sentence to import CUtilLogger v0.3 2015/11/30 - change array declaration to those using range() - __init__() does not take saveto arg - automatically get file name based on the date v0.2 2015/11/30 - update add() to handle ...
mit
Python
99f5d264ab88573e0541c529eca905b8a1d16873
Bump to 0.5.3 dev.
davidt/rbtools,datjwu/rbtools,reviewboard/rbtools,beol/rbtools,haosdent/rbtools,1tush/rbtools,reviewboard/rbtools,datjwu/rbtools,davidt/rbtools,haosdent/rbtools,beol/rbtools,reviewboard/rbtools,davidt/rbtools,halvorlu/rbtools,halvorlu/rbtools,haosdent/rbtools,datjwu/rbtools,beol/rbtools,halvorlu/rbtools
rbtools/__init__.py
rbtools/__init__.py
# # __init__.py -- Basic version and package information # # Copyright (c) 2007-2009 Christian Hammond # Copyright (c) 2007-2009 David Trowbridge # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the So...
# # __init__.py -- Basic version and package information # # Copyright (c) 2007-2009 Christian Hammond # Copyright (c) 2007-2009 David Trowbridge # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the So...
mit
Python
90948c62d1d01800c6a75dd5f15d7fef334dc66f
Add python unittests
dragonfi/noticeboard,dragonfi/noticeboard,dragonfi/noticeboard,dragonfi/noticeboard
noticeboard/test_noticeboard.py
noticeboard/test_noticeboard.py
import os import json import tempfile import unittest from noticeboard import noticeboard class TestNoticeboard(unittest.TestCase): def setUp(self): self.fd, noticeboard.app.config["DATABASE"] = tempfile.mkstemp() noticeboard.app.config["TESTING"] = True self.app = noticeboard.app.test_cl...
mit
Python
17fcdd9a01be24ad9562e5a558e2dd65a84d1a19
Add missing tests/queuemock.py
privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea
tests/queuemock.py
tests/queuemock.py
# -*- coding: utf-8 -*- # # 2019-01-07 Friedrich Weber <friedrich.weber@netknights.it> # Implement queue mock # # License: AGPLv3 # contact: http://www.privacyidea.org # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE # L...
agpl-3.0
Python
6083124c110e0ce657b78f6178cd7464996a042b
add tests I want to pass
theavey/ParaTemp,theavey/ParaTemp
tests/test_geometries.py
tests/test_geometries.py
"""This contains a set of tests for ParaTemp.geometries""" ######################################################################## # # # This script was written by Thomas Heavey in 2017. # # theavey@bu.edu thomasjheavey...
apache-2.0
Python
8c9034e91d82487ae34c592b369a3283b577acc8
Add a new test for the latest RegexLexer change, multiple new states including '#pop'.
aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygmen...
tests/test_regexlexer.py
tests/test_regexlexer.py
# -*- coding: utf-8 -*- """ Pygments regex lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2007 by Georg Brandl. :license: BSD, see LICENSE for more details. """ import unittest from pygments.token import Text from pygments.lexer import RegexLexer class TestLexer(RegexLexer): """Test tuple st...
bsd-2-clause
Python
ba0c292753355e5ff7e8e131c61e8086f31b3b76
Create src/task_2_0.py
fitifit/pythonintask,askras/pythonintask
src/task_2_0.py
src/task_2_0.py
# Раздел 1. Задача 2. Вариант 0. # Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Ф.М.Достоевский. Не забудьте о том, что автор должен быть упомянут на отдельной строке. print("Жизнь, везде жизнь, жизнь в нас самих, а не во внешнем.") print(...
apache-2.0
Python
6f00204ae2603063eafbd74a369e9da0864854ca
Create new monthly violence polls
unicefuganda/edtrac,unicefuganda/edtrac,unicefuganda/edtrac
poll/management/commands/create_new_violence_polls.py
poll/management/commands/create_new_violence_polls.py
#!/usr/bin/python # -*- coding: utf-8 -*- from django.core.management.base import BaseCommand import traceback from poll.models import Poll from unregister.models import Blacklist from django.conf import settings from optparse import make_option from poll.forms import NewPollForm from django.contrib.sites.models impo...
bsd-3-clause
Python