commit
stringlengths
40
40
subject
stringlengths
1
3.25k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
old_contents
stringlengths
0
26.3k
lang
stringclasses
3 values
proba
float64
0
1
diff
stringlengths
0
7.82k
03ad7302f75ea5de0870c798ec70f1a1912288ca
Add main.py file Description for 'hello! hosvik'
src/main.py
src/main.py
Python
0.000001
@@ -0,0 +1,55 @@ +import sys%0Aprint(sys.platform);%0Aprint('Hello hosvik!')%0A
054c75ce1a63732be7a58ec1150e9f8aaff2aedb
Create test.py
plugins/test.py
plugins/test.py
Python
0.000005
@@ -0,0 +1,135 @@ +@bot.message_handler(commands=%5B'test', 'toast'%5D)%0Adef send_test(message):%0A bot.send_message(message.chat.id, TEST_MSG.encode(%22utf-8%22))%0A
5c9ffaaa8e244bb9db627a0408258750cc0e81d6
Create ping.py
src/ping.py
src/ping.py
Python
0.000003
@@ -0,0 +1,6 @@ +nisse%0A
1473e0f4f1949349ef7212e0755fa8ffa6401cbe
Create process_htk_mlf_zh.py
process_htk_mlf_zh.py
process_htk_mlf_zh.py
Python
0
@@ -0,0 +1,1106 @@ +#!/usr/bin/env python%0A#%0A# This script reads in a HTK MLF format label file and converts the %0A# encoded contents to GBK encoding.%0A#%0A%0Aimport string, codecs%0Afin=open('vom_utt_wlab.mlf')%0Afout=codecs.open('vom_utt_wlab.gbk.mlf', encoding='gbk', mode='w')%0Awhile True:%0A sr=fin.readlin...
c8c807cfcb4422edc0e2dbe3a4673a62fa37cbfa
Add extra migration triggered by updated django / parler (#501)
djangocms_blog/migrations/0037_auto_20190806_0743.py
djangocms_blog/migrations/0037_auto_20190806_0743.py
Python
0
@@ -0,0 +1,2240 @@ +# Generated by Django 2.1.11 on 2019-08-06 05:43%0A%0Afrom django.conf import settings%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0Aimport parler.fields%0Aimport taggit_autosuggest.managers%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%...
e082c803bf5ce31c4948d0d512e9ec0366cf0adc
Create politeusersbot.py
politeusersbot.py
politeusersbot.py
Python
0.00002
@@ -0,0 +1,1932 @@ +#Polite Users Bot created by Kooldawgstar%0A%0Aimport praw%0Afrom time import sleep%0Aimport random%0A%0AUSERNAME = %22USERNAME%22%0APASSWORD = %22PASSWORD%22%0ALIMIT = 100%0ARESPONSES = %5B%22Thanks for being a nice user and thanking people for help!%22,%0A %22Thank you for being a nice...
94481f656690956b2a4eb5a1227948d24ba4cc05
Add actual command line python function (#7)
bin/CCDSingleEpochStile.py
bin/CCDSingleEpochStile.py
Python
0.00002
@@ -0,0 +1,120 @@ +#!/usr/bin/env python%0A%0Afrom stile.lsst.base_tasks import CCDSingleEpochStileTask%0A%0ACCDSingleEpochStileTask.parseAndRun()%0A
225d5232cca6bb42e39959b2330758225a748477
add little script to retrieve URLs to PS1-DR1 images
py/legacyanalysis/get-ps1-skycells.py
py/legacyanalysis/get-ps1-skycells.py
Python
0
@@ -0,0 +1,1397 @@ +import requests%0Afrom astrometry.util.fits import *%0Afrom astrometry.util.multiproc import *%0A%0Adef get_cell((skycell, subcell)):%0A url = 'http://ps1images.stsci.edu/cgi-bin/ps1filenames.py?skycell=%25i.%2503i' %25 (skycell, subcell)%0A print('Getting', url)%0A r = requests.get(url)%0A...
0f5ecc42485d4f0e89fbe202b57a2e7735ea69cc
Create product_images.py
product_images.py
product_images.py
Python
0.000012
@@ -0,0 +1,320 @@ +from openerp.osv import osv, fields%0A%0Aclass product_template(osv.Model):%0A _inherit = 'product.template'%0A %0A _columns = %7B%0A 'x_secondpicture': fields.binary(%22Second Image%22,%0A help=%22This field holds the second image used as image for the product, limited to ...
216a51b21484307a38bc0d5147922db189b7ab62
Fix compatibility with Python 2.4
rbtools/commands/setup_repo.py
rbtools/commands/setup_repo.py
import os from rbtools.commands import Command, CommandError, Option from rbtools.utils.console import confirm from rbtools.utils.filesystem import CONFIG_FILE class SetupRepo(Command): """Configure a repository to point to a Review Board server. Interactively creates the configuration file .reviewboardrc i...
Python
0
@@ -3573,19 +3573,17 @@ IOError - as +, e:%0A
e81f6e01ac55723e015c4d7d9d8f61467378325a
Add autoincrement to ZUPC.id
migrations/versions/e187aca7c77a_zupc_id_autoincrement.py
migrations/versions/e187aca7c77a_zupc_id_autoincrement.py
Python
0.00001
@@ -0,0 +1,677 @@ +%22%22%22ZUPC.id autoincrement%0A%0ARevision ID: e187aca7c77a%0ARevises: ccd5b0142a76%0ACreate Date: 2019-10-21 14:01:10.406983%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = 'e187aca7c77a'%0Adown_revision = '86b41c3dbd00'%0A%0Afrom alembic import op%0Afrom sqlalchemy.diale...
cc8b3f8a7fb6af29f16d47e4e4caf56f17605325
Add command handler.
src/server/commandHandler.py
src/server/commandHandler.py
Python
0
@@ -0,0 +1,2021 @@ +from src.shared.encode import decodePosition%0A%0A%0Aclass CommandHandler(object):%0A def __init__(self, gameState, connectionManager):%0A self.gameState = gameState%0A self.connectionManager = connectionManager%0A%0A def broadcastMessage(self, *args, **kwargs):%0A self.co...
be67baac2314408b295bddba3e5e4b2ca9bfd262
Add ffs.exceptions
ffs/exceptions.py
ffs/exceptions.py
Python
0.00354
@@ -0,0 +1,204 @@ +%22%22%22%0Affs.exceptions%0A%0ABase and definitions for all exceptions raised by FFS%0A%22%22%22%0Aclass Error(Exception):%0A %22Base Error class for FFS%22%0A%0Aclass DoesNotExistError(Error):%0A %22Something should have been here%22%0A
2737e1d46263eff554219a5fa5bad060b8f219d3
Add CLI script for scoring huk-a-buk.
score_hukabuk.py
score_hukabuk.py
Python
0
@@ -0,0 +1,2736 @@ +import json%0Aimport os%0Aimport time%0A%0A%0ADATA = %7B'turns': %7B%7D%7D%0A%0A%0Aclass Settings(object):%0A FILENAME = None%0A CURRENT_TURN = 0%0A NAME_CHOICES = None%0A%0A%0Adef set_filename():%0A filename = raw_input('Set the filename? ').strip()%0A if not filename:%0A file...
bb5eb56cd20801ffaf73b3caa69cba6b931d26ac
set last_polled in Sugar importer.
mysite/search/tasks/trac_instances.py
mysite/search/tasks/trac_instances.py
import datetime import logging from celery.task import Task, PeriodicTask from celery.registry import tasks import celery.decorators import mysite.search.models import mysite.customs.bugtrackers.trac ### Twisted class LookAtOneTwistedBug(Task): def run(self, bug_id, **kwargs): logger = self.get_logger(**...
Python
0
@@ -4556,16 +4556,65 @@ from_tb%0A + bug.last_polled = datetime.datetime.utcnow()%0A bug.
7f64a56a17fc6d73da4ac2987d42931885925db0
Create server.py
server/server.py
server/server.py
Python
0.000001
@@ -0,0 +1,170 @@ +import http.server%0Aimport socketserver%0APORT = 80%0AHandler = http.server.SimpleHTTPRequestHandler%0Ahttpd = socketserver.TCPServer((%22%22, PORT), Handler)%0Ahttpd.serve_forever()%0A
be6997772bd7e39dd1f68d96b3d52a82372ad216
update migartions
tracpro/supervisors/migrations/0002_auto_20141102_2231.py
tracpro/supervisors/migrations/0002_auto_20141102_2231.py
Python
0
@@ -0,0 +1,749 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('supervisors', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterModelOpti...
0ccca70cf289fb219768d1a124cacf11396a0ecc
Add files via upload
src/pque.py
src/pque.py
Python
0
@@ -0,0 +1,2044 @@ +class Pque(object):%0A %22%22%22make as priority queue priority scale is 0 through -99%0A 0 has greatest priority with ties being first come first pop%22%22%22%0A def __init__(self):%0A self.next_node = None%0A self.priority = 0%0A self.value = None%0A self....
06235d5913cd5eb54d3767f6a7cf60acb1966b39
Create prettyrpc.py
prettyrpc.py
prettyrpc.py
Python
0
@@ -0,0 +1,325 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Afrom xmlrpclib import ServerProxy%0A%0Aclass PrettyProxy(object):%0A def __init__(self, *args, **kwargs):%0A self._real_proxy = ServerProxy(*args, **kwargs)%0A%0A def __getattr__(self, name):%0A return lambda *args, **kwargs: ge...
38faa038cbc7b8cedbb2dc13c2760f2a270a5f1a
Create problem-5.py
problem-5.py
problem-5.py
Python
0.000911
@@ -0,0 +1,287 @@ +n = 0%0Awhile True:%0A n += 1%0A divisible_list = %5B%5D%0A for i in range(1,21):%0A is_divisible = (n %25 i == 0)%0A if is_divisible:%0A divisible_list.append(is_divisible)%0A else:%0A break%0A %0A if len(divisible_list) == 20:%0A ...
d326391f6412afb54ee05a02b3b11e075f703765
fix value < 0 or higher than max. closes #941
kivy/uix/progressbar.py
kivy/uix/progressbar.py
''' Progress Bar ============ .. versionadded:: 1.0.8 .. image:: images/progressbar.jpg :align: right The :class:`ProgressBar` widget is used to visualize progress of some task. Only horizontal mode is supported, vertical mode is not available yet. The progress bar has no interactive elements, It is a display-o...
Python
0.000019
@@ -829,34 +829,386 @@ -value = NumericProperty(0. +def __init__(self, **kwargs):%0A self._value = 0.%0A super(ProgressBar, self).__init__(**kwargs)%0A%0A def _get_value(self):%0A return self._value%0A%0A def _set_value(self, value):%0A value = max(0, min(self.max, value))%0A ...
5e2e5eed760fdc40d474e511662cf7c22b1ea29b
add usbwatch.py
usbwatch.py
usbwatch.py
Python
0.000003
@@ -0,0 +1,2657 @@ +#!/usr/bin/env python3%0A# usbwatch.py - monitor addition/removal of USB devices%0A#%0A#%0A%0Aimport pyudev%0A%0Aclass UsbDevice:%0A @staticmethod%0A def fromUdevDevice(udev):%0A attr = lambda name: udev.attributes.asstring(name)%0A try:%0A try:%0A manufacturer = attr('manufactur...
9c2be5533dc14443a67ed22c34e2f059992e43cb
Create camera.py
Camera/camera.py
Camera/camera.py
Python
0.000002
@@ -0,0 +1,336 @@ +from SimpleCV import Camera%0A# Initialize the camera%0Acam = Camera()%0A# Loop to continuously get images%0Awhile True:%0A # Get Image from camera%0A img = cam.getImage()%0A # Make image black and white%0A img = img.binarize()%0A # Draw the text %22Hello World%22 on image%0A img.dr...
6014dab06ed2275c5703ab9f9e63272656733c69
Add retrieve_all_pages util method from mtp-cashbook
moj_utils/rest.py
moj_utils/rest.py
Python
0
@@ -0,0 +1,754 @@ +from django.conf import settings%0A%0A%0Adef retrieve_all_pages(api_endpoint, **kwargs):%0A %22%22%22%0A Some MTP apis are paginated, this method loads all pages into a single results list%0A :param api_endpoint: slumber callable, e.g. %60%5Bapi_client%5D.cashbook.transactions.locked.get%60%...
8d10e0e2db81023cb435b047f5c1da793e4b992e
Add python/matplotlib_.py
python/matplotlib_.py
python/matplotlib_.py
Python
0.00352
@@ -0,0 +1,929 @@ +# matplotlib_.py%0D%0A%0D%0A# Imports%0D%0Afrom matplotlib import ticker%0D%0A%0D%0A# label_axis%0D%0Adef label_axis(ax, x_or_y, axis_labels, flip, **props):%0D%0A axis_ticks = range(0, len(axis_labels))%0D%0A axis = getattr(ax, '%25saxis' %25 x_or_y)%0D%0A axis.set_major_locator(ticker.Fixe...
326ef75042fc1d3eeeb6834fd5ff80a2bd1a2be1
Add incoreect_regex.py solution
HackerRank/PYTHON/Errors_and_Exceptions/incoreect_regex.py
HackerRank/PYTHON/Errors_and_Exceptions/incoreect_regex.py
Python
0.000002
@@ -0,0 +1,209 @@ +#!/usr/bin/env python3%0Aimport re%0A%0Aif __name__ == '__main__':%0A for _ in range(int(input())):%0A try:%0A re.compile(input())%0A print('True')%0A except:%0A print('False')%0A
c675fe2a82733ef210bf287df277f8ae956a4295
Add beginning of main script
rarbg-get.py
rarbg-get.py
Python
0.000005
@@ -0,0 +1,409 @@ +#!env /usr/bin/python3%0A%0Aimport sys%0Aimport urllib.parse%0Aimport urllib.request%0A%0Adef main():%0A search = sys.argv%5B1%5D%0A url = 'http://rarbg.to/torrents.php?order=seeders&by=DESC&search='%0A url = url + search%0A print(url)%0A req = urllib.request.Request(url, headers=%7B'U...
480ae590ea1116fdbb5c6601d7466408f274c433
Implement for GNOME activateAutoLoginCommand
src/nrvr/el/gnome.py
src/nrvr/el/gnome.py
Python
0.000001
@@ -0,0 +1,1505 @@ +#!/usr/bin/python%0A%0A%22%22%22nrvr.el.gnome - Manipulate Enterprise Linux GNOME%0A%0AClasses provided by this module include%0A* Gnome%0A%0ATo be improved as needed.%0A%0AIdea and first implementation - Leo Baschy %3Csrguiwiz12 AT nrvr DOT com%3E%0A%0APublic repository - https://github.com/srguiwi...
6affa7946bafc418423c8e1857c6f2b55066c31a
this will find all the primes below a given number
generateprimes.py
generateprimes.py
Python
0.999869
@@ -0,0 +1,750 @@ +#!/usr/bin/env python 3.1%0A#doesn't work for numbers less than 4 %0Afrom math import sqrt %0Adef nextprime(number): %0A%09%22This function will find the smallest prime larger than the current number%22%0A%09potential= number%0A%09j=2%0A%09while j%3C=sqrt(potential):%0A %09if potential%25j:%0A...
6d12624e094ec58118d39c4340438c4a814d404f
add wildcard, this is just a string contain problem
wildcard.py
wildcard.py
Python
0.000001
@@ -0,0 +1,2938 @@ +class Solution:%0A%0A # @param s, an input string%0A%0A # @param p, a pattern string%0A%0A # @return a boolean%0A def shrink(self, pattern):%0A shrinked = %5B%5D%0A i = 0%0A while i %3C len(pattern):%0A stars = 0%0A questions = 0%0A w...
00c86aff808ecc5b6f015da5977265cfa76826bb
add fixtures that start related worker for tests
livewatch/tests/conftest.py
livewatch/tests/conftest.py
Python
0
@@ -0,0 +1,1587 @@ +import pytest%0Aimport time%0A%0Aimport django_rq%0Afrom celery.signals import worker_ready%0A%0Afrom .celery import celery%0A%0A%0AWORKER_READY = list()%0A%0A%0A@worker_ready.connect%0Adef on_worker_ready(**kwargs):%0A %22%22%22Called when the Celery worker thread is ready to do work.%0A This...
275cddfa56501868787abeef10fc515102ffd11d
make setup.py find all packages, now in src
python/setup.py
python/setup.py
Python
0
@@ -0,0 +1,232 @@ +from distutils.core import setup%0A%0Afrom setuptools import find_packages%0A%0Asetup(name='fancontrol',%0A version='0.1.0',%0A modules=%5B'fancontrol'%5D,%0A packages=find_packages(where=%22src%22),%0A package_dir=%7B%22%22: %22src%22%7D,%0A )%0A
9c5de3b667a8e98b0304fb64e30113f551b33404
Create getTwitterData.py
getTwitterData.py
getTwitterData.py
Python
0.000001
@@ -0,0 +1,1212 @@ +from tweepy import Stream%0Afrom tweepy import OAuthHandler%0Afrom tweepy.streaming import StreamListener%0Aimport time%0A%0Ackey = 'dNATh8K9vGwlOSR2phVzaB9fh'%0Acsecret = 'LmBKfyfoZmK1uIu577yFR9jYkVDRC95CXcKZQBZ8jWx9qdS4Vt'%0Aatoken = '2165798475-nuQBGrTDeCgXTOneasqSFZLd3SppqAJDmXNq09V'%0Aasecret =...
e84640c5c67759be3de1a934d974c250d7b73a0c
Split kernels into their own name space
scikits/statsmodels/sandbox/kernel.py
scikits/statsmodels/sandbox/kernel.py
Python
0.999848
@@ -0,0 +1,1596 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0AThis models contains the Kernels for Kernel smoothing.%0A%0AHopefully in the future they may be reused/extended for other kernel based method%0A%22%22%22%0Aclass Kernel(object):%0A %22%22%22%0A Generic 1D Kernel object.%0A Can be constructed by selectin...
632056eef0666808d16740f434a305d0c8995132
Create magooshScraper.py
magooshScraper.py
magooshScraper.py
Python
0.000001
@@ -0,0 +1,1560 @@ +import scrapy%0Afrom bs4 import BeautifulSoup%0A%0Aclass magooshSpider(scrapy.Spider):%0A%09name = 'magoosh'%0A%09start_urls = %5B'http://gre.magoosh.com/login'%5D%0A%0A%09def parse(self, response):%0A%09%09return scrapy.FormRequest.from_response(%0A%09%09%09response,%0A%09%09%09'''%0A%09%09%09Repla...
dbfc033fdfaad5820765a41766a5342831f3c4f9
add util script to dump twitter oauth tokens
scripts/remove_twuser_oauth.py
scripts/remove_twuser_oauth.py
Python
0
@@ -0,0 +1,973 @@ +%22%22%22Remove a twitter user's oauth tokens and reload iembot%22%22%22%0Afrom __future__ import print_function%0Aimport json%0Aimport sys%0A%0Aimport psycopg2%0Aimport requests%0A%0A%0Adef main(argv):%0A %22%22%22Run for a given username%22%22%22%0A screen_name = argv%5B1%5D%0A settings = ...
77aa24bbea447d8684614f0d089320d134412710
Test ini-configured app.
test_app.py
test_app.py
Python
0
@@ -0,0 +1,173 @@ +from flask import Flask%0Afrom flask.ext.iniconfig import INIConfig%0A%0A%0Aapp = Flask(__name__)%0AINIConfig(app)%0A%0A%0Awith app.app_context():%0A app.config.from_inifile('settings.ini')%0A
74bde8878aa9b336046374ce75fc4c7bc63eaba7
add test for VampSimpleHost
tests/test_vamp_simple_host.py
tests/test_vamp_simple_host.py
Python
0.000001
@@ -0,0 +1,917 @@ +#! /usr/bin/env python%0A%0Afrom unit_timeside import unittest, TestRunner%0Afrom timeside.decoder.file import FileDecoder%0Afrom timeside.core import get_processor%0Afrom timeside import _WITH_VAMP%0Afrom timeside.tools.test_samples import samples%0A%0A%0A@unittest.skipIf(not _WITH_VAMP, 'vamp-simpl...
0d596f8c7148c2ac13c2b64be09ca1e20719cdb9
add dumper of flowpaths to shapefile
scripts/util/dump_flowpaths.py
scripts/util/dump_flowpaths.py
Python
0
@@ -0,0 +1,520 @@ +%22%22%22Dump flowpaths to a shapefile.%22%22%22%0A%0Afrom geopandas import read_postgis%0Afrom pyiem.util import get_dbconn%0A%0A%0Adef main():%0A %22%22%22Go Main Go.%22%22%22%0A pgconn = get_dbconn('idep')%0A df = read_postgis(%22%22%22%0A SELECT f.fpath, f.huc_12, ST_Transform(f.g...
f7768b10df84a4b3bb784ee1d449e380b93d88bb
add a simple scan example
data/scan_example.py
data/scan_example.py
Python
0.000001
@@ -0,0 +1,1667 @@ +import numpy%0Aimport theano%0A%0Afrom theano import tensor%0A%0A%0A# some numbers%0An_steps = 10%0An_samples = 5%0Adim = 10%0Ainput_dim = 20%0Aoutput_dim = 2%0A%0A%0A# one step function that will be used by scan%0Adef oneStep(x_t, h_tm1, W_x, W_h, W_o):%0A%0A h_t = tensor.tanh(tensor.dot(x_t, W_...
9737f8b1551adb5d3be62b1922de27d867ac2b24
Add forwarding script for build-bisect.py.
build/build-bisect.py
build/build-bisect.py
Python
0.000002
@@ -0,0 +1,324 @@ +#!/usr/bin/python%0A# Copyright (c) 2010 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0Aimport sys%0A%0Aprint %22This script has been moved to tools/bisect-builds.py.%22%0Aprint %22Please update...
4c2663939008285c395ee5959c38fab280f43e58
Create 03.PracticeCharsAndStrings.py
TechnologiesFundamentals/ProgrammingFundamentals/DataTypesAndVariables-Exercises/03.PracticeCharsAndStrings.py
TechnologiesFundamentals/ProgrammingFundamentals/DataTypesAndVariables-Exercises/03.PracticeCharsAndStrings.py
Python
0
@@ -0,0 +1,75 @@ +print(input())%0Aprint(input())%0Aprint(input())%0Aprint(input())%0Aprint(input())%0A
782e4da9d04c656b3e5290269a4f06328ee5d508
add file
main.py
main.py
Python
0.000002
@@ -0,0 +1,168 @@ +import numpy as np%0A@np.vectorize%0Adef F(n):%0A return 1./np.sqrt(5.)*(((1.+np.sqrt(5))/2.)**n-((1.-np.sqrt(5))/2.)**n)%0An = np.arange(10)%0AF = F(n)%0Anp.savetxt(%22F.txt%22, F)%0A%0A
60f13bdfb97e83ac1bf2f72e3eec2e2c2b88cbb3
add tests for potential density computation
biff/tests/test_bfe.py
biff/tests/test_bfe.py
Python
0.000001
@@ -0,0 +1,1045 @@ +# coding: utf-8%0A%0Afrom __future__ import division, print_function%0A%0A__author__ = %22adrn %3Cadrn@astro.columbia.edu%3E%22%0A%0A# Third-party%0Aimport astropy.units as u%0Afrom astropy.constants import G as _G%0AG = _G.decompose(%5Bu.kpc,u.Myr,u.Msun%5D).value%0Aimport numpy as np%0A%0A# Projec...
1e808aa70882cd30cd0ac7a567d12efde99b5e61
Create runserver.py
runserver.py
runserver.py
Python
0.000002
@@ -0,0 +1,47 @@ +from ucwa.http import app%0A%0Aapp.run(debug=True)%0A
98eb8c1bb013106108e239c7bc8b6961a2f321cd
Allow debug mode from the CLI
blaze/server/spider.py
blaze/server/spider.py
#!/usr/bin/env python from __future__ import absolute_import import os import sys import argparse import yaml from odo import resource from odo.utils import ignoring from .server import Server, DEFAULT_PORT __all__ = 'spider', 'from_yaml' def _spider(resource_path, ignore, followlinks, hidden): resources =...
Python
0.000001
@@ -4086,24 +4086,145 @@ den files')%0A + p.add_argument('-D', '--debug', action='store_true',%0A help='Start the Flask server in debug mode')%0A return p @@ -4591,16 +4591,34 @@ rgs.port +, debug=args.debug )%0A%0A%0Aif _
38b1353f42454905b0bc1b1e79e510a7df9db1cf
Clear memcached.
tools/run-dev.py
tools/run-dev.py
#!/usr/bin/env python import optparse import subprocess import signal import traceback import sys import os from twisted.internet import reactor from twisted.web import proxy, server, resource # Monkey-patch twisted.web.http to avoid request.finish exceptions # https://trac.zulip.net/ticket/1728 from twisted.web...
Python
0
@@ -15,16 +15,55 @@ python%0A +from __future__ import print_function%0A%0A import o @@ -1349,16 +1349,158 @@ n on')%0A%0A +parser.add_option('--no-clear-memcached',%0A action='store_false', dest='clear_memcached',%0A default=True, help='Do not clear memcached')%0A%0A (options @@ -2100,16 +2100,142 @@ repo')...
f737a8be41111f65944b00eb85a76687653fc8c0
Create sort_fpkm.py
sort_fpkm.py
sort_fpkm.py
Python
0
@@ -0,0 +1,766 @@ +import os%0Aimport fnmatch%0Aimport sys, csv ,operator%0A%0Afor root, dirnames, filenames in os.walk('/Users/idriver/RockLab-files/test'):%0A for filename in fnmatch.filter(filenames, '*.fpkm_tracking'):%0A if filename =='isoforms.fpkm_tracking':%0A data = csv.reader(open(os.path.join(root, ...
d42aad6a15dfe9cc5a63dbb19efe112534b91a5e
Add autoexec script for reference (already bundled in config)
resources/autoexec.py
resources/autoexec.py
Python
0
@@ -0,0 +1,287 @@ +# place at ~/.kodi/userdata/autoexec.py%0Aimport xbmc%0Aimport time%0Axbmc.executebuiltin(%22XBMC.ReplaceWindow(1234)%22)%0Atime.sleep(0.1)%0Axbmc.executebuiltin('PlayMedia(%22/storage/videos/SSL%22,%22isdir%22)')%0Axbmc.executebuiltin('xbmc.PlayerControl(repeatall)')%0Axbmc.executebuiltin(%22Action(...
51d26aecab3eee55a811657fe65b18cb08581f46
Make logging.yml configurable
blues/elasticsearch.py
blues/elasticsearch.py
""" Elasticsearch Blueprint ======================= **Fabric environment:** .. code-block:: yaml blueprints: - blues.elasticsearch settings: elasticsearch: version: 1.5 # Version of elasticsearch to install (Required) cluster_name: foobar # Nam...
Python
0.000001
@@ -3432,24 +3432,25 @@ size', 1000) +, %0A %7D%0A c @@ -3526,24 +3526,184 @@ , context)%0A%0A + context = %7B%0A 'log_level': blueprint.get('log_level', 'WARN'),%0A %7D%0A logging = blueprint.upload('./logging.yml', '/etc/elasticsearch/', context)%0A%0A context @@ -3869,16 +3869,27 @@ n...
5b89eb48a76a792cdd6e5cf8f0438f810a5e436a
Make isolated volume tests have unique tenant
tempest/tests/volume/base.py
tempest/tests/volume/base.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack, LLC # 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/...
Python
0.998887
@@ -3069,24 +3069,34 @@ name_root = +rand_name( cls.__name__ @@ -3095,16 +3095,17 @@ __name__ +) %0A
159ed7dd9dd5ade6c4310d2aa106b13bf94aa903
Add empty cloner
stoneridge_cloner.py
stoneridge_cloner.py
Python
0.000007
@@ -0,0 +1,428 @@ +#!/usr/bin/env python%0A# This Source Code Form is subject to the terms of the Mozilla Public License,%0A# v. 2.0. If a copy of the MPL was not distributed with this file, You can%0A# obtain one at http://mozilla.org/MPL/2.0/.%0A%0A# TODO - This will run on the central server, and download releases f...
9c3682ec717fd4de5555874ad3665c6f7be479b8
improve ecom
netforce_sale/netforce_sale/models/payment_method.py
netforce_sale/netforce_sale/models/payment_method.py
from netforce.model import Model,fields,get_model from netforce import database from netforce.logger import audit_log class PaymentMethod(Model): _inherit="payment.method" def payment_received(self,context={}): res=super().payment_received(context=context) if res: return res ...
Python
0.000035
@@ -436,92 +436,8 @@ no)%0A - amount=context.get(%22amount%22)%0A currency_id=context.get(%22currency_id%22)%0A @@ -469,16 +469,16 @@ %22type%22)%0A + @@ -866,209 +866,8 @@ id:%0A - if currency_id and currency_id!=sale.currency_id.id:%0A raise Exception(%22Rece...
3f6a08d92f46c606e99c14eb12849e1386704cf3
Bump version to 0.6
oscar/__init__.py
oscar/__init__.py
import os # Use 'final' as the 4th element to indicate # a full release VERSION = (0, 6, 0, 'beta', 1) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: # Append 3rd digit if > 0 version = '...
Python
0
@@ -92,16 +92,17 @@ 0, ' -beta', 1 +final', 0 )%0A%0A%0A
d9710fa2af26ab4ab5fef62adc5be670437bea68
Create logistics_regression.py
logistics_regression.py
logistics_regression.py
Python
0.000024
@@ -0,0 +1,2456 @@ +#!/usr/bin/python%0A# -*-coding:utf-8 -*-%0A%0Afrom math import exp%0Aimport random%0Aimport data_tool%0A%0A#y = x1*a1 + x2*a2 + x3*a3 + ... + xn*an + b%0Adef predict(data,%0A coef,%0A bias):%0A pred = 0.0%0A for index in range(len(coef)):%0A pred += (data%5Bindex%...
5211117033f596bd506e81e8825ddfb08634c25e
Create battery.py
client/iOS/battery.py
client/iOS/battery.py
Python
0.000028
@@ -0,0 +1,771 @@ +# coding: utf-8%0A%0Aimport collections, objc_util%0A%0Abattery_info = collections.namedtuple('battery_info', 'level state')%0A%0Adef get_battery_info():%0A device = objc_util.ObjCClass('UIDevice').currentDevice()%0A device.setBatteryMonitoringEnabled_(True)%0A try:%0A return battery_...
840d4d555b7b2858ca593251f1593943b10b135b
Add setup_egg.py
setup_egg.py
setup_egg.py
Python
0.000001
@@ -0,0 +1,626 @@ +#!/usr/bin/env python%0A%22%22%22Wrapper to run setup.py using setuptools.%22%22%22%0A%0Afrom setuptools import setup %0A%0A################################################################################%0A# Call the setup.py script, injecting the setuptools-specific arguments.%0A%0Aextra_setuptools...
71a6c671f802e3b1c123b083ef34f81efeb55750
Create MakeMaskfiles.py
MakeMaskfiles.py
MakeMaskfiles.py
Python
0.000001
@@ -0,0 +1,1909 @@ +import gzip%0Aimport sys%0Afrom collections import defaultdict%0A%0A%0Adef readFasta(infile):%0A%09sequence = ''%0A%09if '.gz' in infile:%0A%09%09with gzip.open(infile) as data:%0A%09%09%09for line in data:%0A%09%09%09%09if '%3E' in line:%0A%09%09%09%09%09seqname = line.strip().replace('%3E','')%0A%...
675de92e16e268badd8c6f5de992c3901cc8f2ce
Update Category Model
apps/shop/migrations/0004_category_parent_category.py
apps/shop/migrations/0004_category_parent_category.py
Python
0
@@ -0,0 +1,564 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.5 on 2017-02-11 19:34%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('shop', '0003_pro...
f2d1421555f00f7bcb77f43cd010c221045c6bfd
Add tests for nd-shifty
tests/console/test_shifty.py
tests/console/test_shifty.py
Python
0
@@ -0,0 +1,1389 @@ +import click.testing%0A%0Afrom netdumplings.console.shifty import shifty%0Afrom netdumplings.exceptions import NetDumplingsError%0A%0A%0Aclass TestShifty:%0A %22%22%22%0A Test the nd-shifty commandline tool.%0A %22%22%22%0A def test_shifty(self, mocker):%0A %22%22%22%0A Tes...
dd983ae232829559766bcdf4d2ea58861b8a47ad
Bring your own daemon.
varnish_statd.py
varnish_statd.py
Python
0
@@ -0,0 +1,902 @@ +#!/usr/bin/env python%0A%0Aimport time%0Aimport os%0Afrom pprint import pprint%0A%0Aimport varnishapi%0A%0A%0Adef stat(name=None):%0A if name is None:%0A vsc = varnishapi.VarnishStat()%0A else:%0A vsc = varnishapi.VarnishStat(opt=%5B%22-n%22, name%5D)%0A r = vsc.getStats()%0A ...
c1d4525d5f43a5c2bfbfd88ab0dd943eb2452574
add 127
vol3/127.py
vol3/127.py
Python
0.999999
@@ -0,0 +1,700 @@ +from fractions import gcd%0A%0Aif __name__ == %22__main__%22:%0A LIMIT = 120000%0A rad = %5B1%5D * LIMIT%0A for i in range(2, LIMIT):%0A if rad%5Bi%5D == 1:%0A for j in range(i, LIMIT, i):%0A rad%5Bj%5D *= i%0A ele = %5B%5D%0A for i in range(1, LIMIT):%...
8e7b57c8bc7be6a061d0c841700291a7d85df989
add 174
vol4/174.py
vol4/174.py
Python
0.999959
@@ -0,0 +1,366 @@ +if __name__ == %22__main__%22:%0A L = 10 ** 6%0A count = %5B0%5D * (L + 1)%0A for inner in range(1, L / 4 + 1):%0A outer = inner + 2%0A used = outer * outer - inner * inner%0A while used %3C= L:%0A count%5Bused%5D += 1%0A outer += 2%0A us...
a5b4fa261750fa79d61fc16b6061d449aa7e3523
Add missing block.py
rasterio/block.py
rasterio/block.py
Python
0.000088
@@ -0,0 +1,128 @@ +%22%22%22Raster Blocks%22%22%22%0A%0Afrom collections import namedtuple%0A%0A%0ABlockInfo = namedtuple('BlockInfo', %5B'row', 'col', 'window', 'size'%5D)%0A
65843b537e45b98068566c6cc57e4a3ad139d607
add variant.py
cendr/views/api/variant.py
cendr/views/api/variant.py
Python
0.000001
@@ -0,0 +1,1184 @@ +# NEW API%0A%0Afrom cendr import api, cache, app%0Afrom cyvcf2 import VCF%0Afrom flask import jsonify%0Aimport re%0Aimport sys%0Afrom subprocess import Popen, PIPE%0A%0A%0Adef get_region(region):%0A m = re.match(%22%5E(%5B0-9A-Za-z%5D+):(%5B0-9%5D+)-(%5B0-9%5D+)$%22, region)%0A if not m:%0A ...
d2bcba204d36a8ffd1e6a1ed79b89fcb6f1c88c5
Add file to test out kmc approach. Dump training k-mers to fasta file
ideas/test_kmc.py
ideas/test_kmc.py
Python
0
@@ -0,0 +1,1362 @@ +# This code will test out the idea of using kmc to%0A# 1. quickly enumerate the k-mers%0A# 2. intersect these with the training database, output as fasta%0A# 3. use that reduced fasta of intersecting kmers as the query to CMash%0A%0A###################################################################...
c584bca2f9ac7bc005128d22b4e81a6b4885724c
allow Fabric to infrastructure config from YAML data files
templates/fabfile.py
templates/fabfile.py
Python
0
@@ -0,0 +1,484 @@ +import yaml%0Afrom fabric.api import env, run%0A%0Adef import_inf(data='web_app_basic.yml'):%0A inf_data = open(data, 'r')%0A inf = yaml.load(inf_data)%0A# for box in inf:%0A# print '%5Cn'%0A# for parameter in box:%0A# print parameter, ':', box%5Bparameter%5D%0A r...
f657a02a560af1a5860f9a532052f54330018620
Build "shell" target with chromium_code set.
ui/shell/shell.gyp
ui/shell/shell.gyp
# Copyright 2013 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. { 'targets': [ { 'target_name': 'shell', 'type': 'static_library', 'dependencies': [ '../aura/aura.gyp:aura', '../vie...
Python
0.999994
@@ -158,16 +158,62 @@ ile.%0A%0A%7B%0A + 'variables': %7B%0A 'chromium_code': 1,%0A %7D,%0A 'targe @@ -307,24 +307,60 @@ dencies': %5B%0A + '../../skia/skia.gyp:skia',%0A '../ @@ -420,44 +420,8 @@ s',%0A - '../../skia/skia.gyp:skia',%0A
bddfeeec193d9fb61d99c70be68093c854e541f7
Add initial check thorium state
salt/thorium/check.py
salt/thorium/check.py
Python
0
@@ -0,0 +1,1760 @@ +'''%0AThe check Thorium state is used to create gateways to commands, the checks%0Amake it easy to make states that watch registers for changes and then just%0Asucceed or fail based on the state of the register, this creates the pattern%0Aof having a command execution get gated by a check state via ...
4a8ab668df01b7aaf402610df98067b046c78aa9
Remove unused BaseLibraryUpdateProvider
mopidy/backends/base.py
mopidy/backends/base.py
from __future__ import unicode_literals import copy class Backend(object): #: Actor proxy to an instance of :class:`mopidy.audio.Audio`. #: #: Should be passed to the backend constructor as the kwarg ``audio``, #: which will then set this field. audio = None #: The library provider. An insta...
Python
0
@@ -2829,746 +2829,8 @@ s%0A%0A%0A -class BaseLibraryUpdateProvider(object):%0A uri_schemes = %5B%5D%0A%0A def load(self):%0A %22%22%22Loads the library and returns all tracks in it.%0A%0A *MUST be implemented by subclass.*%0A %22%22%22%0A raise NotImplementedError%0A%0A def add(se...
0b0647a0537c3c325f5cf57cae933e06f7997ea9
add "_" prefix to plot names
crosscat/tests/timing_analysis.py
crosscat/tests/timing_analysis.py
import argparse def _generate_parser(): default_num_rows = [100, 400, 1000, 4000] default_num_cols = [8, 16, 32] default_num_clusters = [1, 2] default_num_views = [1, 2] # parser = argparse.ArgumentParser() parser.add_argument('--dirname', default='timing_analysis', type=str) parser.ad...
Python
0
@@ -2121,16 +2121,91 @@ esults)%0A + # add plot_prefix so plots show up at top of list of files/folders%0A @@ -2233,16 +2233,33 @@ results, + plot_prefix='_', dirname
42e0504933d6b9e55cdb6edb9931ba080baab136
add 408, replace print in test cases into assert
python/408_valid_word_abbreviation.py
python/408_valid_word_abbreviation.py
Python
0.000002
@@ -0,0 +1,1880 @@ +%22%22%22%0AGiven a non-empty string s and an abbreviation abbr, return whether the string%0Amatches with the given abbreviation.%0A%0AA string such as %22word%22 contains only the following valid abbreviations:%0A%0A%5B%22word%22, %221ord%22, %22w1rd%22, %22wo1d%22, %22wor1%22, %222rd%22, %22w2d%22...
5e91e3b2c7e4cbc9f14067a832b87c336c0811e7
update add test for c4
redis_i_action/c4-process-log-and-replication/test.py
redis_i_action/c4-process-log-and-replication/test.py
Python
0
@@ -0,0 +1,1767 @@ +class TestCh04(unittest.TestCase):%0A%09def setUp(self):%0A%09import redis%0A%09self.conn = redis.Redis(db=15)%0A%09self.conn.flushdb()%0A%0A%09def tearDown(self):%0A%09%09self.conn.flushdb()%0A%09%09del self.conn%0A%09%09print%0A%09%09print%0A%0A%09def test_list_item(self):%0A%09%09import pprint%0A...
5fd556bc01fdd5d3c9690a56a70557fbd6eb73f8
print the to calc statistical test
MachineLearning/print_ensemble_precisions.py
MachineLearning/print_ensemble_precisions.py
Python
0.999999
@@ -0,0 +1,2523 @@ +#%0A# This program is distributed without any warranty and it%0A# can be freely redistributed for research, classes or private studies,%0A# since the copyright notices are not removed.%0A#%0A# This file just read the data to calculate the statistical test%0A#%0A# Jadson Santos - jadsonjs@gmail.com%0...
88d2ad776518d62a66fa3b8f7dd7520cff3debfc
Create bulk_parse.py
scripts/bulk_parse.py
scripts/bulk_parse.py
Python
0.000008
@@ -0,0 +1 @@ +%0A
10d71b1208175eac4af0a20d7ee0a8176c7829ef
add new rename script to prepend to *.c files
rename/prepend.py
rename/prepend.py
Python
0
@@ -0,0 +1,585 @@ +import os%0Aimport sys%0A%0Aif __name__ == '__main__':%0A if len(sys.argv) %3C 2:%0A print 'usage: %3Cpath%3E %3Cprepend%3E'%0A sys.exit()%0A%0Aexts=%5B'.c'%5D%0Achange_count = 0%0Afor root, dirs, files in os.walk(sys.argv%5B1%5D):%0A for filename in files:%0A if any(filena...
02ad029840b2e770bc802fd7f8504498cb0f756d
Add `issubset` and `issuperset` tests
lib/ansible/plugins/test/mathstuff.py
lib/ansible/plugins/test/mathstuff.py
Python
0.000001
@@ -0,0 +1,1012 @@ +# (c) 2016, Ansible, Inc%0A#%0A# This file is part of Ansible%0A#%0A# Ansible is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as published by%0A# the Free Software Foundation, either version 3 of the License, or%0A# (at your option) an...
adede4415e36830485429f49b8476f655f3d4929
Add environment.py
tests/environment.py
tests/environment.py
Python
0.000003
@@ -0,0 +1,497 @@ +# -*- coding: UTF-8 -*-%0Aimport shutil%0Afrom steps.common_steps.common_environment import docker_setup%0A%0A%0Adef before_all(context):%0A docker_setup(context)%0A context.build_or_pull_image(skip_pull=True, skip_build=True)%0A%0A%0Adef after_scenario(context, scenario):%0A if 'KEEP_CONTAI...
bf86584829f56f91b363f251d77f3157f952db0f
Add tests for masking of data based on being within a range of values
tests/test_cyprep.py
tests/test_cyprep.py
Python
0
@@ -0,0 +1,1050 @@ +import unittest%0A%0Aimport numpy as np%0A%0Aimport yatsm._cyprep%0A%0A%0Aclass TestCyPrep(unittest.TestCase):%0A%0A @classmethod%0A def setUpClass(cls):%0A # Test data%0A n_band = 7%0A n_mask = 50%0A n_images = 1000%0A%0A cls.data = np.random.randint(%0A ...
9c249d3f9d202632b7fd2241d39dfc2e180fd358
Add ledger tests
tests/test_ledger.py
tests/test_ledger.py
Python
0.000001
@@ -0,0 +1,1566 @@ +# -*- coding: utf-8 -*-%0Aimport pytest%0A%0Afrom accounts.ledger import Ledger%0A%0A# Database migrations run for each test in this module.%0A# See %60conftest.pytest_runtest*%60.%0ADB_MIGRATIONS = %5B'0003-create-balances', '0004-create-movements'%5D%0A%0A# Fixtures ###%0A%0A@pytest.fixture%0Adef ...
65f6b1101aba2086654f2ff0ff3e942f69d584b2
Add an application that returns spaCy similarity query
app/app.py
app/app.py
Python
0.000278
@@ -0,0 +1,618 @@ +from flask import Flask, jsonify%0Aimport spacy.en%0Afrom numpy import dot%0Afrom numpy.linalg import norm%0A%0Aapp = Flask(__name__)%0Anlp = spacy.en.English()%0A%0Adef cossim(a, b):%0A return dot(a, b) / (norm(a) * norm(b))%0A%0A@app.route('/')%0Adef index():%0A return %22Hello, World!%22%0A%...
ddd4473f8edc4e7cfc503fc6cdbb570f33f224a4
Add Preprocessor module Edges to generate possible edges between two entities given the relation type
nala/preprocessing/edges.py
nala/preprocessing/edges.py
Python
0.000003
@@ -0,0 +1,2006 @@ +import abc%0Afrom nala.structures.data import Edge%0A%0Aclass EdgeGenerator:%0A %22%22%22%0A Abstract class for generating edges between two entities. Each edge represents%0A a possible relationship between the two entities%0A Subclasses that inherit this class should:%0A * Be named %...
0377cf9cc3c2460c2936ec9153edbdb196cff5bf
Add zdt agent
zephyrus/examples/zdt/agent.py
zephyrus/examples/zdt/agent.py
Python
0.000017
@@ -0,0 +1,583 @@ +import sys%0Afrom itertools import islice%0Afrom math import sqrt%0A%0Afrom zephyrus.agent import Agent%0Afrom zephyrus.message import Message%0A%0A%0Aclass ZDTAgent(Agent):%0A def mainloop(self):%0A msg = self.socket_receive.recv()%0A action = self.perceive(msg.content)%0A se...
bc812daf7c99b34a3952d933666f240597eb835d
add a spider for Xin Shi Dai board, Ya Zhou catagory.
t66ySpider/t66ySpider/spiders/t66yXinshidaiYazhouSpider.py
t66ySpider/t66ySpider/spiders/t66yXinshidaiYazhouSpider.py
Python
0
@@ -0,0 +1,1123 @@ +# -*- coding: utf-8 -*-%0A%0Aimport scrapy%0A%0Afrom t66ySpider.items import T66YspiderXinshidaiItem%0A%0A%0Aclass t66yDagaierSpider(scrapy.Spider):%0A name = 'XinShiDaiYaZhou'%0A allowed_domains = %5B't66y.com'%5D%0A start_urls = %5B%22http://t66y.com/thread0806.php?fid=8&type=1%22%5D%0A ...
25d8cbfd4b59166ba748d5cd42fbcd7ffe925f0e
Allow using exogenous data in hierachical models #124
tests/hierarchical/test_hierarchy_AU_AllMethods_Exogenous_all_nodes.py
tests/hierarchical/test_hierarchy_AU_AllMethods_Exogenous_all_nodes.py
Python
0
@@ -0,0 +1,2004 @@ +import pandas as pd%0Aimport numpy as np%0Aimport pyaf.HierarchicalForecastEngine as hautof%0Aimport pyaf.Bench.TS_datasets as tsds%0A%0Aimport datetime%0A%0A#get_ipython().magic('matplotlib inline')%0A%0Adef create_exog_data(b1):%0A # fake exog data based on date variable%0A lDate1 = b1.mPast...
b135e8e473837909c6847f8a52711527409b5224
Add windows build tools
tools/build_mwpfh.py
tools/build_mwpfh.py
Python
0
@@ -0,0 +1,930 @@ +from __future__ import print_function%0A%0Aimport subprocess%0Aimport sys%0Aimport os%0A%0Apath = os.path.split(__file__)%5B0%5D%0Aif path:%0A%09os.chdir(path)%0A%0Aenvironments = %5B'26', '27', '32', '33', '34'%5D%0A%0Atarget = %22pypi%22 if %22--push%22 in sys.argv else %22test%22%0A%0Areturnvalues...
002842c4d7db431a4dedc067ef54dab8747d70f4
add debug statement
library/pyjamas/media/Video.mshtml.py
library/pyjamas/media/Video.mshtml.py
class Video(Media): def __init__(self, src=None, **kwargs): print "create object" obj = DOM.createElement("OBJECT") DOM.setAttribute(obj, "TYPE", "application/x-mplayer2") #DOM.setAttribute(obj, "type", "application/x-oleobject") DOM.setAttribute(obj, "classid", ...
Python
0.000018
@@ -1236,16 +1236,39 @@ ement()%0A + print dir(obj)%0A
012acdc7a280b307bbb110449dcfee5d05a77e38
Create new package (#6379)
var/spack/repos/builtin/packages/r-chemometrics/package.py
var/spack/repos/builtin/packages/r-chemometrics/package.py
Python
0
@@ -0,0 +1,2392 @@ +##############################################################################%0A# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Created by Todd Gamblin, tgamblin@llnl.gov, All r...
aa78a2670766b0a5e093a1876cb402ed513573bd
Add script to explore parameters units
openfisca_france/scripts/parameters/explore_parameters_unit.py
openfisca_france/scripts/parameters/explore_parameters_unit.py
Python
0
@@ -0,0 +1,1857 @@ +# -*- coding: utf-8 -*-%0A%0A%0Afrom openfisca_core.parameters import ParameterNode, Scale%0Afrom openfisca_france import FranceTaxBenefitSystem%0A%0A%0Atax_benefit_system = FranceTaxBenefitSystem()%0Aparameters = tax_benefit_system.parameters%0A%0A%0Adef get_parameters_by_unit(parameter, parameters...
e095b6a76ac36255983d8c69d4899d64178e0ef3
Add segment_euclidean_length tests module
tests/plantcv/morphology/test_segment_euclidean_length.py
tests/plantcv/morphology/test_segment_euclidean_length.py
Python
0.000001
@@ -0,0 +1,902 @@ +import pytest%0Aimport cv2%0Aimport numpy as np%0Afrom plantcv.plantcv import outputs%0Afrom plantcv.plantcv.morphology import segment_euclidean_length%0A%0A%0Adef test_segment_euclidean_length(morphology_test_data):%0A # Clear previous outputs%0A outputs.clear()%0A skeleton = cv2.imread(mor...
26ab37868e67b5b815cf8df67cc04876ff44c148
Add file for Nongrammar entities tests
tests/rules_tests/isValid_tests/NongrammarEntitiesTest.py
tests/rules_tests/isValid_tests/NongrammarEntitiesTest.py
Python
0
@@ -0,0 +1,287 @@ +#!/usr/bin/env python%0A%22%22%22%0A:Author Patrik Valkovic%0A:Created 23.06.2017 16:39%0A:Licence GNUv3%0APart of grammpy%0A%0A%22%22%22%0A%0Afrom unittest import main, TestCase%0Afrom grammpy import Rule%0Afrom .grammar import *%0A%0A%0Aclass NongrammarEntitiesTest(TestCase):%0A pass%0A%0A%0Aif ...
e80ec7adc6fe71310e1c2adba720be9640a49d0f
test code for midiGenerator
src/test4.py
src/test4.py
Python
0
@@ -0,0 +1,476 @@ +import midiGenerator%0Agenerator = midiGenerator.MidiGenerator(200,1)%0Achannel = midiGenerator.Channel()%0Anote = midiGenerator.Note(43,100,200)%0Achannel.addNote(note)%0Achannel.addNote(midiGenerator.Note(45,200,300))%0Achannel.addNote(midiGenerator.Note(57,300,400))%0Achannel.addNote(midiGenerator...
3757ec1444c55049009bc7d40490fa4a1a4f33d4
Fix send_response implementation
run_dev_server.py
run_dev_server.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 json import optparse import os import sys import time from build import generate_deps_js_contents as deps_generator import S...
Python
0.00001
@@ -1602,28 +1602,49 @@ -super(Handler, self) +SimpleHTTPServer.SimpleHTTPRequestHandler .sen @@ -1654,12 +1654,18 @@ espo -sne( +nse(self, code
e195aef0fa870bf0f471be99a0144a59fdcc5b97
Create norm_distri_of_proj_valu.py
norm_distri_of_proj_valu.py
norm_distri_of_proj_valu.py
Python
0.000005
@@ -0,0 +1,509 @@ +import pandas as pd%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0A%25matplotlib inline%0Aimport math%0A%0Ax_train = pd.read_csv(%22Train.csv%22)%0Ax_test = pd.read_csv(%22Test.csv%22)%0A%0Adef log_method(x):%0A if x == 0:%0A return 0%0A return math.log(x,2)%0A%0Atest = x_train...
3724e828ea7c0aa2a910db16c1392390f7c9f7a8
add a simple schema building tool
spyne/test/interface/build_schema.py
spyne/test/interface/build_schema.py
Python
0
@@ -0,0 +1,268 @@ +#!/usr/bin/env python%0A%0A# This can be used to debug invalid Xml Schema documents.%0A%0Aimport sys%0A%0Afrom lxml import etree%0A%0Aif len(sys.argv) != 2:%0A print %22Usage: %25s %3Cpath_to_xsd_file%3E%22 %25 sys.argv%5B0%5D%0A sys.exit(1)%0A%0Af = open(sys.argv%5B1%5D)%0A%0Aetree.XMLSchema(e...
56a8250baa197285a5727dfbca12adaab81238ab
Add a snippet.
python/tkinter/python3/menu_checkbutton.py
python/tkinter/python3/menu_checkbutton.py
Python
0.000002
@@ -0,0 +1,2209 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2016 J%C3%A9r%C3%A9mie DECOCK (http://www.jdhp.org)%0A%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in t...
fa3a02e6660ce556defc2f2c6008c6eb24eb71c1
Add a simple sampler for playing wav files triggered by note on messages
Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Sampler.py
Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Sampler.py
Python
0
@@ -0,0 +1,3108 @@ +import time%0Aimport wave%0Aimport pygame%0Aimport numpy%0Aimport Axon%0Afrom Axon.SchedulingComponent import SchedulingComponent%0A%0Aclass WavVoice(SchedulingComponent):%0A bufferSize = 1024%0A def __init__(self, fileName, **argd):%0A super(WavVoice, self).__init__(**argd)%0A%0A ...
bff1e954213fb7592505c94294eb3800a8b199c3
Update patternMatch.py
TechInterviews/Python/patternMatch.py
TechInterviews/Python/patternMatch.py
import sys import re def stripSlashes(path): if path.startswith('/'): path = path[1:] if path.endswith('/'): path = path[:-1] return path def findBestWildCardMatch(patterns): pass def getRePattern(pattern): return pattern.replace(',', '/').replace('*', '[a-zA-Z0-9_]*') def findBe...
Python
0
@@ -15,16 +15,62 @@ ort re%0A%0A +# Strip only the beginning and ending slashes%0A def stri @@ -240,24 +240,180 @@ (patterns):%0A + #The best match is wildcards that are rightmost%0A #Get the positions of the * and add them to get the largest number to figure out which is rightmost%0A pass%0A%0Ade
bbe0cf1666b4706973bfba73ed77126581026057
add new test case to test add image from local file system.
integrationtest/vm/virt_plus/other/test_add_local_image.py
integrationtest/vm/virt_plus/other/test_add_local_image.py
Python
0
@@ -0,0 +1,1865 @@ +'''%0D%0A%0D%0ANew Integration Test for add image from MN local URI.%0D%0A%0D%0AThe file should be placed in MN.%0D%0A%0D%0A@author: Youyk%0D%0A'''%0D%0A%0D%0Aimport os%0D%0Aimport time%0D%0Aimport zstackwoodpecker.test_util as test_util%0D%0Aimport zstackwoodpecker.test_state as test_state%0D%0Aimp...
bfdcebfb287b6c3495e74888ace0409f47b530c9
add testGroup script
ros_ws/src/crazyswarm/scripts/testGroup.py
ros_ws/src/crazyswarm/scripts/testGroup.py
Python
0.000001
@@ -0,0 +1,453 @@ +#!/usr/bin/env python%0A%0Aimport numpy as np%0Afrom pycrazyswarm import *%0A%0AZ = 1.5%0A%0Aif __name__ == %22__main__%22:%0A swarm = Crazyswarm()%0A timeHelper = swarm.timeHelper%0A allcfs = swarm.allcfs%0A%0A allcfs.crazyfliesById%5B9%5D.setGroup(1)%0A allcfs.crazyfliesById%5B10%5D....