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
92138e7ab37e6a69eb3808f9888b52b9e38deaa0
remove duplicate classifier
setup.py
setup.py
from distutils.core import setup from require import __version__ version_str = ".".join(str(n) for n in __version__) setup( name = "django-require", version = version_str, license = "BSD", description = "A Django staticfiles post-processor for optimizing with RequireJS.", author = "Dave Hall", ...
from distutils.core import setup from require import __version__ version_str = ".".join(str(n) for n in __version__) setup( name = "django-require", version = version_str, license = "BSD", description = "A Django staticfiles post-processor for optimizing with RequireJS.", author = "Dave Hall", ...
Python
0.999991
ac94d2cf9b4ab775fb7a125a83abc4fa59d56136
Add setuptools build
setup.py
setup.py
from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md')) as f: long_description = f.read() setup( name='pyshadowcopy', version='0.0.1', description='Python class to work with Shadow Copy on Windows', long_de...
Python
0
edcf0e371ea3430c7d0c515dbf59e39e3522c076
Add license information to setup.py
setup.py
setup.py
from distutils.core import setup import loginurl setup(name='django-loginurl', version=loginurl.__version__, description='Allowing an anonymous user to log in by only visiting a URL', author='Fajran Iman Rusadi', author_email='fajran@gmail.com', url='http://github.com/fajran/django-login...
from distutils.core import setup import loginurl setup(name='django-loginurl', version=loginurl.__version__, description='Allowing an anonymous user to log in by only visiting a URL', author='Fajran Iman Rusadi', author_email='fajran@gmail.com', url='http://github.com/fajran/django-login...
Python
0
ef53ea9d1754ce5056b7b872ad0b7cd99e4af2bc
Add setup file
setup.py
setup.py
# -*- coding: utf-8 -*- import re from distutils.core import setup version = re.search( '^__version__\s*=\*"(.*)"', open('bundigo/bundigo.py').read(), re.M ).group(1) with open('README.md', 'rb') as f: long_descr = f.read().decode('utf-8') setup( name = 'bundigo', packages = ['bundig...
Python
0.000001
d9b844db2dc0453c073050c6ce7db18c3d48b57c
add setup.py file
setup.py
setup.py
import setuptools setuptools.setup( install_requires=['pyyaml'], author = 'Caleb Boylan', name = 'apt-package-mirror', description = 'Python script for running an apt package mirror', author_email = 'calebboylan@gmail.com', url = 'https://github.com/squidboylan/apt-packa...
Python
0.000001
ac2f2b72c1f653f15058b300c82060c90adf146b
Update for 1.3.0 release
setup.py
setup.py
# Importing these adds a 'bdist_mpkg' option that allows building binary # packages on OS X. try: import setuptools import bdist_mpkg except ImportError: pass import os import numpy.distutils.core as core # Configure our C modules that are built with f2py. tridiag = core.Extension(name = 'dadi.tridiag', ...
# Importing these adds a 'bdist_mpkg' option that allows building binary # packages on OS X. try: import setuptools import bdist_mpkg except ImportError: pass import os import numpy.distutils.core as core # Configure our C modules that are built with f2py. tridiag = core.Extension(name = 'dadi.tridiag', ...
Python
0
916cdddfa1e861b8402bdda935c2a9c46a5b6566
Bump version to 1.2.
setup.py
setup.py
import glob import os import platform import subprocess import sys from setuptools import setup, Command, Extension from setuptools.command.test import test as TestCommand def define_extensions(file_ext): return [Extension("lightfm.lightfm_fast", ['lightfm/lightfm_fast%s' % file_ext], ...
import glob import os import platform import subprocess import sys from setuptools import setup, Command, Extension from setuptools.command.test import test as TestCommand def define_extensions(file_ext): return [Extension("lightfm.lightfm_fast", ['lightfm/lightfm_fast%s' % file_ext], ...
Python
0
379488ee2980e1b33753d098d88fb1139a69deeb
add setup.py
setup.py
setup.py
from setuptools import setup, find_packages setup( name="hs-onliner", version="0.0.1", author="Firemark & Kytes", author_email="marpiechula@gmail.com", description="Site to view who will be in hackerspace every week." license="MIT", keywords="example documentation tutorial", url="https:/...
Python
0.000001
b63a6ababb1a66ed3766399328c5b9c4ac0a7ce3
Bump version
setup.py
setup.py
from setuptools import setup setup( name="funsize", version="0.29", description="Funsize Scheduler", author="Mozilla Release Engineering", packages=["funsize"], include_package_data=True, # Not zip safe because we have data files in the package zip_safe=False, entry_points={ ...
from setuptools import setup setup( name="funsize", version="0.28", description="Funsize Scheduler", author="Mozilla Release Engineering", packages=["funsize"], include_package_data=True, # Not zip safe because we have data files in the package zip_safe=False, entry_points={ ...
Python
0
a281bad5905da4710314d657943cc145b7d748d4
add minimal setup.py
setup.py
setup.py
import setuptools setuptools.setup( name='tvb-hpc', version='0.0', description='HPC code generation for TVB', author='TVB-HPC Contributors', url='https://github.com/the-virtual-brain/tvb-hpc', packages=setuptools.find_packages(), )
Python
0.000001
b383fadf43d3fb31d1501c780d4436717cc43776
add setup.py
setup.py
setup.py
import os from setuptools import setup, find_packages os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-payline-dotir', version='0.1', author='Mahdi Bornazadeh', author_email='Bornazadeh@gmail.com', description='Persian payline.ir payment gateway in...
Python
0.000001
6bc555b93e09ab18a5778487cf3eb47329e83098
Set version to our own.
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup(name="python-instagram", version="0.8.0powll1", description="Instagram API client", license="MIT", install_requires=["simplejson","httplib2"], author="Instagram, Inc", author_email="apidevelopers@instagram.com",...
#!/usr/bin/env python from setuptools import setup, find_packages setup(name="python-instagram", version="0.8.0", description="Instagram API client", license="MIT", install_requires=["simplejson","httplib2"], author="Instagram, Inc", author_email="apidevelopers@instagram.com", ...
Python
0
68fac699c5506f80ab727a4c569d8797294584bd
Bump the version number.
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup( name='hapipy', version='2.9.1', description="A python wrapper around HubSpot's APIs", long_description=open('README.md').read(), author='HubSpot Dev Team', author_email='devteam+hapi@hubspot.com', url='https://github.com/HubSpot/hapi...
#!/usr/bin/env python from setuptools import setup setup( name='hapipy', version='2.9.0', description="A python wrapper around HubSpot's APIs", long_description=open('README.md').read(), author='HubSpot Dev Team', author_email='devteam+hapi@hubspot.com', url='https://github.com/HubSpot/hapi...
Python
0.000002
c1c49b0e1718331663ee109f3417aff97fd23b70
Add minimal setup.py for RTD
setup.py
setup.py
# Minimal setup.py to get readthedocs working, not recommended for real use from distutils.core import setup setup(name="h11", version="0.0.0", packages=["h11"], )
Python
0
f34dd8ab047275b8d29366599621443a8bc468c9
Add launcher script for nbconvert
databaker/databaker_nbconvert.py
databaker/databaker_nbconvert.py
#!/usr/bin/env python import os import subprocess import sys def main(argv): if len(argv) == 0 or len(argv) > 2: print("Usage: databaker_process.py <notebook_file> <input_file>") print() print("<input_file> is optional; it replaces DATABAKER_INPUT_FILE") print("in the notebook.") ...
Python
0
a18c6d560a02049bf3dae08bebf6d3598f29c35d
Add pywinauto automated test for top-down view
contrib/automation_tests/orbit_top_down.py
contrib/automation_tests/orbit_top_down.py
""" Copyright (c) 2020 The Orbit Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. """ """Inspect the top-down view in Orbit using pywinauto. Before this script is run there needs to be a gamelet reserved and "hello_ggp_standalone" has to b...
Python
0.999999
afe216da917c171ff857de122be64a9b2a7d3e9c
migrate doaj client test from harvester
doajtest/unit/test_api_client.py
doajtest/unit/test_api_client.py
""" Unit tests for the DOAJ client """ from unittest import TestCase from doajtest.fixtures.journals import JournalFixtureFactory from portality.api.v1.client import client as doajclient, models from portality.lib import dataobj class TestDOAJ(TestCase): def setUp(self): pass def tearDown(self): ...
Python
0
fc9dd735c96ae21b4a64286e4c9ebcedc0e1fbca
Add script to subset kerning plist.
subsetKerning.py
subsetKerning.py
import sys from plistlib import writePlist from defcon import Font __doc__ = ''' Subset kerning in UFO given a list of glyphs provided. Will export new plist files that can be swapped into the UFO. Usage: python subsetKerning.py subsetList font.ufo ''' class SubsetKerning(object): """docstring for SubsetKernin...
Python
0
4a7ccea9a70642bb73f33b70147ba78877cae9f6
Add regular roi from csv file dialog, which can read MNI cordinates to generate sphere or cube roi based on the input radius in x, y ,z orientation.
froi/gui/component/regularroifromcsvfiledialog.py
froi/gui/component/regularroifromcsvfiledialog.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from PyQt4.QtCore import * from PyQt4.QtGui import * from froi.algorithm import imtool from froi.io.csv import get_cord_from_file import numpy as np import os class RegularROIFromCSVFileDialog(QDialog):...
Python
0
0e6d0def4e00868ed5e788f5319440ab6382f10f
include provision script (#176)
cxs/libcxs/scripts/provision_agent_keys.py
cxs/libcxs/scripts/provision_agent_keys.py
#!/usr/bin/env python3 # Provided by The Python Standard Library import json import argparse import asyncio import time import os import urllib.request import sys from ctypes import * def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("WALLET_NAME") parser.add_argument("AGENCY_URL") ...
Python
0
35258c9b37997801af05875f04f450050a3e5273
Create tarea5.py
tareas/tarea5.py
tareas/tarea5.py
#josue de leon #lista de supermercado #una tupla para las opciones, y una lista para la lista import os lista = [] opciones = ("1. Añadir producto a la lista.","2. Borrar el ultimo producto de la lista.","3. Mostrar toda la lista.") control = 1 print("\n\n\tBienvenido a su lista de compras.\n\nRecuerde que su lista e...
Python
0.000001
0c4d6491fe89e339e9d9505e6e46e8317e78034a
Add telnet testing script
telnet/telnet.py
telnet/telnet.py
#!/usr/bin/env python3 import pexpect import os, sys, time ip = "127.0.0.1" port = "10000" username = "nikitapekin@gmail.com" password = "12345" os.remove('../maildir/.lock') child = pexpect.spawn('telnet '+ ip + ' ' + port) child.expect('.\n') child.logfile = sys.stdout.buffer time.sleep(1) child.sendline('1 login...
Python
0.000001
419d31f817af0436c699c0b565e2d6a058c487db
test tls case
test/test_tls.py
test/test_tls.py
#!/usr/bin/env python import unittest import os import re import subprocess from framework import VppTestCase, VppTestRunner from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath def checkQat(): r = os.path.exists("/dev/qat_dev_processes") if r: return True else: print("NO QAT! E...
Python
0.000001
faf9397c2cd2c8384bbf8dad9b1122c78380cd2a
Fix and migrate missing contact-details #15 #16
migrateContacts.py
migrateContacts.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests import re base_url = "http://api.popit.sinarproject.org" token = open('token.txt') headers = {'Authorization': token.read().rstrip()} # ========= UTILS ========= # def clean(label): return re.sub(r'[^\w\s]', '', label.lower()) def getUserna...
Python
0.000001
40832b561437d8a022b2dbe9f19e5fcf622fb6d4
Add genspec.py, used to convert from the current Python-based spec to the new XML-based
tools/genspec.py
tools/genspec.py
#!/usr/bin/python2.4 import sys try: from elementtree.ElementTree import fromstring, tostring, Element, SubElement except ImportError: print "You need to install ElementTree (http://effbot.org/zone/element-index.htm)" sys.exit(1) import dbus from xml.dom.minidom import parseString from telepathy.server ...
Python
0.000001
945fe81c4a0f970e57ff7c5a13d8c3aa03df5fc6
Add function to save/restore environment between configuration checks.
numscons/checkers/new/common.py
numscons/checkers/new/common.py
from copy import deepcopy def save_and_set(env, opts, keys=None): """Put informations from option configuration into a scons environment, and returns the savedkeys given as config opts args.""" saved_keys = {} if keys is None: keys = opts.keys() for k in keys: saved_keys[k] = (env.h...
Python
0
207f9f1ed34066c0ed00842cd6287eb6907078f8
fix NameError in stub functions returning 'a' programmatically call all stub functions using inspect
0mq/stub_server.py
0mq/stub_server.py
import argparse import inspect import re import operator import time import sys # import jsonrpc2_zeromq import jsonrpc2_zeromq.common class RPCTestServer(jsonrpc2_zeromq.RPCServer): def handle_initialize_method(self, M_c, M_r, T, i): X_L = {} X_D = [[]] return M_c, M_r, X_L, X_D def ...
import argparse import inspect import re import operator import time import sys # import jsonrpc2_zeromq import jsonrpc2_zeromq.common class RPCTestServer(jsonrpc2_zeromq.RPCServer): def handle_initialize_method(self, M_c, M_r, T, i): X_L = {} X_D = [[]] return M_c, M_r, X_L, X_D def ...
Python
0
bef94fea3318c835c1474ebdfe74f89d8251baf9
add test_cover.py
pylayers/gis/test/test_cover.py
pylayers/gis/test/test_cover.py
import pylayers.gis.ezone as ez from pylayers.gis.gisutil import ent,ext2qt import matplotlib.pyplot as plt import numpy as np import seaborn as sns import os import smopy from cartopy import config import cartopy.crs as ccrs fig = plt.figure(figsize=(12,12)) white = np.zeros((10,10)) ax = fig.add_subplot(111) z = ez.E...
Python
0.000003
1a29e182a196e3fc4fbe00c0db6e22c2619473f3
Add iOSExtractor test
strings2pot/extractors/ios_test.py
strings2pot/extractors/ios_test.py
# -*- coding: utf-8 -*- import os import unittest import ios class iOSExtractorTest(unittest.TestCase): def setUp(self): self.mock_source_file = 'mock_source_ios.strings' self.mock_destination_file = 'mock_destination_ios.pot' def mock_context_id_generator(s): return 'MOCK_CONTEXT_ID' ...
Python
0
f1c95af353c741f26a9bd95f8228ef74e90bca75
Add itest
itests/tests.py
itests/tests.py
from unittest import TestCase import inferi class Tests(TestCase): def test_variables(self): # Basic variable behaviour var = inferi.Variable(4, 8, 15, 16, 23, 42, name="Numbers") self.assertEqual(var.values(), (4, 8, 15, 16, 23, 42)) self.assertEqual(var.name(), "Numbers") ...
Python
0.999957
90642d734fbdcc3a97693106259c35c25f19d38e
Add problem 1
problem_1.py
problem_1.py
import sys hex_string = sys.argv[1] print hex_string.decode('hex').encode('base64')
Python
0.000022
e19e45f7c6ff68599503c3ee0d6712974a8b4e66
Document current pycurl exception behavior
tests/error_test.py
tests/error_test.py
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et import pycurl import sys import unittest class ErrorTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl() def tearDown(self): self.curl.close() # error originating in libcurl def test_pycurl_error_libcurl(...
Python
0
b6500cc5ae48212b7cabefc313b417a42273274b
Add test for parsing the man page
tests/test_parse.py
tests/test_parse.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import mock from tldr.parser import parse_page class TestParse(unittest.TestCase): def test_parse_page(self): mock_config = { 'colors': { 'command': 'cyan', ...
Python
0.000001
38dee68b15e2daf3c9d6ece845dc561500545258
Create test_plots.py
tests/test_plots.py
tests/test_plots.py
from test_model import test_add_stressmodel from pastas.plots import TrackSolve def test_plot(): ml = test_add_stressmodel() ml.plot() def test_decomposition(): ml = test_add_stressmodel() ml.plots.decomposition(min_ylim_diff=0.1) def test_results(): ml = test_add_stressmodel() ml.plo...
Python
0.000104
8a573baabee65bfbd348901e0d1c7828cdadd337
Add tests for stats.normalize
tests/test_stats.py
tests/test_stats.py
import numpy as np np.seterr(all='raise') from stats import normalize def check_normalization_constants(arr, axis): sum = np.log(np.sum(arr, axis=axis)) z = normalize(np.log(arr), axis=axis)[0] zdiff = np.abs(sum - z) if not (zdiff < 1e-8).all(): print sum print z raise Asser...
Python
0.000005
88f6c8c3657cba81c65da34a7161c860c8a23c5f
add RPC test for InvalidateBlock
qa/rpc-tests/invalidateblock.py
qa/rpc-tests/invalidateblock.py
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test InvalidateBlock code # from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy imp...
Python
0
fadac460052cb1a778bf8398879e1cb616c26228
Add new migration for Django 1.8
propaganda/migrations/0002_auto_20150802_1841.py
propaganda/migrations/0002_auto_20150802_1841.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('propaganda', '0001_initial'), ] operations = [ migrations.AlterField( model_name='subscriber', name=...
Python
0
b29417d3b387c8ab62c1e09589c2d93dae905993
Add skeleton tle.api
tle/api.py
tle/api.py
import json import logging import bottle import functools from paste import httpserver from paste.translogger import TransLogger from collections import OrderedDict log = logging.getLogger(__name__) class APILogger(TransLogger): def write_log( self, environ, method, req_uri, ...
Python
0.000069
b042675463c34340d4d3ae5d6868b243abf9741b
Create Average_sorting.py
Average_sorting.py
Average_sorting.py
# coding: utf-8 import rw success_list=[] #Meet the requirements of the combined group max_min=[] #Max ad min volue save var;[function_name : max_min_mark] def count(x,y): result=x+y return result def count_list(x,y): total=count(len(x),len(y)) return total def max_min_mark(var): for i in v...
Python
0.000001
2b7d1de9f1db2ca2c0b9cf146063f58eb4a2aad5
add hwuitest
wa/workloads/hwuitest/__init__.py
wa/workloads/hwuitest/__init__.py
# Copyright 2013-2018 ARM Limited # # 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
1136824ab60dbb8774ba5cb8d011e898f9286e06
Add a missing file
reviewboard/admin/validation.py
reviewboard/admin/validation.py
from django import forms def validate_bug_tracker(input_url): """ Validates that an issue tracker URI string contains one `%s` Python format specification type (no other types are supported). """ try: # Ignore escaped `%`'s test_url = input_url.replace('%%', '') if test_ur...
Python
0
298d3e352193e574e0c8980e37a50d226552109e
Create conf.py
docs/conf.py
docs/conf.py
extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', 'repoze.sphinx.autointerface', 'sphinxcontrib.programoutput', 'sphinxcontrib.images', ]
Python
0.000001
acdb13c3680b7958f9a1def3e538ef9ebd166922
add migration for org name + apptext
portal/migrations/versions/9b1bedfa916b_.py
portal/migrations/versions/9b1bedfa916b_.py
from alembic import op import sqlalchemy as sa from sqlalchemy.orm import sessionmaker from portal.models.app_text import AppText from portal.models.organization import Organization """empty message Revision ID: 9b1bedfa916b Revises: 441185240f62 Create Date: 2017-10-26 15:24:32.623899 """ # revision identifiers, ...
Python
0.000001
ac45b330072ec7d171602c698711844f29af77e8
Create bgg_games.py
bgg_games.py
bgg_games.py
import csv import time from boardgamegeek import BoardGameGeek bgg = BoardGameGeek() # first import the game id list f = open("bgg_game_ids.txt") idlist = [] for line in f: idlist.append(int(line.split()[0])) f.close() # data file datafile = "bgg_games.csv" # max and min game id # (if you don't want to scrape the...
Python
0.000003
4ce5e57b882ae057fa21d0397925512073447b77
Add admin interface
chunked_upload/admin.py
chunked_upload/admin.py
from django.contrib import admin from .models import ChunkedUpload class ChunkedUploadAdmin(admin.ModelAdmin): list_display = ('upload_id', 'file', 'filename', 'user', 'offset', 'created_on', 'status', 'completed_on') admin.site.register(ChunkedUpload, ChunkedUploadAdmin)
Python
0.000001
1db74fafd5f281053dc82d2d4ff2d24447db8338
add initial Nose tests
tests/test_connection.py
tests/test_connection.py
from nose.tools import raises from unittest.case import SkipTest from urllib2 import urlopen import StringIO import mock import datetime, md5 import harvestmedia.api.exceptions import harvestmedia.api.config import harvestmedia.api.client api_key = '12345' webservice_url = 'https://service.harvestmedia.net/HMP-WS.sv...
Python
0.000001
a3deadbc54fad13e4e40da143f25ae4b26cf690b
Add missed travis-ci manage.py.
travis-ci/manage.py
travis-ci/manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "travis-ci.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Python
0
58a5257505a4ae9d32cf233d059b4350f9494d86
Create timer.py
timer.py
timer.py
# # jasoncg # 2015-02-23 # # timer.py # # A simple timer supporting the Python "with" statement # import time # # Use in a "with" statement: # with timer.Timer(): # perform_expensive_calculation() # # May also print the current progress: # with timer.Timer() as t: # perform_expensive_calculation_1() # t.print_progr...
Python
0.000003
d1e568ab1e238586ed914de35ed44dc2231af3d2
Create version.py
ngboost/version.py
ngboost/version.py
__version__ = "0.2.0"
Python
0.000001
29bdfc794f759a5f8189d4c89dcaa3fa9699bc2b
Add sfp_numinfo
modules/sfp_numinfo.py
modules/sfp_numinfo.py
#------------------------------------------------------------------------------- # Name: sfp_numinfo # Purpose: SpiderFoot plug-in to search numinfo.net for a phone number # and retrieve email address. # # Author: <bcoles@gmail.com> # # Created: 2019-05-28 # Copyright: (c) bcoles 2019...
Python
0.999397
b6a6e6a9bf0254f9c79215c98b392b02db53827b
Add wireless module #305
cme/modules/wireless.py
cme/modules/wireless.py
class CMEModule: name = 'wireless' description = "Get key of all wireless interfaces" supported_protocols = ['smb'] opsec_safe = True multiple_hosts = True def options(self, context, module_options): ''' ''' def on_admin_login(self, context, connection): comm...
Python
0
74aaf7f459875c4dec9ed1076bf748786db4af0d
Add example for downloading TOP N files from VT matching an Intelligence search
examples/search_and_download_topn_files.py
examples/search_and_download_topn_files.py
#!/usr/bin/python """ This example program shows how to download files from VirusTotal matching a VirusTotal Intelligence search. NOTE: In order to use this script you will need to have access to VT Intelligence or to the Premium API. Learn more about these services at: https://www.virustotal.com/gui/intelligence-ove...
Python
0
5ad1170c2515fd799acc43e99e35299bbab9cec1
Add tests for harmonic in 791628c4df60369583474c07d64f1439bd5c19e0
tests/test_transforms.py
tests/test_transforms.py
""" Test for `yatsm.regression.transforms` """ import numpy as np import patsy import py.test from yatsm.regression.transforms import harm def test_harmonic_transform(): x = np.arange(735688, 735688 + 100, 1) design = patsy.dmatrix('0 + harm(x, 1)') truth = np.vstack((np.cos(2 * np.pi / 365.25 * x), ...
Python
0.000002
5681684a4df6cd70ba4c2e4c667b81a7e8367e25
add missing wrapmodule.py
dune/pymor/core/wrapmodule.py
dune/pymor/core/wrapmodule.py
# This file is part of the dune-pymor project: # https://github.com/pyMor/dune-pymor # Copyright Holders: Felix Albrecht, Stephan Rave # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from inspect import isclass from types import ModuleType from dune.pymor.core.wrapper import Wrapper fr...
Python
0.000001
3c37704b3b819bee5d441c75a6fd59a64279a0e8
use unicode.strip instead of string.strip of the string module for metadata processors
pelican/readers.py
pelican/readers.py
# -*- coding: utf-8 -*- try: from docutils import core # import the directives to have pygments support from pelican import rstdirectives except ImportError: core = False try: from markdown import Markdown except ImportError: Markdown = False import re from pelican.utils import get_date, open ...
# -*- coding: utf-8 -*- try: from docutils import core # import the directives to have pygments support from pelican import rstdirectives except ImportError: core = False try: from markdown import Markdown except ImportError: Markdown = False import re import string from pelican.utils import g...
Python
0.000001
ddb9c9b3108ac587e3c29e7a45bacea6afd488cc
add python solution to "project euler - problem 11"
problem11.py
problem11.py
number_string = """08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 2...
Python
0
0d390edeeb8829c0b8afef090f133d0fee8bce4f
Bump PROVISION_VERSION for latest changes.
version.py
version.py
ZULIP_VERSION = "1.6.0+git" PROVISION_VERSION = '9.1'
ZULIP_VERSION = "1.6.0+git" PROVISION_VERSION = '9.0'
Python
0
59a228312bb3091db8bfb6bf9a75ce4ae47431f4
Add zero system test to neural net
neuralnets/net_test.py
neuralnets/net_test.py
from net import NeuralNet import numpy as np #TODO(Wesley) More tests class TestNeuralNet(object): def test_zero_system(self): net = NeuralNet(3, 2, 4, 1, seed=0) net.weights = [ np.zeros((3,4)), np.zeros((4,4)), np.zeros((4,4)), ...
Python
0.004377
0a7fb32471fa5ae6e66348527c0ae2f299361211
Allow to pass extra argument to the Base class initializer
opbeat/handlers/logging.py
opbeat/handlers/logging.py
""" opbeat.handlers.logging ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011-2012 Opbeat Large portions are :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import datetime import logging import sys import trace...
""" opbeat.handlers.logging ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011-2012 Opbeat Large portions are :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import datetime import logging import sys import trace...
Python
0
d97b9f6c508dd24da0f86bc1587ea64708c84a89
Add parser for the advisory mail recipients.
tools/dist/security/mailinglist.py
tools/dist/security/mailinglist.py
# # 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 # "License"); you may not...
Python
0.000296
80a7493e56b1ba6b01bf44f6dd9140de916511a7
add twisted interface to psycopg2
pyiem/twistedpg.py
pyiem/twistedpg.py
""" module twistedpg.py Author: Federico Di Gregorio http://twistedmatrix.com/pipermail/twisted-python/2006-April/012955.html """ from psycopg2 import * from psycopg2 import connect as _2connect from psycopg2.extensions import connection as _2connection from psycopg2.extras import RealDictCursor del connect def conne...
Python
0
009182d0c603f9c1f8fa650f6a9771b38a74c6cc
Add a proper validator for disable_builtins
flexget/plugins/plugin_disable_builtins.py
flexget/plugins/plugin_disable_builtins.py
import logging from flexget import plugin from flexget.plugin import priority, register_plugin, plugins log = logging.getLogger('builtins') def all_builtins(): """Helper function to return an iterator over all builtin plugins.""" return (plugin for plugin in plugins.itervalues() if plugin.builtin) class Pl...
import logging from flexget import plugin from flexget.plugin import priority, register_plugin log = logging.getLogger('builtins') class PluginDisableBuiltins(object): """ Disables all builtin plugins from a feed. """ def __init__(self): self.disabled = [] def validator(self): ...
Python
0.000064
98524c4e7c7c4b6e8b51b7fd89501d8ac00e0d8e
generates a hash of the string input
elements/GenerateHashOfString.py
elements/GenerateHashOfString.py
# coding: utf-8 from ElementBase import ElementBase from ElementParameter import ElementParameter from ElementValue import ElementValue import hashlib class GenerateHashOfString(ElementBase): def __init__(self): self.status = 'running' self.output = None self.params = [] self.type = 'Standard' self.setup_...
Python
0.999975
f47482df83a8ab643a55062b12fce11fbd703886
add 90. The first 100 problems have been solved! Oh~~~~~~~~Yeah
vol2/90.py
vol2/90.py
from itertools import combinations def valid(c1, c2): return all(x in c1 and y in c2 or x in c2 and y in c1 for x, y in squares) if __name__ == "__main__": squares = [(0,1), (0,4), (0,6), (1,6), (2,5), (3,6), (4,6), (8,1)] cube = list(combinations([0,1,2,3,4,5,6,7,8,6], 6)) print sum(1 for i, c1 in en...
Python
0.999935
ddbbfbb5db9cf2f4ff4338924a7965c2dffc1e3f
add VWS API client implement file
vuforia.py
vuforia.py
#!/usr/bin/env python # Copyright 2013 """Simple VWS client implementation using python. The client supports add, update, retrieving, delete and listing targets on a Vuforia Cloud Database. """ import hmac import hashlib import base64 import json from time import strftime, gmtime from httplib import HTTPSConnection...
Python
0
c6cd7d2a310bc0b107e0d2a481260b2e95bac577
add prime_factors function to utils
utils.py
utils.py
"Utilities to help solving problems." def prime_factors(num): i = 2 while i * i <= num: if num % i: i += 1 else: num //= i yield i if num > 1: yield num
Python
0.000008
6be93bfbaf254234f008e2c714b0aae10434fe68
add orm
www/orm.py
www/orm.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'Jiayi Li' import asyncio, aiomysql, logging def log(sql, args=()): logging.info('SQL: %s' % sql) # create a connection pool, stored by global variable '__pool' async def create_pool(loop, **kw): logging.info('create database connection pool...') ...
Python
0.000047
c596f7cec968ccd450508e17a2534d87feb5615a
add the googlecode upload script
gc_upload.py
gc_upload.py
#!/usr/bin/env python # # Copyright 2006 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for # uplo...
Python
0.000001
5b05640a60c66d9d12b9794f2ae55785efe1e099
Define solidfill.
riot/tags/solidfill.py
riot/tags/solidfill.py
# -*- coding: utf-8 -*- from urwid import SolidFill def parse_tag_from_node(node): return SolidFill()
Python
0.000002
785f2d3a6d10d8d6ba72712eec29c5be5849f671
Add build_raw_data.py
fluid/PaddleNLP/text_classification/async_executor/data_generator/build_raw_data.py
fluid/PaddleNLP/text_classification/async_executor/data_generator/build_raw_data.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Python
0.000008
f99c8e6e26b85ae7805ff38e4d89978d06e93c97
Add SQSRequest base class
sqs.py
sqs.py
from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPClient from tornado.httputil import url_concat import datetime import hashlib import hmac class SQSRequest(HTTPRequest): """SQS AWS Adapter for Tornado HTTP request""" def __init__(self, *args, **kwargs): super(SQSRequest, self).__init__...
Python
0
972f58d3280c95c2823b04a76469c401e7d9fc02
add border and basic functional
xoi.py
xoi.py
#! /usr/bin/env python import sys import curses from curses import KEY_ENTER import time from collections import namedtuple KEY = "KEY" K_A = ord("a") K_D = ord("d") class Point: def __init__(self, x, y): self._x = x self._y = y @property def x(self): return self._x @x.sett...
Python
0
9e2669539c5d7662bb6d6a89877b30235eef1bc2
Write solution to DEC14 XOR question.
xor.py
xor.py
# http://www.codechef.com/DEC14/problems/XORSUB import operator def f(p): if p == []: return 0 elif len(p) == 1: return p[0] else: return reduce(operator.xor, p) def list_powerset(lst): result = [[]] for x in lst: result.extend([subset + [x] for subset in result]) return result t = int(ra...
Python
0.999905
135cdb7f16372978774acf06d4da556d0a7a7db7
add solution template
exercises/error-handling/error_handling.py
exercises/error-handling/error_handling.py
def handle_error_by_throwing_exception(): pass def handle_error_by_returning_none(input_data): pass def handle_error_by_returning_tuple(input_data): pass def filelike_objects_are_closed_on_exception(filelike_object): pass
Python
0.000001
286e996c8dd7a299a5db148e78bbdaa0e1cb1b5c
Add sample base.
samples/sample.py
samples/sample.py
# -*- coding: utf-8 -*- """AirWaveAPIClient sample.""" def main(): """Sample main.""" if __name__ == "__main__": main()
Python
0
c1fae9e5ace57320b4f4e69efc941c7fe6266381
add stft graph writer
write_stft_graph.py
write_stft_graph.py
import pdb import tensorflow as tf from birdwatcher.generators import compose, stft, amplitude_to_db, read_audio, reshape AUDIO_SHAPE = (44100*3, 1) clean_samples = compose(reshape, amplitude_to_db, stft, read_audio) x = tf.placeholder(tf.float32, shape=AUDIO_SHAPE) out = clean_samples(x) sess = tf.Session() tf.trai...
Python
0
aa517e0300e3e5079523d30c0bb7bfe1fe9640a4
Add script to wait for ELB instances to come into service.
scripts/wait-for-elb-instances-in-service.py
scripts/wait-for-elb-instances-in-service.py
#!/usr/bin/env python import argparse, re, time from assume_role_lib import log, sts from assume_role_lib.util import unwrap from datetime import datetime, timedelta from collections import Counter as counter __version__ = '0.1' logger = None def add_arguments(argument_parser): argument_parser.add_argument( ...
Python
0
eff5016653980f24c5c55dfb866dbe108f50dedf
Add the cbtf spack build package. cbtf is the base package for the component based tool framework and is used for building and connecting cbtf components, including distributed components via the MRNet transfer mechanism.
var/spack/packages/cbtf/package.py
var/spack/packages/cbtf/package.py
################################################################################ # Copyright (c) 2015 Krell Institute. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; eith...
Python
0
fc21bb14600f79a3d9970272fb7edd4eba548262
Add test for python runner action wrapper process script performance.
st2actions/tests/integration/test_python_action_process_wrapper.py
st2actions/tests/integration/test_python_action_process_wrapper.py
# Licensed to the StackStorm, Inc ('StackStorm') 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 "License"); you may not use th...
Python
0
c6df42ca99c8f633c2f1efeb9af26ad4b88c4d75
Create 04.py
02/hw/04.py
02/hw/04.py
# Define a procedure, find_last, that takes as input # two strings, a search string and a target string, # and returns the last position in the search string # where the target string appears, or -1 if there # are no occurences. # # Example: find_last('aaaa', 'a') returns 3 # Make sure your procedure has a return stat...
Python
0
ba0093c8b6801bdbded870ea5cc27eeec05abb58
create db script
web/create_db.py
web/create_db.py
__author__ = 'David Mitchell' #This script creates an example/test db. from app import db from app import MenuCategory, MenuItem db.drop_all() db.create_all() appetizer_category = MenuCategory(name='Appetizers') entree_category = MenuCategory(name='Entrees') desert_category = MenuCategory(name='Deserts') bacon_item ...
Python
0.000001
955a2a7e467cdcf83a19525e421feb9a5eaca7e3
Add huxley/js.py for javascript
huxley/js.py
huxley/js.py
# Copyright (c) 2013 Facebook # # 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 writing,...
Python
0
79710bb5b77b8cfa95d92f7f39ac44fc0c605022
Create featureCC.py
featureCC.py
featureCC.py
### *- Program: FeatureCC ### *- Objective: To determine the total number of point, line, and polygon shapefiles ### in a directory ### *- Input: Provided by the user (workspace) ### *- Output: Display total files for point, line, and polygon shapefiles to the user # - START PROGRAM - # Import OS module to load appro...
Python
0
61fa5c26b9b2eff24e88313671c7aa673e24bb0f
Create pythagoras.py
pythagoras.py
pythagoras.py
#!/bin/python from math import sqrt print "a^2 + b^2 = c^2" leg1 = raw_input("Leg1 (a): ") leg2 = raw_input("Leg2 (b): ") hypotenuse = sqrt((int(leg1) ** 2) + (int(leg2) ** 2)) print hypotenuse
Python
0.000003
c1bed8533d479112df6ae4aea0bb31e4419ae4f8
change location of jianfan lib in data repo
setup/setupdev.py
setup/setupdev.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import shutil """ $PALI_DIR is the dir of git clone https://github.com/siongui/pali.git Manual setup (for reference): 1. setup TongWen (deprecated): ```bash cd $PALI_DIR mkdir -p common/app/scripts/ext cd common/app/scripts/ext/ wget http://tongwen.openf...
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import shutil """ $PALI_DIR is the dir of git clone https://github.com/siongui/pali.git Manual setup (for reference): 1. setup TongWen (deprecated): ```bash cd $PALI_DIR mkdir -p common/app/scripts/ext cd common/app/scripts/ext/ wget http://tongwen.openf...
Python
0
7b09ba64c0327ecea04cc95057ffa7d5c8d939c8
Add test for setopt to demonstrate that edit_config retains non-ASCII characters.
setuptools/tests/test_setopt.py
setuptools/tests/test_setopt.py
# coding: utf-8 from __future__ import unicode_literals import io import six from setuptools.command import setopt from setuptools.extern.six.moves import configparser class TestEdit: @staticmethod def parse_config(filename): parser = configparser.ConfigParser() with io.open(filename, enco...
Python
0
cbf0d257bcbaeddeb9390047f575038b5d842dc8
update version
paginator_plus/__init__.py
paginator_plus/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.0.1'
Python
0
348d6bba64423a1ca0f1532f4cf878811b65760f
add deploy.py
deep_speech_2/deploy.py
deep_speech_2/deploy.py
"""Deployment for DeepSpeech2 model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import gzip import distutils.util import multiprocessing import paddle.v2 as paddle from data_utils.data import DataGenerator from model import deep_speec...
Python
0.000001
dc5e87f4a7bb1399951423c3a4236c58ab723665
change AjaxImageField to behave like standard django FileField
ajaximage/fields.py
ajaximage/fields.py
#-*- coding: utf-8 -*- from django.core.files.storage import default_storage from django.db.models.fields.files import FileDescriptor, FieldFile from django.db.models import Field from django.conf import settings from .widgets import AjaxImageEditor class AjaxImageField(Field): storage = default_storage attr...
#-*- coding: utf-8 -*- from django.db.models import Field from django.forms import widgets from ajaximage.widgets import AjaxImageEditor from django.conf import settings class AjaxImageField(Field): def __init__(self, *args, **kwargs): upload_to = kwargs.pop('upload_to', '') max_height = kwargs.po...
Python
0
a7ab3b5e4d75a4f5a887bafc980d24dce7983b4a
add Alfred.py
Alfred.py
Alfred.py
# Copyright (c) 2013 Christopher Kaster (@Kasoki) # # This file is part of alfred.py <https://github.com/Kasoki/alfred.py> # # 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 restricti...
Python
0.000936
d522281a6a70c00f4ad6c77783a1269dd20289dc
Add Scripts for Regression benchmark (#2516)
.dev_scripts/benchmark_filter.py
.dev_scripts/benchmark_filter.py
import argparse import mmcv import os import os.path as osp def parse_args(): parser = argparse.ArgumentParser(description='Filter configs to train') parser.add_argument( '--basic-arch', action='store_true', help='to train models in basic arch') parser.add_argument( '--data...
Python
0
2a963c4d13035b6f8e301a7f0240b28e0e0764d3
Create WordLadder_001.py
leetcode/127-Word-Ladder/WordLadder_001.py
leetcode/127-Word-Ladder/WordLadder_001.py
class Solution(object): def ladderLength(self, beginWord, endWord, wordList): """ :type beginWord: str :type endWord: str :type wordList: Set[str] :rtype: int """ if beginWord == endWord: return 1 cnt = 1 q = [beginWord] ...
Python
0
c657d92f1f8dc3cd4ff9995dc0d2857ce8f6fdd4
Create CountingBits.py
leetcode/338-Counting-Bits/CountingBits.py
leetcode/338-Counting-Bits/CountingBits.py
class Solution(object): def countBits(self, num): """ :type num: int :rtype: List[int] """ seed = 1 res = [0] while num > 0: res += [res[i] + 1 for i in xrange(min(num, seed))] num -= seed seed = seed << 1 r...
Python
0.000001
b85eb165ca41528d2709ae255e47e722a194aa87
Add piano-roll/audio file to pretty_midi object example
examples/reverse_pianoroll.py
examples/reverse_pianoroll.py
""" Utility function for converting an audio file to a pretty_midi.PrettyMIDI object. Note that this method is nowhere close to the state-of-the-art in automatic music transcription. This just serves as a fun example for rough transcription which can be expanded on for anyone motivated. """ from __future__ import divis...
Python
0
2c3136d0d68024cd867efac5ac92a84067936c49
Improve 'workarounds' conf options documentation
nova/conf/workarounds.py
nova/conf/workarounds.py
# Copyright 2016 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Copyright 2016 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
Python
0.000008
0cd5ed79f019db91261c0d858b61796021ec3f80
Add syntax highlighting tests for PEP 570
test/highlight/parameters.py
test/highlight/parameters.py
def g(h, i, /, j, *, k=100, **kwarg): # ^ operator # ^ operator pass
Python
0
a85f0df776da6c8f39e5d5dbb91370531e4605be
Create GUI-Main.py
GUI-Main.py
GUI-Main.py
#!/usr/bin/env python import tkinter as tk import sys, glob, time from tkinter.filedialog import * from PIL import Image _imaging = Image.core class Application(tk.Frame): def __init__(self, master=None): tk.Frame.__init__(self, master) self.grid() self.input_directory = StringVar() self.output_directory =...
Python
0.000001
bf6c8ce59ec841b19dab3a02a9065864035d4d82
Add a new helper to convert stackalytics default_data.json
bin/helpers/openstack/stackalytics.py
bin/helpers/openstack/stackalytics.py
import sys import json import yaml import datetime # Read default_data.json from stackalytics/etc/ and convert for # repoXplorer. if __name__ == "__main__": ident = {'identities': {}, 'groups': {}} data = json.loads(file(sys.argv[1]).read()) users = data['users'] groups = data['companies'...
Python
0.00006
367a1ff9f0ca3daae3ee804b5484e3863bb72307
Add initial proposal tests
tests/views/test_proposal.py
tests/views/test_proposal.py
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
Python
0
ee4ab0cf3ef08459e1a8ad1cdae370870ba28805
Create lc1755.py
LeetCode/lc1755.py
LeetCode/lc1755.py
class Solution: def minAbsDifference(self, nums: List[int], goal: int) -> int: n = len(nums) nums.sort(key=lambda x: -abs(x)) neg = [0 for _ in range(n+1)] pos = [0 for _ in range(n+1)] for i in range(n-1, -1, -1): if nums[i] < 0: neg[i] = neg[i+1]...
Python
0.000001