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
f26bdfa1ff0a388fb7bd2d473cf7b4b03fa61f6d
add unit test
doajtest/unit/event_consumers/test_application_publisher_revision_notify.py
doajtest/unit/event_consumers/test_application_publisher_revision_notify.py
from portality import models from portality import constants from portality.bll import exceptions from doajtest.helpers import DoajTestCase from doajtest.fixtures import ApplicationFixtureFactory import time from portality.events.consumers.application_publisher_revision_notify import ApplicationPublisherRevisionNotify...
Python
0.000001
d24e8c746359169058e9c0577c2f843695ca3b55
Add 2 instance with EBS test.
heat/tests/functional/test_WordPress_2_Instances_With_EBS.py
heat/tests/functional/test_WordPress_2_Instances_With_EBS.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicabl...
Python
0
7231f362ac121d7e61854369db6b27eb9ee66607
Add script that generates genome table entries
scripts/export/generate_genome_metadata.py
scripts/export/generate_genome_metadata.py
#!/usr/bin/python """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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 ...
Python
0.000001
f83b6091abd0102d6b81ff9191c3f8cb3258ae0b
Add OPAL sysfs tests.
testcases/OpalSysfsTests.py
testcases/OpalSysfsTests.py
#!/usr/bin/python2 # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2018 # [+] International Business Machines Corp. # # # 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...
Python
0
24c5248d578774d13d69b001fad8f50e2eac192a
Add tracepoint_variable_sized_types.py
scripts/tracepoint_variable_sized_types.py
scripts/tracepoint_variable_sized_types.py
# This script lists all the types in the kernel's tracepoint format files # which appear with more than one size. This script's output should be # compared to the code in TracepointFormatParser::adjust_integer_types() import glob field_types = {} for format_file in glob.iglob("/sys/kernel/debug/tracing/events/*/*/fo...
Python
0.000007
15cf70107d999c673a6bd6a4e026f04396ceb5f3
create basic and compatability test for nixio_fr
neo/test/iotest/test_nixio_fr.py
neo/test/iotest/test_nixio_fr.py
import numpy as np import unittest from neo.io.nixio_fr import NixIO as NixIOfr import quantities as pq from neo.io.nixio import NixIO class TestNixfr(unittest.TestCase): files_to_test = ['nixio_fr.nix'] def setUp(self): self.testfilename = 'nixio_fr.nix' self.reader_fr = NixIOfr(filename=se...
Python
0
673dac79cbab6de0be5650d46840a3bc9858b2b4
Add a help script to clear the test bucket
tests/clear_qiniu_bucket.py
tests/clear_qiniu_bucket.py
import os from qiniu import Auth, BucketManager QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.environ.get('QINIU_BUCKET_DOMAIN') def main(): auth = Auth(QINIU_ACCESS_KEY...
Python
0.000001
3e4111265f6bff0808a29c808a4dba93515cf371
Add changemap tests
tests/cli/test_changemap.py
tests/cli/test_changemap.py
""" Test ``yatsm changemap ...`` """ from click.testing import CliRunner import numpy as np from yatsm.cli.main import cli # flake8: ignore = E241 # TRUTH VALUES first_change_YYYYDOY = np.array([ [ -9999, -9999, 2003288, -9999, -9999], [ -9999, -9999, -9999, -9999, -9999], [ -9999, -99...
Python
0.000001
da7deee98bb8d6a92d2ab1b8ad5c3e550a24fc83
add `Config` class tests
tests/config/test_config.py
tests/config/test_config.py
# -*- coding: utf-8 -*- import os import tempfile import unittest from mock import patch from opoona.config import Config class TestInvalidSyntaxException(unittest.TestCase): @patch('os.path.expanduser') def test_init(self, expanduser): expanduser.return_value = 'HOME/.opoona.yaml' config = ...
Python
0.000016
ae92573d2c86fa1e83b636c17c443cc8f97f4040
Add unittest for ElementaryLine.
tests/elementary_line_test.py
tests/elementary_line_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test case for ElementaryLine. """ import unittest from catplot.ep_components.ep_lines import ElementaryLine class ElementaryLineTest(unittest.TestCase): def setUp(self): self.maxDiff = True def test_construction_and_query(self): """ Test w...
Python
0
6e11fca06415d45b77b2bce19700e5f920eceb7b
add search config helpers
invenio_search_ui/searchconfig.py
invenio_search_ui/searchconfig.py
# -*- coding: utf-8 -*- # # Copyright (C) 2022 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Search app configuration helper.""" from copy import deepcopy from flask import current_app class SearchOptionsSele...
Python
0
666d9c467806782827edac4b2c0c13d494e41250
Add a test for the status server
jobmon/test/test_status_server.py
jobmon/test/test_status_server.py
import os import select import socket import time import unittest from jobmon.protocol import * from jobmon import protocol, status_server, transport PORT = 9999 class StatusRecorder: def __init__(self): self.records = [] def process_start(self, job): self.records.append(('started', job)) ...
Python
0.000001
09ea74a9b3b3f518c67f719c3525b14058b528af
add files
declination.py
declination.py
# -*- coding: utf-8 -*- """ Created on Sun Jul 20 21:11:52 2014 @author: SB ############################################################################### This function gets the declination using webservices hosted by the National Oceanic and Atmospheric Administration (NOAA) Declination is a function...
Python
0.000002
27bfb211b4f10a6a61e53b613b9074e90f417321
create BST.py
BST.py
BST.py
class BinaryNode: def __init__(self ): self.data = None self.left = None self.right = None self.parent = None class Binarytree: def __init__(self,data=None): self.root = BinaryNode() self.root.data = data def search(self,k): return self.searchtree(se...
Python
0.000005
1a9f379ed121945a79eff5c2fdd468c98f0381d7
add Jeu.py
Jeu.py
Jeu.py
import pygame import sys from pygame.locals import * class Jeu: def Jeu(self): self.__score = 0 print('Jeu creer') def augmenter_Score(self): return 0 def recup_score(self): return 0 def score(self): return 0 def tableau_jeu(self): return 0 ...
Python
0.000001
63d7639f6c0e470575820be2b51444f34aa4bf2d
add flask app
app.py
app.py
import jinja2 from flask import Flask, jsonify, make_response from pdf_getter import main app = Flask(__name__) @app.route('/planning', methods=['GET']) def get_planning(): pdf_filename = main() if pdf_filename: binary_pdf = open("./planning.pdf", "rb") binary_pdf = binary_pdf.read() ...
Python
0.000003
dc6a1c07831ca90cfa3a8479a23cfa33af456d1f
Add main application
app.py
app.py
''' Agile Scrum Pokerbot for Slack Hosted on AWS Lambda. ''' import boto3 import logging from urlparse import parse_qs # Start Configuration SLACK_TOKEN = '<insert your Slack token>' IMAGE_LOCATION = '<insert your image path> (e.g. http://www.my-site.com/images/)' COMPOSITE_IMAGE = IMAGE_LOCATION + 'composite.png' V...
Python
0
ec78a2b7551838ab05dce6c2c93c8c42b76fc850
Add utility functions (1)
src/btc_utilities.py
src/btc_utilities.py
# Brain Tumor Classification # Script for Utility Functions # Author: Qixun Qu # Create on: 2017/10/11 # Modify on: 2017/10/11 # ,,, ,,, # ;" '; ;' ", # ; @.ss$$$$$$s.@ ; # `s$$$$$$$$$$$$$$$' # $$$$$$$$$$$$$$$$$$ # $$$$P""Y$$$Y""W$$$$$ # $$$$ p"$$$"q $$$$$ # $$$$ .$$$$$. $$$$' # ...
Python
0
1d8ff137f4792121bdf0cb52f719dbd5966dc87b
Add missing cct.py
cct.py
cct.py
# cct.py - calling context tree # # A Calling Context Tree (CCT) has a single root which contains multiple calls to Functions which # can themselves have other calls. from collections import defaultdict import json class Function(object): def __init__(self, name): self.calls = [] self.name = name...
Python
0.006097
800df7bcaa57e0935c0836f1f49de6407c55c212
add tests for clock exercise
day2/clock_test.py
day2/clock_test.py
import unittest import clock class ClockTest(unittest.TestCase): def test_on_the_hour(self): self.assertEqual("08:00", Clock.at(8).__str__() ) self.assertEqual("09:00", Clock.at(9).__str__() ) def test_past_the_hour(self): self.assertEqual("11:09", Clock.at(11, 9).__str__() ) def test_add_a_few_mi...
Python
0.000001
659af8d29ec1839217c74522d8fa5bcf61e48451
FIX category
l10n_it_CEE_balance/__openerp__.py
l10n_it_CEE_balance/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Italian OpenERP Community (<http://www.openerp-italia.com>) # # This program is free software: you can redistrib...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Italian OpenERP Community (<http://www.openerp-italia.com>) # # This program is free software: you can redistrib...
Python
0.000001
e920d0dc413dacd2b1084c2cdcacb4bae3bc3d8b
Create problem10.py
W2/L4/problem10.py
W2/L4/problem10.py
#L4 PROBLEM 10 def isVowel(char): if char == 'a' or char == 'e' or char == 'i' or char == 'o' or char == 'u' or char == 'A' or char == 'E' or char == 'I' or char == 'O' or char == 'U': return True else: return False
Python
0.000029
799599e1b841db8c9eff9de4cdf7dbc5cb396c37
Create dml.py
dml.py
dml.py
dml
Python
0.000003
349e63385ea71d1a69e094aeee1268c44e951b53
Update code funny
Strings/funny-string.py
Strings/funny-string.py
# Funny String # Developer: Murillo Grubler # Link: https://www.hackerrank.com/challenges/funny-string/problem import string # ca - xz # xc - cx # zx - ac #acxz - 3 #acxza def funnyString(s): str_inverted = s[::-1] for i in range(len(s) - 1): print(s[i]) return "" q = int(input().strip()) for ...
Python
0.000001
4091fbf0051d022730b11da6d6786a25c38a6dd3
Add a simple audio recorder. Note that this would normally not work on a raspberry pi as it has no audio in. You'll have to add an usb microphone for this to work.
src/util/audiorecorder.py
src/util/audiorecorder.py
# simple audio recorder... source: http://stackoverflow.com/questions/892199/detect-record-audio-in-python # you need pyaudio, install with python -m pip install pyaudio from sys import byteorder from array import array from struct import pack import pyaudio import wave THRESHOLD = 500 CHUNK_SIZE = 1024 FORMAT = py...
Python
0
45b0e958aa377afed2c62bf1e6f7c4933ccde39b
Add a test for main
test/test_main.py
test/test_main.py
from git_lang_guesser import main from git_lang_guesser import git_requester LANGUAGE = "language" test_username = "TestUser" example_data = [ {LANGUAGE: "HTML"}, {LANGUAGE: "Java"}, {LANGUAGE: "Python"}, {LANGUAGE: "Python"}, {LANGUAGE: "C"}, ] expected_count = { "HTML": 1, "Java": 1, ...
Python
0
2dc94daed7c0475e84f829d48d97afc63f2e803d
add type_vec4 test
test/type_vec4.py
test/type_vec4.py
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2014 mack stone # # 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 limitation the righ...
Python
0.000001
c80a015151fb6648aa34e7b79cd29f4cd2c97560
add a example
test_disco_job.py
test_disco_job.py
from DiscoJob import DiscoJob import logging config = { "split_size": 1, #MB "input_uri": "mongodb://localhost/test.modforty", "create_input_splits": True, "split_key": {'_id' : 1}, "output_uri":"mongodb://localhost/test.out", #"job_output_key":"I am the key", ...
Python
0.000425
8f38091605db7c54d1d6a5701469ee17b4f893e8
Create domap.py
domap.py
domap.py
#!/usr/bin/env python #Licence LGPL v2.1 #https://github.com/minetest/minetest/blob/944ffe9e532a3b2be686ef28c33313148760b1c9/doc/mapformat.txt #http://www.tutorialspoint.com/sqlite/sqlite_bitwise_operators.htm #http://stackoverflow.com/questions/1294619/does-sqlite-support-any-kind-of-ifcondition-statement-in-a-select...
Python
0
ee78590d2a6f0a509b08bf1b59b3f27560375524
add conftest
tests/conftest.py
tests/conftest.py
from __future__ import print_function import numpy as np def pytest_runtest_setup(item): seed = np.random.randint(1000) print("Seed used in np.random.seed(): %d" % seed) np.random.seed(seed)
Python
0.000001
e8853997b7ba28da48e1620fd1466fbe8ca1d0c0
Add setup.py
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup from pyarrfs import pyarrfs ver = pyarrfs.__version__ long_desc = open("README").read() short_desc = long_desc.split('\n')[0].split(' - ')[1].strip() setup( name = 'pyarrfs', version = pyarrfs.__version__, description = short_desc, long_descript...
Python
0
b0ada080d8c8890152a57168e6b7b449a5588f10
Add setup.py for PyPI
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='clocktower', version='0.1.0', author='Kyle Conroy', author_email='kyle@twilio.com', url='https://github.com/derferman/clocktower', description='Download websites from Wayback Machine', install_requires=['lxml'], ...
Python
0.000001
9c6ba2717fb71755d31d8c7b7066730171be8b20
bump version, add missing dependency - Django
setup.py
setup.py
import os from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.md')) readme = f.read() f.close() setup( name='django-ajaximage', version='0.1.16-rohanza', description='Add ajax image upload functionality with a progress bar to file input fields within Django admin. Images ...
import os from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.md')) readme = f.read() f.close() setup( name='django-ajaximage', version='0.1.16', description='Add ajax image upload functionality with a progress bar to file input fields within Django admin. Images are opti...
Python
0
fac7c76ea056179653574dffd297f927f76daa42
add setuptools routine
setup.py
setup.py
import os from setuptools import setup setup( name = "opti_ssr", version = "0.0.4", py_modules=['opti_ssr', 'ssr_network', 'opti_network'], author = "Felix Immohr, Fiete Winter", author_email = "test@te.st, fiete.winter@gmail.com", description = ("Using the OptiTrack system for different applic...
Python
0
230cae4f6cce8e064b5b74f87ec09181e41f57c2
Add MDR setup file
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages def calculate_version(): initpy = open('mdr/_version.py').read().split('\n') version = list(filter(lambda x: '__version__' in x, initpy))[0].split('\'')[1] return version package_version = calculate_version() setup(...
Python
0
612517b15a40af29fa57d3a5507ba778ff32fa51
Add setup.py
setup.py
setup.py
from setuptools import setup setup(name='pattern_finder_gpu', version='1.0', description='Brute force OpenCL based pattern localization in images that supports masking and weighting.', url='https://github.com/HearSys/pattern_finder_gpu', author='Samuel John (HörSys GmbH)', author_email='j...
Python
0.000001
380fb1e3b5b8fbde868f7fffbe0a6f22fc037e55
Remove download_url from setup.py
setup.py
setup.py
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import ah_bootstrap import pkg_resources from setuptools import setup from astropy_helpers.setup_helpers import register_commands, get_package_info from astropy_helpers.version_helpers import generate_version_py NAME = 'astropy_help...
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import ah_bootstrap import pkg_resources from setuptools import setup from astropy_helpers.setup_helpers import register_commands, get_package_info from astropy_helpers.version_helpers import generate_version_py NAME = 'astropy_help...
Python
0
a9f0d310e967bea276f01cd558f48fc102ea24fc
add setup file for installation as module
setup.py
setup.py
from setuptools import setup setup(name='minedatabase', version='0.1', description='Metabolic In silico Network Expansions', url='http://github.com/JamesJeffryes/mine-database', author='James Jeffryes', author_email='jamesgjeffryes@gmail.com', license='MIT', packages=['minedat...
Python
0
77700d265fbf3fafa21b335585b8060a0b025143
add setup.py
setup.py
setup.py
# Copyright 2010 Gregory Szorc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
Python
0.000001
092bf8bc2e558420ca51384a3dd1019ab1115ad2
Fix conditional dependencies when using wheels
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup from djangocms_link import __version__ CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: B...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup from djangocms_link import __version__ INSTALL_REQUIRES = [ #'Django-Select2', ] CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience ::...
Python
0.000266
a9e2e225e083575c66c33986db06b496c1596449
Create setup.py
setup.py
setup.py
from setuptools import setup, find_packages setup( name='wwsync', version='1.0', author='Matt Bachmann', url='https://github.com/Bachmann1234/weight-watchers-sync', description='Syncs Weight Watcher food log to Fitbit', license='MIT', packages=find_packages(), install_requires=['requests==2.9.1...
Python
0.000001
265e1b6177552e13f332b1f39885433789f27d94
add setup.py
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup import re with open('jook/__init__.py', 'r') as fobj: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fobj.read(), re.MULTILINE).group(1) with open('README.rst', 'r') as fobj: long_description = fobj.read() setup( ...
Python
0.000001
90faa98cf8d0a11e8cfd1ff1b91b505a43f956c5
Add setup.py
setup.py
setup.py
"""Module to prepare you python environment.""" import importlib def run_package(package): """Try to run the package just installed.""" try: globals()[package] = importlib.import_module(package) print("================================") except Exception: print("We can't install {}"...
Python
0.000001
1bf649207f850b21e99eb6a9479ecdb1cb03a93d
Update version to 0.7.1
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup install_requires = ['Django>=1.5'] try: from collections import OrderedDict except ImportError: install_requires.append('ordereddict>=1.1') setup( name='django-auth-policy', version='0.7.1', description='Enforces a couple of common authenticati...
#!/usr/bin/env python from setuptools import setup install_requires = ['Django>=1.5'] try: from collections import OrderedDict except ImportError: install_requires.append('ordereddict>=1.1') setup( name='django-auth-policy', version='0.7', description='Enforces a couple of common authentication...
Python
0.000001
b37b2976398f52032379c916714e4b6360614e78
create packaging file
setup.py
setup.py
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() with open('README.rst') as f: readme = f.read() with open('LICENSE') as f: lice...
Python
0.000001
18688b67e2dfc36ff6b1c28a618a289f46cc494d
Add Slide class
slide.py
slide.py
class Slide: """ Stores data to be studied. """ def __init__(self, prompt, answer): self.prompt = prompt self.answer = answer
Python
0
b418ff779c79afd0eca85ed1479ba633f25ce73c
Fix variable referenced before assginment in vmwareapi code.
nova/tests/test_vmwareapi_vm_util.py
nova/tests/test_vmwareapi_vm_util.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Canonical Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.or...
Python
0.000001
c3f1e723e13598deb53a8454787204f00841c34a
Add extension method type
numba/typesystem/exttypes/methods.py
numba/typesystem/exttypes/methods.py
from numba.typesystem import * #------------------------------------------------------------------------ # Extension Method Types #------------------------------------------------------------------------ class ExtMethodType(NumbaType, minitypes.FunctionType): """ Extension method type, a FunctionType plus t...
Python
0.000001
b41206dd44948a4a99f0f3fabb3ffc04f0d781a1
Create spatial_pooler_compute_test.py
packages/spatial_pooler/tests/spatial_pooler_compute_test.py
packages/spatial_pooler/tests/spatial_pooler_compute_test.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2022, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
Python
0.000127
7162926576b6136c17a4f1d889d7ecd2541a763c
Add examples_plot_features.py
examples/plot_features.py
examples/plot_features.py
#!/usr/bin/env python # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fo...
Python
0
ebceea82af38e4c7f11678841bfbce3635a66f7d
Add twitter_parser.py
newsman/scraper/twitter_parser.py
newsman/scraper/twitter_parser.py
#!/usr/bin/env python #-*- coding: utf-8 -*- """ Twitter parser parses specific twitter account in real time """ # @author chengdujin # @contact chengdujin@gmail.com # @created Nov. 19, 2013 import sys reload(sys) sys.setdefaultencoding('UTF-8') import twitter import urllib2 access_token_key = "24129666-M47Q6p...
Python
0.00285
3912e9ab49e10f2490da36b17e8525d2c97c1844
add fabric
fabfile.py
fabfile.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from fabric.api import run, env, cd # the user to use for the remote commands env.user = 'answeror' # the servers where the commands are executed env.hosts = ['aip.io'] def deploy(): run('pyenv virtualenvwrapper') run('workon aip') with cd('/www/aip/repo'...
Python
0.000001
643b4867627feb2810257f99b0b7865b43bb6454
Add fabfile to deploy documentation
fabfile.py
fabfile.py
# -*- coding: utf-8 -*- """ fabfile Fab file to build and push documentation to github :copyright: © 2013-2014 by Openlabs Technologies & Consulting (P) Limited :license: BSD, see LICENSE for more details. """ import time import getpass import os from fabric.api import ( local, lcd, cd, sudo, exe...
Python
0.000005
b63f6a83f86808df0a2fea66b47478e3c5ec0994
Create neymanPearson2.py
scripts/neymanPearson2.py
scripts/neymanPearson2.py
# Convert Neyman-Pearson testing paradigm(Fig 5.15 (a)) to python/JAX # Author: Garvit9000c import jax.scipy.stats.multivariate_normal as gaussprob import jax.numpy as jnp import matplotlib.pyplot as plt #constants pi=jnp.pi sigma=1.5 xmin = -4 xmax = 8 ymin = 0 ymax = 0.3 res = 0.01 #Domain x=jnp.arange(xmin,xmax,r...
Python
0.999614
e7a41ed29f6ec097e19f4c9beec9821a2804585c
Add organizations.py
octokit/resources/organizations.py
octokit/resources/organizations.py
# encoding: utf-8 """Methods for the Organizations API http://developer.github.com/v3/orgs/ """
Python
0.000002
337c48648f3a891642fc58c7161fdb48e705160f
add timer
timer.py
timer.py
# Copyright (c) 2015, Bartlomiej Puget <larhard@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this...
Python
0.000008
cbde3323e790717fa593d75ca282e2875bb67dca
Add stacker ecs hook
stacker/hooks/ecs.py
stacker/hooks/ecs.py
# A lot of this code exists to deal w/ the broken ECS connect_to_region # function, and will be removed once this pull request is accepted: # https://github.com/boto/boto/pull/3143 import logging logger = logging.getLogger(__name__) from boto.regioninfo import get_regions from boto.ec2containerservice.layer1 import...
Python
0
421b99ffb0cf84a8ccea0c4c0fe2496f895603a0
Add migration
bluebottle/initiatives/migrations/0011_auto_20190522_0931.py
bluebottle/initiatives/migrations/0011_auto_20190522_0931.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2019-05-22 07:31 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('initiatives', '0010_auto_20190521_0954'), ] operations = [ migrations.RemoveField(...
Python
0.000002
51e516f260858e699ee828ac6fc91af39c67254c
Add script for automatically updating schemas
update-schemas.py
update-schemas.py
#!/usr/bin/env python import os import re import sys import subprocess as sp def get_schemas(pattern): cmd = ['git', 'grep', '--name-only'] output = sp.check_output(cmd + [pattern, '--', 'schemas']).decode('utf8') names = output.split() print(names) dedupe = dict() for name in names: ...
Python
0
eb07819cfaf6c854ca3c37f14f9be7de5194f77f
create the Spider for Estonia of McDonalds
locations/spiders/mcdonalds_et.py
locations/spiders/mcdonalds_et.py
# -*- coding: utf-8 -*- import scrapy import re import json from locations.items import GeojsonPointItem class McDonaldsETSpider(scrapy.Spider): name = "mcdonalds_et" allowed_domains = ["www.mcdonalds.ee"] start_urls = ( 'http://www.mcdonalds.ee/et/restoranid', ) def normalize_time(self,...
Python
0.000001
7e8ffcef7111fc3cd2f1d58831afb09741d9d8fc
Create my-calendar-i.py
Python/my-calendar-i.py
Python/my-calendar-i.py
# Time: O(n^2) # Space: O(n) # Implement a MyCalendar class to store your events. # A new event can be added if adding the event will not cause a double booking. # # Your class will have the method, book(int start, int end). # Formally, this represents a booking on the half open interval [start, end), # the range of ...
Python
0.000177
e1993d4d3c3199dce2be2b475a9236e95732a0f0
Verify computer executing the script is of OS X 10.6.1 or higher type
dodge.py
dodge.py
import platform class OSXDodger(object): allowed_version = "10.12.1" def __init__(self, applications_dir): self.app_dir = applications_dir def load_applications(self): """ Read all applications in the `/Applications/` dir """ pass def select_applications(self...
Python
0.000035
74d587303a6bb6aad3274cbbdd3e043b1be76877
Add wham.py from dynamiq2 r198
openpathsampling/analysis/wham.py
openpathsampling/analysis/wham.py
#!/usr/bin/env python # wham.py # The Weighted Histogram Analysis Method (WHAM) for combining histograms # from several files. import math class WHAM(object): def __init__(self): # default values self.tol = 1e-10 # tolerance for convergence self.max_iter = 1000000 # maximum number...
Python
0.000002
e965147ef7bc89e6c8885d1521d92305604de6f8
add problem
others/find_array_index_of_sum.py
others/find_array_index_of_sum.py
""" 题目:给定一个整数数组和一个整数,返回两个数组的索引,这两个索引指向的数字的加和等于指定的整数。需要最优的算法,分析算法的空间和时间复杂度 """ if __name__ == "__main__": numbers = [1,2,3,4,5,6,7,8,9] n = 10 index_map = {} supplment_map = {} index = 0 for i in numbers: index_map[i] = index supplment_map[i] = n - i index = index + 1 ...
Python
0.044376
ef8b909beb4de8435c20ed0b45bca9478d476ed8
Add python script to get coordinates from the csv
geocode.py
geocode.py
#! /bin/python3 import csv import time from geopy.geocoders.googlev3 import GoogleV3 geocoder = GoogleV3(api_key="AIzaSyAy6XiyZG-6u99q-qacOz-dtT9ILbYzb-4") with open("../ReadingBusesOrig.csv") as cf: with open("../out.csv", "a") as cw: reader = csv.DictReader(cf) writer = csv.DictWriter(cw, ["lati...
Python
0.000001
bb928a0c0a4ddc11b05771e9eaa33f1058cc022a
Add pageset for ugamsolutions.com
tools/skp/page_sets/skia_ugamsolutions_desktop.py
tools/skp/page_sets/skia_ugamsolutions_desktop.py
# Copyright 2014 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. # pylint: disable=W0401,W0614 from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class SkiaBuildbotDesk...
Python
0
68e5bdc3c3a8a59f820ea15e706e85e14f2a654b
Add mgmt cmd to fix bad loc-type references
corehq/apps/locations/management/commands/fix_loc_type_reference.py
corehq/apps/locations/management/commands/fix_loc_type_reference.py
from optparse import make_option from django.core.management.base import BaseCommand from corehq.apps.locations.models import SQLLocation, LocationType class Command(BaseCommand): help = "Make " option_list = ( make_option('--dry_run', action='store_true', dest='dry_run', ...
Python
0
0ca7ec8da8fffbfe057038e832bb12a33384c07b
add date format to date column in ctable mapping
custom/apps/gsid/ctable_mappings.py
custom/apps/gsid/ctable_mappings.py
from ctable.fixtures import CtableMappingFixture from ctable.models import ColumnDef, KeyMatcher class PatientSummaryMapping(CtableMappingFixture): name = 'patient_summary' domains = ['gsid'] couch_view = 'gsid/patient_summary' schedule_active = True @property def columns(self): colum...
from ctable.fixtures import CtableMappingFixture from ctable.models import ColumnDef, KeyMatcher class PatientSummaryMapping(CtableMappingFixture): name = 'patient_summary' domains = ['gsid'] couch_view = 'gsid/patient_summary' schedule_active = True @property def columns(self): colum...
Python
0.000001
5d6dabcad4f2467f07765f1e28752b5cbba61d53
add xfailing test for #693
test/util/test_options.py
test/util/test_options.py
from __future__ import absolute_import, division, print_function import os import pytest from dials.util.options import OptionParser from dials.util.options import flatten_datablocks pytestmark = pytest.mark.skipif( not os.access('/dls/i04/data/2019/cm23004-1/20190109/Eiger', os.R_OK), reason='Test images not av...
Python
0
32471e9abff0d11b001ad0024a8f917e9ddadd60
Test for commandline.py
tests/commandline_test.py
tests/commandline_test.py
#!/usr/bin/env python # encoding: utf-8 import os import time from unittest import TestCase, main from gi import require_version require_version('Gtk', '3.0') from gi.repository import Gtk import vimiv.main as v_main from vimiv.parser import parse_config def refresh_gui(delay=0): time.sleep(delay) while Gtk.e...
Python
0.000001
00bba22c2fb62b378efb40d86ff633881c55991d
Add tests
tests/test_commit_view.py
tests/test_commit_view.py
import os from textwrap import dedent import sublime from unittesting import DeferrableTestCase from GitSavvy.tests.mockito import unstub, when from GitSavvy.tests.parameterized import parameterized as p from GitSavvy.core.commands.commit import extract_commit_message, GsCommitCommand examples = [ ( de...
Python
0.000001
c972873f6fd1c85776101ecca16fa8ae48c48c14
Fix movie_queue unit test again
tests/test_movie_queue.py
tests/test_movie_queue.py
from flexget.plugins.filter.movie_queue import queue_add, queue_get from tests import FlexGetBase class TestMovieQueue(FlexGetBase): __yaml__ = """ templates: global: mock: - {title: 'MovieInQueue', imdb_id: 'tt1931533', tmdb_id: 603, movie_name: MovieInQueue} ...
from flexget.plugins.filter.movie_queue import queue_add, queue_get from tests import FlexGetBase class TestMovieQueue(FlexGetBase): __yaml__ = """ templates: global: mock: - {title: 'MovieInQueue', imdb_id: 'tt1931533', tmdb_id: 603, movie_name: MovieInQueue} ...
Python
0.000006
d1eac6f370f4a06151870be25cb362370d9ec53d
Add salt/utils/cli.py
salt/utils/cli.py
salt/utils/cli.py
# -*- coding: utf-8 -*- ''' Functions used for CLI argument handling ''' # Import python libs import re import yaml # Import salt libs from salt._compat import string_types, integer_types #KWARG_REGEX = re.compile(r'^([^\d\W][\w-]*)=(?!=)(.*)$', re.UNICODE) # python 3 KWARG_REGEX = re.compile(r'^([^\d\W][\w-]*)=(?!...
Python
0
13e6f6967298173d4979c1bc4eb9d7ec6b1f9354
add a wrapper, not finished yet
gpudb.py
gpudb.py
#! /usr/bin/python import sys import os import shutil def dbHelp(): print "Command:" print "\tcreate DBName: create the database" print "\tdelete DBName: delete the database" print "\tlist: list the table infomation in the database" print "\ttranslate SQL: translate SQL into CUDA file" print "...
Python
0
3a14fa67e4d35fa2865d20e08c03272cff7fcd4e
test wechat post
hello.py
hello.py
from flask import Flask, request app = Flask(__name__) @app.route('/') def index(): return '<h1>Hello World!</h1>' @app.route('/kindle_push', methods=['POST']) def kindle_push(): print(request.data) return 'success' if __name__ == '__main__': app.run(debug=True)
Python
0
2d0950df803d45c486cbf87d49ff055b818d4999
Create cvrfile.py
cvrminer/cvrfile.py
cvrminer/cvrfile.py
"""CVR miner. Handles JSONL files from CVR in Erhvervsstyrelsen with information about companies, places and participants. Command-line usage ------------------ $ python -m cvrminer.cvrfile JSON file structure ------------------- _id : ID of some form _index : _source : Actual data _type: 'virksomhed', 'prod...
Python
0.000002
ffdcc9d523daa5a610de1534f3ed10f4d629aaf2
add 'inspect' filter
filter_plugins/inspect.py
filter_plugins/inspect.py
class FilterModule(object): ''' A comment ''' def filters(self): return { 'inspect': self.inspect, } def inspect(self, input_value, verbose=None): if (type(input_value) is list) and verbose: return "[{}]".format(",".join([str(type(i)) for i in input_value]))...
Python
0.000026
737936b91a4a908a02338373b716161f487e44c9
add factories
skrill/tests/factories.py
skrill/tests/factories.py
from decimal import Decimal import random from django.contrib.auth.models import User import factory from skrill.models import PaymentRequest from skrill.settings import ISO4217 class UserFactory(factory.Factory): FACTORY_FOR = User username = factory.Sequence(lambda n: "Test User %s" % n) class Payment...
Python
0.998819
5b54313e08ddf7176583f4776c804a482b111de1
add test
mysqlutil/test/test_privileges.py
mysqlutil/test/test_privileges.py
#!/usr/bin/env python # coding: utf-8 import logging import unittest from pykit import mysqlutil from pykit import ututil dd = ututil.dd logger = logging.getLogger(__name__) class TestPrivileges(unittest.TestCase): def test_load_dump(self): ks = ( "ALL", "ALTER", "...
Python
0.000009
fa72e740e7e0b0f48d2be823d657136c40524c61
add complete layer3 neural network
neuralNetwork/layer3/nerualNet.py
neuralNetwork/layer3/nerualNet.py
# coding:utf-8 import time import matplotlib.pyplot as plt import numpy as np import sklearn import sklearn.datasets import sklearn.linear_model import matplotlib matplotlib.rcParams['figure.figsize'] = (10.0, 8.0) np.random.seed(0) X, y = sklearn.datasets.make_moons(200, noise=0.20) plt.scatter(X[:,0], X[:,1], s=40...
Python
0.003827
860580119cc6ae9241e866275eccc7d71ae95e8c
Build fis assets on deploy updated.
fapistrano/plugins/fis.py
fapistrano/plugins/fis.py
# -*- coding: utf-8 -*- from fabric.api import show, run, env, cd from .. import signal def init(): signal.register('deploy.updated', build_fis_assets) def build_fis_assets(): with show('output'): run(''' fis release --file %(releases_path)s/%(new_release)s/%(fis_conf)s \ --dest %(...
Python
0
3eb6d5eba963c7f30011ec330e9465f1670c5e95
build courses and notes out of OCW scraped JSON, except FP won't get the mimetype right
karmaworld/apps/notes/management/commands/import_ocw_json.py
karmaworld/apps/notes/management/commands/import_ocw_json.py
#!/usr/bin/env python # -*- coding:utf8 -*- # Copyright (C) 2012 FinalsClub Foundation import json import os.path import requests from apps.notes.models import Note from apps.notes.gdrive import convert_raw_document from apps.courses.models import Course from apps.courses.models import School from apps.licenses.mode...
Python
0
471f5738e82fbb57c1028bdf2f1556edb0b074ed
Rename concurrent log handler
src/diamond/logging/handlers/concurrentloghandler.py
src/diamond/logging/handlers/concurrentloghandler.py
# coding=utf-8 from concurrent_log_handler import ConcurrentRotatingFileHandler as CRFH import sys class ConcurrentRotatingFileHandler(TRFH): def flush(self): try: super(ConcurrentRotatingFileHandler, self).flush() except IOError: sys.stderr.write('ConcurrentRotatingFileH...
Python
0.000006
24b2f67b80320d1f215c6465ea0092b7b01caa04
Add copyright notice and documentation to .bzl file.
grpc.bzl
grpc.bzl
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
def _lower_underscore_to_upper_camel(str): humps = [] for hump in str.split('_'): humps += [hump[0].upper() + hump[1:]] return "".join(humps) def _file_to_upper_camel(src): elements = src.rpartition('/') upper_camel = _lower_underscore_to_upper_camel(elements[-1]) return "".join(elements[:-1] + [upper...
Python
0
910fb34ec6ef8544d4de5d8baf52fbd1c2c48027
Create Hello World Example
hello.py
hello.py
from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return '<h1>Hello 391 team!<h1>' if __name__ == '__main__': app.run()
Python
0.000077
1290fc572bfc862ab7c8ee579257e00486a3c921
add a really tiny wsgi
hrf.wsgi
hrf.wsgi
from hrf.hrf import app as application
Python
0.000175
44a4957b0317b2b9fabbab6d2c0356f1a847ef69
Create mimic.py
mimic.py
mimic.py
''' Author: w4nderlust License: MIT ''' from collections import defaultdict, Counter from random import random import codecs from optparse import OptionParser import cPickle as pickle import os import operator class Model(object): def __init__(self, lm, order): self.lm = lm self.or...
Python
0.000002
a4200e281279370f1ef6b4527c5340cec9c729b4
add lexer for Elm language
pygments/lexers/elm.py
pygments/lexers/elm.py
# -*- coding: utf-8 -*- """ pygments.lexers.elm ~~~~~~~~~~~~~~~~~~~ Lexer for the Elm programming language. """ import re from pygments.lexer import bygroups, RegexLexer, words, include, using from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, String, Text, Error __all__ ...
Python
0
c242589075aa4fc9af0a17461f235348b53284a1
Add sample code decorator
decorator/cli-sample-decorator.py
decorator/cli-sample-decorator.py
#!/usr/bin/env python class Deco(object): def __init__(self, func): self.func = func def __call__(self, *args, **kwargs): result = self.func(*args, **kwargs) # multiple it by itself result = result * result return result @Deco def process(x=0, y=0): return x+y pr...
Python
0
bf6cfcaa1ac20c1cb65d2d803f64f35026c099f3
Add Event class as well as connect and fire methods.
event.py
event.py
class Event: def __init__(self): self.listeners = [] def connect(self, listener): self.listeners.append(listener) def fire(self, *args, **kwargs): for listener in self.listeners: listener(*args, **kwargs)
Python
0
8d38a72548f3bfc62bac9f49d537fa2cdee7a6df
Add vanilla sequential face detection example.
face1.py
face1.py
"""Sequential, vanilla face detection.""" import datetime import sys import cv2 import numpy as np import util import cascade DEVICE = int(sys.argv[1]) WIDTH = int(sys.argv[2]) HEIGHT = int(sys.argv[3]) DURATION = float(sys.argv[4]) # In seconds. # Create the OpenCV video capture object. cap = cv2.VideoCapt...
Python
0
78ce22e302d749e56352e6ec8f592dca4e2287f6
Add IATISerializer
akvo/api/serializers.py
akvo/api/serializers.py
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from lxml import etree import os from ...
Python
0
6cbd414a670e4b25e8e1e8df9c0e32bee541478c
Create ember.py
ember.py
ember.py
from django import template register = template.Library() @register.tag(name='linkto') def do_linkto(parser, token): nodelist = parser.parse(('endlinkto',)) args = token.split_contents()[1:] if not args: raise template.TemplateSyntaxError("{0} tag requires at least one argument".format(token.cont...
Python
0.000002
6d80c414944bfdd6632b6068d98805a6f67353fb
add test script for interfaces
_examples/iface/test.py
_examples/iface/test.py
# Copyright 2015 The go-python Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. ## py2/py3 compat from __future__ import print_function import iface ### test docs print("doc(iface): %r" % (iface.__doc__,)) print("t = iface.T()") t =...
Python
0.000002
bb4f81f86d5b7bc5869da9f29cc5ea6013d4b4cf
Add plot speed analysis
analysis/plot_speeds.py
analysis/plot_speeds.py
"""Plots the speed readings.""" #from dateutil import parser as dateparser from matplotlib import pyplot import collections import datetime import json import sys def main(): """Main function.""" if sys.version_info.major <= 2: print('Please use Python 3') sys.exit(1) if len(sys.argv) !=...
Python
0.000002
d19899981a77faa9c2017b6991c8e0c4ca4b7b97
Create db_migrate.py
fade/db_migrate.py
fade/db_migrate.py
#!flask/bin/python """ See LICENSE.txt file for copyright and license details. """ import imp from migrate.versioning import api from app import db from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) migration =...
Python
0.000003
1646916ce204b51a2900fd9edd4626e145f0d873
Create objects_impl.py
CoreConceptsPy/objects_impl.py
CoreConceptsPy/objects_impl.py
from coreconcepts import AObjects from osgeo import gdal, gdal_array import ogr, os, osr from gdalconst import * import numpy as np class ArcShpObjects(AObjects): @staticmethod def getBounds (obj): #Get geometery geom = obj.GetGeometryRef() env = geom.GetEnvelope() #Return boun...
Python
0.000048
fa1e8f21347d41712b03817e4fac5a07a1a991eb
Add `btheadphone.py` to find headphones' BTADDR
bin/btheadphone.py
bin/btheadphone.py
#!/usr/bin/env python import dbus from xml.etree import ElementTree bluez_bus = 'org.bluez' bluez_root = '/org/bluez' intro_iface = 'org.freedesktop.DBus.Introspectable' props_iface = 'org.freedesktop.DBus.Properties' dev_iface = 'org.bluez.Device1' a2dp_uuid = '0000110d-0000-1000-8000-00805f9b34fb' avrcp_uuid = '00...
Python
0
80efa877c1702b6ebb7845a28b21ff564b769fb4
add greader module
greader.py
greader.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import logging import urllib2 from urllib import urlencode as url_encode from urllib import quote as url_quote import re import json AUTH_URL = 'https://www.google.com/accounts/ClientLogin' SUBSCRIPTIONS_LIST_URL = 'http://www.google.com/reader/api/0/subscription/list'...
Python
0
e7b5f2a91cbf55666e29ec6ac4775e8cee1cc574
Add ob_atom class
maxwellbloch/ob_atom.py
maxwellbloch/ob_atom.py
# -*- coding: utf-8 -*- import json from maxwellbloch import ob_base class OBAtom(ob_base.OBBase): def __init__(self, num_states=0, energies=[], decays=[], fields=[]): self.num_states = num_states self.energies = energies self.decays = decays self.build_fields(fields) def ...
Python
0.9994