commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
1d7fa31d9f4ce42586fb33bea98d5af87bd95f3a
Allow setup.py install
setup.py
setup.py
from setuptools import setup setup(name='multifil', version='0.2', description='A spatial half-sarcomere model and the means to run it', url='https://github.com/cdw/multifil', author='C David Williams', author_email='cdave@uw.edu', license='MIT', packages=['multifil'], i...
Python
0
30220f57bc5052cb05ed5c7e3dc01c763152d175
Add setup for python installation
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup(name='lqrrt', version='1.0', description='Kinodynamic RRT Implementation', author='Jason Nezvadovitz', packages=['lqrrt'], )
Python
0
0c7ec853c97a71eacc838be925c46ac0c26d1518
Create setup.py
setup.py
setup.py
from distutils.core import setup setup( name = 'ratio-merge', packages = ['ratio-merge'], version = '0.1', description = 'A small utility function for merging two lists by some ratio', author = 'Adam Lev-Libfeld', author_email = 'adam@tamarlabs.com', url = 'https://github.com/daTokenizer/ratio-merge-pytho...
Python
0.000001
a29b7195af2550e5646f3aac581cbaf47244e8f4
Create setup.py
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # setup.py """ Setup files Copyright (c) 2020, David Hoffman """ import setuptools # read in long description with open("README.md", "r") as fh: long_description = fh.read() # get requirements with open("requirements.txt", "r") as fh: requirements = [line.strip(...
Python
0.000001
45d734cb495e7f61c5cbbac2958e220868033a9d
Add setup.py for RTD
setup.py
setup.py
from distutils.core import setup setup( name='mayatools', version='0.1-dev', description='Collection of general tools and utilities for working in and with Maya.', url='https://github.com/westernx/mayatools', packages=['mayatools'], author='Mike Boers', author_email='mayatools@mik...
Python
0
1ac147a2a9f627cccd917006f61cdda7b25ccc06
Add setup.py
setup.py
setup.py
from distutils.core import setup setup( name='applied-sims', version='0.1', classifiers=[ 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Programming Language :: Python :: 3', 'Topic :: Scientific/Engineering :: Physics', 'Intended Audience :: Other Audie...
Python
0.000001
e6e96d9fa725ec28028b090c900086474e69cdb8
Add basic setup.py
setup.py
setup.py
from distutils.core import setup setup( name='litemap', version='1.0a', description='Mapping class which stores in SQLite database.', url='http://github.com/mikeboers/LiteMap', py_modules=['litemap'], author='Mike Boers', author_email='litemap@mikeboers.com', license='New BSD Lice...
Python
0.000002
479ff810c07ebe5c309bb4c9f712e689e831945e
Add setup.py
setup.py
setup.py
import os from setuptools import setup this_dir = os.path.dirname(__file__) long_description = "\n" + open(os.path.join(this_dir, 'README.rst')).read() setup( name='ansible_role_apply', version='0.0.0', description='Apply a single Ansible role to host(s) easily', long_description=long_description, ...
Python
0.000001
9d12617170982fc1b6b01d109d986f5cd45e0552
Update setup.py.
setup.py
setup.py
from setuptools import setup,find_packages setup ( name = 'pymatgen', version = '1.0.1', packages = find_packages(), # Declare your packages' dependencies here, for eg: install_requires = ['numpy','scipy','matplotlib','PyCIFRW'], author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan Gunter', aut...
from setuptools import setup,find_packages setup ( name = 'pymatgen', version = '1.0.1', packages = find_packages(), # Declare your packages' dependencies here, for eg: install_requires = ['numpy','matplotlib','pymongo','PyCIFRW','psycopg2'], author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan ...
Python
0
4a7234d4592166a1a13bc6b8e8b3b201019df23b
Create prims_minimum_spanning.py
algorithms/graph/prims_minimum_spanning.py
algorithms/graph/prims_minimum_spanning.py
import heapq # for priority queue # input number of nodes and edges in graph n, e = map (int,input().split()) # initializing empty graph as a dictionary (of the form {int:list}) g = dict (zip ([i for i in range(1,n+1)],[[] for i in range(n)])) # input graph data for i in range(e): a, b, c = map (int,input().spl...
Python
0.000041
24f6cbdcf2f4261a651d058934c65c3696988586
add setup.py to document deps
setup.py
setup.py
from setuptools import setup setup( name='gentle', version='0.1', description='Robust yet lenient forced-aligner built on Kaldi.', url='http://lowerquality.com/gentle', author='Robert M Ochshorn', license='MIT', packages=['gentle'], install_requires=['twisted'], )
Python
0
654bd46a8226ea97000a1263132a37f7bf130718
ADD setup.py
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup(name='kernel_regression', version='1.0', description='Implementation of Nadaraya-Watson kernel regression with automatic bandwidth selection compatible with sklearn.', author='Jan Hendrik Metzen', author_email='jhm@informatik.uni-bre...
Python
0.000001
1707306cdee6442e78fe9eaee1d472a0248f75d5
make license consistent
setup.py
setup.py
# -*- coding: utf-8 -*- """ argcomplete ~~~~ Argcomplete provides easy and extensible automatic tab completion of arguments and options for your Python script. It makes two assumptions: - You're using bash as your shell - You're using argparse to manage your command line options See AUTODOCS_LINK for more info. ""...
# -*- coding: utf-8 -*- """ argcomplete ~~~~ Argcomplete provides easy and extensible automatic tab completion of arguments and options for your Python script. It makes two assumptions: - You're using bash as your shell - You're using argparse to manage your command line options See AUTODOCS_LINK for more info. ""...
Python
0.000004
1f1096046e11067c4d42235d3b1aadbfec869bff
Remove setuptools from install_requires
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages from os import path import codecs import os import re import sys def read(*parts): file_path = path.join(path.dirname(__file__), *parts) return codecs.open(file_path, encoding='utf-8').read() def find_version(*parts): version_file = read(...
#!/usr/bin/env python from setuptools import setup, find_packages from os import path import codecs import os import re import sys def read(*parts): file_path = path.join(path.dirname(__file__), *parts) return codecs.open(file_path, encoding='utf-8').read() def find_version(*parts): version_file = read(...
Python
0
260911a0a46601092aa75882c806ca921a0cbf6d
Add setup.py file so we can install
setup.py
setup.py
from __future__ import with_statement import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand version = "0.0.1-dev" def readme(): with open('README.md') as f: return f.read() reqs = [line.strip() for line in open('requirements.txt')] class PyTest...
Python
0
b1d87a8f96fb6a019bc7ebab71fe8e0c5921d80f
Include setup.py
setup.py
setup.py
from setuptools import find_packages from setuptools import setup REQUIRED_PACKAGES = ['distance', 'tensorflow', 'numpy', 'six'] setup( name='attentionocr', url='https://github.com/emedvedev/attention-ocr', author_name='Ed Medvedev', version='0.1', install_requires=REQUIRED_PACKAGES, packages=...
Python
0
6ded510fa9c694e8a836302131157604859d40b1
add setup settings
setup.py
setup.py
from setuptools import setup setup(name='uc-numero-alumno', version='0.1.0', description='Valida un número de alumno de la UC ', url='https://github.com/mrpatiwi/uc-numero-alumno-python', author='Patricio López', author_email='patricio@lopezjuri.com', license='MIT', packages=[...
Python
0.000001
414c5d0f9e7e92772cf65be976791889e96e2799
Package with setuptools
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages classifiers = [ 'Development Status :: 5 - Production/Stable', 'Framework :: Twisted', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: P...
Python
0
01caadc16b58305d52c12517cd89300b9f0f80ae
Add forgotten file
nipy/modalities/fmri/tests/test_iterators.py
nipy/modalities/fmri/tests/test_iterators.py
#TODO the iterators are deprecated import numpy as np from nipy.testing import * from nipy.core.api import Image import nipy.core.reference.coordinate_map as coordinate_map from nipy.modalities.fmri.api import FmriImageList """ Comment out since these are slated for deletion and currently are broken. Keep for referenc...
Python
0.000001
8aada38d951d039e11e03a6bae9445c784bb4cce
Write a brief demo using nltk
parse-demo.py
parse-demo.py
#!/usr/bin/python3 import sys, os import nltk if len(sys.argv) < 2: print("Please supply a filename.") sys.exit(1) filename = sys.argv[1] with open(filename, 'r') as f: data = f.read() # Break the input down into sentences, then into words, and position tag # those words. sentences = [nltk.pos_tag(nltk...
Python
0.000001
89fa937d218bef113d2bcc681cb4dbd547940c45
Add setup.py
setup.py
setup.py
from distutils.core import setup setup( name = 'koofr', packages = ['koofr'], # this must be the same as the name above install_requires=['requests'], version = '0.1', description = 'Python SDK for Koofr', author = 'Andraz Vrhovec', author_email = 'andraz@koofr.net', url = 'https://github.com/koofr/pyth...
Python
0.000001
8ecfe73916fbca42b9a1b47fb2758bb561b76eec
Remove print.
setup.py
setup.py
import os from setuptools import setup, find_packages README = os.path.join(os.path.dirname(__file__), 'README.md') long_description = open(README).read() + '\n\n' setup ( name = 'pymatgen', version = '1.2.4', packages = find_packages(), install_requires = ['numpy', 'scipy', 'matplotlib', 'PyCIFRW'], packa...
import os from setuptools import setup, find_packages README = os.path.join(os.path.dirname(__file__), 'README.md') long_description = open(README).read() + '\n\n' print find_packages() setup ( name = 'pymatgen', version = '1.2.4', packages = find_packages(), install_requires = ['numpy', 'scipy', 'matplotli...
Python
0.000001
fe8cc65832b389314ee6e83c76371809e40cc5d1
Bump to 0.1.1
setup.py
setup.py
from ez_setup import use_setuptools use_setuptools() from setuptools import setup setup( name='Kivy Garden', version='0.1.1', license='MIT', packages=['garden'], scripts=['bin/garden', 'bin/garden.bat'], install_requires=['requests'], )
from ez_setup import use_setuptools use_setuptools() from setuptools import setup setup( name='Kivy Garden', version='0.1', license='MIT', packages=['garden'], scripts=['bin/garden', 'bin/garden.bat'], install_requires=['requests'], )
Python
0.000683
9a0d2a8d207d9f8a105795eb97bdeaac0c30ddec
add ping_interval property
aiohttp_sse/__init__.py
aiohttp_sse/__init__.py
import asyncio from aiohttp import hdrs from aiohttp.protocol import Response as ResponseImpl from aiohttp.web import StreamResponse from aiohttp.web import HTTPMethodNotAllowed __version__ = '0.0.1' __all__ = ['EventSourceResponse'] class EventSourceResponse(StreamResponse): DEFAULT_PING_INTERVAL = 15 def...
import asyncio from aiohttp import hdrs from aiohttp.protocol import Response as ResponseImpl from aiohttp.web import StreamResponse from aiohttp.web import HTTPMethodNotAllowed __version__ = '0.0.1' __all__ = ['EventSourceResponse'] class EventSourceResponse(StreamResponse): PING_TIME = 15 def __init__(se...
Python
0.000001
b35affdf2183fa81e628f03a904ce80beb165de2
Fix quote output
bertil.py
bertil.py
# -*- coding: utf-8 -*- import sys import datetime import time import urllib import json import socket import re import random from slackbot.bot import Bot, listen_to, respond_to from tinydb import TinyDB db = TinyDB('/home/simon/bertil/quotes.json') def get_food(day): # Get JSON URL = 'http://www.hanssono...
# -*- coding: utf-8 -*- import sys import datetime import time import urllib import json import socket import re import random from slackbot.bot import Bot, listen_to, respond_to from tinydb import TinyDB db = TinyDB('/home/simon/bertil/quotes.json') def get_food(day): # Get JSON URL = 'http://www.hanssono...
Python
0.999424
ce7914dd35e66820248cb82760b50a31bc8a625b
Add setup.py script to install whip-neustar cli script
setup.py
setup.py
from setuptools import setup setup( name='whip-neustar', version='0.1', packages=['whip_neustar'], entry_points={ 'console_scripts': [ 'whip-neustar = whip_neustar.cli:main', ], } )
Python
0
a72bc73aab4b696113bee16f5f7f9da1540bc02f
Create playerlist.py
playerlist.py
playerlist.py
import config class players: def __init__(self): self.path=config.install_path+"reg\\N_NOW_RUNNING\\PLAYERS\\LIST.nreg" def get_names_str(self,level): a=open(self.path,"r") b=a.readlines() string="" for i in b: string=string+i a.close() return ...
Python
0.000001
7fa6d8beb2637bed6b31cf1cea5fdafffc6049bf
add tests
tests/test_dfg.py
tests/test_dfg.py
#!/usr/bin/env python import logging import time import sys from os.path import join, dirname, realpath l = logging.getLogger("angr.tests.test_dfg") l.setLevel(logging.DEBUG) import nose import angr import pyvex test_location = str(join(dirname(realpath(__file__)), "../../binaries/tests")) def perform_one(binary_...
Python
0.000001
c9e7f66aa1715720e37e62ca4bd5618df6adf2a8
Add tdb/upload subclass for elife titers.
tdb/elife_upload.py
tdb/elife_upload.py
import os, re, time, datetime, csv, sys, json from upload import upload import rethinkdb as r from Bio import SeqIO import argparse from parse import parse sys.path.append('') # need to import from base from base.rethink_io import rethink_io from vdb.flu_upload import flu_upload parser = argparse.ArgumentParser() par...
Python
0
d7a0962a817e1a7e530fcd84a11dc51be82574a6
Create get_qpf_f012.py
get_qpf_f012.py
get_qpf_f012.py
import sys import os import urllib2 import datetime import time import psycopg2 from subprocess import call, Popen # pull the last hours worth of precip data os.system("wget http://www.srh.noaa.gov/ridge2/Precip/qpfshp/latest/latest_rqpf_f012.tar.gz -O latest_rqpf_f012.tar.gz") os.system("mv latest_rqpf_f012.tar.gz l...
Python
0.000001
504612eb0c3c6ec210dd6e555941c13523333f12
install without cython
setup.py
setup.py
from setuptools import setup, Extension from glob import glob library = ('primesieve', dict( sources=glob("lib/primesieve/src/primesieve/*.cpp"), include_dirs=["lib/primesieve/include"], language="c++", )) try: from Cython.Build import cythonize except ImportError: cythonize = None extension ...
from setuptools import setup, Extension from Cython.Build import cythonize from glob import glob library = ('primesieve', dict( sources=glob("lib/primesieve/src/primesieve/*.cpp"), include_dirs=["lib/primesieve/include"], language="c++", )) extension = Extension( "primesieve", ["primes...
Python
0
42ca323888dc13246fa7f6a01a6e29efcdb2d5c5
Add setup.py
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup import molvs if os.path.exists('README.rst'): long_description = open('README.rst').read() else: long_description = '''''' setup( name='MolVS', version=molvs.__version__, author=molvs.__author__, author_ema...
Python
0.000001
e91b1c56b252ddc3073a15209e38e73424911b62
Remove unused import.
setup.py
setup.py
#!/usr/bin/env python # # Copyright 2014 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
#!/usr/bin/env python # # Copyright 2014 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
Python
0
d139ced0b482fa65720a3c8f268d71dbf25119fb
add jsonsoup plugin
commonplugs/jsonsoup.py
commonplugs/jsonsoup.py
# commonplugs/jsonsoup.py # # ## gozerlib imports from gozerlib.callbacks import callbacks from gozerlib.utils.url import posturl, getpostdata from gozerlib.persistconfig import PersistConfig from gozerlib.commands import cmnds from gozerlib.socket.irc.monitor import outmonitor from gozerlib.socket.rest.server import...
Python
0
52cd79d7045a69ff5073af7ed14e9ed774de7a39
Add setup.py.
setup.py
setup.py
from setuptools import setup setup( name='pySUMO', version='0.0.0a1', description='A graphical IDE for Ontologies written in SUO-Kif', long_description='A graphical IDE for Ontologies written in SUO-Kif', url='', author='', author_email='', license='', classifiers=['Development Stat...
Python
0
7354dc674a4551169fb55bfcec208256e956d14e
Add skeleton class for conditions
components/condition.py
components/condition.py
"""A class to store conditions (eg. WHERE [cond]).""" class SgConditionSimple: """ A class to store a simple condition. A simple condition is composed of 2 operands and 1 operator. """ def __init__(self, operand-l, operator, operand-r): self._op-l = operand-l self._op = operat...
Python
0
8e3de37e14013dc371064eec5102f682b32d0cfc
modify cwd so setup.py can be run from anywhere
setup.py
setup.py
#!/usr/bin/python import os from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext def generate_sources(dir_files_tuples): sources = [] for dir, files in dir_files_tuples: full_files = [ os.path.join(dir, file) ...
#!/usr/bin/python import os # old crosscat setup.py from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext # venture setup.py # from distutils.core import setup, Extension def generate_sources(dir_files_tuples): sources = [] for dir, files in dir_...
Python
0
a0607d0f9b7c08ddcf81459868b33761d8ed5bb2
Set up the dependency
setup.py
setup.py
# Copyright 2021 The KerasNLP 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Python
0.000008
d9be2b8a61a88f0ee228c08d1f277770602840b1
Add python version for compress
compression/compress.py
compression/compress.py
def compress(uncompressed): count = 1 compressed = "" if not uncompressed: return compressed letter = uncompressed[0] for nx in uncompressed[1:]: if letter == nx: count = count + 1 else: compressed += "{}{}".format(letter, count) count =...
Python
0.000002
d480c2738bb4d0ae72643fc9bc1f911cb630539c
add 12-list.py
python/12-list.py
python/12-list.py
#!/usr/bin/env python import math list = ['physics', 'chemistry', 1997, 2001]; print "list[2] = ", list[2] print "list[1:3] = ", list[1:3] list[2] = "math"; print "update, list[2] = ", list[2] del list[2] print "delete, list[2] = ", list[2] print "length of delete:", len(list) if ('physics' in list): print...
Python
0.000003
240b22d0b078951b7d1f0df70156b6e2041a530f
fix setup.py dor pypi.
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 Benoit Chesneau <benoitc@e-engura.org> # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import os import sys from setuptools import setup data_files = [] root_dir = os.path....
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 Benoit Chesneau <benoitc@e-engura.org> # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import os import sys from setuptools import setup data_files = [] root_dir = os.path....
Python
0
588750832d8bfb1047bb2c56f335cb70f6b2ff5f
add QualityControl
qualitycontrol.py
qualitycontrol.py
import os,sys from optparse import OptionParser import time import fastq maxLen = 200 allbases = ("A", "T", "C", "G"); ########################### QualityControl class QualityControl: readLen = 0 readCount = 0 counts = {} percents = {} qualities = [0 for x in xrange(maxLen)] def __init__(self...
Python
0
3ada80358a059b3a5ee4dd4ceed572f933a1ec67
Create setup.py
setup.py
setup.py
from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( ...
Python
0.000001
606853d904c1967b41b30d828940c4aa7ab4c0ab
add setup.py
setup.py
setup.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 # "...
Python
0.000001
90ec011ebec93f4c0b0e93fc831b0f782be1b13e
Add the setup.py PIP install config file.
setup.py
setup.py
from setuptools import setup setup( name='SedLex', version='0.1', install_requires=[ 'html5lib', 'beautifulsoup4', 'requests', 'jinja2', 'python-gitlab' ] )
Python
0
fa88dac9c35fc473ebfea05926e0200926251d9d
Create setup.py
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup(name='RPiProcessRig', version='1.0', description='A simple industrial rig that can be used for experimentation with a variety of different control algortithms', author='Alexander Leech', author_email='alex.leech@talktalk.net', ...
Python
0
c0989ce01ee62367a92eb48855a42c3c4986de84
Add setup.py.
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import codecs import os from setuptools import find_packages, setup def read(file_name): file_path = os.path.join(os.path.dirname(__file__), file_name) return codecs.open(file_path, encoding='utf-8').read() PACKAGE = "ad...
Python
0
7634b58b1bd0fc2eee121bad2a20b61077a48d7b
Update setup.py
setup.py
setup.py
#!/usr/bin/env python import sys from distutils.core import setup try: import fontTools except: print "*** Warning: defcon requires FontTools, see:" print " fonttools.sf.net" try: import robofab except: print "*** Warning: defcon requires RoboFab, see:" print " robofab.com" #if "sdist"...
#!/usr/bin/env python import sys from distutils.core import setup try: import fontTools except: print "*** Warning: defcon requires FontTools, see:" print " fonttools.sf.net" try: import robofab except: print "*** Warning: defcon requires RoboFab, see:" print " robofab.com" #if "sdist"...
Python
0
3c5802bda34ed9c772f7bb2e33b29f265440f286
Add a simple setup.py.
setup.py
setup.py
import os from setuptools import setup, find_packages README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.markdown') description = 'django-goodfields makes creating good form fields easy.' long_description = os.path.exists(README_PATH) and open(README_PATH).read() or description setup( ...
Python
0
26cc1c4ff2b5c0de8b83bb9bd088d80f5650dda1
Create setup.py
setup.py
setup.py
__author__ = 'Alumne' from distutils.core import setup setup(name='PEACHESTORE', version='python 3', author='albert cuesta', author_email='albert_cm_91@hotmail.com', url='https://github.com/albertcuesta/PEACHESTORE', description='es una tienda online de aplicaciones moviles similar a goo...
Python
0.000001
456babd37b63e36b1041472aa6bb913c90e46816
install of python interface via setup.py
setup.py
setup.py
# see https://stackoverflow.com/questions/42585210/extending-setuptools-extension-to-use-cmake-in-setup-py import os import pathlib import re import sys import sysconfig import platform import subprocess import shutil from distutils.command.install_data import install_data from setuptools import find_packages, setup,...
Python
0
d64367eda03772997af21792e82a2825848c1ae6
add tests for splat utils
astroquery/splatalogue/tests/test_utils.py
astroquery/splatalogue/tests/test_utils.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst from ... import splatalogue from astropy import units as u import numpy as np from .test_splatalogue import patch_post from .. import utils def test_clean(patch_post): x = splatalogue.Splatalogue.query_lines(114*u.GHz,116*u.GHz,chemical_name=' CO ') ...
Python
0
4420556002c32f512f1afc9ea49ba8f01818f08a
add script to generate all jobs
scripts/generate_all_jobs.py
scripts/generate_all_jobs.py
#!/usr/bin/env python3 import argparse import os import subprocess import sys from ros_buildfarm.argument import add_argument_config_url from ros_buildfarm.config import get_index from ros_buildfarm.config import get_release_build_files from ros_buildfarm.config import get_source_build_files from ros_buildfarm.jenki...
Python
0.000001
b72f8a9b0d9df7d42c43c6a294cc3aab2cb91641
Add missing migrations for limit_choices_to on BlogPage.author
blog/migrations/0002_auto_20190605_1104.py
blog/migrations/0002_auto_20190605_1104.py
# Generated by Django 2.2.2 on 2019-06-05 08:04 import blog.abstract from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0001_squashed_0006_auto_20180206_2239'), ] operations...
Python
0.000001
7fdf796440c3a4ed84ffcb4343cd92f0013c8b1f
add current client, supports basic chatting
slack.py
slack.py
from slackclient import SlackClient def get_client(token='4577027817.4577075131'): return SlackClient(token) print get_client().api_call('api.test')
Python
0
f1c1206af29ee0f7be8b7477cd409f2844c816b3
add Todo generator
todo/generator.py
todo/generator.py
# coding=utf8 """ Generator from todo object to todo format string """ from models import Task from models import Todo class Generator(object): """ Generator from todo object to readable string. """ newline = "\n" def gen_task_id(self, task_id): """ int => str e.g. 12 => ...
Python
0
3c290803bbd6d7401903506b3a27cf2c9ebad0b4
Add ChatInfoFormatter
bot/action/standard/info/formatter/chat.py
bot/action/standard/info/formatter/chat.py
from bot.action.standard.info.formatter import ApiObjectInfoFormatter from bot.action.util.format import ChatFormatter from bot.api.api import Api from bot.api.domain import ApiObject class ChatInfoFormatter(ApiObjectInfoFormatter): def __init__(self, api: Api, chat: ApiObject, bot_user: ApiObject, user: ApiObjec...
Python
0
1ad56e631c29869d127931b555d0b366f7e75641
Add test for fftpack.
numpy/fft/tests/test_fftpack.py
numpy/fft/tests/test_fftpack.py
import sys from numpy.testing import * set_package_path() from numpy.fft import * restore_path() class test_fftshift(NumpyTestCase): def check_fft_n(self): self.failUnlessRaises(ValueError,fft,[1,2,3],0) if __name__ == "__main__": NumpyTest().run()
Python
0
ab6fa9717b092f3b8eea4b70920a1d7cef042b69
Return disappeared __main__
certchecker/__main__.py
certchecker/__main__.py
import click from certchecker import CertChecker @click.command() @click.option( '--profile', default='default', help="Section name in your boto config file" ) def main(profile): cc = CertChecker(profile) print(cc.result) if __name__ == "__main__": print(main())
Python
0.000169
b9feeb2a37f0596b48f9582e8953d29485167fc8
Add an event-driven recording tool
tools/sofa-edr.py
tools/sofa-edr.py
#!/usr/bin/env python3 import subprocess import time import argparse if __name__ == '__main__': bwa_is_recorded = False smb_is_recorded = False htvc_is_recorded = False parser = argparse.ArgumentParser(description='A SOFA wrapper which supports event-driven recording.') parser.add_argument('--trac...
Python
0.000002
3fc58964cc6291698f92cff51f9f0e00f1263357
Task b
project2/b.py
project2/b.py
from sklearn.feature_extraction import text from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.pipeline import Pipeline from pandas import DataFrame import nltk from nltk import word_tokeni...
Python
1
0bd65e0e20911e7ac87aba3ef076b327f57b2f6f
Add get-aixdzs.py
get-aixdzs.py
get-aixdzs.py
#!/usr/bin/env python3 import argparse import html.parser from typing import List, Tuple import urllib.request class AixdzsHTMLParser(html.parser.HTMLParser): def __init__(self): super().__init__() self.last_url: str = '' self.next_url: str = '' self.is_in_content_tag: bool = Fal...
Python
0.000001
42ab52b6d077443fac20ea872b503589f6ddb3f7
Create pyPostings.py
pyPostings.py
pyPostings.py
import re import string def posting(corpus): posting = [] tokens = tokenize(corpus) for index, token in enumerate(tokens): posting.append([token, (index+1)]) return posting def posting_list(corpus): posting_list = {} tokens = tokenize(corpus) for index, token in enumerat...
Python
0
ee39e69fe5d6e93844f47eaff0d9547622600fa7
make parsing times easier
py/phlsys_strtotime.py
py/phlsys_strtotime.py
#!/usr/bin/env python # encoding: utf-8 """A poor substitute for PHP's strtotime function.""" import datetime def describeDurationStringToTimeDelta(): return str('time can be specified like "5 hours 20 minutes", use ' 'combinations of seconds, minutes, hours, days, weeks. ' 'each u...
Python
0.000002
2cf2a89bf3c7ccf667e4bcb623eeb6d0e1ea37bb
print sumthing pr1
python/py1.py
python/py1.py
#!/usr/bin/env python3 """ If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. """ thing = [] for urmom in range(1,1000): if urmom % 5 == 0 or urmom % 3 == 0: thing.appen...
Python
0.999948
784fd8b08ee0f268350a2003a9c06522c0678874
Add python code for doing tensor decomposition with scikit-tensor.
python/run.py
python/run.py
import logging import numpy from numpy import genfromtxt from sktensor import sptensor, cp_als # Set logging to DEBUG to see CP-ALS information logging.basicConfig(level=logging.DEBUG) data = genfromtxt('../datasets/movielens-synthesized/ratings-synthesized-50k.csv', delimiter=',') # we need to convert data into two ...
Python
0
00413958a12607aab942c98581b1a9e6d682ef28
Create Single-Prime.py
python/Single-Prime.py
python/Single-Prime.py
#By Isabelle. #Checks a single number and lists all of its factors (except 1 and itself) import math num = int(input("Pick a number to undergo the primality test!\n")) root = int(round(math.sqrt(num))) prime = True for looper in range(2,root + 1): #53225 should normally be 3 if num % 2 == 0 or num % 3 == 0 or num % ...
Python
0.000003
1cb8df64d4f6f257d0bd03caaaddb33ad11a5c2c
Add or_gate
python/ch02/or_gate.py
python/ch02/or_gate.py
import numpy as np def OR(x1, x2): x = np.array([x1, x2]) w = np.array([0.5, 0.5]) b = -0.2 tmp = np.sum(w * x) + b if tmp <= 0: return 0 else: return 1 if __name__ == '__main__': for xs in [(0, 0), (1, 0), (0, 1), (1, 1)]: y = OR(xs[0], xs[1]) print(str(x...
Python
0.000001
a58a31a6037babdc607593196da2841f13791bfa
Revert "去掉camelcase和underscore的转换, 直接用三方的"
railguns/utils/text.py
railguns/utils/text.py
""" https://github.com/tomchristie/django-rest-framework/issues/944 """ import re first_cap_re = re.compile('(.)([A-Z][a-z]+)') all_cap_re = re.compile('([a-z0-9])([A-Z])') def camelcase_to_underscore(name): s1 = first_cap_re.sub(r'\1_\2', name) return all_cap_re.sub(r'\1_\2', s1).lower() def underscore_t...
Python
0
cd727a5e17cabcc4ee03f2973775f30b7c8b5a26
add terrible copypasta'd watchdog-using piece of shit for test running
tasks.py
tasks.py
import sys import time from invocations.docs import docs, www from invocations.testing import test, coverage from invocations.packaging import vendorize, release from invoke import ctask as task, Collection, Context @task(help=test.help) def integration(c, module=None, runner=None, opts=None): """ Run the i...
import sys import time from invocations.docs import docs, www from invocations.testing import test, coverage from invocations.packaging import vendorize, release from invoke import ctask as task, Collection, Context @task(help=test.help) def integration(c, module=None, runner=None, opts=None): """ Run the i...
Python
0
a723c70a0ae9da0f2207dd9278c619be323bda4a
move test parts to avnav_test
avnav_test/avn_debug.py
avnav_test/avn_debug.py
import sys sys.path.append(r'/home/pi/avnav/pydev') import pydevd from avnav_server import * pydevd.settrace(host='10.222.10.45',stdoutToServer=True, stderrToServer=True) main(sys.argv)
Python
0
aa1b39b455f7145848c287ee9ee85507f5b66de0
Add Meduza
collector/rss/meduza.py
collector/rss/meduza.py
# coding=utf-8 import feedparser import logging from util import date, tags SOURCE_NAME = 'Meduza' FEED_URL = 'https://meduza.io/rss/all' log = logging.getLogger('app') def parse(): feed = feedparser.parse(FEED_URL) data = [] for entry in feed['entries']: data.append({ 'title': ent...
Python
0
d50814603217ca9ea47324a0ad516ce7418bc9bf
Add script to generate a standalone timeline view.
build/generate_standalone_timeline_view.py
build/generate_standalone_timeline_view.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import parse_deps import sys import os srcdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../src")) ...
Python
0.999893
93df464ec396774cb161b51d4988773e4ce95e44
Create lfu-cache.py
Python/lfu-cache.py
Python/lfu-cache.py
# Time: O(1), per operation # Space: O(k), k is the capacity of cache # Design and implement a data structure for Least Frequently Used (LFU) cache. # It should support the following operations: get and put. # # get(key) - Get the value (will always be positive) of the key # if the key exists in the cache, otherwise...
Python
0.000001
f6ef8e0c31163f95fa0c62873a7195ab51f65cf1
Add cw_are_they_the_same.py
cw_are_they_the_same.py
cw_are_they_the_same.py
"""Codewars: Are they the "same"? 6 kyu URL: https://www.codewars.com/kata/550498447451fbbd7600041c Given two arrays a and b write a function comp(a, b) (compSame(a, b) in Clojure) that checks whether the two arrays have the "same" elements, with the same multiplicities. "Same" means, here, that the elements in b are...
Python
0.01265
64ea416a335d9c1a8946411c2b3b1a67cd450131
Add first pass at reconstructed targets module.
vizard/targets.py
vizard/targets.py
import viz import vizact import vizshape import vrlab class Target: '''A target is a single cube in the motion-capture space. Subjects are tasked with touching the cubes during the experiment. ''' def __init__(self, index, x, y, z): self.center = x, y, z self.sphere = vizshape.addSp...
Python
0
f1f57561c4ebb5a374b168cd5e6274cbb854611d
change except lines
wakatime/queue.py
wakatime/queue.py
# -*- coding: utf-8 -*- """ wakatime.queue ~~~~~~~~~~~~~~ Queue for offline time logging. http://wakatime.com :copyright: (c) 2014 Alan Hamlett. :license: BSD, see LICENSE for more details. """ import logging import os import sqlite3 import traceback from time import sleep log = logging.ge...
# -*- coding: utf-8 -*- """ wakatime.queue ~~~~~~~~~~~~~~ Queue for offline time logging. http://wakatime.com :copyright: (c) 2014 Alan Hamlett. :license: BSD, see LICENSE for more details. """ import logging import os import sqlite3 import traceback from time import sleep log = logging.ge...
Python
0.000137
58626e757b463f2aec6751e04fbaf0e83cf0adf9
Create Bigram.py
src/3-trained-classifier/Bigram.py
src/3-trained-classifier/Bigram.py
__author__ = 'Atef Bellaaj' __author__ = 'Bellaaj' import collections import nltk.metrics import nltk.classify.util from nltk.classify import NaiveBayesClassifier from nltk.corpus import movie_reviews neg_ids = movie_reviews.fileids('neg') pos_ids = movie_reviews.fileids('pos') import itertools from nltk.collocatio...
Python
0.000001
527e9270f599b0bd574a8c2d2fd762c73ad78fb8
Add migration to changes to upload all historical data
fellowms/migrations/0029_auto_20160714_1435.py
fellowms/migrations/0029_auto_20160714_1435.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-07-14 14:35 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('fellowms', '0028_auto_20160713_1301'), ] operations...
Python
0
ad0a1c1404c53f1565ef728a747d5d5f319f1992
Add tests for Enterprise
auth0/v2/test/authentication/test_enterprise.py
auth0/v2/test/authentication/test_enterprise.py
import unittest import mock from ...authentication.enterprise import Enterprise class TestEnterprise(unittest.TestCase): @mock.patch('auth0.v2.authentication.enterprise.Enterprise.get') def test_saml_metadata(self, mock_get): e = Enterprise('my.domain.com') e.saml_metadata('cid') m...
Python
0
8780243a88f505c06962247fdcc6e4bc4abb2912
add prototype at python
prototype.py
prototype.py
#!/usr/bin/env python import copy class Manager: def __init__(self): self.showcase = {} def register(self, name, obj): self.showcase[name] = obj def clone(self, name): return copy.deepcopy(self.showcase[name]) class MessageBox: def __init__(self, deco_char): self.de...
Python
0
c61452cb7358c3000992e593349158a0e24a5f51
Add migration
allseasons/convert/migrations/0004_message.py
allseasons/convert/migrations/0004_message.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-28 14:05 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('convert', '0003_auto_20170714_1421'), ] operations...
Python
0.000002
c68d2492b8dcc6fbd7fc91e784994ef9cf43db0f
Create LORA_Repeater_logger.py
LORA_Repeater/LORA_Repeater_logger.py
LORA_Repeater/LORA_Repeater_logger.py
from datetime import datetime NOME_FILE = "LORA_LOG.txt" import serial ser = serial.Serial('/dev/ttyACM0', 9600) while ser.inWaiting()!=0: trash = ser.readline() while(True): while ser.inWaiting()!=0: incoming = ser.readline().decode("utf-8") #print(incoming) parsed = str(incomin...
Python
0
399af52c20a5c490471f8e98c4c72aa6e99466df
fix a import typo
src/diamond/handler/mysql.py
src/diamond/handler/mysql.py
# coding=utf-8 """ Insert the collected values into a mysql table """ from Handler import Handler import MySQLdb class MySQLHandler(Handler): """ Implements the abstract Handler class, sending data to a mysql table """ conn = None def __init__(self, config=None): """ Create a ne...
# coding=utf-8 """ Insert the collected values into a mysql table """ from handler import Handler import MySQLdb class MySQLHandler(Handler): """ Implements the abstract Handler class, sending data to a mysql table """ conn = None def __init__(self, config=None): """ Create a ne...
Python
0.999997
1553863d25eb3053fdf558a290e2eb0a1fae28c0
Add debug tests.
tests/test_debug.py
tests/test_debug.py
#!/usr/bin/env python # Test Inform debug functions try: # python3 import builtins except ImportError: # python2 import __builtin__ as builtins # Imports {{{1 from inform import Inform, aaa, ddd, ppp, sss, vvv from textwrap import dedent # Test cases {{{1 def test_anglicize(capsys): In...
Python
0
60c10a781501b0a467b55a599d835bdc760c8891
Add test_utils
tests/test_utils.py
tests/test_utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_django-watchman ------------ Tests for `django-watchman` decorators module. """ from __future__ import unicode_literals import unittest from watchman.utils import get_checks class TestWatchman(unittest.TestCase): def setUp(self): pass def t...
Python
0.000006
52219c4d55c7b80b4a2185887675615c4d427298
Add is_sequence util function
lib/ansible/module_utils/common/collections.py
lib/ansible/module_utils/common/collections.py
# Copyright (c), Sviatoslav Sydorenko <ssydoren@redhat.com> 2018 # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) """Collection of low-level utility functions.""" from __future__ import absolute_import, division, print_function __metaclass__ = type from ..six...
Python
0.999999
973c2098eec88c9656fe858d4815bd7925d532f6
add Memento pattern
memento/Memento.py
memento/Memento.py
# # Python Design Patterns: Memento # Author: Jakub Vojvoda [github.com/JakubVojvoda] # 2016 # # Source code is licensed under MIT License # (for more details see LICENSE) # import sys # # Memento # stores internal state of the Originator object and protects # against access by objects other than the originator # cl...
Python
0.000001
cbbf4ec62bc8b8ed2c375e9e60939f932d2034e8
Create jogovelha.py
src/jogovelha.py
src/jogovelha.py
Python
0.000002
0e12011edc31f964db8ce419d2f64b6d525be641
Create delete_occurrences_of_an_element_if_it_occurs_more_than_n_times.py
delete_occurrences_of_an_element_if_it_occurs_more_than_n_times.py
delete_occurrences_of_an_element_if_it_occurs_more_than_n_times.py
#Kunal Gautam #Codewars : @Kunalpod #Problem name: Delete occurrences of an element if it occurs more than n times #Problem level: 6 kyu def delete_nth(order,max_e): i=0 while(i<len(order)): if order[:i].count(order[i])>=max_e: order.pop(i) else: i+=1 return order
Python
0.00002
06451bdb55faaa7fd22f7bac403d00dda0018c5d
Create setup.py
setup.py
setup.py
from distutils.core import setup from setuptools import find_packages setup( name="nhlscrapi", version=nhlscrapi.__version__, description='NHL Scrapr API for Python', author='Rob Howley', author_email='howley.robert@gmail.com', url='https://github.com/robhowley/nhlscrapi', ...
Python
0.000001
f1d277c58f80a352b3715c145ce55a4030a4ab6a
add setup.py
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup from setuptools import find_packages setup( name='Fake Zato', version='0.1.0', description='Fake Zato', author='Zetaops', author_email='aliriza@zetaops.io', url='https://github.com/zetaops/fake_zato', packages=find_packages(), )
Python
0.000001
a262aeda8b706848b33d30353a9f269daf3acb0d
Bump version
setup.py
setup.py
# Copyright (C) 2011-2012 Yaco Sistemas <lgs@yaco.es> # # 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 applicab...
# Copyright (C) 2011-2012 Yaco Sistemas <lgs@yaco.es> # # 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 applicab...
Python
0
9eacc3c3b81002c721cb24a1641583bf49bc3a53
bump version number
setup.py
setup.py
# setup.py inspired by the PyPA sample project: # https://github.com/pypa/sampleproject/blob/master/setup.py from setuptools import setup, find_packages from codecs import open # To use a consistent encoding from os import path def get_long_description(): here = path.abspath(path.dirname(__file__)) ...
# setup.py inspired by the PyPA sample project: # https://github.com/pypa/sampleproject/blob/master/setup.py from setuptools import setup, find_packages from codecs import open # To use a consistent encoding from os import path def get_long_description(): here = path.abspath(path.dirname(__file__)) ...
Python
0.000001
c99b5e564252aff55f14dd63c9cdef1728026561
Add setup.py
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import twid from setuptools import setup, find_packages setup( name = "twid", version = twid.__version__, description = "The relevant functions about Taiwan Identification Card system.", author = "Plenty Su", author_email = "plenty.su@gmail.com", ...
Python
0.000001
f16a21776eafc7fc373b9c43d5db74cea213c897
Create SoftwareCategory.py
SoftwareCategory.py
SoftwareCategory.py
from lxml import etree class SoftwareCategory: def __init__(self, parent, category, unlock, scan=False): self.software = category self.feature = unlock if not scan: self.create_software_category(parent, category, unlock) @classmethod def delete_category(cls, feature, s...
Python
0
c54bd0cf16891bbc8b82dd2cb2af1455795325a2
add setup.py
setup.py
setup.py
import os import sys from setuptools import setup exec(open('dsplice/version.py').read()) setup(name='dsplice', version=version, packages=['dsplice'], description='Docker image merge tool', author='Bradley Cicenas', author_email='bradley@vektor.nyc', url='https://github.com/bcicen/...
Python
0.000001
5d9ac40273f9dae541ffa20b8767ae289b743b95
Add loader calls in main
nose2/main.py
nose2/main.py
import os from nose2.compat import unittest from nose2 import loader, session class PluggableTestProgram(unittest.TestProgram): sessionClass = session.Session loaderClass = loader.PluggableTestLoader # XXX override __init__ to warn that testLoader and testRunner are ignored? def parseArgs(self, arg...
import os from nose2.compat import unittest from nose2 import loader, session class PluggableTestProgram(unittest.TestProgram): sessionClass = session.Session loaderClass = loader.PluggableTestLoader # XXX override __init__ to warn that testLoader and testRunner are ignored? def parseArgs(self, arg...
Python
0.000001
3f66dbc15cb0564b22d304e09ed3c0b673d59476
Add setup.py
setup.py
setup.py
from distutils.core import setup setup(name='fbmq', version='1.0.1', install_requires=['json', 'requests>=2.0'] )
Python
0.000001
a1f17cf4b56edf861c9b650ccd18049ecf168e03
Add setup.py
setup.py
setup.py
import os import re try: from setuptools import setup except ImportError: from distutils.core import setup PACKAGE_NAME = "humanizepy" HERE = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(HERE, "README.md")) as fp: README = fp.read() with open(os.path.join(HERE, PACKAGE_NAME, "__init_...
Python
0.000001