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
2a6527c60d09c0cbb2f1902b57ae02ddade213eb
Create communicati.py
libs/communicati.py
libs/communicati.py
Python
0.000001
@@ -0,0 +1,1012 @@ +# communications.py%0A# M%C3%B3nica Mil%C3%A1n (@mncmilan)%0A# mncmilan@gmail.com%0A# http://steelhummingbird.blogspot.com.es/%0A%0A# Library that contains all necessary methods in order to enable communications between PC and eZ430-Chronos.%0A%0Aimport serial%0A%0As = serial.Serial('COM4', baudrate...
e5293f7e33740f210ab58c3c05db18829db1474d
add docstrings [skip ci]
mailthon/helpers.py
mailthon/helpers.py
""" mailthon.helpers ~~~~~~~~~~~~~~~~ Implements various helper functions/utilities. :copyright: (c) 2015 by Eeo Jun :license: MIT, see LICENSE for details. """ import sys import mimetypes from collections import MutableMapping from email.utils import formataddr if sys.version_info[0] == 3: ...
Python
0
@@ -1836,16 +1836,268 @@ (dict):%0A + %22%22%22%0A A dictionary that handles unicode values%0A magically - that is, byte-values are%0A automatically decoded. Accepts a dict%0A or iterable *values*.%0A%0A :param encoding: Default encoding used%0A if no encoding is specified.%0A %22%22%22%0A%...
ea652c892219d1ed08a0453a3b2ede3efb452e23
Create __init__.py
ui_techmenu/__init__.py
ui_techmenu/__init__.py
Python
0.000429
@@ -0,0 +1,1744 @@ +# -*- coding: utf-8 -*-%0A%0A######################################################################%0A#%0A# ui_techmenu - Explode Technical Menu for Odoo %0A# Copyright (C) 2012 - TODAY, Ursa Information Systems (%3Chttp://ursainfosystems.com%3E)%0A# Copyright (C) 2004-2010 Tiny SPRL (%3Chttp://t...
841e8fe236eab35b803cb9d8bec201306ce4642e
Add script to generate big RUM_* files
util/repeat_rum_file.py
util/repeat_rum_file.py
Python
0
@@ -0,0 +1,512 @@ +from rum_mapping_stats import aln_iter%0Aimport argparse%0Aimport sys%0A%0Aparser = argparse.ArgumentParser()%0A%0Aparser.add_argument('--times', type=int)%0Aparser.add_argument('--max-seq', type=int)%0Aparser.add_argument('rum_file', type=file)%0A%0Aargs = parser.parse_args()%0A%0Aalns = list(aln_it...
3ab98baaf2b81ffa1afef808f27608f06bc946d3
Create commands.py
web/commands.py
web/commands.py
Python
0.000011
@@ -0,0 +1,1507 @@ +#%0A# Commands for RPC interface%0A#%0A%0Afrom twisted.protocols.amp import AMP, Boolean, Integer, String, Float, Command%0A%0Aclass Sum(Command):%0A arguments = %5B('a', Integer()),%0A ('b', Integer())%5D%0A response = %5B('status', Integer())%5D%0A%0Aclass HeartbeatCmd(Comman...
b5f8299cbe539cf2a01988ca25e0c7638400bc8c
Create stuff.py
bottomline/stuff.py
bottomline/stuff.py
Python
0.000001
@@ -0,0 +1,29 @@ +# Testing%0Aprint 'heck yeah!'%0A
5777877d1ed71ed21f67e096b08ad495ff844ed8
add testexample/simpleTestwithPython.py
testexample/simpleTestwithPython.py
testexample/simpleTestwithPython.py
Python
0.000001
@@ -0,0 +1,1800 @@ +import os%0Aimport re%0Aimport json%0Aimport sys%0Aimport getopt%0Aimport argparse%0Afrom docopt import docopt%0Afrom urllib2 import urlopen, Request%0Aimport urllib%0Aimport urllib2%0Aimport requests%0A%0Aurl_phenotypes = 'http://localhost:9000/api/phenotypes'%0Aurl_genotypes = 'http://localhost:90...
606020fbb7c3e608c8eab19ca143919003ea4f7d
add some first tests.
test_triptan.py
test_triptan.py
Python
0
@@ -0,0 +1,1756 @@ +import os%0Afrom unittest import TestCase%0Afrom tempfile import TemporaryDirectory%0A%0Afrom triptan.core import Triptan%0A%0A%0Aclass TriptanInitializationTest(TestCase):%0A %22%22%22%0A Asserts that triptan can setup the necessary data correctly.%0A %22%22%22%0A%0A def test_init_f...
1803ec42e2eaad689dd51d3afb0b943e411f10d5
Add breath first search algorithm
breath_first_search/breath_first_search.py
breath_first_search/breath_first_search.py
Python
0.000049
@@ -0,0 +1,2616 @@ +#!/usr/bin/env python%0A%0Afrom collections import deque%0A%0A%0Aclass BreathFirstSearchGame(object):%0A def __init__(self):%0A # The node index are from 0 to 7, such as 0, 1, 2, 3, 4%0A self.node_number = 8%0A%0A # The edges to connect each node%0A self.edges = %5B(0, 1), (0, 3), (1, 2...
c98eff8545c90563246a53994fe8f65faaf76b0a
Add fetch recipe for the open source infra repo.
recipes/infra.py
recipes/infra.py
Python
0.00002
@@ -0,0 +1,969 @@ +# Copyright 2014 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%0Aimport recipe_util # pylint: disable=F0401%0A%0A%0A# This class doesn't need an __init__ method, so we disable th...
5b3b5bb145eea8a71c81a383d2bdac7ecf13f98e
Add sys module tests
tests/integration/modules/sysmod.py
tests/integration/modules/sysmod.py
Python
0.000001
@@ -0,0 +1,619 @@ +# Import python libs%0Aimport os%0A%0A# Import salt libs%0Aimport integration%0A%0Aclass SysModuleTest(integration.ModuleCase):%0A '''%0A Validate the sys module%0A '''%0A def test_list_functions(self):%0A '''%0A sys.list_functions%0A '''%0A funcs = self.run_fu...
7d800a0fc2d94cad14e825faa27e1f5b2d2cbed8
Create new package (#6648)
var/spack/repos/builtin/packages/breseq/package.py
var/spack/repos/builtin/packages/breseq/package.py
Python
0
@@ -0,0 +1,1885 @@ +##############################################################################%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...
19cf7a2833ba2ffcff46bd4543ed93fd80c1d8ea
fix trying to run configure on an already configured directory fixes #2959 (#2961)
var/spack/repos/builtin/packages/libmng/package.py
var/spack/repos/builtin/packages/libmng/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
@@ -1958,8 +1958,105 @@ pes.h')%0A +%0A @run_before('configure')%0A def clean_configure_directory(self):%0A make('distclean')%0A
94f2ea927d9e218f2b5065456275d407164ddf0a
Add anidub.com tracker support
updatorr/tracker_handlers/handler_anidub.py
updatorr/tracker_handlers/handler_anidub.py
Python
0
@@ -0,0 +1,3303 @@ +from updatorr.handler_base import BaseTrackerHandler%0Afrom updatorr.utils import register_tracker_handler%0Aimport urllib2%0A%0A%0Aclass AnidubHandler(BaseTrackerHandler):%0A %22%22%22This class implements .torrent files downloads%0A for http://tr.anidub.com tracker.%22%22%22%0A%0A logged_...
2b6456e5724f62b7b170252a6bf7d076768d1167
Fix broken Hypothesis test
tests/test_metasync.py
tests/test_metasync.py
# -*- coding: utf-8 -*- from hypothesis import given import hypothesis.strategies as st import pytest from vdirsyncer.metasync import MetaSyncConflict, metasync from vdirsyncer.storage.base import normalize_meta_value from vdirsyncer.storage.memory import MemoryStorage from . import blow_up def test_irrelevant_st...
Python
0.000151
@@ -46,16 +46,25 @@ rt given +, example %0Aimport @@ -2540,16 +2540,120 @@ ins')%0A)%0A +@example(a=%7Bu'0': u'0'%7D, b=%7B%7D, status=%7Bu'0': u'0'%7D, keys=%7Bu'0'%7D,%0A conflict_resolution='a wins')%0A def test @@ -3189,16 +3189,48 @@ n keys:%0A + s = status.get(key, '')%0A @@ -3279,9...
b02ec9a16689bf2814e85f0edb01c7f4a5926214
Add pre-migration script for account module.
addons/account/migrations/8.0.1.1/pre-migration.py
addons/account/migrations/8.0.1.1/pre-migration.py
Python
0
@@ -0,0 +1,1375 @@ +# -*- coding: utf-8 -*-%0A##############################################################################%0A#%0A# Copyright (C) 2014 Akretion (http://www.akretion.com/)%0A# @author: Alexis de Lattre %3Calexis.delattre@akretion.com%3E%0A#%0A# This program is free software: you can redistribut...
07841312d062fd0dd48baa0d3bc0d92989e05841
add script mp3-file-renamer.py
mp3-file-renamer.py
mp3-file-renamer.py
Python
0.000001
@@ -0,0 +1,1667 @@ +#!/usr/bin/python%0A#Python script to rename mp3 files according to the format%0A#%22Track-number Track-name.mp3%22, for example: 02 Self Control.mp3%0A#Note: Tracks must have valid ID3 data for this to work - python-mutagen is required.%0A#By Charles Bos%0A%0Aimport os%0Aimport sys%0Afrom mutagen.i...
cc76c00efa919f8532e21365606f38431093cc22
Write inversion counting algorithm
count_inversions.py
count_inversions.py
Python
0.0007
@@ -0,0 +1,2447 @@ +def count_inversions(list, inversion_count = 0):%0A %22%22%22%0A recursively counts inversions of halved lists%0A where inversions are instances where a larger el occurs before a smaller el%0A merges the halved lists and increments the inversion count at each level%0A%0A :param list list: list ...
3331a9a6b8ada075aaefef021a8ad24a49995931
Add test for prepare_instance_slug #92
derrida/books/tests/test_search_indexes.py
derrida/books/tests/test_search_indexes.py
Python
0
@@ -0,0 +1,1411 @@ +from unittest.mock import patch%0Afrom django.test import TestCase%0Afrom derrida.books.models import Reference, Instance%0Afrom derrida.books.search_indexes import ReferenceIndex%0A%0A%0Aclass TestReferenceIndex(TestCase):%0A fixtures = %5B'test_references.json'%5D%0A%0A def setUp(self):%0A ...
451799f126afcdda70138dc348b9e1f276b1f86f
Add setting file for later use.
ox_herd/settings.py
ox_herd/settings.py
Python
0
@@ -0,0 +1,64 @@ +%22%22%22Module to represent basic settings for ox_herd package.%0A%22%22%22%0A%0A
ec5136b86cce92a49cf2eea852f1d8f2d7110cf0
Create element_search.py
09-revisao/practice_python/element_search.py
09-revisao/practice_python/element_search.py
Python
0.000002
@@ -0,0 +1,1102 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%22%22%22Exercise 20: Element Search%0A%0AWrite a function that takes an ordered list of numbers (a list where the%0Aelements are in order from smallest to largest) and another number. The%0Afunction decides whether or not the given number is inside...
7060b82030d719cdcbdcecdb5eb7d34b405aa805
Make the migration for previous commit
platforms/migrations/0003_auto_20150718_0050.py
platforms/migrations/0003_auto_20150718_0050.py
Python
0.000013
@@ -0,0 +1,447 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0Aimport jsonfield.fields%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('platforms', '0002_auto_20150718_0042'),%0A %5D%0A%0A operations = %5B%...
9f4861c4cfc919cffc234cc40044d3bc84e8b086
Implement statsd prefix sanitization
gunicorn/instrument/statsd.py
gunicorn/instrument/statsd.py
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. "Bare-bones implementation of statsD's protocol, client-side" import re import socket import logging from gunicorn.glogging import Logger # Instrumentation constants STATSD_DEFAULT_PORT = 81...
Python
0.998375
@@ -670,83 +670,54 @@ +self. prefix -_regex = re.compile(r%22%5C.*$%22)%0A self.prefix = prefix_regex.sub(%22 + = re.sub(r%22%5E(.+%5B%5E.%5D+)%5C.*$%22, %22%5Cg%3C1%3E .%22,
582c911c5a18659ca4c95bf434294cfeedf1843c
Add line parser for evidence import
src/ggrc/converters/handlers/document.py
src/ggrc/converters/handlers/document.py
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Handlers document entries.""" from flask import current_app from ggrc import models from ggrc.login import get_current_user_id from ggrc.converters.handlers import handlers class RequestLinkHandler(ha...
Python
0.000001
@@ -1616,32 +1616,392 @@ st imports.%22%22%22%0A%0A + @staticmethod%0A def _parse_line(line):%0A %22%22%22Parse a single line and return link and title.%0A%0A Args:%0A line: string containing a single line from a cell.%0A%0A Returns:%0A tuple containing a link and a title.%0A %22%22%22%0A pa...
3b42e348987294602440c3c1d4aa4361afcdc298
Add problem 14
problem_14.py
problem_14.py
Python
0
@@ -0,0 +1,2558 @@ +from problem_12 import new_encryption_oracle, find_blocksize%0Aimport random%0Afrom string import printable%0A%0ARANDOM_PREFIX = ''.join(random.choice(printable) for _ in range(random.randrange(0, 20)))%0A# print len(RANDOM_PREFIX)%0A%0A%0Adef oracle(adversary_input):%0A return new_encryption_ora...
49b1de4a68133e618723f96f2dc922b311bdd982
Add Script to encode raw RGB565
util/encode_raw.py
util/encode_raw.py
Python
0
@@ -0,0 +1,603 @@ +#!/usr/bin/env python%0A# Converts raw RGB565 video to MP4/AVI%0A%0Afrom sys import argv, exit%0Afrom array import array%0Afrom subprocess import call%0A%0Abuf=None%0ATMP_FILE = %22/tmp/video.raw%22%0A%0Aif (len(argv) != 4):%0A print(%22Usage: encode_raw input.raw output.avi fps%22)%0A exit(1)%...
74354263acb3399295e7fde18d6aeed4b7bb7397
Fix maybe all flake8 errors. Add first test.
what_transcode/tests.py
what_transcode/tests.py
Python
0
@@ -0,0 +1,3233 @@ +%22%22%22%0AThis file demonstrates writing tests using the unittest module. These will pass%0Awhen you run %22manage.py test%22.%0A%0AReplace this with more appropriate tests for your application.%0A%22%22%22%0A%0Afrom django.test import TestCase%0A%0Afrom what_transcode.utils import get_mp3_ids%0A%...
5dba86b3a68c27a01eb143a6dfdb35d01c3c99e8
add app_test
turbo/test/app_test.py
turbo/test/app_test.py
Python
0.000003
@@ -0,0 +1,1086 @@ +from __future__ import absolute_import, division, print_function, with_statement%0A%0Aimport os%0Aimport signal%0Aimport sys%0Aimport unittest%0Aimport random%0Aimport time%0Aimport threading%0Aimport logging%0Aimport requests%0Aimport multiprocessing%0A%0Afrom turbo import app%0Afrom turbo.conf imp...
be0331e64726d659b824187fbc91b54ce0405615
add initial implementation of weighted EM PCA
wpca/test/test_empca.py
wpca/test/test_empca.py
Python
0
@@ -0,0 +1,1313 @@ +import numpy as np%0Afrom numpy.testing import assert_allclose%0A%0Afrom ..empca import orthonormalize, random_orthonormal, pca, empca%0A%0Adef norm_sign(X):%0A i_max_abs = np.argmax(abs(X), 0)%0A sgn = np.sign(X%5Bi_max_abs, range(X.shape%5B1%5D)%5D)%0A return X * sgn%0A%0A%0Adef assert_co...
7ccfc89a51a76764c36b009dd9b5fc55570e3f56
Add forgot password test
api/radar_api/tests/test_forgot_password.py
api/radar_api/tests/test_forgot_password.py
Python
0.000001
@@ -0,0 +1,1710 @@ +import json%0A%0Afrom radar_api.tests.fixtures import get_user%0Afrom radar.database import db%0A%0A%0Adef test_forgot_password(app):%0A user = get_user('admin')%0A%0A client = app.test_client()%0A%0A assert user.reset_password_token is None%0A assert user.reset_password_date is None%0A%...
b4bf757a15c404080679335bcce04ba45a7e4eae
Update fix_nonwarehouse_ledger_gl_entries_for_transactions.py
erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py
erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): if not frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock"): return frappe.reload_doctype("A...
Python
0.000001
@@ -821,10 +821,10 @@ reho -s u +s e an @@ -1690,24 +1690,25 @@ return warehouse_account +%0A
ae52e3e4dc1fc254b7e1c258caa1fe00317bb9a5
Add migrate script.
disqus_converter.py
disqus_converter.py
Python
0
@@ -0,0 +1,2462 @@ +'''Convert disquls XML comments to YAML.'''%0Aimport os%0Aimport copy%0Aimport pathlib%0Aimport hashlib%0Aimport yaml%0Aimport iso8601%0Aimport xmltodict%0Afrom postsinfo import mapping%0Afrom rebuild_comments import encrypt%0A%0A%0ACOMMENT_DIR = os.environ.get('COMMENT_DIR', './_data/comments')%0A%...
c8ae682ff98f2c5b5733ae4b299970c820e46630
Add regression test for #636
spacy/tests/regression/test_issue636.py
spacy/tests/regression/test_issue636.py
Python
0.000001
@@ -0,0 +1,506 @@ +# coding: utf8%0Afrom __future__ import unicode_literals%0A%0Afrom ...tokens.doc import Doc%0Aimport pytest%0A%0A%0A@pytest.mark.xfail%0A@pytest.mark.models%0A@pytest.mark.parametrize('text', %5B%22I cant do this.%22%5D)%0Adef test_issue636(EN, text):%0A %22%22%22Test that to_bytes and from_bytes ...
423707ea25e88b2454a9541eb52f900da87e95b2
allow external backends, specified via ZMQ_BACKEND env
zmq/backend/__init__.py
zmq/backend/__init__.py
"""Import basic exposure of libzmq C API as a backend""" #----------------------------------------------------------------------------- # Copyright (C) 2013 Brian Granger, Min Ragan-Kelley # # This file is part of pyzmq # # Distributed under the terms of the New BSD License. The full license is in # the file COPY...
Python
0
@@ -609,16 +609,26 @@ ------%0A%0A +import os%0A from .se @@ -671,14 +671,262 @@ nd%0A%0A -%0A +if 'PYZMQ_BACKEND' in os.environ:%0A backend = os.environ%5B'PYZMQ_BACKEND'%5D%0A if backend in ('cython', 'cffi'):%0A backend = 'zmq.backend.%25s' %25 backend%0A _ns = select_backend(backend)%0Aelse:%0A ...
cb9166c4564c4e763e1214355dc76cbe6d466258
Add data migration for section
books/migrations/0009_auto_20141127_1718.py
books/migrations/0009_auto_20141127_1718.py
Python
0
@@ -0,0 +1,1844 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Adef add_sections(apps, schema_editor):%0A # Don't just use books.models.Section, that could be out of date%0A Section = apps.get_model('books', 'Section')%0A%0A FRONT_MATT...
161feec0d3764c7cdeebfdc7cd62e5901a89666a
Add initial implementation
runtracker.py
runtracker.py
Python
0.000001
@@ -0,0 +1,2205 @@ +import cv2%0Aimport numpy as np%0Aimport imutils%0A%0A%0API = 3.141592654%0A%0AAREA_ERROR_THRESH = 0.05 # Error away from the mean area%0A%0A%0A# Color ranges%0A#CALIB_COLOR_MIN = ( 70, 40, 61)%0A#CALIB_COLOR_MAX = (110, 175, 255)%0ACALIB_COLOR_MIN = ( 52, 24, 56)%0ACALIB_COLOR_MAX = ( 98, 169,...
07825b7f80a12619c847de49f0f2b991faeea7b4
Add a simple handler cookie_wsh.py useful for cookie test
example/cookie_wsh.py
example/cookie_wsh.py
Python
0.000004
@@ -0,0 +1,916 @@ +# Copyright 2014 Google Inc. All rights reserved.%0A#%0A# Use of this source code is governed by a BSD-style%0A# license that can be found in the COPYING file or at%0A# https://developers.google.com/open-source/licenses/bsd%0A%0A%0Aimport urlparse%0A%0A%0Adef _add_set_cookie(request, value):%0A re...
39019e998da2c1f73f82e0eb446df78ffc95c134
Create safe_steps.py
safe_steps.py
safe_steps.py
Python
0.000459
@@ -0,0 +1,318 @@ +import mcpi.minecraft as minecraft%0Aimport mcpi.block as block%0Amc = minecraft.Minecraft.create()%0A%0Awhile True:%0A%09p = mc.player.getTilePos()%0A%09b = mc.getBlock(p.x, p.y-1, p.z)%0A%09if b == block.AIR.id or b == block.WATER_FLOWING.id or b==block.WATER_STATIONARY.id:%0A%09%09mc.setBlock(pos....
c78480fc1f566bb6d266705336dbe9cd90d07996
Create 476_number_complement.py
476_number_complement.py
476_number_complement.py
Python
0.998761
@@ -0,0 +1,1381 @@ +%22%22%22%0Ahttps://leetcode.com/problems/number-complement/description/%0AGiven a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.%0A%0ANote:%0AThe given integer is guaranteed to fit within the range of a 32-bit signed integer...
0104600fe32b2b676974f29df37d10cc86a7441a
enable CMake build (with HTTP/3) -- take 2
build/fbcode_builder/specs/proxygen_quic.py
build/fbcode_builder/specs/proxygen_quic.py
Python
0.000001
@@ -0,0 +1,671 @@ +#!/usr/bin/env python%0A# Copyright (c) Facebook, Inc. and its affiliates.%0Afrom __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import print_function%0Afrom __future__ import unicode_literals%0A%0Aimport specs.folly as folly%0Aimport specs.fizz as fizz%0Aimport...
37e74416a090342c18cfad87df74dd958400145d
Add 'Others' category.
bulb/migrations/0009_add_others_category.py
bulb/migrations/0009_add_others_category.py
Python
0.998649
@@ -0,0 +1,648 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0Adef add_categories(apps, schema_editor):%0A Category = apps.get_model('bulb', 'Category')%0A Category.objects.create(code_name=%22others%22, name=%22%D8%A3%D8%AE%D8%B1%D9%89%22)%...
317160665a58a2e0433202e4605710b09a71de9d
add scrub script to remove solution tags, thanks https://gist.github.com/minrk/3836889
scrub_sols.py
scrub_sols.py
Python
0
@@ -0,0 +1,1339 @@ +#!/usr/bin/env python%0A%22%22%22%0Asimple example script for scrubping solution code cells from IPython notebooks%0AUsage: %60scrub_code.py foo.ipynb %5Bbar.ipynb %5B...%5D%5D%60%0AMarked code cells are scrubbed from the notebook%0A%22%22%22%0A%0Aimport io%0Aimport os%0Aimport sys%0A%0Afrom IPython...
3bafceba383125475d5edb895bc9d88b0dfc5042
Add status to Role
project/apps/api/migrations/0093_role_status.py
project/apps/api/migrations/0093_role_status.py
Python
0.000001
@@ -0,0 +1,481 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.4 on 2016-03-05 23:28%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0Aimport django_fsm%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('api', '0092_auto_20160305_1514'),%0A ...
4735ee97aa36920e811edc450d8b6e8a09b5caf5
add utility for explode bam
iron/utilities/explode_bam.py
iron/utilities/explode_bam.py
Python
0.000001
@@ -0,0 +1,1905 @@ +#!/usr/bin/python%0Aimport sys, argparse%0Afrom subprocess import Popen, PIPE%0Afrom SamBasics import SamStream%0Afrom multiprocessing import cpu_count, Pool%0Adef main():%0A parser = argparse.ArgumentParser(description=%22Break a bam into evenly sized chunks print the number of chunks%22,formatter...
ebd62eac70d5589b0b7f593009024868f981e658
Add actor with behavior similar to old-style Delay
calvin/actorstore/systemactors/std/ClassicDelay.py
calvin/actorstore/systemactors/std/ClassicDelay.py
Python
0.000002
@@ -0,0 +1,1706 @@ +# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2015 Ericsson AB%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENS...
a88cf930a5c0e67a7aef93ab5c4eb705ad7aad32
Fix ‘permissions_classes’ typos
kolibri/core/lessons/tests.py
kolibri/core/lessons/tests.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase # Create your tests here.
Python
0.999755
@@ -61,65 +61,4 @@ als%0A -%0Afrom django.test import TestCase%0A%0A# Create your tests here.%0A
e363aac46c9a5b607c7b32bcc5546c5a2728d750
Add migration which fixes missing message IDs.
climate_data/migrations/0029_auto_20170628_1527.py
climate_data/migrations/0029_auto_20170628_1527.py
Python
0
@@ -0,0 +1,953 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.2 on 2017-06-28 15:27%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0Afrom datetime import timedelta%0A%0A%0A# noinspection PyUnusedLocal%0Adef add_message_id_to_reading(apps, schema_editor):%0A # noinspectio...
840bc57e7120ae67e84c1c7bca94cfef34c8d2a8
Copy old script from @erinspace which added identifiers to existing preprints.
scripts/add_missing_identifiers_to_preprints.py
scripts/add_missing_identifiers_to_preprints.py
Python
0
@@ -0,0 +1,2439 @@ +import sys%0Aimport time%0Aimport logging%0Afrom scripts import utils as script_utils%0Afrom django.db import transaction%0A%0Afrom website.app import setup_django%0Afrom website.identifiers.utils import request_identifiers_from_ezid, parse_identifiers%0A%0Asetup_django()%0Alogger = logging.getLogge...
3a9ec86e4b996912b1a47abe07c70116be14b3f8
Create hello.py
hello.py
hello.py
Python
0.999503
@@ -0,0 +1,18 @@ +print %22Hello all%22%0A
d73b2108358c8aa43509b6def6879fc70b138fb5
add objects
nefi2_main/nefi2/view/test2.py
nefi2_main/nefi2/view/test2.py
Python
0.000006
@@ -0,0 +1,1560 @@ +from PyQt4 import QtGui, QtCore%0Aimport sys%0A%0Aclass Main(QtGui.QMainWindow):%0A def __init__(self, parent = None):%0A super(Main, self).__init__(parent)%0A%0A # main button%0A self.addButton = QtGui.QPushButton('button to add other widgets')%0A self.addButton.click...
98bf1c67b95d40888e26068015e4abf1b94d0640
add ddns state module
salt/states/ddns.py
salt/states/ddns.py
Python
0
@@ -0,0 +1,2909 @@ +'''%0ADynamic DNS updates.%0A====================%0A%0AEnsure a DNS record is present or absent utilizing RFC 2136%0Atype dynamic updates. Requires dnspython module.%0A%0A.. code-block:: yaml%0A%0A webserver:%0A ddns.present:%0A - zone: example.com%0A - ttl: 60%0A'''%0A%0A%0Ade...
4ea54e24948356b039ad961c857e685c30bb0737
Solve task #500
500.py
500.py
Python
0.999999
@@ -0,0 +1,606 @@ +class Solution(object):%0A def findWords(self, words):%0A %22%22%22%0A :type words: List%5Bstr%5D%0A :rtype: List%5Bstr%5D%0A %22%22%22%0A rows = %5B'qwertyuiop', 'asdfghjkl', 'zxcvbnm'%5D%0A def inOneRow(word):%0A mask = %5B0, 0, 0%5D%0A ...
ce3eef2c749f7d9f7bcd1d439497121e89e3727b
Add notification
devicehive/notification.py
devicehive/notification.py
Python
0.000001
@@ -0,0 +1,958 @@ +from devicehive.api_object import ApiObject%0A%0A%0Aclass Notification(ApiObject):%0A %22%22%22Notification class.%22%22%22%0A%0A DEVICE_ID_KEY = 'deviceId'%0A ID_KEY = 'id'%0A NOTIFICATION_KEY = 'notification'%0A PARAMETERS_KEY = 'parameters'%0A TIMESTAMP_KEY = 'timestamp'%0A%0A ...
bf53cbe08d4908ab37063f35bdcb97cb682823b0
Support setting explicit mute value for Panasonic Viera TV (#13954)
homeassistant/components/media_player/panasonic_viera.py
homeassistant/components/media_player/panasonic_viera.py
""" Support for interface with a Panasonic Viera TV. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.panasonic_viera/ """ import logging import voluptuous as vol from homeassistant.components.media_player import ( SUPPORT_NEXT_TRACK, SU...
Python
0
@@ -4203,34 +4203,25 @@ elf. -send_key('NRC_POWER-ONOFF' +_remote.turn_off( )%0A @@ -4339,34 +4339,26 @@ elf. -send_key('NRC_VOLUP-ONOFF' +_remote.volume_up( )%0A%0A @@ -4440,36 +4440,28 @@ elf. -send_key('NRC_VOLDOWN-ONOFF' +_remote.volume_down( )%0A%0A @@ -4542,33 +4542,29 @@ elf. -send_key('NRC_MUTE-ONOFF...
a02a46752d954c29a65bf8bc5b88fa3545315175
Add unit tests for timestr()
lib/svtplay_dl/tests/utils.py
lib/svtplay_dl/tests/utils.py
Python
0
@@ -0,0 +1,701 @@ +#!/usr/bin/python%0A# ex:ts=4:sw=4:sts=4:et%0A# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-%0A%0A# The unittest framwork doesn't play nice with pylint:%0A# pylint: disable-msg=C0103%0A%0Afrom __future__ import absolute_import%0Aimport unittest%0Aimport svtplay_dl.utils%0A%0Aclass...
46c036cad1323d55c61f546b5cd6174739ab1b42
add helper functions for data persistence
ws/data_persistence.py
ws/data_persistence.py
Python
0.000001
@@ -0,0 +1,1987 @@ +# https://github.com/usc-isi-i2/dig-etl-engine/issues/92%0A%0Aimport json%0Aimport threading%0Aimport os%0Aimport codecs%0A%0A%0A# 1.acquire file write lock%0A# 2.write to file.new%0A# 3.acquire replace lock%0A# 4.rename file to file.old%0A# 5.rename file.new to file%0A# 6.release replace lock and w...
327b74d5e0328e6415520b907e4c43ed8cb54cf2
add sample that fetches the graph and renders it as an ascii tree
examples/fetchDebianDependencyGraph.py
examples/fetchDebianDependencyGraph.py
Python
0
@@ -0,0 +1,1529 @@ +#!/usr/bin/python%0Aimport sys%0Afrom pyArango.connection import *%0Afrom pyArango.graph import *%0Afrom asciitree import *%0A%0Aconn = Connection(username=%22root%22, password=%22%22)%0A%0Adb = conn%5B%22ddependencyGrahp%22%5D%0A%0Aif not db.hasGraph('debian_dependency_graph'):%0A raise Exceptio...
8e73752e9242796a933d3566eb4a5e4470f13d5e
Create sequences.py
sequences.py
sequences.py
Python
0.000009
@@ -0,0 +1,1455 @@ +import random%0Aimport sys%0Aimport os%0A%0A# User input%0Auser_input = input(%22Type in 5 integers of any sequence separated by commas. Example: 1,2,3,4,5: %22)%0Alist_input = user_input.split(%22,%22)%0A# Convert numbered strings into integers in list%0Alist_int = list(map(int, list_input))%0A%0A#...
d6db1d0b81211a80884131b10212195ab38f99ad
Fix a conflict with IPython.
dosagelib/output.py
dosagelib/output.py
# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam import time import sys import os import threading import traceback import codecs from .ansicolor import Colorizer lock = threading.Lock() def get_threadname(): """Return name o...
Python
0.00166
@@ -11,18 +11,13 @@ ng: -iso-8859-1 +utf-8 -*- @@ -126,16 +126,63 @@ ineidam%0A +# Copyright (C) 2005-2016 Tobias Gruetzmacher%0A%0A import t @@ -288,16 +288,17 @@ orizer%0A%0A +%0A lock = t @@ -314,16 +314,17 @@ Lock()%0A%0A +%0A def get_ @@ -923,32 +923,37 @@ if -sys.version_info%5B0%5D %3E= 3 +hasattr(s...
ea40075f8924c2d61da8f92fe9ecf74045bbe6cc
add script to convert Tandem Repeats Finder dat format to bed format required for STRetch
scripts/TRFdat_to_bed.py
scripts/TRFdat_to_bed.py
Python
0
@@ -0,0 +1,1770 @@ +#!/usr/bin/env python%0Afrom argparse import (ArgumentParser, FileType)%0A%0Adef parse_args():%0A %22Parse the input arguments, use '-h' for help%22%0A parser = ArgumentParser(description='Convert Tandem Repeat Finder (TRF) dat file to bed format with repeat units for microsatellite genotyping...
272eceebbc44bd7dc44498233a7dca5ab9c2bdd8
add iplookup
scripts/iplookup.py
scripts/iplookup.py
Python
0.000001
@@ -0,0 +1,991 @@ +import sys%0Aimport json%0Aimport numpy as np%0Aimport pandas as pd%0Aimport geoip2.database%0A%0A%0Aif len(sys.argv) != 3:%0A sys.exit('Please specify a GeoLite DB and an ip table.')%0A%0Areader = geoip2.database.Reader(sys.argv%5B1%5D)%0A%0A%0Adef get_name(entry, lang):%0A if hasattr(entry, '...
462cdfaf93f23e227b8da44e143a5ff9e8c047be
test futil for files
tests/test_futil.py
tests/test_futil.py
Python
0
@@ -0,0 +1,582 @@ +%22%22%22Run doctests in pug.nlp.futil.%22%22%22%0Afrom __future__ import print_function, absolute_import%0A%0Aimport doctest%0A%0Aimport pug.nlp.futil%0A%0Afrom unittest import TestCase%0A%0A%0Aclass DoNothingTest(TestCase):%0A %22%22%22A useless TestCase to encourage Django unittests to find thi...
a1039c2e38243b64d2027621aa87ee020636f23b
Add initial test for routes.
tests/test_views.py
tests/test_views.py
Python
0
@@ -0,0 +1,560 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport os%0Aimport sys%0Asys.path.insert(0, os.path.abspath('..'))%0A%0Aimport website%0Aimport unittest%0Aimport tempfile%0A%0Aclass FPOTestCase(unittest.TestCase):%0A%0A def test_homepage(self):%0A self.app = website.app.test_client()%0...
6cebbd302556469dd4231d6252ec29c5d7c1165c
add script to convert data from Rime/luna-pinyin
data/convertdict.py
data/convertdict.py
Python
0
@@ -0,0 +1,1938 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0Aimport sys%0A%0A%0Adef uniq(seq): # Dave Kirby%0A # Order preserving%0A seen = set()%0A return %5Bx for x in seq if x not in seen and not seen.add(x)%5D%0A%0A%0Adef pinyin(word):%0A N = len(word)%0A pos = 0%0A result = %5B%5D%0...
41e3d696967b523d0d031a0a17d18c9804f455ee
Change G+ default type
djangocms_blog/settings.py
djangocms_blog/settings.py
# -*- coding: utf-8 -*- from django.conf import settings from meta_mixin import settings as meta_settings BLOG_IMAGE_THUMBNAIL_SIZE = getattr(settings, 'BLOG_IMAGE_THUMBNAIL_SIZE', { 'size': '120x120', 'crop': True, 'upscale': False }) BLOG_IMAGE_FULL_SIZE = getattr(settings, 'BLOG_IMAGE_FULL_SIZE', { ...
Python
0
@@ -1537,31 +1537,28 @@ CATEGORY', ' -Article +Blog ')%0ABLOG_GPLU
ab2b2c6f12e2e5ec53ac6d140919a343a74b7e3c
Update migration
django_afip/migrations/0017_receipt_issued_date.py
django_afip/migrations/0017_receipt_issued_date.py
Python
0
@@ -0,0 +1,623 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.2 on 2017-06-10 13:33%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('afip', '0016_auto_20170529_2012'),%0A %5D%0A%0A ...
a52dd9d66ff7d9a29f6d635e5ca1a2a0584c267b
Add rosetta utils
rosetta_utils.py
rosetta_utils.py
Python
0.0015
@@ -0,0 +1,379 @@ +# From: https://github.com/mbi/django-rosetta/issues/50%0A# Gunicorn may work with --reload option but it needs%0A# https://pypi.python.org/pypi/inotify package for performances%0A%0Afrom django.dispatch import receiver%0Afrom rosetta.signals import post_save%0A%0Aimport time%0Aimport os%0A%0A@receiv...
8410b027987f088b86989898b4fade5b0960886a
Solve problem 2
problem002.py
problem002.py
Python
0.999999
@@ -0,0 +1,205 @@ +#!/usr/bin/env python3%0A%0Adef fibs(maxnumber):%0A fib1, fib2 = 1, 2%0A while fib1 %3C maxnumber:%0A yield fib1%0A fib1, fib2 = fib2, fib1 + fib2%0A%0Aprint(sum(f for f in fibs(4000000) if f %25 2 == 0))%0A
278920272efd7ab959d7cad5b5f7d6c17935c7e6
Add problem 35, circular primes
problem_35.py
problem_35.py
Python
0.000126
@@ -0,0 +1,945 @@ +from math import sqrt%0Afrom time import time%0A%0APRIME_STATUS = %7B%7D%0A%0A%0Adef is_prime(n):%0A if n == 2:%0A return True%0A if n %25 2 == 0 or n %3C= 1:%0A return False%0A for i in range(3, int(sqrt(n))+1, 2):%0A if n %25 i == 0:%0A return False%0A re...
dad430fd56b8be22bd1a3b9773f9948c3e305883
Add unit tests for lazy strings
stringlike/test/lazy_tests.py
stringlike/test/lazy_tests.py
Python
0.000001
@@ -0,0 +1,1367 @@ +import sys%0Aimport os%0Asys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))%0A%0A%0Afrom stringlike.lazy import LazyString, CachedLazyString%0Afrom unittest import main, TestCase%0A%0A%0Aclass TestLazyString(TestCase):%0A def test_equality(self):%0A se...
458d2e55de4db6c9f72758b745245301ebd02f48
Add solution 100
100_to_199/euler_100.py
100_to_199/euler_100.py
Python
0.998911
@@ -0,0 +1,1201 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A'''%0AProblem 100%0AIf a box contains twenty-one coloured discs, composed of fifteen blue discs and six red discs, and two discs were taken at random, it can be seen that the probability of taking two blue discs, P(BB) = (15/21)%C3%97(14/20) = 1/...
1966225450e36921c283e46dfb896e86a8d41c94
load tasks in project via __setup__ instead of onload function, to return tasks via get_doc
erpnext/projects/doctype/project/project.py
erpnext/projects/doctype/project/project.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate from frappe import _ from frappe.model.document import Document class Project(Document): def get...
Python
0.000001
@@ -398,14 +398,17 @@ def -onload +__setup__ (sel @@ -453,16 +453,34 @@ view%22%22%22%0A +%09%09self.tasks = %5B%5D%0A %09%09for ta
c421024bfd1660685bb6ec6cb84a0369244627c5
add celery module
service_mapper/celery.py
service_mapper/celery.py
Python
0.000001
@@ -0,0 +1,580 @@ +from __future__ import absolute_import%0A%0Aimport os%0A%0Afrom celery import Celery%0A%0Afrom django.conf import settings%0A%0A# set the default Django settings module for the 'celery' program.%0Aos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'service_mapper.settings')%0A%0Aapp = Celery('service_ma...
2eb05eb7d42f1b14191cccba2563c2105fabaed1
Add processing module
processing.py
processing.py
Python
0.000001
@@ -0,0 +1,749 @@ +#!/usr/bin/env python%0A%22%22%22%0AProcessing routines for the waveFlapper case.%0A%0A%22%22%22%0A%0Aimport foampy%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0A%0Awidth_2d = 0.1%0Awidth_3d = 3.66%0A%0Adef plot_force():%0A %22%22%22Plots the streamwise force on the paddle over time.%22...
df0e285b6f8465eb273af50c242299c5601fa09f
Add a new example
examples/sanic_aiomysql_with_global_pool.py
examples/sanic_aiomysql_with_global_pool.py
Python
0.000102
@@ -0,0 +1,2105 @@ +# encoding: utf-8%0A%22%22%22%0AYou need the aiomysql%0A%22%22%22%0Aimport asyncio%0Aimport os%0A%0Aimport aiomysql%0Aimport uvloop%0Afrom sanic import Sanic%0Afrom sanic.response import json%0A%0Adatabase_name = os.environ%5B'DATABASE_NAME'%5D%0Adatabase_host = os.environ%5B'DATABASE_HOST'%5D%0Adat...
e7b6aef4db85c777463d2335107145b60b678ae2
Create a new tour example
examples/tour_examples/maps_introjs_tour.py
examples/tour_examples/maps_introjs_tour.py
Python
0.000012
@@ -0,0 +1,1770 @@ +from seleniumbase import BaseCase%0A%0A%0Aclass MyTourClass(BaseCase):%0A%0A def test_google_maps_tour(self):%0A self.open(%22https://www.google.com/maps/@42.3598616,-71.0912631,15z%22)%0A self.wait_for_element(%22#searchboxinput%22)%0A self.wait_for_element(%22#minimap%22)%0...
8ddc9333513a2e900ff61b6d2904db3e58635bb9
add initial self_publish version
elm_self_publish.py
elm_self_publish.py
Python
0
@@ -0,0 +1,2133 @@ +#! /usr/bin/env python%0Afrom __future__ import print_function%0A%0Aimport sys%0Aimport json%0Aimport shutil%0Aimport argparse%0A%0Adef copy_package(location, destination):%0A shutil.copytree(location, destination)%0A%0Adef package_name(url):%0A %22%22%22 get the package name from a github url...
a004611ceb3402c95675a749eb9a3db764c97e51
Move cython_build_ext command to utils.distutils and put it to setup.cfg
edgedb/lang/common/distutils.py
edgedb/lang/common/distutils.py
Python
0
@@ -0,0 +1,802 @@ +##%0A# Copyright (c) 2014 Sprymix Inc.%0A# All rights reserved.%0A#%0A# See LICENSE for details.%0A##%0A%0A%0Afrom distutils.command import build_ext as _build_ext%0A%0A%0Aclass cython_build_ext(_build_ext.build_ext):%0A def __init__(self, *args, **kwargs):%0A self._ctor_args = args%0A ...
d05de03f258c215ce0a23023e5c15b057fbf7283
add missing import
s2plib/fusion.py
s2plib/fusion.py
# Copyright (C) 2015, Carlo de Franchis <carlo.de-franchis@cmla.ens-cachan.fr> # Copyright (C) 2015, Gabriele Facciolo <facciolo@cmla.ens-cachan.fr> # Copyright (C) 2015, Enric Meinhardt <enric.meinhardt@cmla.ens-cachan.fr> # Copyright (C) 2015, Julien Michel <julien.michel@cnes.fr> from __future__ import print_functi...
Python
0.000001
@@ -445,16 +445,42 @@ ort cfg%0A +from s2plib import common%0A %0A%0Adef av
bc235b15bbeacf7fee7e1d23a5d94b6271e33e41
Add initial code
rpsls.py
rpsls.py
Python
0.000003
@@ -0,0 +1,1999 @@ +#!/usr/bin/python%0A%0Afrom collections import OrderedDict%0Afrom random import choice, seed%0Afrom sys import exit%0A%0A%0AWEAPONS = OrderedDict(%5B%0A ('rock', 1),%0A ('paper', 2),%0A ('scissors', 3),%0A ('lizard', 5),%0A ('spock', 4)%0A%5D)%0A%0A%0AEXPLANATIONS = %7B%0A 'lizardl...
43c74dc2dbe82a30f7a9b6c0403db39eb159fc96
add control panel test for fetch
paystackapi/tests/test_cpanel.py
paystackapi/tests/test_cpanel.py
Python
0
@@ -0,0 +1,691 @@ +import httpretty%0A%0Afrom paystackapi.tests.base_test_case import BaseTestCase%0Afrom paystackapi.cpanel import ControlPanel%0A%0A%0Aclass TestPage(BaseTestCase):%0A%0A @httpretty.activate%0A def test_fetch_payment_session_timeout(self):%0A %22%22%22Method defined to test fetch payment ...
233db6d2decad39c98bf5cbe8b974f93308bea16
Create re.py
python2.7/re.py
python2.7/re.py
Python
0.000001
@@ -0,0 +1,990 @@ +#/usr/bin/python%0Aimport re%0A%0A#Shows how to test if a string matches a regular expression (yes/no) and uses more than one modifier%0Aexpression = re.compile(r%22%5E%5Cw+.+string%22, re.I %7C re.S)%09#compile the expression%0Aif expression.match(%22A Simple String To Test%22):%09%09#See if a strin...
d93916b1927f0ae099cee3cf93619d3113db147b
Add small example of basic anomaly detection w/peewee.
examples/anomaly_detection.py
examples/anomaly_detection.py
Python
0
@@ -0,0 +1,1697 @@ +import math%0Afrom peewee import *%0A%0A%0Adb = SqliteDatabase(':memory:')%0A%0Aclass Reg(Model):%0A key = TextField()%0A value = IntegerField()%0A%0A class Meta:%0A database = db%0A%0A%0Adb.create_tables(%5BReg%5D)%0A%0A# Create a user-defined aggregate function suitable for computi...
b5eaf371bf4b19818a3c339ee86f2411d95115db
Add user and group in ini files
setup.py
setup.py
import os import sys import re import pwd import grp # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... from setuptools import setup from setupto...
Python
0
@@ -5691,16 +5691,307 @@ /modules +%5Cn%22)%0A if not 'user=' in open(file).read():%0A with open(file, %22a%22) as inifile:%0A inifile.write(%22user=%22 + user + %22%5Cn%22)%0A if not 'group=' in open(file).read():%0A with open(file, %22a%22) as inifile:%0A ...
12b334983be4caf0ba97534b52f928180e31e564
add quick script to release lock
release-lock.py
release-lock.py
Python
0
@@ -0,0 +1,76 @@ +from batch import Lock%0A%0Alock = Lock(key=%22charge-cards-lock%22)%0Alock.release()%0A
687a186bd29eb1bef7a134fa5499c9b4c56abaa6
Create setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,643 @@ +from distutils.core import setup%0Aimport py2exe, os, pygame%0AorigIsSystemDLL = py2exe.build_exe.isSystemDLL%0Adef isSystemDLL(pathname):%0A if os.path.basename(pathname).lower() in %5B%22sdl_ttf.dll%22%5D:%0A return 0%0A return origIsSystemDLL(pathname)%0Apy2exe.build_exe.isSystemDLL =...
77ca6d5e6ef7e07ede92fa2b4566a90c31fd7845
Bump grappelli and filebrowser versions.
setup.py
setup.py
from __future__ import with_statement import os exclude = ["mezzanine/project_template/dev.db", "mezzanine/project_template/local_settings.py"] exclude = dict([(e, None) for e in exclude]) for e in exclude: if e.endswith(".py"): try: os.remove("%sc" % e) except: ...
Python
0
@@ -619,17 +619,17 @@ == 0.2. -3 +4 %22,%0A %22 @@ -650,17 +650,17 @@ == 0.2. -2 +4 %22,%0A%5D%0A%0Atr
8dfdcfa0f1d13e810a6e56e0a031f15dbaba3656
Use environment metadata for conditional dependencies
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import djangocms_blog try: from setuptools import setup except ImportError: from distutils.core import setup version = djangocms_blog.__version__ if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') print("You pro...
Python
0
@@ -1064,86 +1064,8 @@ r',%0A - 'django-select2' if sys.version_info%5B0%5D==2 else 'django-select2-py3',%0A @@ -1337,24 +1337,268 @@ .1',%0A %5D,%0A + extras_require=%7B%0A %22:python_version=='3.3'%22: %5B'django-select2-py3'%5D,%0A %22:python_version=='3.4'%22: %5B'django-select2-py3'%...
2e57e929db19ebd864680d4616eb1bba595f1e57
Create setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,471 @@ +from distutils.core import setup%0Asetup(%0A name = 'fram3w0rk-python',%0A packages = %5B'fram3w0rk-python'%5D,%0A version = '0.5',%0A description = '%22Class%22 effort to unify functions across 30 languages.',%0A author = 'Jonathan Lawton',%0A author_email = 'jlawton@lawtonsoft.com',%0A url =...
b0184d74d0f186662df8596f511f95e1130bcf20
Add libffi package
rules/libffi.py
rules/libffi.py
Python
0
@@ -0,0 +1,204 @@ +import xyz%0Aimport os%0Aimport shutil%0A%0Aclass Libffi(xyz.BuildProtocol):%0A pkg_name = 'libffi'%0A%0A def configure(self, builder, config):%0A builder.host_lib_configure(config=config)%0A%0Arules = Libffi()%0A
b1d08df29b02c107bbb2f2edc9add0c6f486c530
Add app
app.py
app.py
Python
0.000002
@@ -0,0 +1,494 @@ +# coding: utf-8%0Aimport json%0A%0Aimport flask%0Afrom flask import request%0Aimport telegram%0A%0A__name__ = u'eth0_bot'%0A__author__ = u'Joker_Qyou'%0A__config__ = u'config.json'%0A%0Aapp = flask.Flask(__name__)%0Aapp.debug = False%0A%0Awith open(__config__, 'r') as cfr:%0A config = json.loads(c...
69f787a69e400b69fa4aef2e49f6f03781304dae
Update setup.py.
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # from astm.version import __version__ try: from setuptools import setup, find_...
Python
0
@@ -833,21 +833,19 @@ package( - dir - ):%0A @@ -1246,16 +1246,62 @@ tocol.', +%0A long_description = open('README').read(), %0A%0A au
19b6d71e17f616bed3566d5615b5938bbfe3a497
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,337 @@ +#!/usr/bin/env python%0A%0Afrom distutils.core import setup%0A%0Asetup(name='hydrus',%0A version='0.0.1',%0A description='A space-based application for W3C HYDRA Draft',%0A author='W3C HYDRA development group',%0A author_email='public-hydra@w3.org',%0A url='https://github.com...
e2ae0798424d4aa0577e22d563646856866fbd1f
add setup.py file for pypi
setup.py
setup.py
Python
0
@@ -0,0 +1,618 @@ +import os%0Afrom setuptools import setup, find_packages%0A%0Aimport versioncheck%0A%0A%0Adef read(fname):%0A return open(os.path.join(os.path.dirname(__file__), fname)).read()%0A%0Asetup(%0A name='django-versioncheck',%0A version=versioncheck.__version__,%0A description='A small django ap...
d43bcc978b1d79a20820ab1df73bd69d5d3c100d
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,796 @@ +from setuptools import find_packages%0Afrom setuptools import setup%0A%0AVERSION = '0.0.1'%0A%0Asetup_args = dict(%0A name='BigQuery-Python',%0A description='Simple Python client for interacting with Google BigQuery.',%0A url='https://github.com/tylertreat/BigQuery-Python',%0A version=VER...
840e178a85da246d8357481a8e6ea5a8d87deef7
Create setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,1198 @@ +%22%22%22%0AKonF'00'%0A~~~~~~~~%0A%0AKonFoo is a Python Package for creating byte stream mappers in a declarative%0Away with as little code as necessary to help fighting the confusion with the%0Afoo of the all too well-known memory dumps or binary data.%0A%0ASetup%0A-----%0A%0A.. code:: bash%0A $...
10ccc510deab5c97ce8a6c5ee57232c5e399986e
Add decision tree classifier attempt.
decision_tree.py
decision_tree.py
Python
0.000004
@@ -0,0 +1,553 @@ +import pandas as pd%0Afrom sklearn import tree%0A%0A# X = %5B%5B0, 1%5D, %5B1, 1%5D%5D%0A# Y = %5B0, 1%5D%0A#clf = tree.DecisionTreeClassifier()%0A#clf = clf.fit(X, Y)%0A%0Adata = pd.read_excel('/home/andre/sandbox/jhu-immuno/journal.pcbi.1003266.s001-2.XLS')%0A%0Aresp_cols = %5B 'MHC' %5D%0A%0Adata%...
efe596e3f935fe31af5bcbd8ef1afbb6750be123
add a setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,879 @@ +%22%22%22Set up the kd project%22%22%22%0A%0A%0Afrom setuptools import setup%0A%0A%0Aimport kd%0A%0A%0Asetup(%0A name='kd',%0A version=kd.__version__,%0A url='https://github.com/jalanb/kd',%0A license='MIT License',%0A author='J Alan Brogan',%0A author_email='kd@al-got-rhythm.net',%...
f2c03f66fd09c1a86fdf88fc60b6db53d9d50a5b
Version 0.5.1
setup.py
setup.py
#!/usr/bin/python # # Copyright 2012 Major Hayden # # 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.000001
@@ -785,17 +785,17 @@ on='0.5. -0 +1 ',%0A a
9220523e6bcac6b80410a099b2f2fd30d7cbb7d3
Add first draft of setup.py
setup.py
setup.py
Python
0
@@ -0,0 +1,369 @@ +from setuptools import setup%0A%0Asetup(%0A name = 'pyAPT',%0A version = '0.1.0',%0A author = 'Christoph Weinsheimer',%0A author_email = 'christoph.weinsheimer@desy.de',%0A packages = %5B'pyAPT'%5D,%0A scripts = %5B%5D,%0A descr...