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
fe11a1b638b1779e51da87eaa30f1f12b2d0911c
Add a module for known data models: CDS, ECMWF, etc.
cf2cdm/datamodels.py
cf2cdm/datamodels.py
Python
0
@@ -0,0 +1,1991 @@ +#%0A# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).%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.apac...
b6303a18051f5bc050c141b72935b9a87c752a59
move into separate module
utils/rms_paths.py
utils/rms_paths.py
Python
0.000001
@@ -0,0 +1,951 @@ +import pathlib%0Afrom collections import namedtuple%0A%0A%0Adef get_paths(prj_root):%0A %22%22%22%0A Maps path structure into a namedtuple.%0A :return:dict: namedtuple paths%0A %22%22%22%0A root_dir = pathlib.Path(prj_root).absolute().parent%0A RMSPaths = namedtuple(%22RMSPaths%22, ...
1a1ee9eff1f04d6e40c9288e15dc3fad7515c2b8
Make a unittest for CArray class
tests/cupy_tests/core_tests/test_carray.py
tests/cupy_tests/core_tests/test_carray.py
Python
0.000011
@@ -0,0 +1,1519 @@ +import unittest%0A%0Aimport cupy%0Afrom cupy import testing%0A%0A%0Aclass TestCArray(unittest.TestCase):%0A%0A def test_size(self):%0A x = cupy.arange(3).astype('i')%0A y = cupy.ElementwiseKernel(%0A 'raw int32 x', 'int32 y', 'y = x.size()', 'test_carray_size',%0A ...
2cf5f7baf115511c9dd8a8a0333a9b579455b9a3
Add file for rule's symbol tests
tests/rules_tests/FromSymbolComputeTest.py
tests/rules_tests/FromSymbolComputeTest.py
Python
0
@@ -0,0 +1,264 @@ +#!/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%0A%0A%0Aclass FromSymbolComputeTest(TestCase):%0A pass%0A%0A%0Aif __name__ == '__main__':%0A...
3f63b647d9f1e3c0ea8c83a869db8fc0028127c5
Create 05.FibonacciNumbers.py
TechnologiesFundamentals/ProgrammingFundamentals/MethodsAndDebugging-Excercises/05.FibonacciNumbers.py
TechnologiesFundamentals/ProgrammingFundamentals/MethodsAndDebugging-Excercises/05.FibonacciNumbers.py
Python
0.000008
@@ -0,0 +1,204 @@ +def fibonacci(n):%0A if n == 0 or n == 1:%0A return 1%0A else:%0A return fibonacci(n - 1) + fibonacci(n - 2)%0A%0Aif __name__ == '__main__':%0A number = int(input())%0A print(fibonacci(number))%0A
f5a0227042b64c6e8a8d85b9e0bc9cf437dc11b8
resolve migration conflict
ovp_users/migrations/0012_merge_20170112_2144.py
ovp_users/migrations/0012_merge_20170112_2144.py
Python
0.000008
@@ -0,0 +1,342 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.1 on 2017-01-12 21:44%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('ovp_users', '0011_auto_20170111_1633'),%0A ('ovp_use...
3247ff26cbe63d875a493382c3f567f112de8b58
Add maintenance script to fix missing menu links
bin/maintenance/update_menus.py
bin/maintenance/update_menus.py
Python
0
@@ -0,0 +1,1197 @@ +from __future__ import division%0A%0Afrom collections import Counter%0A%0Afrom indico.core.db import DBMgr%0Afrom indico.util.console import conferenceHolderIterator, success%0Afrom MaKaC.conference import ConferenceHolder%0Afrom MaKaC.webinterface.displayMgr import ConfDisplayMgrRegistery%0A%0A%0Ad...
1324ae9a6ba9d57841df3f7b729036120eee3d47
delete easyui
exercise/file/somecript.py
exercise/file/somecript.py
Python
0.000001
@@ -0,0 +1,86 @@ +import sys%0Atext = sys.stdin.read()%0Awords = text.split()%0Awordcount = len(words)%0Aprint()
3e23bf784a75de688811a4655e29bd2ae9bc163a
condense utility
topicmodel/interpret/condense_doctopics.py
topicmodel/interpret/condense_doctopics.py
Python
0.999754
@@ -0,0 +1,1459 @@ +# condense_doctopics.py%0A%0A# The doctopics file produced by MALLET can be very%0A# bulky. This script condenses it by keeping only the%0A# rows needed to evaluate our preregistered hypotheses.%0A%0Aimport sys, csv, os%0A%0Adef getdoc(anid):%0A '''%0A Gets the docid part of a character id%0A ...
b333deae9db90a193d274bf235dca8d6dddff5c2
Add script for getting milestone contributors (#4396)
docs/_bin/get-milestone-contributors.py
docs/_bin/get-milestone-contributors.py
Python
0
@@ -0,0 +1,1156 @@ +#!/usr/bin/env python3%0A%0Aimport json%0Aimport sys%0A%0Aimport requests%0A%0A# tested with python 3.6 and requests 2.13.0%0A%0Aif len(sys.argv) != 2:%0A sys.stderr.write('usage: program %3Cmilestone-number%3E%5Cn')%0A sys.stderr.write('Provide the github milestone number, not name. (e.g., 19 ins...
28377ff5ac680cb5c97997f01b6300debe1abd80
add missing migration. fix #118
waliki/migrations/0006_auto_20170326_2008.py
waliki/migrations/0006_auto_20170326_2008.py
Python
0.000706
@@ -0,0 +1,520 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.6 on 2017-03-26 20:08%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('waliki', '0005_auto_20141124_0020'),%0A %5D%0A%0...
648c51c41b51fe7919798de755ab1f04f40502a7
Add Simple File Example
examples/simple_file_instance.py
examples/simple_file_instance.py
Python
0
@@ -0,0 +1,609 @@ +#!/usr/bin/env python%0A%22%22%22Creates the CybOX content for CybOX_Simple_File_Instance.xml%0A%22%22%22%0A%0Afrom cybox.common import Hash%0Afrom cybox.core import Observable, Observables%0Afrom cybox.objects.file_object import File%0A%0Adef main():%0A h = Hash(%22a7a0390e99406f8975a1895860f55f2...
47e7d9fc28214e69ed9b0a36104feed80422a5b7
Create molecule.py
molecule.py
molecule.py
Python
0.000493
@@ -0,0 +1,1689 @@ +import numpy as np%0A%0A%0A%0A%0A%0Adef grab_iter_dual(i, bond_hash, mol_used, body_hash=None):%0A s = %5Bi%5D%0A r = %5B%5D%0A while s:%0A v = s.pop()%0A if not mol_used%5Bv%5D:%0A r.append(v)%0A mol_used%5Bv%5D = True%0A # for w in bond_hash%...
7cdeb30d5beefbed8d44e3b8eb5384ff05a1f09e
change logg buff, but no save
class4/class4_ex2.py
class4/class4_ex2.py
Python
0
@@ -0,0 +1,1853 @@ +#!/usr/bin/env python%0A%0Aimport paramiko%0Aimport time%0Afrom getpass import getpass%0A%0A%0Adef prevent_paging(remote_conn):%0A%0A ''' stop pagination '''%0A remote_conn.send(%22%5Cn%22)%0A remote_conn.send(%22term len 0%5Cn%22)%0A time.sleep(1)%0A%0A ''' clear output buffer '''%0A...
dfb4b3ab679a5c8767bd7571da0fdd40850d2d84
Add __main__.py
crox/__main__.py
crox/__main__.py
Python
0.000019
@@ -0,0 +1,262 @@ +#!/usr/bin/env python%0Afrom __future__ import division, print_function, absolute_import%0A%0Aimport os%0Aimport sys%0Asys.path = %5Bos.path.join(os.path.abspath(os.path.dirname(__file__)), %22..%22)%5D + sys.path%0Afrom crox.core import main%0A%0Aif __name__ == '__main__':%0A main()%0A
2a81e39a843e31181af455a89ad2b200b7d2f024
Add migrations for session changes
director/sessions_/migrations/0005_auto_20160316_2124.py
director/sessions_/migrations/0005_auto_20160316_2124.py
Python
0
@@ -0,0 +1,1693 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.1 on 2016-03-16 21:24%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('sessions_', '0004_auto_20160124_0931'),%0A %5D%0...
92c7efdfd0a1a70081d6dd5e3c318432124bc87d
Add disk caching so we don't have to always wait for closure
util/builder.py
util/builder.py
import os import subprocess import zipfile from zipfile import ZipFile from StringIO import StringIO # Helper class for generating custom builds of rainbow class RainbowBuilder(object): def __init__(self, js_path, closure_path): self.js_path = js_path self.closure_path = closure_path self.j...
Python
0
@@ -32,24 +32,49 @@ ort zipfile%0A +import hashlib%0Aimport re%0A from zipfile @@ -124,62 +124,8 @@ IO%0A%0A -# Helper class for generating custom builds of rainbow %0Acla @@ -713,30 +713,30 @@ not os.path. -exists +isfile (self.closur @@ -1392,16 +1392,445 @@ ite_to%0A%0A + def openFile(self, path):%0A ...
43d2045611320bbe78c1167e6505135425bf9499
Add customfilters.py to theme
customfilters.py
customfilters.py
Python
0
@@ -0,0 +1,2256 @@ +#!/usr/bin/env python%0Aimport bs4%0A%0Adef menu_filter(pelican_pages, direct_templates):%0A %22%22%22%0A Jinja filter for Pelican page object list%0A%0A Structures pages into a three-level menu that can be parsed by Jinja2%0A templating. Reads page metadata of the form:%0A :menu: %3C...
9968aad924fee0c80b895bc24e1452f5c525ee9e
add invite sender
invite.py
invite.py
Python
0.000001
@@ -0,0 +1,369 @@ +from auth import init_manager_for_invite%0Aimport sys%0A%0Adef main():%0A m = init_manager_for_invite()%0A res = m.send_invite(sys.argv%5B1%5D,%0A email_template='templates/emailinvite.html',%0A host='http://localhost:8088')%0A if res:%0A ...
e16043547bb43476f56195d5652881ebeb684e57
Add new create_realm management command.
zerver/management/commands/create_realm.py
zerver/management/commands/create_realm.py
Python
0
@@ -0,0 +1,2219 @@ +import argparse%0Afrom typing import Any%0A%0Afrom django.core.management.base import CommandError%0A%0Afrom zerver.lib.actions import do_create_realm, do_create_user%0Afrom zerver.lib.management import ZulipBaseCommand%0Afrom zerver.models import UserProfile%0A%0A%0Aclass Command(ZulipBaseCommand):...
059a29aede4fb1b4db914131b0aad9ca581201fe
Create followers.py
followers.py
followers.py
Python
0
@@ -0,0 +1,645 @@ +from twython import Twython%0Aimport datetime%0Aprint datetime.datetime.now()%0Aplayers = %5B%22fabiofogna%22,%0A %22richardgasquet1%22,%0A %22JohnIsner%22,%0A %22keinishikori%22,%0A %22andy_murray%22,%0A %22milosraonic%22,%0A %22GrigorDimitrov%22...
0c775a1bb685ff5a77f7f4fb3bbde58d0f1f4334
add missing catalogo app migration
indicarprocess/catalogo/migrations/0002_catalogorapideye.py
indicarprocess/catalogo/migrations/0002_catalogorapideye.py
Python
0
@@ -0,0 +1,1029 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0Aimport django.contrib.gis.db.models.fields%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('catalogo', '0001_initial'),%0A %5D%0A%0A operation...
c994cfda927353c195048b7c5ac42ed557d8ac0a
Create setup.py
swift/setup.py
swift/setup.py
Python
0.000001
@@ -0,0 +1 @@ +%0A
ffa99e9ae77a2b651e29dcdbf6abf7a2c9c142a6
Create DP_Coin_Change_Problem_ctci.py
DP_Coin_Change_Problem_ctci.py
DP_Coin_Change_Problem_ctci.py
Python
0.000003
@@ -0,0 +1,881 @@ +#!/bin/python%0A'''Given a number of dollars, N, and a list of dollar values for C = %7BC0,C1,C2,...CM%7D distinct coins, M, find%0Aand print the number of different ways you can make change for N dollars if each coin is available in an infinite quantity.'''%0A%0Aimport sys%0A %0Adef make_change(coi...
67ee018391df9682e5fe96dd0beba687517f1bf1
Create autoclearbuf.py
HexChat/autoclearbuf.py
HexChat/autoclearbuf.py
Python
0.000001
@@ -0,0 +1,963 @@ +import hexchat%0A%0A__module_name__ = 'autoclearbuf'%0A__module_author__ = 'fladd & TingPing'%0A__module_version__ = '1.0'%0A__module_description__ = 'Auto clear buffer of closed queries with znc'%0A%0A# TODO:%0A# Don't run on non-znc networks%0A# Actually check for channel type (currently crashe...
fdc1145b91175673552d21abbfb7ba41c034c426
Add blaze css
wdom/themes/blaze.py
wdom/themes/blaze.py
Python
0.000169
@@ -0,0 +1,1775 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0Afrom wdom.tag import NewTagClass as NewTag%0Afrom wdom.tag import *%0A%0A%0Acss_files = %5B%0A '//cdn.jsdelivr.net/blazecss/latest/blaze.min.css',%0A%5D%0A%0AButton = NewTag('Button', bases=Button, class_='button')%0ADefaultButton = NewTag('De...
0c44e2527004bbb3000c2f3cbe06648ff04f0c92
Fix python 2.6 'zero length field name in format' error
stripe/error.py
stripe/error.py
# Exceptions class StripeError(Exception): def __init__(self, message=None, http_body=None, http_status=None, json_body=None, headers=None): super(StripeError, self).__init__(message) if http_body and hasattr(http_body, 'decode'): try: http_body = http_...
Python
0.001793
@@ -844,12 +844,14 @@ st %7B +0 %7D: %7B +1 %7D%22.f
ece35f891ffd976a7ecfd191e9fbad1e416650d2
TEST added for phantom
dipy/sims/tests/test_phantom.py
dipy/sims/tests/test_phantom.py
Python
0
@@ -0,0 +1,1353 @@ +import numpy as np%0Aimport nose%0Aimport nibabel as nib%0Afrom nose.tools import assert_true, assert_false, assert_equal, assert_almost_equal%0Afrom numpy.testing import assert_array_equal, assert_array_almost_equal%0Afrom dipy.core.geometry import vec2vec_rotmat%0Afrom dipy.data import get_data ...
4f2cd5d857c00c5b2f4d4aed5fff42a00a003cac
add directory
MellPlayer/directory.py
MellPlayer/directory.py
Python
0.000001
@@ -0,0 +1,259 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A'''%0ANetease Music Player%0A%0ACreated on 2017-02-23%0A@author: Mellcap%0A'''%0A%0Aimport os%0A%0ADIRECTORY = '~/.MellPlayer'%0A%0Adef create_directory(directory):%0A if not os.path.exists(directory):%0A os.makedirs(directory)%0A
2d9122adc0e12b00f29bca321979dc2ecc428ddc
Create proxy_scan.py
proxy_scan.py
proxy_scan.py
Python
0.000002
@@ -0,0 +1,797 @@ +from burp import IBurpExtender%0Afrom burp import IHttpListener%0Afrom burp import IScannerListener%0Afrom java.net import URL%0Afrom java.io import File%0Aimport datetime%0Aimport time%0A%0Aclass BurpExtender(IBurpExtender, IHttpListener, IScannerListener):%0A def registerExtenderCallbacks(self, ...
19c0183e6e23195aef479553c018718565925585
Add new regex based features
nala/features/regex.py
nala/features/regex.py
Python
0
@@ -0,0 +1,1873 @@ +import re%0A%0Afrom nala.features import FeatureGenerator%0A%0A%0Aclass RegexNLFeatureGenerator(FeatureGenerator):%0A def __init__(self):%0A self.patterns = %5B%0A re.compile('%5Bg%5D%5C.%5B0-9%5D+_%5B0-9%5D+(del)%5B0-9%5D+'),%0A re.compile('deletion of( (the%7Ca))?.*...
0259d9a361fa49966977f958b8222f977616713f
Add SRIM energy histogram vacancy analysis script (#31)
analysis/SRIMVacEnergyCount.py
analysis/SRIMVacEnergyCount.py
Python
0
@@ -0,0 +1,905 @@ +#!/usr/bin/python%0A%0A#%0A# Tool to parse a SRIM COLLISION.txt file and produce an output comparable%0A# to TrimVacEnergyCount (output.type = 'vaccount')%0A#%0A%0Aimport fileinput%0Aimport math%0Aimport re%0A%0Arecoil = re.compile('%5E%5Cxdb')%0A%0A# read file header%0Aheader = %5B''%5D * 4%0Afor i ...
620e568b59d8e811a6457be251dfa7d5bf0f8a3d
implement stack using the linked list
utils/stack.py
utils/stack.py
Python
0.000001
@@ -0,0 +1,958 @@ +try:%0A from .linkedlist import LinkedList, Element%0Aexcept ModuleNotFoundError as e:%0A from linkedlist import LinkedList, Element%0A%0A%0Aclass Stack(object):%0A def __init__(self, top=None):%0A self.ll = LinkedList(top)%0A%0A def push(self, new_element):%0A %22%22%22Push...
a94964156d1bfbcab1fd711514d375d8fba0eaf5
sum plus one
problems/sum-of-array-plus-one/sum-of-array-plus-one.py
problems/sum-of-array-plus-one/sum-of-array-plus-one.py
Python
0.99844
@@ -0,0 +1,91 @@ +def sum_plus_one(arr):%0A return sum(arr) + len(arr)%0A%0Aprint sum_plus_one(%5B1, 2, 3, 4%5D) # 14%0A
fd2cc81feab4b24b276c8f4a0a8efc16cacef60b
Add template for lab 09 class A
Lab/09/Template_09_A.py
Lab/09/Template_09_A.py
Python
0.000001
@@ -0,0 +1,1155 @@ +%0Aclass Bangunan:%0A def __init__(self, nama, lama_sewa, harga_sewa):%0A self.nama = nama%0A self.lama_sewa = lama_sewa%0A self.harga_sewa = harga_sewa%0A%0A def getHargaSewa(self):%0A return self.harga_sewa%0A%0Aclass Restoran(Object):%0A def __init__(self, nam...
5bf67ac445da7b69dd4f883b8d4ed89bd17f8274
add urlinfo with basic youtube parsing
modules/urlinfo.py
modules/urlinfo.py
Python
0
@@ -0,0 +1,1920 @@ +from twisted.web.client import getPage%0Afrom twisted.internet.defer import inlineCallbacks%0Afrom core.Uusipuu import UusipuuModule%0A%0Aimport re%0Aimport lxml.html%0A%0Aclass Module(UusipuuModule):%0A %0A def startup(self):%0A self.log('urlinfo.py loaded')%0A%0A def privmsg(self, ...
e70ec3a60d36a6d525230b6864a516ac9bf9c255
importing __init__ in counting
theshitfolder/Jake/__init__.py_misconfigure/src/counting.py
theshitfolder/Jake/__init__.py_misconfigure/src/counting.py
Python
0.999645
@@ -0,0 +1,606 @@ +import __init__%0A%0A#Log Here%0Alogging.basicConfig(level=logging.INFO)%0Alogger = logging.getLogger(__name__)%0A%0A#import timeit%0A#TODO add a shit ton more threads%0A#just counts files were indexing%0Adef counting():%0A%09root=os.path.expanduser('~')#change this before development%0A%09#print %22...
fdb2dc8b54c5d7194639457444c32c20d5e2bfca
Create launch.py
launch.py
launch.py
Python
0.000001
@@ -0,0 +1,189 @@ +#!/usr/bin/env python%0A%0Afrom __future__ import print_function%0Afrom __future__ import division%0Aimport pygecko%0Aimport opencvutils as cvu%0A%0Adef run():%0A pass%0A%0Aif __name__ == '__main__':%0A run()%0A
cee5313906b2ee7e4fb01fc772e2afc6c4de1072
Add simple lauch script without configuration options
launch.py
launch.py
Python
0
@@ -0,0 +1,695 @@ +from twisted.application import internet, service%0Afrom twisted.names import dns%0Afrom twisted.names import server%0Afrom openvpnzone import OpenVpnStatusAuthority, extract_status_file_path%0A%0A%0Adef createOpenvpn2DnsService():%0A zones = %5BOpenVpnStatusAuthority(extract_status_file_path('ser...
281e328711b9724027eb6b64939bf9795fe86ac4
Create linter.py
linter.py
linter.py
Python
0.000002
@@ -0,0 +1,782 @@ +#!/usr/bin/python%0A%0Aimport yaml, sys, getopt, os.path%0A%0Adef main(argv):%0A try:%0A opts, args = getopt.getopt(argv,%22hi:%22)%0A except getopt.GetoptError:%0A print 'linter.py -i %3Cinputfile.yml%3E'%0A sys.exit(2)%0A for opt, arg in opts:%0A if opt == '-h':...
5d7574728290fd1afba39769bb933b12b6044ee9
Create massinvandring_streamer.py
massinvandring_streamer.py
massinvandring_streamer.py
Python
0.000001
@@ -0,0 +1,776 @@ +# the MassinvandringStreamer is a subclass of TwythonStreamer%0Afrom twython import TwythonStreamer%0A%0A# the MassinvandringStreamer class will use the streaming api to find tweets containing the word 'massinvandring'%0A# This class could technically be used to reply to all kinds of tweets.%0Aclass ...
ced30f90907909090c0da0e468c855f400d9da92
Add shallow tests for spin-1/2 general drudge
tests/spin_one_half_gen_test.py
tests/spin_one_half_gen_test.py
Python
0
@@ -0,0 +1,509 @@ +%22%22%22Tests for the general model with explicit one-half spin.%22%22%22%0A%0Aimport pytest%0A%0Afrom drudge import UP, DOWN, SpinOneHalfGenDrudge%0A%0A%0A@pytest.fixture(scope='module')%0Adef dr(spark_ctx):%0A %22%22%22The fixture with a general spin one-half drudge.%22%22%22%0A return SpinO...
251e88398541124555b0c87edf83a59c4ea0347a
add testing framework for new announcer
tests/test_announcer_2_chair.py
tests/test_announcer_2_chair.py
Python
0
@@ -0,0 +1,320 @@ +import unittest%0Afrom source.announcer_2_chair import *%0A%0Aclass AnnouncerTestCase(unittest.TestCase):%0A%0A def setUp(self):%0A pass%0A%0A def test_announcer_is_a_class(self):%0A pass%0A%0A def test_announcer_has_a_show_method(self):%0A pass%0A%0A def test_announc...
733dc300dff354312fdfa7588bcd7636117ac0c7
Create SpatialFieldRetrieve.py
SpatialFieldRetrieve.py
SpatialFieldRetrieve.py
Python
0
@@ -0,0 +1,2563 @@ +#-------------------------------------------------------------------------------%0A# Name: Spatial Field Retrieval%0A# Purpose: Retrieve a field from the source dataset and use it to populate%0A# the target field. Honors selections.%0A# Author: Andy Bradford%0A#%0A# Cr...
4791122d34cbf4eaf6bc118c5e7e78346dee7010
add cost_ensemble
costcla/models/cost_ensemble.py
costcla/models/cost_ensemble.py
Python
0.001376
@@ -0,0 +1,18 @@ +__author__ = 'al'%0A
abd6fab2000d8af016a0251ab9fb912c359a77ed
add atom for eLisp
compiler/eLisp2/eLisp/atom.py
compiler/eLisp2/eLisp/atom.py
Python
0.000021
@@ -0,0 +1,2850 @@ +#!/usr/bin/env python%0A# -*- encoding: utf-8 -*-%0A#%0A# Copyright (c) 2015 ASMlover. All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions%0A# are met:%0A#%0A# * Redistributions of sou...
59f9e552d16e7d4dca73b1232c0804d4ef3154a7
Add functioning code for training sequence
training_sequence_classifier.py
training_sequence_classifier.py
Python
0.000011
@@ -0,0 +1,1677 @@ +import tensorflow as tf%0Aimport numpy as np%0A%0Atf.set_random_seed(5)%0A%0An_steps = 28%0An_inputs = 28%0An_neurons = 150%0An_outputs = 10%0A%0Alearning_rate = 0.001%0A%0AX = tf.placeholder(tf.float32, %5BNone, n_steps, n_inputs%5D)%0Ay = tf.placeholder(tf.int32, %5BNone%5D)%0A%0Awith tf.variable_...
6ea0d957a49f734151605c952768d15183d3a285
Create __init__.py
CyberGuard_v2/secrets/__init__.py
CyberGuard_v2/secrets/__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
9e38386947ba01effcf5908adad264aa77a688e5
Add basic auth module
modernrpc/auth.py
modernrpc/auth.py
Python
0.000001
@@ -0,0 +1,1338 @@ +# coding: utf-8%0A%0A%0Adef user_pass_test(func=None, test_function=None, params=None):%0A%0A def decorated(function):%0A%0A function.modernrpc_auth_check_function = test_function%0A function.modernrpc_auth_check_params = params%0A return function%0A%0A # If @rpc_method is...
2a44794af558563d9cdfc1d0ea9bf072fad41ffa
test soma_workflow working directory
epac/tests/test_swf_wd.py
epac/tests/test_swf_wd.py
Python
0
@@ -0,0 +1,1129 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Tue Sep 17 17:07:47 2013%0A%0A@author: jinpeng.li@cea.fr%0A%22%22%22%0A%0Aimport tempfile%0Aimport os%0Afrom soma_workflow.client import Job, Workflow%0Afrom soma_workflow.client import Helper, FileTransfer%0Afrom soma_workflow.client import WorkflowC...
231029d867171ad5ee708c61d8a0aed60127aa9a
Add test for Link object.
cybox/test/objects/link_test.py
cybox/test/objects/link_test.py
Python
0
@@ -0,0 +1,612 @@ +# Copyright (c) 2015, The MITRE Corporation. All rights reserved.%0A# See LICENSE.txt for complete terms.%0A%0Aimport unittest%0A%0Afrom mixbox.vendor.six import u%0A%0Afrom cybox.objects.link_object import Link%0Afrom cybox.objects.uri_object import URI%0Afrom cybox.test.objects import ObjectTestCas...
07b198463951753535217ff1612c2789045c4046
add manage.py
manage.py
manage.py
Python
0.000001
@@ -0,0 +1,296 @@ +#!/usr/bin/env python%0Aimport os%0Aimport sys%0A%0Aif __name__ == %22__main__%22:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22,%0A %22seed_staged_based_messaging.settings%22)%0A%0A from django.core.management import execute_from_command_line%0A%0A execute_f...
2cad12729048dd5dc52b5d612656fe60bb3bd256
Use '/usr/bin/env python' instead of '/usr/bin/python' in manage.py to support running manage.py as an executable in virtualenvs.
manage.py
manage.py
#!/usr/bin/python import os import sys if not os.path.exists('mysite/manage.py'): print "Eek, where is the real manage.py? Quitting." sys.exit(1) execfile('mysite/manage.py', globals(), locals())
Python
0
@@ -4,16 +4,20 @@ usr/bin/ +env python%0Ai
979dbd0ff0fba03847ca96beaf4d68a0f4e5c9eb
Add beam information to 850um file
data/b5_scuba2_850um_addbeam.py
data/b5_scuba2_850um_addbeam.py
Python
0
@@ -0,0 +1,387 @@ +import os%0Afrom astropy.io import fits%0A%0Afile_scuba2_raw='B5_850um_ext_v2_regrid.fits'%0Afile_scuba2_out='B5_850um_ext_v2_regrid_beam.fits'%0A%0Ahdu = fits.open(file_scuba2_raw)%0Ahdr =hdu%5B0%5D.header%0Adata=hdu%5B0%5D.data%0Ahdu.close()%0Ahdr.append(('BMAJ', 14.6/3600.))%0Ahdr.append(('BMIN', ...
d87311d349b3a7a25b23bd03804a27fd29e90b52
add missing file
moban/data_loaders/manager.py
moban/data_loaders/manager.py
Python
0.000001
@@ -0,0 +1,638 @@ +import os%0Afrom lml.plugin import PluginManager%0Afrom moban import constants%0A%0A%0Aclass AnyDataLoader(PluginManager):%0A def __init__(self):%0A super(AnyDataLoader, self).__init__(constants.DATA_LOADER_EXTENSION)%0A%0A def get_data(self, file_name):%0A file_extension = os.pat...
5346b024ffc3e4eca25794214a4539cb8a20f08c
add monk file
monk_eproperty.py
monk_eproperty.py
Python
0
@@ -0,0 +1,639 @@ +#!/usr/bin/python%0Aimport monkModule%0Aimport monkTools as tools%0Aimport os%0A%0Adef get_desc():%0A%09return %22E-property simple property interface%22%0A%0Adef create():%0A%09# module name is 'ewol' and type binary.%0A%09myModule = monkModule.Module(__file__, 'eproperty', 'LIBRARY')%0A%09# enable ...
d0a53dfaec71959728aeecfee755e0bde6e2370e
Make octal numbers python2 and python3 compliant.
neon/ipc/shmem.py
neon/ipc/shmem.py
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
Python
0.000055
@@ -2680,32 +2680,33 @@ e, ipc.O_CREX, 0 +o 660, initial_val @@ -2701,32 +2701,32 @@ initial_value)%0A - except i @@ -2901,24 +2901,25 @@ pc.O_CREX, 0 +o 660, initial @@ -3134,32 +3134,33 @@ e, ipc.O_CREX, 0 +o 660, size)%0A @@ -3300,32 +3300,32 @@ en_shmem(name))%0A - memo @@ -3365,...
3aa165d9527266d978d943437cb03816c30b8608
add a fit_nh3 test
examples/ammonia_fit_example_wrapper.py
examples/ammonia_fit_example_wrapper.py
Python
0.00001
@@ -0,0 +1,1171 @@ +from __future__ import print_function%0Aimport pyspeckit%0Aimport numpy as np%0Afrom astropy import units as u%0A%0Afrom pyspeckit.spectrum.models import ammonia%0A%0Axarr = np.linspace(-40, 40, 300) * u.km/u.s%0Aoneonemod = ammonia.ammonia(xarr.to(u.GHz, u.doppler_radio(ammonia.freq_dict%5B'oneone'...
29d8e20e41ab599030cd1027069ba01f569c1627
add terminal highlight utils
highlight.py
highlight.py
Python
0.000001
@@ -0,0 +1,1616 @@ +class bcolors:%0A HEADER = '%5C033%5B95m'%0A OKBLUE = '%5C033%5B94m'%0A OKGREEN = '%5C033%5B92m'%0A WARNING = '%5C033%5B93m'%0A FAIL = '%5C033%5B91m'%0A ENDC = '%5C033%5B0m'%0A BOLD = '%5C033%5B1m'%0A UNDERLINE = '%5C033%5B4m'%0A%0Adef highlight( s, **term_color ):%0A %22%...
23607247006f36034ba29eba0fddbc35c9f407b4
add script for automatic dependency updates
bin/update-web-dependencies.py
bin/update-web-dependencies.py
Python
0
@@ -0,0 +1,1669 @@ +#!/usr/bin/env python%0A%0Aimport sys,re,urllib.request,json,fileinput%0Afrom prettytable import PrettyTable%0A%0Adef replaceAll(file,searchExp,replaceExp):%0A for line in fileinput.input(file, inplace=1):%0A if searchExp in line:%0A line = line.replace(searchExp,replaceExp)%0A ...
f2f2f8833628058052fae0c5c814e42411f681d2
Add migrations
python/ecep/portal/migrations/0021_auto_20170625_1454.py
python/ecep/portal/migrations/0021_auto_20170625_1454.py
Python
0.000001
@@ -0,0 +1,571 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('portal', '0020_auto_20170525_1921'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterFie...
0de4e4d0d81f4b1d0ecf2b7a91b0aa1db84c7e88
Add default locale for currency
oscar/defaults.py
oscar/defaults.py
from django.utils.translation import ugettext_lazy as _ OSCAR_SHOP_NAME = 'Oscar' OSCAR_SHOP_TAGLINE = '' # Basket settings OSCAR_BASKET_COOKIE_LIFETIME = 7 * 24 * 60 * 60 OSCAR_BASKET_COOKIE_OPEN = 'oscar_open_basket' OSCAR_BASKET_COOKIE_SAVED = 'oscar_saved_basket' OSCAR_MAX_BASKET_QUANTITY_THRESHOLD = 10000 # Cur...
Python
0
@@ -349,16 +349,48 @@ = 'GBP' +%0AOSCAR_CURRENCY_LOCALE = 'en_GB' %0A%0A# Max
4feb6d987f92981542eea2a9501e363277ce4109
Create Tcheck2_clear.py
Tcheck2_clear.py
Tcheck2_clear.py
Python
0.000001
@@ -0,0 +1,2273 @@ +import sys%0Afrom itertools import combinations%0A%0AF_dict = dict()%0AM_dict = dict()%0Acounter = 0%0A%0AfileIn1 = sys.argv%5B1%5D #feb_less_april_clear%0AfileIn2 = sys.argv%5B2%5D #mar_clear.txt %0AfileOut1 = sys.argv%5B3%5D #t_pairs_clear.feb%0AfileOut2 = sys.argv%5B4%5D #t_uniq_pairs_clear.mar%0...
64c21a3e01d50cdc6a719f0e4e48f925d5dd9e03
Add tests for very big AST trees
src/testers/unittests/test_ast_deep.py
src/testers/unittests/test_ast_deep.py
Python
0
@@ -0,0 +1,1271 @@ +import unittest%0Afrom triton import *%0A%0ADEPTH = 10000%0A%0A%0Aclass TestDeep(unittest.TestCase):%0A%0A def setUp(self):%0A %22%22%22Define the arch.%22%22%22%0A self.triton = TritonContext()%0A self.triton.setArchitecture(ARCH.X86_64)%0A self.ctx = self.triton.getA...
c2f79200689171a49c5bd72e6354ba56ee09a6b6
Upgrade libchromiumcontent to contain printing headers.
script/lib/config.py
script/lib/config.py
#!/usr/bin/env python import platform import sys NODE_VERSION = 'v0.11.13' BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' LIBCHROMIUMCONTENT_COMMIT = 'bb664e4665851fe923ce904e620ba43d8d010ba5' ARCH = { 'cygwin': '32bit', 'darwin': '64bit', 'linux2': platform.architecture()[...
Python
0
@@ -181,47 +181,47 @@ = ' -bb664e4665851fe923ce904e620ba43d8d010ba +432720d4613e3aac939f127fe55b9d44fea349e 5'%0A%0A
ddf0a5a4438531e4bfa29d8709c1c76d8ca17f59
Add helper module for keyword-only arguments.
volttron/platform/kwonlyargs.py
volttron/platform/kwonlyargs.py
Python
0
@@ -0,0 +1,1438 @@ +'''Support functions for implementing keyword-only arguments.%0A%0AThis module is designed to make it easy to support keyword-only%0Aarguments in Python 2.7 while providing the same kind of exceptions one%0Awould see with Python 3.x.%0A%0ABasic usage:%0A%0A def foo(arg1, *args, **kwargs):%0A ...
99d95d6ed14e912701b1f6ae26779612694590f5
add gdw2 django task tutorial
examples/djangotasks/tasks.py
examples/djangotasks/tasks.py
Python
0.000241
@@ -0,0 +1,2724 @@ +from pyjamas.ui.Label import Label%0Afrom pyjamas.ui.RootPanel import RootPanel%0Afrom pyjamas.ui.VerticalPanel import VerticalPanel%0Afrom pyjamas.ui.TextBox import TextBox%0Afrom pyjamas.ui.ListBox import ListBox%0Afrom pyjamas.ui import KeyboardListener%0A%0Afrom pyjamas.JSONService import JSONPr...
cbfb38e904c7bc75c0635d36e896feef6c44fde2
add modbus_thread example
examples/modbus_thread.py
examples/modbus_thread.py
Python
0
@@ -0,0 +1,876 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A# modbus_thread%0A# start a thread for polling a set of registers, display result on console%0A%0Aimport time%0Afrom threading import Thread, Lock%0Afrom pyModbusTCP.client import ModbusClient%0A%0ASERVER_HOST = %22localhost%22%0ASERVER_PORT = 502%...
7d317f013389f77b09f2b057c2ddd15beca653e4
Fix URL in the pirate bay URL rewriter
flexget/plugins/urlrewrite_piratebay.py
flexget/plugins/urlrewrite_piratebay.py
from __future__ import unicode_literals, division, absolute_import import re import urllib import logging from flexget.plugins.plugin_urlrewriting import UrlRewritingError from flexget.entry import Entry from flexget.plugin import register_plugin, internet, PluginWarning from flexget.utils import requests from flexget....
Python
0.000762
@@ -563,16 +563,17 @@ :torrent +s %5C.)?thep
081297b75fdcc9415be20e84b8db19a8eae483c9
Create match_smiley_to_cvr.py
examples/match_smiley_to_cvr.py
examples/match_smiley_to_cvr.py
Python
0.000035
@@ -0,0 +1,540 @@ +%22%22%22Print match and missing match between smiley and CVR.%22%22%22%0A%0A%0Afrom __future__ import print_function%0A%0Afrom cvrminer.cvrmongo import CvrMongo%0Afrom cvrminer.smiley import Smiley%0A%0A%0Acvr_mongo = CvrMongo()%0A%0Asmiley = Smiley()%0Acvrs = smiley.all_cvrs()%0A%0An_missing = 0%0A...
1f2917dd4146c2ddb6c0f5532e4aaa63f19f1a44
Create 1.py
python/problems/1/1.py
python/problems/1/1.py
Python
0.000001
@@ -0,0 +1,112 @@ +sum = 0%0Afor number in range(1000):%0A if not (number %25 3 or number %25 5):%0A sum = sum + number%0Aprint(sum)%0A
9641234ac5897ec3f1a5f6cf0b5a822e7b103ae8
Update consecutive-numbers-sum.py
Python/consecutive-numbers-sum.py
Python/consecutive-numbers-sum.py
# Time: O(sqrt(n)) # Space: O(1) # Given a positive integer N, # how many ways can we write it as a sum of # consecutive positive integers? # # Example 1: # # Input: 5 # Output: 2 # Explanation: 5 = 5 = 2 + 3 # Example 2: # # Input: 9 # Output: 3 # Explanation: 9 = 9 = 4 + 5 = 2 + 3 + 4 # Example 3: # # Input: 15 # O...
Python
0.003216
@@ -534,32 +534,308 @@ int%0A %22%22%22%0A + # x + x+1 + x+2 + ... + x+l-1 = N = 2%5Ek * M%0A # =%3E l*x + (l-1)*l/2 = N%0A # =%3E x = (N -(l-1)*l/2)/l= 2%5Ek * M/l - (l-1)/2 is integer%0A # =%3E l could be 2 or any odd factor of M (excluding M)%0A # =%3E the answer is the num...
5c084bf10cb8feda62ac46939b3508a8c0e6a080
load csv files generic
parsers/data_parser.py
parsers/data_parser.py
Python
0.000001
@@ -0,0 +1,353 @@ +import numpy as np%0Afrom tflearn.data_utils import load_csv%0A%0Adef parse_csv(csv_file):%0A%09features, labels = load_csv(csv_file, target_column=4, columns_to_ignore=None, has_header=True)%0A%09feature_tensor = np.array(features).reshape(len(features%5B0%5D), len(features))%0A%09label_tensor = np....
8be9ab8de9558efa6ded7d184a3cdc8dad43e4ff
Add an ajax_aware_render utility.
jsonit/utils.py
jsonit/utils.py
Python
0
@@ -0,0 +1,657 @@ +import os%0A%0Afrom django.http import HttpResponse%0Afrom django.template import RequestContext, loader%0A%0A%0Adef ajax_aware_render(request, template_list, extra_context=None, **kwargs):%0A if isinstance(template_list, basestring):%0A template_list = %5Btemplate_list%5D%0A if request....
a21add52424d81a36f5a34d067f70cfb2066636f
Add process module
androtoolbox/process.py
androtoolbox/process.py
Python
0.000001
@@ -0,0 +1,1560 @@ +import attr%0Aimport re%0A%0Afrom .adb import adb%0A%0A%0A@attr.s%0Aclass Process(object):%0A name = attr.ib()%0A user = attr.ib()%0A pid = attr.ib(convert=int)%0A parent_pid = attr.ib(convert=int)%0A vsize = attr.ib(convert=int)%0A rss = attr.ib(convert=int)%0A wchan = attr.ib(...
add720894d1d29eb80ee99986c7e8473ef4f3067
upgrade script for translations works for published items (#1431)
superdesk/data_updates/00015_20181127-105425_archive.py
superdesk/data_updates/00015_20181127-105425_archive.py
Python
0
@@ -0,0 +1,2891 @@ +# -*- coding: utf-8; -*-%0A# This file is part of Superdesk.%0A# For the full copyright and license information, please see the%0A# AUTHORS and LICENSE files distributed with this source code, or%0A# at https://www.sourcefabric.org/superdesk/license%0A#%0A# Author : tomas%0A# Creation: 2018-11-27 1...
56c955b5700eb9e133024c9f51e39af9b065dfb1
Add neopixel rainbow demo.
demos/rainbow.py
demos/rainbow.py
Python
0
@@ -0,0 +1,767 @@ +# Add your Python code here. E.g.%0Afrom microbit import *%0Aimport neopixel%0A%0A%0Anp = neopixel.NeoPixel(pin13, 12)%0A%0Arainbow_raw = %5B%0A (255, 0, 0),%0A (255, 127, 0),%0A (255, 255, 0),%0A (127, 255, 0),%0A (0, 255, 0),%0A (0, 255, 127),%0A (0, 255, 255),%0A (0, 127, 2...
255d9b002b820d1c475d2434858fd5ab3c6847cf
add SeriesStim
pliers/stimuli/misc.py
pliers/stimuli/misc.py
Python
0
@@ -0,0 +1,2434 @@ +%22%22%22Miscellaneous Stim classes.%22%22%22%0A%0Aimport numpy as np%0Aimport pandas as pd%0A%0Afrom .base import Stim%0A%0A%0Aclass SeriesStim(Stim):%0A '''Represents a pandas Series as a pliers Stim.%0A%0A Args:%0A data (dict, pd.Series, array-like): A dictionary, pandas Series, or a...
d270330375060d0bd8694bc8a2ea8bdbb3762586
add show_single_event for debugging
show_single_event.py
show_single_event.py
Python
0.000001
@@ -0,0 +1,314 @@ +from deepjets.generate import get_generator_input, generate%0A%0Agen_input = get_generator_input('pythia', 'w.config', random_state=1)%0A%0Afor event in generate(gen_input, 1):%0A print event.jets%0A print event.subjets%0A print event.subjets.shape%0A print event.trimmed_constit%0A pri...
974ebd337c00a8b4a07991983eea0b9b60e1af08
Add example binary sink
sinks/binary_sink.py
sinks/binary_sink.py
Python
0.000001
@@ -0,0 +1,1015 @@ +import struct%0Aimport sys%0A%0A# Line format. We have:%0A# 8 byte unsigned timestamp%0A# 1 byte metric type%0A# 1 byte value type%0A# 2 byte key length%0A# 8 byte value%0ALINE = struct.Struct(%22%3CQBBHd%22)%0APREFIX_SIZE = 20%0A%0ATYPE_MAP = %7B%0A 1: %22kv%22,%0A 2: %22counter%22,%0A 3: ...
420ebb50cfb5a366b35d058ad6018857b899a19e
Add function approximator to deal with off-switch
hiora_cartpole/offswitch_hfa.py
hiora_cartpole/offswitch_hfa.py
Python
0
@@ -0,0 +1,1014 @@ +# -*- coding: utf-8 -*-%0A%0Afrom __future__ import unicode_literals%0A%0A# HO %E2%80%A6 higher-order%0Aclass SliceHOFeatureVec(object):%0A def __init__(self, slice_i, entries_per_slice, feature_vec):%0A self.feature_vec = feature_vec%0A self.slice = slice(slice_i * entries_pe...
d154adc3486cf5671d757d8072a705ed4c67a433
Remove timestamp, fix time
scrapi/consumers/uwashington/consumer.py
scrapi/consumers/uwashington/consumer.py
# University of Washington consumer from __future__ import unicode_literals import requests from datetime import date, timedelta, datetime from dateutil.parser import * import time from lxml import etree from scrapi.linter import lint from scrapi.linter.document import RawDocument, NormalizedDocument from nameparser ...
Python
0.005017
@@ -355,29 +355,8 @@ ce'%0A -TODAY = date.today()%0A OAI_ @@ -811,13 +811,20 @@ e = -TODAY +date.today() - t @@ -5586,19 +5586,8 @@ _doc -, timestamp ):%0A @@ -6382,57 +6382,8 @@ )),%0A - 'timestamp': copy_to_unicode(timestamp),%0A
e150f6bc2401d396d9baed52d1cee747ee906141
extract all sentence from BCCWJ/SUW"
Script/get_sent_from_BCCWJ_SUW.py
Script/get_sent_from_BCCWJ_SUW.py
Python
0.999999
@@ -0,0 +1,758 @@ +#!usr/bin/python%0A#coding:utf-8%0Aimport glob%0Aimport pickle%0Aimport sys%0A%0A%0Aif __name__ == %22__main__%22:%0A dir_name = '../Orig_Data/' #sys.args%5B1%5D%0A %0A fnames = sorted(glob.glob(dir_name + '*.txt') )%0A for fname in fnames:%0A sentences = ''%0A print fname%0...
cfe103b4edc5e8366cccb7e34e1a890fe8ad9bfc
unify quotes
letsencrypt/tests/configuration_test.py
letsencrypt/tests/configuration_test.py
"""Tests for letsencrypt.configuration.""" import os import unittest import mock class NamespaceConfigTest(unittest.TestCase): """Tests for letsencrypt.configuration.NamespaceConfig.""" def setUp(self): self.namespace = mock.MagicMock( config_dir='/tmp/config', work_dir='/tmp/foo', foo='...
Python
0.029793
@@ -2489,11 +2489,11 @@ R = -%22a%22 +'a' %0A @@ -2562,17 +2562,17 @@ S_DIR = -%22 +' renewal_ @@ -2578,17 +2578,17 @@ _configs -%22 +' %0A
2db2727dcccf81c3dca2e86efabd8e40afb223d1
Automate Transfers: Add another pre-transfer script
transfers/pre-transfer/add_metadata.py
transfers/pre-transfer/add_metadata.py
Python
0
@@ -0,0 +1,714 @@ +#!/usr/bin/env python2%0A%0Aimport json%0Aimport os%0Aimport sys%0A%0Adef main(transfer_path):%0A basename = os.path.basename(transfer_path)%0A try:%0A _, dc_id, _ = basename.split('---')%0A except ValueError:%0A return 1%0A metadata = %5B%0A %7B%0A 'parts'...
8549a8fe5e71e2e35a4f034549e95fa44f34a9cb
Add exception wrapper to prevent elb snapshot from blowing up.
security_monkey/watchers/ec2/ebs_snapshot.py
security_monkey/watchers/ec2/ebs_snapshot.py
# Copyright 2016 Bridgewater Associates # # 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 appli...
Python
0
@@ -2752,24 +2752,48 @@ st_session%0A%0A + @record_exception()%0A def get_
29555289b28e63655e5bb6fa89d163b5e3022827
add supervised loss as separate term
hypergan/losses/supervised.py
hypergan/losses/supervised.py
Python
0
@@ -0,0 +1,808 @@ +import tensorflow as tf%0Afrom hypergan.util.ops import *%0Afrom hypergan.util.hc_tf import *%0Aimport hyperchamber as hc%0A%0Adef config():%0A selector = hc.Selector()%0A selector.set(%22reduce%22, %5Btf.reduce_mean%5D)#reduce_sum, reduce_logexp work%0A%0A selector.set('create', create)%0A ...
e1478f694d6ad422a87e03f71a79a8c1b5e77c5c
build for the entire framework
Sketches/AM/KPIFramework/setup.py
Sketches/AM/KPIFramework/setup.py
Python
0
@@ -0,0 +1,1511 @@ +#!/usr/bin/env python%0D%0A#%0D%0A# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)%0D%0A# All Rights Reserved.%0D%0A#%0D%0A# You may only modify and redistribute this under the terms of any of the%0D%0A# following licenses(2): Mozilla Public License, V1.1, GNU General%0D%...
53306793268cb31944d42caf95c275afcbe97e6d
Add migration for creating the Professional Certificate program type
course_discovery/apps/edx_catalog_extensions/migrations/0002_create_professional_certificate_program_type.py
course_discovery/apps/edx_catalog_extensions/migrations/0002_create_professional_certificate_program_type.py
Python
0
@@ -0,0 +1,1125 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.11 on 2016-12-19 19:51%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0A%0APAID_SEAT_TYPES = ('credit', 'professional', 'verified',)%0APROGRAM_TYPE = 'Professional Certificate'%0A%0A%0Adef add_program_type(apps, sch...
8b894a02cf1d271b7df65e1c3efcac499100ed51
Add submission form tests
reddit/tests/test_submission.py
reddit/tests/test_submission.py
Python
0
@@ -0,0 +1,1144 @@ +from django.test import TestCase, Client%0Afrom reddit.forms import SubmissionForm%0A%0A%0Aclass TestSubmissionForm(TestCase):%0A def test_full_valid_submission(self):%0A test_data = %7B%0A 'title': 'submission_title',%0A 'url': 'http://example.com',%0A 'te...
d2802eebe9311243aabc5954f26719fa5544b378
Create matchingBrackets.py
GeneralPython/PyDataStructure/matchingBrackets.py
GeneralPython/PyDataStructure/matchingBrackets.py
Python
0.000001
@@ -0,0 +1,958 @@ +# https://www.geeksforgeeks.org/check-for-balanced-parentheses-in-an-expression/%0A%0Adef areParanthesisBalanced(expr):%0A stack = list()%0A%0A for i,chr in enumerate(expr):%0A #print(i, chr)%0A if chr in %5B'(','%7B','%5B'%5D:%0A stack.append(chr)%0A continu...
6e9a789aa3113403d6d60ca662605506ce70c4d1
Add empty Resources module.
app/api_v1/resources.py
app/api_v1/resources.py
Python
0
@@ -0,0 +1,72 @@ +%22%22%22This module contains the resources to be served on the endpoints.%22%22%22%0A
b223bc7023cd959c95171fc69466153a744f035a
Add note saying where code was lifted from.
src/new/util/util.py
src/new/util/util.py
#################### import functools import gzip import io import random import time try: import socks NO_SOCKS = False except ImportError: NO_SOCKS = True import socket ################### try: import urllib2 except ImportError: import urllib.request as urllib2 #################### class Util...
Python
0
@@ -2171,16 +2171,118 @@ rn ret%0A%0A + # :SEE: http://wiki.python.org/moin/PythonDecoratorLibrary/#Alternate_memoize_as_nested_functions%0A @sta
faa1c167e6551da738f2039ef9e9373bde50ab41
Add unittest utils.
app/tests/test_utils.py
app/tests/test_utils.py
Python
0
@@ -0,0 +1,477 @@ +import unittest%0Aimport re%0Afrom app.util.utils import *%0A%0A%0Aclass utilsTest(unittest.TestCase):%0A %22%22%22Docstring for decorationsTest. %22%22%22%0A%0A def setUp(self):%0A %22%22%22 decorators: setup%0A %22%22%22%0A pass%0A%0A def tearDown(self):%0A pass...
d9486bc6180a2dfe38a953eb84184e0410e1cb66
Add a Quartz backend for the null toolkit
enthought/enable/null/quartz.py
enthought/enable/null/quartz.py
Python
0.000001
@@ -0,0 +1,1924 @@ +#------------------------------------------------------------------------------%0A# Copyright (c) 2011, Enthought, Inc.%0A# All rights reserved.%0A#%0A# This software is provided without warranty under the terms of the BSD%0A# license included in enthought/LICENSE.txt and may be redistributed only%0...
5f9a2fe783891dd5a1f926060fcfa2561150d840
add cleese pipeline runner
reduction/run_pipeline_cleese.py
reduction/run_pipeline_cleese.py
Python
0.000001
@@ -0,0 +1,566 @@ +import make_apex_cubes%0Afrom os.path import join%0A%0Aroot = '/scratch/aginsbur/apex/'%0Arawpath = join(root,'raw/')%0Areducedpath = join(root,'reduced/')%0Amake_apex_cubes.june2013datapath = rawpath%0Amake_apex_cubes.june2013path = join(reducedpath,'june2013/')%0Amake_apex_cubes.h2copath = join(red...
a659f0f8f4672933fc36cecfe62c65366c496f07
Add a package for VarDictJava@1.5.1 (#5626)
var/spack/repos/builtin/packages/vardictjava/package.py
var/spack/repos/builtin/packages/vardictjava/package.py
Python
0
@@ -0,0 +1,1938 @@ +##############################################################################%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...
cc582dd4b435ba06dc140b1ca96b688871e36abb
Add mock python package.
var/spack/repos/builtin.mock/packages/python/package.py
var/spack/repos/builtin.mock/packages/python/package.py
Python
0
@@ -0,0 +1,1871 @@ +##############################################################################%0A# Copyright (c) 2013-2015, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Written by Todd Gamblin, tgamblin@llnl.gov, All r...
f718f852bcc9be7d7ff57b8a0188499d5b1c9f99
Create pyglatin.py
pyglatin.py
pyglatin.py
Python
0.000012
@@ -0,0 +1,590 @@ +print %22Welcome to the Pig Latin Translator! %5Cn%22%0A%0Apyg = %22ay%22%0Aoriginal = raw_input(%22Enter a word: %22)%0A%0Aif len(original) %3E 0 and original.isalpha():%0A%09word = original.lower()%0A%09first = word%5B0%5D%0A%09if word%5B0%5D != %22a%22 or %22e%22 or %22i%22 or %22o%22 or %22u%22:%...
a5edbf04345653b18bdb63ed9bd63625689b0f4c
add some simple unit tests for ADMM
odl/test/solvers/nonsmooth/admm_test.py
odl/test/solvers/nonsmooth/admm_test.py
Python
0
@@ -0,0 +1,2106 @@ +# Copyright 2014-2017 The ODL contributors%0A#%0A# This file is part of ODL.%0A#%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 https://mozilla.org/MPL/2.0/.%0A%0A%22%22%2...