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
3618ce5749517c7757a04f0c08a74275e8e82b69
Create fasttext.py
fasttext.py
fasttext.py
Python
0.000031
@@ -0,0 +1,3188 @@ +from __future__ import print_function%0Aimport numpy as np%0A%0Afrom keras.preprocessing import sequence%0Afrom keras.models import Sequential%0Afrom keras.layers import Dense%0Afrom keras.layers import Embedding%0Afrom keras.layers import GlobalAveragePooling1D%0Afrom keras.datasets import imdb%0A%...
7655e376696a04aa1c3596274861515953f592e8
Add profiling script for savings code
openprescribing/frontend/price_per_unit/profile.py
openprescribing/frontend/price_per_unit/profile.py
Python
0
@@ -0,0 +1,1010 @@ +%22%22%22%0ABasic profiling code for working out where we're spending our time%0A%0AInvoke with:%0A./manage.py shell -c 'from frontend.price_per_unit.profile import profile; profile()'%0A%22%22%22%0Afrom cProfile import Profile%0Aimport datetime%0Aimport time%0A%0Afrom .savings import get_all_saving...
e019ed140e31f4a25b843429b70c3e28d48a8628
Add missing mock for cinder.default_quota_get
openstack_dashboard/dashboards/admin/info/tests.py
openstack_dashboard/dashboards/admin/info/tests.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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.org/licenses/LICENSE-2.0 # # ...
Python
0.999998
@@ -1177,16 +1177,76 @@ ported') +,%0A api.cinder: ('default_quota_get',) %7D)%0A d @@ -1731,16 +1731,144 @@ urn(%7B%7D)%0A + api.cinder.default_quota_get(IsA(http.HttpRequest), self.tenant.id)%5C%0A .AndReturn(self.cinder_quotas.first())%0A
40caa4c9b720388207e338ffde3cd7f2d85cdf0d
add a single script to perform formatting of base log files
base-format.py
base-format.py
Python
0
@@ -0,0 +1,2739 @@ +#!/usr/bin/python%0A%0Afrom __future__ import print_function%0A%0Aimport sys%0Aimport re%0Aimport datetime%0Aimport ircformatlib as il%0A%0Atimeformat_format = '%25H:%25M:%25S'%0Atimeformat_formatlen = 8%0Atimeformat_filler = ' ' * timeformat_formatlen%0A%0Adef timeformat(time):%0A try:%0A ...
2766e8797515497e5569b31696416db68641c9b4
Extend MediaRemovalMixin to move media files on updates
base/models.py
base/models.py
import os from django.conf import settings class MediaRemovalMixin(object): """ Removes all files associated with the model, as returned by the get_media_files() method. """ # Models that use this mixin need to override this method def get_media_files(self): return def delete(se...
Python
0
@@ -311,24 +311,41 @@ delete(self +, *args, **kwargs ):%0A f @@ -561,10 +561,760 @@ .delete( +*args, **kwargs)%0A%0A def save(self, *args, **kwargs):%0A if self.pk:%0A # Primary key exists, object is being edited%0A old_object = self.__class__.objects.get(pk=self.pk)%0A ...
24c642063ffcb3313545b2e1ba3abbb62aa98437
Add cuit validator to utils module
nbs/utils/validators.py
nbs/utils/validators.py
Python
0
@@ -0,0 +1,568 @@ +# -*- coding: utf-8-*-%0A%0A%0Adef validate_cuit(cuit):%0A %22from: http://python.org.ar/pyar/Recetario/ValidarCuit by Mariano Reingart%22%0A # validaciones minimas%0A if len(cuit) != 13 or cuit%5B2%5D != %22-%22 or cuit %5B11%5D != %22-%22:%0A return False%0A%0A base = %5B5, 4, 3,...
7274f9286bd267970c286954e9d21e601af30cb7
Create messenger.py
messenger.py
messenger.py
Python
0.000002
@@ -0,0 +1,271 @@ +# -*- coding: utf-8 -*-%0Aimport requests%0Aapiurl = '%E4%BD%A0%E7%9A%84%E5%9C%B0%E5%9D%80'%0Aapiheaders = %7B'U-ApiKey': '%E4%BD%A0%E7%9A%84key'%7D%0Acode=%22%E5%8A%A8%E6%80%81%E7%A0%81%22%0Aresponse = requests.get(apiurl, params=%7B%22media_id%22:'gh_3fc78df4c9d2',%22auth_code%22:code, %22scene%22:...
620ad7f4dc5ed9403f468f592b99a22a92d22072
make python -m i3configger work
i3configger/__main__.py
i3configger/__main__.py
Python
0.000012
@@ -0,0 +1,81 @@ +import i3configger.main%0A%0A%0Aif __name__ == %22__main__%22:%0A i3configger.main.main()%0A
ad2178a8973ce2de55611321c0b7b57b1488fc6b
move utilities in a private module
appengine_toolkit/management/commands/_utils.py
appengine_toolkit/management/commands/_utils.py
Python
0
@@ -0,0 +1,672 @@ +import pkg_resources%0Aimport os%0A%0A%0Aclass RequirementNotFoundError(Exception):%0A pass%0A%0A%0Adef collect_dependency_paths(package_name):%0A %22%22%22%0A TODO docstrings%0A %22%22%22%0A deps = %5B%5D%0A try:%0A dist = pkg_resources.get_distribution(package_name)%0A e...
79b99968d7c9e728efe05f8c962bdda5c9d56559
Add LDAP authentication plugin
web/utils/auth.py
web/utils/auth.py
Python
0
@@ -0,0 +1,2461 @@ +# http://www.djangosnippets.org/snippets/501/%0Afrom django.contrib.auth.models import User%0Afrom django.conf import settings%0Aimport ldap%0A%0A%0Aclass ActiveDirectoryBackend:%0A%0A supports_object_permissions = False%0A supports_anonymous_user = False%0A supports_inactive_user = False%0...
8e1a3cc1a3d4e4d9bc63fb73a8787e5c627afb7d
add tests for service inspector
tests/test_service_inspector.py
tests/test_service_inspector.py
Python
0.000001
@@ -0,0 +1,1963 @@ +from __future__ import absolute_import%0A%0Aimport unittest%0A%0Aimport servy.server%0A%0A%0Aclass Dummy(object):%0A def fn(self):%0A pass%0A%0A%0Aclass Service(servy.server.Service):%0A def __call__(self):%0A pass%0A%0A%0Aclass ServiceDetection(unittest.TestCase):%0A def test...
43de875bcb2dcf4213b881ff1de8f9e715fb2d30
Add brute_force.py
brute_force.py
brute_force.py
Python
0.99866
@@ -0,0 +1,755 @@ +from battingorder import *%0Afrom itertools import permutations%0A%0Aif __name__ == %22__main__%22:%0A parser = argparse.ArgumentParser(description='Brute force.')%0A parser.add_argument(%22filename%22, nargs='?', default='braves.data', help=%22file with necessary statistics%22)%0A args = pa...
b013f059a5d39acf05ba8e5ef9d6cb1d9e3f724c
add a script to exercise the example jsonrpc methods
tester.py
tester.py
Python
0
@@ -0,0 +1,728 @@ +import zmq%0A%0Aclass JRPC:%0A%09def __init__(self):%0A%09%09self.id = 0%0A%0A%09def make_req(self, method, params):%0A%09%09req = %7B%22jsonrpc%22:%222.0%22, %22method%22:method, %22params%22:params,%0A%09%09%09%09%22id%22:self.id%7D%0A%09%09self.id += 1%0A%09%09return req%0A%0Azctx = zmq.Context.in...
819bb017a4d2a0c03d7f655cee452c5fa5f67a37
Check DOB not in future
radar/radar/validation/recruit_patient.py
radar/radar/validation/recruit_patient.py
from radar.validation.core import Validation, Field, pass_call, pass_context, ValidationError, ListField from radar.validation.validators import optional, required, not_in_future, in_, not_empty, upper from radar.models.patients import GENDERS, ETHNICITIES, Patient from radar.permissions import has_permission_for_group...
Python
0
@@ -818,24 +818,41 @@ (%5Brequired() +, not_in_future() %5D)%0A numbe
0dcf9178564b879a51b06ae06df58917f78adb6d
Fix linting
tensorflow_datasets/image/nyu_depth_v2.py
tensorflow_datasets/image/nyu_depth_v2.py
"""NYU Depth V2 Dataset.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import h5py import os import numpy as np import tensorflow.compat.v2 as tf import tensorflow_datasets as tfds _CITATION = """\ @inproceedings{Silberman:ECCV12, author = {Nat...
Python
0.000004
@@ -143,20 +143,19 @@ ort -h5py +os%0A %0Aimport os%0Ai @@ -150,18 +150,20 @@ %0Aimport -os +h5py %0Aimport @@ -2300,16 +2300,22 @@ for dir +ectory in tf.i @@ -2410,16 +2410,22 @@ dir, dir +ectory )):%0A @@ -2469,16 +2469,22 @@ dir, dir +ectory , file_n @@ -2498,19 +2498,16 @@ r') as f -ile :%0A ...
061dcecdd7b691cefd34c8a254037a399b251378
add a new script to build a pypi 'simple' index from a dir containing wheels
build_index.py
build_index.py
Python
0
@@ -0,0 +1,1550 @@ +import sys%0Aimport py%0A%0APACKAGES = %5B%0A 'netifaces',%0A%5D%0A%0Aclass IndexBuilder(object):%0A%0A def __init__(self, wheeldir, outdir):%0A self.wheeldir = py.path.local(wheeldir)%0A self.outdir = py.path.local(outdir)%0A self.packages = %5B%5D%0A%0A def copy_wheel...
b22bf4e2431ac3598d9c8afee3f924d940e2297e
Create building_df.py
building_df.py
building_df.py
Python
0.000002
@@ -0,0 +1,866 @@ +%22%22%22Utility functions%22%22%22%0A%0Aimport os%0Aimport pandas as pd%0A%0Adef symbol_to_path(symbol, base_dir=%22data%22):%0A %22%22%22Return CSV file path given ticker symbol.%22%22%22%0A return os.path.join(base_dir, %22%7B%7D.csv%22.format(str(symbol)))%0A%0A%0Adef get_data(symbols, date...
7d84cf8c41105d9990b8cfdf176415f1bcb20e0f
Add tests for batch norm
thinc/tests/integration/test_batch_norm.py
thinc/tests/integration/test_batch_norm.py
Python
0
@@ -0,0 +1,2406 @@ +import pytest%0Afrom mock import MagicMock%0Aimport numpy%0Aimport numpy.random%0Afrom numpy.testing import assert_allclose%0Afrom hypothesis import given, settings, strategies%0A%0Afrom ...neural._classes.batchnorm import BatchNorm%0Afrom ...api import layerize, noop%0A%0Afrom ...neural._classes.af...
7473384155edbf85304cc541325d0a94a75d2cf4
Add converting script
labs/12_i2c_oled_display/convert.py
labs/12_i2c_oled_display/convert.py
Python
0
@@ -0,0 +1,789 @@ +import imageio%0Aimport sys%0Aimport os%0Aimport numpy as np%0A%0Aif (len(sys.argv) != 2):%0A print(%22Format: python convert.py grayscale_image_name%22)%0A sys.exit(1)%0A%0Atry:%0A data = imageio.imread(sys.argv%5B1%5D)%0Aexcept:%0A print(%22Wrong image name!%22)%0A sys.exit(1)%0A%0Ai...
2448f1d6835129bc08855a9ecc59fea347a14243
add re.escape for match_with_format
onlinejudge/implementation/format_utils.py
onlinejudge/implementation/format_utils.py
# Python Version: 3.x import onlinejudge import onlinejudge.implementation.utils as utils import onlinejudge.implementation.logging as log import collections import glob import pathlib import re import sys from typing import Dict, List, Match, Optional def glob_with_format(directory: pathlib.Path, format: str) -> List...
Python
0
@@ -247,16 +247,17 @@ tional%0A%0A +%0A def glob @@ -598,16 +598,17 @@ paths%0A%0A +%0A def matc @@ -817,16 +817,26 @@ e('%5E' + +re.escape( str(dire @@ -851,18 +851,44 @@ solve()) +) + +%0A '/' + u @@ -898,38 +898,49 @@ s.percentformat( +re.escape( format +) , table) + '$')%0A @...
3db7c5502bcba0adbfbcf6649c0b4179b37cd74a
Create redis_board.py
simpleRaft/boards/redis_board.py
simpleRaft/boards/redis_board.py
Python
0.000001
@@ -0,0 +1,627 @@ +import redis%0Afrom board import Board%0A%0Aclass RedisBoard( Board ):%0A %22%22%22This will create a message board that is backed by Redis.%22%22%22%0A %0A def __init__( self, *args, **kwargs ):%0A %22%22%22Creates the Redis connection.%22%22%22%0A self.redis = redis.Redis( *args, **kwargs ...
69fbab70f09f83e763f9af7ff02d028af62d8d89
Create weighted_4_node_probability_convergence.py
weighted_4_node_probability_convergence.py
weighted_4_node_probability_convergence.py
Python
0.000003
@@ -0,0 +1,1935 @@ +# statistics on convergence_weighted_4_node.txt%0A# output into a csv file%0Aimport re,sys, numpy as np, pandas as pd%0Afrom pandas import Series, DataFrame%0A%0Adef main(argv):%0A author = ''%0A play = ''%0A%0A sub = %5B%5D%0A %0A play_subgraph=Series()%0A l=''%0A subgraph = ''...
944ec176f4d6db70f9486dddab9a6cf901d6d575
Create MyUsefulExample.py
src/zhang/MyUsefulExample.py
src/zhang/MyUsefulExample.py
Python
0
@@ -0,0 +1,2283 @@ +#JUST EXAMPLES%0Aimport pyspark.ml.recommendation%0Adf = spark.createDataFrame(%0A... %5B(0, 0, 4.0), (0, 1, 2.0), (1, 1, 3.0), (1, 2, 4.0), (2, 1, 1.0), (2, 2, 5.0)%5D,%0A... %5B%22user%22, %22item%22, %22rating%22%5D)%0A%0Aals = ALS(rank=10, maxIter=5, seed=0)%0A%0Amodel = als.fit(df)%0Amo...
5ba36ca805b002af63c619e17dd00400650da14b
Add script to rewrite the agents used by scc.
agent_paths.py
agent_paths.py
Python
0
@@ -0,0 +1,1131 @@ +#!/usr/bin/env python3%0Afrom argparse import ArgumentParser%0Aimport json%0Aimport os.path%0Aimport re%0Aimport sys%0A%0Afrom generate_simplestreams import json_dump%0A%0A%0Adef main():%0A parser = ArgumentParser()%0A parser.add_argument('input')%0A parser.add_argument('output')%0A args...
5cc627d0c0cb18e236a055ce7fceb05b63b45385
Add flask backend file
woogle.py
woogle.py
Python
0.000001
@@ -0,0 +1,273 @@ +%22%22%22:mod:%60woogle%60 --- Flask Backend for Woogle Calendar%0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%0A%22%22%22%0A%0Afrom flask import Flask%0Aapp = Flask(__name__)%0A%0A@app.route(%22/%22)%0Adef calendar():%0A return %22Hello World!%22%0A%0Aif __name__ == %22__m...
f82ef484f6440c2b5b10eb144af09b770fa413c9
Add python script for extracting server i18n msgs
.infrastructure/i18n/extract-server-msgs.py
.infrastructure/i18n/extract-server-msgs.py
Python
0
@@ -0,0 +1,535 @@ +import os%0A%0A# Keys indicating the fn symbols that pybabel should search for%0A# when finding translations.%0Akeys = '-k format -k format_time -k format_date -k format_datetime'%0A%0A# Extraction%0Aos.system(%22pybabel extract -F babel.cfg %7B%7D -o messages.pot .%22.format(keys))%0Aos.system(%22py...
5046ff8ba17899893a9aa30687a1ec58a6e95af2
Add solution for Square Detector.
2014/qualification-round/square-detector.py
2014/qualification-round/square-detector.py
Python
0
@@ -0,0 +1,2110 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0Aimport sys%0A%0Aclass QuizzesParser:%0A def __init__(self, src):%0A self.src = src%0A with open(src) as f:%0A self.raw = f.read().splitlines()%0A self.amount = int(self.raw%5B0%5D)%0A def quizpool(self):%0A ...
3df4cc086bf6c85eebc12094cc3ca459bd2bcd3d
Add unit test for programmatic application and approval
project/members/tests/test_application.py
project/members/tests/test_application.py
Python
0
@@ -0,0 +1,477 @@ +# -*- coding: utf-8 -*-%0Aimport pytest%0Afrom members.tests.fixtures.memberlikes import MembershipApplicationFactory%0Afrom members.tests.fixtures.types import MemberTypeFactory%0Afrom members.models import Member%0A%0A@pytest.mark.django_db%0Adef test_application_approve():%0A mtypes = %5BMember...
1a682405904dcc711d889881d6a216b3eff9e1dd
remove off method from status light
status_light.py
status_light.py
import time import config import RPi.GPIO as GPIO class StatusLight(object): """available patterns for the status light""" patterns = { 'on' : (.1, [True]), 'off' : (.1, [False]), 'blink_fast' : (.1, [False, True]), 'blink' : (.1, [False, False, False, True, True, True, True,...
Python
0.000001
@@ -1863,131 +1863,8 @@ e)%0A%0A - %0A def off(self, state):%0A %22%22%22Turn off status light%22%22%22%0A self.cont = False%0A self.set_state(state)%0A
aa292c2f180ffcfdfc55114750f22b6c8790a69b
Add Jaro-Winkler distance based on code on RosettaCode
pygraphc/similarity/RosettaJaroWinkler.py
pygraphc/similarity/RosettaJaroWinkler.py
Python
0.000004
@@ -0,0 +1,1600 @@ +from __future__ import division%0Afrom itertools import combinations%0Afrom time import time%0A%0A%0Adef jaro(s, t):%0A s_len = len(s)%0A t_len = len(t)%0A%0A if s_len == 0 and t_len == 0:%0A return 1%0A%0A match_distance = (max(s_len, t_len) // 2) - 1%0A%0A s_matches = %5BFals...
2674aa95c69c6e0fe0d8fd71d9116150cfab6507
add xdawn decoding example
examples/decoding/plot_decoding_xdawn_meg.py
examples/decoding/plot_decoding_xdawn_meg.py
Python
0.000001
@@ -0,0 +1,2911 @@ +%22%22%22%0A=============================%0A XDAWN Decoding From MEG data%0A=============================%0A%0AERF decoding with Xdawn. For each event type, a set of spatial Xdawn filters%0Aare trained and apply on the signal. Channels are concatenated and rescaled to%0Acreate features vectors that ...
34986c7bfd1d4634861a5c4b54cf90ef18090ff4
test versions of required libs across different places
spacy/tests/test_requirements.py
spacy/tests/test_requirements.py
Python
0
@@ -0,0 +1,2407 @@ +import re%0Afrom pathlib import Path%0A%0A%0Adef test_build_dependencies(en_vocab):%0A libs_ignore_requirements = %5B%22pytest%22, %22pytest-timeout%22, %22mock%22, %22flake8%22, %22jsonschema%22%5D%0A libs_ignore_setup = %5B%22fugashi%22, %22natto-py%22, %22pythainlp%22%5D%0A%0A # check re...
13959dbce03b44f15c4c05ff0715b7d26ff6c0fa
Add a widget.
python/tkinter/python3/animation_print.py
python/tkinter/python3/animation_print.py
Python
0
@@ -0,0 +1,1593 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2016 J%C3%A9r%C3%A9mie DECOCK (http://www.jdhp.org)%0A%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in t...
1372a374b02d5e1d01b1569c71f84bdb71fb1296
Update handler.py
tendrl/node_agent/message/handler.py
tendrl/node_agent/message/handler.py
import os from io import BlockingIOError import sys import traceback import gevent.event import gevent.greenlet from gevent.server import StreamServer from gevent import socket from gevent.socket import error as socket_error from gevent.socket import timeout as socket_timeout from tendrl.commons.message import Mess...
Python
0.000001
@@ -45,16 +45,30 @@ ort sys%0A +import struct%0A import t @@ -76,16 +76,16 @@ aceback%0A - %0A%0Aimport @@ -378,33 +378,8 @@ r%0A%0A%0A -RECEIVE_DATA_SIZE = 4096%0A MESS @@ -731,46 +731,153 @@ s -elf.data = sock.recv(RECEIVE_DATA_SIZE +ize = self._msgLength(sock)%0A data = self._read(sock, size)%0A...
bb8c257dd5ce845c7ac07742c739b719c71d8b3a
add support for ROBOT_SUPPRESS_NAME to remove exception name from error message
src/robot/utils/error.py
src/robot/utils/error.py
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0
@@ -3361,16 +3361,87 @@ ceptions + or %5C%0A getattr(self.error, 'ROBOT_SUPPRESS_NAME', False) :%0A
49253451d65511713cd97a86c7fe54e64b3e80a9
Add a separate test of the runtest.py --qmtest option.
test/runtest/qmtest.py
test/runtest/qmtest.py
Python
0
@@ -0,0 +1,3111 @@ +#!/usr/bin/env python%0A#%0A# __COPYRIGHT__%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining%0A# a copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without restriction, including%0A# without limitation the rights ...
0c2fb46c977d8d8ee03d295fee8ddf37cee8cc06
Add script to calculate recalls of track zip files.
tools/stats/zip_track_recall.py
tools/stats/zip_track_recall.py
Python
0
@@ -0,0 +1,1677 @@ +#!/usr/bin/env python%0A%0Afrom vdetlib.utils.protocol import proto_load, proto_dump, track_box_at_frame%0Afrom vdetlib.utils.common import iou%0Aimport argparse%0Aimport numpy as np%0Aimport glob%0Aimport cPickle%0A%0Aif __name__ == '__main__':%0A parser = argparse.ArgumentParser()%0A parser....
3ee41b704e98e143d23eb0d714c6d79e8d6e6130
Write test for RequestTypeError
tests/web/test_request_type_error.py
tests/web/test_request_type_error.py
Python
0.000004
@@ -0,0 +1,410 @@ +import unittest%0Afrom performance.web import RequestTypeError%0A%0A%0Aclass RequestTypeErrorTestCase(unittest.TestCase):%0A def test_init(self):%0A type = 'get'%0A error = RequestTypeError(type)%0A self.assertEqual(type, error.type)%0A%0A def test_to_string(self):%0A ...
125a6714d1c4bda74a32c0b2fc67629ef2b45d7a
6-2 lucky_number
06/lucky_number.py
06/lucky_number.py
Python
0.998787
@@ -0,0 +1,171 @@ +friend = %7B'dwq': '5', 'bql': '3','xx': '28', 'txo':'44', 'fw':'2'%7D%0A%0Aprint(friend%5B'dwq'%5D)%0Aprint(friend%5B'bql'%5D)%0Aprint(friend%5B'xx'%5D)%0Aprint(friend%5B'txo'%5D)%0Aprint(friend%5B'fw'%5D)%0A
00e75bc59dfec20bd6b96ffac7d17da5760f584c
Add Slack integration
hc/api/migrations/0012_auto_20150930_1922.py
hc/api/migrations/0012_auto_20150930_1922.py
Python
0.000001
@@ -0,0 +1,486 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('api', '0011_notification'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A ...
f92d06346b3d28513c5f5b9833dbf5a4d48c3e46
Create rot_alpha.py
rot_alpha.py
rot_alpha.py
Python
0.000078
@@ -0,0 +1,631 @@ +#!/usr/bin/env python%0A%0Afrom string import uppercase, lowercase, maketrans%0Aimport sys%0A%0Aclass ROTAlpha():%0A%0A def rot_alpha(self, data, rot):%0A%0A upper = ''.join(%5Buppercase%5B(i+rot)%2526%5D for i in xrange(26)%5D)%0A lower = ''.join(%5Blowercase%5B(i+rot)%2526%5D for i in xrange...
d96acd58ecf5937da344942f387d845dc5b26871
Add db tests
test/test_db.py
test/test_db.py
Python
0
@@ -0,0 +1,2186 @@ +from piper.db import DbCLI%0A%0Aimport mock%0Aimport pytest%0A%0A%0Aclass DbCLIBase(object):%0A def setup_method(self, method):%0A self.cli = DbCLI()%0A self.ns = mock.Mock()%0A self.config = mock.Mock()%0A%0A%0Aclass TestDbCLIRun(DbCLIBase):%0A def test_plain_run(self):%0...
83afa054e3bee18aba212394973978fd49429afa
Create test_ratings.py
test_ratings.py
test_ratings.py
Python
0.000015
@@ -0,0 +1,1539 @@ +#!/usr/bin/env python3.5%0A%0Aimport sys%0Aimport re%0Aimport os%0Aimport csv%0A%0Afrom extract_toc import parseargs%0Afrom get_ratings import Ratings, Ratings2%0A%0Adef nvl(v1,v2):%0A if v1:%0A return v1%0A else:%0A return v2%0A%0Adef process_ratings_for_file(ratings, filename):%0A ratings...
f804300765f036f375768e57e081b070a549a800
Add test script with only a few packages
test-extract-dependencies.py
test-extract-dependencies.py
Python
0
@@ -0,0 +1,380 @@ +from dependencies import extract_package%0Aimport xmlrpc.client as xmlrpclib%0A%0Aimport random%0Aclient = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')%0Apackages = %5B'gala', 'scikit-learn', 'scipy', 'scikit-image', 'Flask'%5D%0Arandom.shuffle(packages)%0Afor i, package in enumerate(packages...
7de55b168a276b3d5cdea4d718680ede46edf4d8
Create file to test thinc.extra.search
thinc/tests/unit/test_beam_search.py
thinc/tests/unit/test_beam_search.py
Python
0
@@ -0,0 +1,88 @@ +from ...extra.search import MaxViolation%0A%0Adef test_init_violn():%0A v = MaxViolation()%0A
38b839405f9976df2d63c08d3c16441af6cdebd1
Add test
test/selenium/src/tests/test_risk_threats_page.py
test/selenium/src/tests/test_risk_threats_page.py
Python
0.000005
@@ -0,0 +1,1004 @@ +# Copyright (C) 2015 Google Inc., authors, and contributors %3Csee AUTHORS file%3E%0A# Licensed under http://www.apache.org/licenses/LICENSE-2.0 %3Csee LICENSE file%3E%0A# Created By: jernej@reciprocitylabs.com%0A# Maintained By: jernej@reciprocitylabs.com%0A%0A%22%22%22All smoke tests relevant to r...
51030039f68d0dc4243b6ba125fb9b7aca44638d
Add Pipeline tests
test/data/test_pipeline.py
test/data/test_pipeline.py
Python
0.000001
@@ -0,0 +1,1641 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0Aimport torchtext.data as data%0A%0Afrom ..common.torchtext_test_case import TorchtextTestCase%0A%0A%0Aclass TestPipeline(TorchtextTestCase):%0A @staticmethod%0A def repeat_n(x, n=3):%0A %22%22%22%0A Given a seque...
ca4f6e72c152f975c8bf01b920bcbdb3b611876b
add script to save_segment to disk
scripts/save_segment.py
scripts/save_segment.py
Python
0
@@ -0,0 +1,2073 @@ +'''%0AIDAPython script that saves the content of a segment to a file.%0APrompts the user for:%0A - segment name%0A - file path%0A%0AUseful for extracting data from memory dumps.%0A%0AAuthor: Willi Ballenthin %3Cwilliam.ballenthin@fireeye.com%3E%0ALicence: Apache 2.0%0A'''%0Aimport logging%0Afrom c...
369eed75c8a2fdc916885344fabb14e116bb60f9
add datatype test
tests/test_datatype.py
tests/test_datatype.py
Python
0.000002
@@ -0,0 +1,676 @@ +# encoding: utf-8%0A%0Afrom unittest import TestCase%0Afrom statscraper import Datatype, NoSuchDatatype%0A%0A%0Aclass TestDatatype(TestCase):%0A%0A def test_datatype(self):%0A dt = Datatype(%22str%22)%0A self.assertTrue(str(dt) == %22str%22)%0A%0A def test_datatype_with_values(sel...
9f7a8e01f7897e8979997b8845a9ace3f64d5412
Add more tests
tests/test_generate.py
tests/test_generate.py
Python
0
@@ -0,0 +1,233 @@ +import pytest%0A%0Afrom nlppln.generate import to_bool%0A%0A%0Adef test_to_bool_correct():%0A assert to_bool('y') == True%0A assert to_bool('n') == False%0A%0A%0Adef test_to_bool_error():%0A with pytest.raises(ValueError):%0A to_bool('foo')%0A
ff2eac9f6b382e8ad30eed2b733740ce4a50f6e6
Fix choosing languges function
searx/engines/gentoo.py
searx/engines/gentoo.py
# -*- coding: utf-8 -*- """ Gentoo Wiki @website https://wiki.gentoo.org @provide-api no (Mediawiki provides API, but Arch Wiki blocks access to it @using-api no @results HTML @stable no (HTML can change) @parse url, title """ from lxml import html from searx.engines.xpath import ex...
Python
0
@@ -94,69 +94,11 @@ pi -no (Mediawiki provides API, but Arch Wiki blocks access to it +yes %0A @u @@ -901,21 +901,20 @@ ang_urls - = %7B%0A + 'en' @@ -1034,16 +1034,176 @@ &%7Bquery%7D +'%0A %7D,%0A 'others': %7B%0A 'base': 'https://wiki.gentoo.org',%0A 'search': '/index.php?title=Speci...
2cd1ab91ca48b8a8d34eabcc2a01b4014a97bcf6
add unit tests
test/test_ncompress.py
test/test_ncompress.py
Python
0.000001
@@ -0,0 +1,2961 @@ +import shutil%0Aimport subprocess%0Afrom io import BytesIO%0A%0Aimport pytest%0Afrom ncompress import compress, decompress%0A%0A%0A@pytest.fixture%0Adef sample_data():%0A chars = %5B%5D%0A for i in range(15):%0A chars += %5Bi * 16%5D * (i + 1)%0A chars += %5B0, 0, 0%5D%0A return b...
c297de3964c53beffdf33922c0bffd022b376ae6
Create __init__.py
crawl/__init__.py
crawl/__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
ccf21faf0110c9c5a4c28a843c36c53183d71550
add missing file
pyexcel_xls/__init__.py
pyexcel_xls/__init__.py
Python
0.000003
@@ -0,0 +1,657 @@ +%22%22%22%0A pyexcel_xls%0A ~~~~~~~~~~~~~~~~~~~%0A%0A The lower level xls/xlsm file format handler using xlrd/xlwt%0A%0A :copyright: (c) 2015-2016 by Onni Software Ltd%0A :license: New BSD License%0A%22%22%22%0Afrom pyexcel_io.io import get_data as read_data, isstream, store_data as wr...
5c4ed354d1bfd5c4443cc031a29e6535b2063178
add test-env
sikuli-script/src/test/python/test-env.py
sikuli-script/src/test/python/test-env.py
Python
0
@@ -0,0 +1,170 @@ +from __future__ import with_statement%0Afrom sikuli.Sikuli import *%0A%0Aprint Env.getOS(), Env.getOSVersion()%0Aprint %22MAC?%22, Env.getOS() == OS.MAC%0Aprint Env.getMouseLocation()%0A
1828f7bb8cb735e755dbcb3a894724dec28748cc
add sort file
sort/sort.py
sort/sort.py
Python
0.000001
@@ -0,0 +1,157 @@ +#!/usr/bin/env python%0A# -*- coding:utf-8 -*-%0Afrom __future__ import division%0Afrom __future__ import unicode_literals%0Afrom __future__ import print_function%0A%0A%0A
fbd6db138ce65825e56a8d39bf30ed8525b88503
Add exception handler for db not found errors.
resources/middlewares/db_not_found_handler.py
resources/middlewares/db_not_found_handler.py
Python
0
@@ -0,0 +1,84 @@ +import falcon%0A%0A%0Adef handler(ex, req, resp, params):%0A raise falcon.HTTPNotFound()%0A
a1eaf66efa2041849e906010b7a4fb9412a9b781
Add instance method unit tests
tests/test_instancemethod.py
tests/test_instancemethod.py
Python
0.000001
@@ -0,0 +1,473 @@ +# Imports%0Aimport random%0Aimport unittest%0Afrom funky import memoize, timed_memoize%0A%0A%0Aclass Dummy(object):%0A @memoize%0A def a(self):%0A return random.random()%0A%0A%0Aclass TestInstanceMethod(unittest.TestCase):%0A def test_dummy(self):%0A dummy = Dummy()%0A v...
c3221d70f829dc2968ebfb1a47efd9538a1ef59f
test gaussian + derivatives
tests/vigra_compare.py
tests/vigra_compare.py
Python
0.000002
@@ -0,0 +1,590 @@ +import fastfilters as ff%0Aimport numpy as np%0Aimport sys%0A%0Atry:%0A%09import vigra%0Aexcept ImportError:%0A%09print(%22WARNING: vigra not available - skipping tests.%22)%0A%09with open(sys.argv%5B1%5D, 'w') as f:%0A%09%09f.write('')%0A%09exit()%0A%0Aa = np.random.randn(1000000).reshape(1000,1000)...
8ec1d35fe79554729e52aec4e0aabd1d9f64a9c7
Put main.py display functions in its own module so they can be used in other parts of the package
fire_rs/display.py
fire_rs/display.py
Python
0
@@ -0,0 +1,2228 @@ +from mpl_toolkits.mplot3d import Axes3D%0Aimport matplotlib%0Aimport matplotlib.pyplot as plt%0Afrom matplotlib.colors import LightSource%0Afrom matplotlib.ticker import FuncFormatter%0Afrom matplotlib import cm%0A%0A%0Adef get_default_figure_and_axis():%0A fire_fig = plt.figure()%0A fire_ax =...
78f730b405c6e67988cdc9efab1aa5316c16849f
Add initial test for web response
tests/test_web_response.py
tests/test_web_response.py
Python
0
@@ -0,0 +1,853 @@ +import unittest%0Afrom unittest import mock%0Afrom aiohttp.web import Request, StreamResponse%0Afrom aiohttp.protocol import Request as RequestImpl%0A%0A%0Aclass TestStreamResponse(unittest.TestCase):%0A%0A def make_request(self, method, path, headers=()):%0A self.app = mock.Mock()%0A ...
644a678d3829513361fdc099d759ca964100f2e6
Add script to replace text
text-files/replace-text.py
text-files/replace-text.py
Python
0.000003
@@ -0,0 +1,1034 @@ +#!/usr/bin/env python3%0A# This Python 3 script replaces text in a file, in-place.%0A%0A# For Windows, use:%0A#!python%0A%0Aimport fileinput%0Aimport os%0Aimport sys%0A%0Adef isValidFile(filename):%0A return (filename.lower().endswith('.m3u') or%0A filename.lower().endswith('.m3u8'))%0...
8d8f6b99357912fa9a29098b0744712eeb1d4c70
Add coder/decoder skeleton
src/coder.py
src/coder.py
Python
0.000004
@@ -0,0 +1,1109 @@ +from bitarray import bitarray%0Afrom datetime import datetime, timedelta%0A%0Adef decode():%0A with open() as f:%0A timestamps = %5B%5D%0A start = %5B0, 0, 0%5D%0A end = %5B1, 1, 1%5D%0A delta = timedelta(seconds=1)%0A for line in f:%0A ts = line.spli...
3c18ace928b0339b0edf4763f4132d327936cbe8
add utils
src/utils.py
src/utils.py
Python
0.000004
@@ -0,0 +1,776 @@ +def set_trace():%0A from IPython.core.debugger import Pdb%0A import sys%0A Pdb(color_scheme='Linux').set_trace(sys._getframe().f_back)%0A%0Adef plot_ROC(actual, predictions):%0A%09# plot the FPR vs TPR and AUC for a two class problem (0,1)%0A%09import matplotlib.pyplot as plt%0A%09from sklea...
3f141c4e8f123e0ca8c7a8b8475bf1798c18cdb4
Combine Importer/Loader
src/sentry/runner/importer.py
src/sentry/runner/importer.py
""" sentry.runner.importer ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import sys def install(name, config_path, default_settings, callback): sys.meta_path.ap...
Python
0.000001
@@ -884,17 +884,16 @@ return%0A -%0A @@ -903,434 +903,12 @@ urn -Loader(%0A name=self.name,%0A config_path=self.config_path,%0A default_settings=self.default_settings,%0A callback=self.callback,%0A )%0A%0A%0Aclass Loader(object):%0A def __init__(self, ...
0bca09339bb49e4540c5be8162e11ea3e8106200
Create a PySide GUI window.
budget.py
budget.py
Python
0
@@ -0,0 +1,202 @@ +#!/usr/bin/env python%0A%0Aimport sys%0Afrom PySide import QtGui%0A%0Aapp = QtGui.QApplication(sys.argv)%0A%0Awid = QtGui.QWidget()%0Awid.resize(250, 150)%0Awid.setWindowTitle('Simple')%0Awid.show()%0A%0Asys.exit(app.exec_())%0A
19a23591b9b21cbe7dd34c8be7d2cb435c0f965a
generate XML works
umpa/extensions/XML.py
umpa/extensions/XML.py
Python
0.999372
@@ -0,0 +1,2268 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A# Copyright (C) 2008 Adriano Monteiro Marques.%0A#%0A# Author: Bartosz SKOWRON %3Cgetxsick at gmail dot com%3E%0A#%0A# This library is free software; you can redistribute it and/or modify %0A# it under the terms of the GNU Lesser General Public Li...
4ff319033277bbaa04b1e226f9a90232ecadd49d
Trying out the potential new name, Spectra
cronenberg/config.py
cronenberg/config.py
DEBUG = True DEFAULT_FROM_TIME = '-3h' DEFAULT_THEME = 'light' DASHBOARD_APPNAME = 'Cronenberg' SQLALCHEMY_DATABASE_URI = 'sqlite:///cronenberg.db' GRAPHITE_URL = 'http://graphite.prod.urbanairship.com' SERVER_ADDRESS = '0.0.0.0' SERVER_PO...
Python
0.999999
@@ -133,18 +133,15 @@ = ' -Cronenberg +Spectra '%0ASQ
bc28f6ab7ba5bb5e82bf38c544a4d091d89973ea
Use servoblaster to control servo
candycrush.py
candycrush.py
Python
0.000001
@@ -0,0 +1,817 @@ +#!/usr/bin/env python%0Aimport os.path%0Aimport subprocess%0Aimport time%0A%0Adef scaler(OldMin, OldMax, NewMin, NewMax):%0A def fn(OldValue):%0A return (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin%0A return fn%0A%0Adef setup_servod():%0A if not os.path.exi...
26595ad3dd7dcd9dfd16ae551345db9b7e58412a
Add updater
updater/openexchangerates.py
updater/openexchangerates.py
Python
0
@@ -0,0 +1,1021 @@ +#!env/bin/python%0Aimport urllib2%0Aimport simplejson%0Aimport datetime%0A%0AAPP_ID = %2240639356d56148f1ae26348d670e889f%22%0ATARGET_URL = %22http://taggy-api.bx23.net/api/v1/currency/%22%0A%0Adef main():%0A print 'Getting rates...'%0A request = urllib2.Request(%22http://openexchangerates.org...
3ef4fdcc98a12111aee6f0d214af98ef68315773
add reboot module
gozerlib/reboot.py
gozerlib/reboot.py
Python
0.000001
@@ -0,0 +1,1491 @@ +# gozerbot/utils/reboot.py%0A#%0A#%0A%0A%22%22%22%0A reboot code. %0A%0A%22%22%22%0A%0A## gozerlib imports%0A%0Afrom gozerlib.fleet import fleet%0Afrom gozerlib.config import cfg as config%0A%0A## basic imports%0A%0Afrom simplejson import dump%0Aimport os%0Aimport sys%0Aimport pickle%0Aimport te...
3c37f63f65a9d85c605dde55ae19c8d5d62ad777
add missing file
rmake/plugins/plugin.py
rmake/plugins/plugin.py
Python
0.000003
@@ -0,0 +1,2653 @@ +#%0A# Copyright (c) 2006 rPath, Inc.%0A#%0A# This program is distributed under the terms of the Common Public License,%0A# version 1.0. A copy of this license should have been distributed with this%0A# source file in a file called LICENSE. If it is not present, the license%0A# is always available at...
2100eb3e0a72395f23571c6be2bada9939739869
add ex
checkDigit.py
checkDigit.py
Python
0.00024
@@ -0,0 +1,283 @@ +#-*-coding:UTF-8 -*-%0A#%0A# %E5%88%A4%E6%96%B7%E8%BC%B8%E5%85%A5%E6%98%AF%E5%90%A6%E7%82%BA%E6%95%B4%E6%95%B8(int)%0A%0Ainput_string = input('Please input n:')%0A#while input_string.isdigit() == False:%0Awhile not input_string.isdigit():%0A%09print(%22Error, %25s is not digit!%22 %25 input_string)%0...
09592b081a68f912bf9bb73c5269af8398c36f64
Add unit test for treating Ordering as a collection
tests/test_collection.py
tests/test_collection.py
Python
0
@@ -0,0 +1,822 @@ +from unittest import TestCase%0A%0Afrom ordering import Ordering%0A%0A%0Aclass TestOrderingAsCollection(TestCase):%0A def setUp(self) -%3E None:%0A self.ordering = Ordering%5Bint%5D()%0A self.ordering.insert_start(0)%0A for n in range(10):%0A self.ordering.insert_af...
6f1ed2fcdd43a5237d0211b426a216fd25930734
add test preprocess
tests/test_preprocess.py
tests/test_preprocess.py
Python
0.000001
@@ -0,0 +1,1142 @@ +# coding: utf-8%0A%0Acode = '''%0An = 10%0Afor i in range(0,n):%0A x = 2 * i%0A%0A y = x / 3%0A # a comment%0A if y %3E 1:%0A%0A print(y)%0A%0A for j in range(0, 3):%0A x = x * y%0A%0A y = x + 1%0A%0Aif x %3E 1:%0A print(x)%0A'''%0A%0Acode = '''%0A#...
175b36b0eb1e84378e350ddc31da3ef7fcae32c2
Add test.
test/test.py
test/test.py
Python
0.000001
@@ -0,0 +1,1175 @@ +#!/usr/bin/env python%0A%0A# Test PyCharlockHolmes%0A#%0A%0Afrom charlockholmes import detect%0A%0ATEST_FILES = %7B%0A %22py%22: %5B%0A %22file/test.py%22,%0A %7B'confidence': 34, 'type': 'text', 'language': 'en', 'encoding': 'ISO-8859-1'%7D%0A %5D,%0A %22txt%22: %5B%0A ...
829defd825d5e311ad187569ba61381ecb40dd08
Add q1 2019
2019/q1.py
2019/q1.py
Python
0.000002
@@ -0,0 +1,2746 @@ +%22%22%22%0ABIO 2019 Q1: Palindromes%0A%0AThis ended up being surprisingly difficult, for whatever reason I found it surprisingly difficult%0Ato reason about.%0A%0AI found it easier to think about how, given a palindrome, I would calculate the following%0Apalindrome. There are ~2 cases:%0A%0AOdd num...
80b395ce04248b8fb8b47187410a661a87931145
remove main block
src/robot/libraries/ProcessLibrary.py
src/robot/libraries/ProcessLibrary.py
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0.000096
@@ -4550,132 +4550,8 @@ rr%0A%0A -if __name__ == '__main__':%0A r = ProcessLibrary().run_process('python', '-c', %22print %5C'hello%5C'%22)%0A print repr(r.stdout)%0A %0Acla
5a1518bc2bd8b509bc5c00850ba1da59989147f8
Add basic tests
test_main.py
test_main.py
Python
0.000004
@@ -0,0 +1,1098 @@ +#!/usr/bin/env python%0Aimport sys%0Afrom io import StringIO%0Afrom jproperties import Properties%0A%0A%0Adef _test_deserialize(*data):%0A%09for s, items in data:%0A%09%09props = Properties()%0A%09%09props.load(StringIO(s))%0A%09%09assert list(props.items()) == items%0A%0A%0Adef test_eq_separator():...
4249c6456ca21ad6bbec0eccdf66aef629deb511
Add basic tag testing script
test_tags.py
test_tags.py
Python
0.000006
@@ -0,0 +1,344 @@ +import sys%0Aimport requests%0A%0Afrom wikibugs import Wikibugs2%0Afrom channelfilter import ChannelFilter%0Aimport configfetcher%0A%0Aconf = configfetcher.ConfigFetcher()%0Aw = Wikibugs2(conf)%0Ac = ChannelFilter()%0A%0A%0Aprint(%22%5Cn%5Cn%5Cn%5Cn%5Cn%5Cn%5Cn%5Cn%22)%0Apage = requests.get(sys.argv%...
377f44ea05d8fc550be5916a1ca6c085df8f8cdc
add mysql database backup script
backupmysql.py
backupmysql.py
Python
0.000001
@@ -0,0 +1,2389 @@ +#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0A#Author: Andrew McDonald andrew@mcdee.com.au http://mcdee.com.au%0A %0A# Example: config file%0A#%5Bclient%5D%0A#host = localhost%0A#user = root%0A#password = root-pass%0A %0Afrom datetime import datetime%0Aimport sys, os, subprocess, tarfile%0Aimport...
07c5ed48d107c7ec88a990698647a70187d277a1
Update cms_helper.py
cms_helper.py
cms_helper.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from tempfile import mkdtemp gettext = lambda s: s HELPER_SETTINGS = { 'NOSE_ARGS': [ '-s', ], 'ROOT_URLCONF': 'tests.test_utils.urls', 'INSTALLED_APPS': [ 'admin_enhancer', 'filer', 'parler', 'taggit', ...
Python
0.000001
@@ -39,17 +39,16 @@ f-8 -*-%0A -%0A import s @@ -79,16 +79,17 @@ mkdtemp%0A +%0A gettext @@ -125,15 +125,18 @@ S = -%7B +dict( %0A -' NOSE @@ -140,19 +140,17 @@ OSE_ARGS -': += %5B%0A @@ -168,17 +168,16 @@ %5D,%0A -' ROOT_URL @@ -180,19 +180,17 @@ _URLCONF -': += 'tests.t @@ -210,17 +210...
a3a2f645d3154334e8ae6af93fe56a3f2368c4c7
Add multiprocessing pool example
multiprocessing_pool.py
multiprocessing_pool.py
Python
0
@@ -0,0 +1,1001 @@ +from multiprocessing.pool import ThreadPool as Pool%0Afrom multiprocessing import Queue as PQueue%0Aimport Queue%0A%0Amy_dict = %7B%0A 'url1': 'url2',%0A 'url3': 'url4',%0A%7D%0A%0Amy_q = PQueue()%0A%0A%0Adef test_p(uq):%0A q, url = uq%5B0%5D, uq%5B1%5D%0A q.put(url, False)%0A%0A%0Adef m...
b117fbc82de4fb6acd8a044651c95e2425d9e71c
Create preprocess_MS_dataset_utils_test.py
preprocess_MS_dataset_utils_test.py
preprocess_MS_dataset_utils_test.py
Python
0.000004
@@ -0,0 +1,2293 @@ +# Copyright 2020 Google LLC%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# https://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by ...
6bf43087967dee2bfb9f31a5de61c91ed0664586
update get ids and columns in pecanstreet, much faster
proto/pylearn2/create_ev_dataset.py
proto/pylearn2/create_ev_dataset.py
Python
0.000001
@@ -0,0 +1,546 @@ +import sys%0Aimport os.path%0Asys.path.append(os.path.join(os.pardir,os.pardir))%0Aimport disaggregator as da%0Aimport disaggregator.PecanStreetDatasetAdapter as psda%0A%0Adb_url = %22postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres%22%0Apsda.set_url(db_url)%0Aschema = 'shared'%0A%0A%0...
10524dd2c42ef499d36b3f64e31150885d45e51b
Add slot_usage command for checking cluster balance
streamparse/cli/slot_usage.py
streamparse/cli/slot_usage.py
Python
0
@@ -0,0 +1,3028 @@ +%22%22%22%0ADisplay slots used by every topology on the cluster%0A%22%22%22%0A%0Afrom __future__ import absolute_import, print_function%0A%0Afrom collections import Counter, defaultdict%0A%0Afrom pkg_resources import parse_version%0Afrom prettytable import PrettyTable%0Afrom six import iteritems%0A%...
19636701b429341bd5d2ac69d0540f550e38bb76
Fix RCWA example
examples/ex_RCWA.py
examples/ex_RCWA.py
"""Rigorous Coupled Wave Analysis example.""" import numpy import pylab import EMpy from EMpy.materials import IsotropicMaterial, AnisotropicMaterial, RefractiveIndex, EpsilonTensor alpha = 0. delta = 0. # psi = EMpy.utils.deg2rad(0.) # TM # psi = EMpy.utils.deg2rad(90.) # TE psi = EMpy.utils.deg2rad(70.) # hybr...
Python
0.000002
@@ -106,16 +106,22 @@ import +(%0A Isotropi @@ -182,16 +182,17 @@ onTensor +) %0A%0A%0Aalpha @@ -1615,16 +1615,25 @@ s.Layer( +%0A Isotropi @@ -1904,32 +1904,37 @@ AnisotropicRCWA( +%0A multilayer1, alp @@ -2006,16 +2006,21 @@ picRCWA( +%0A multilay @@ -2063,16 +2063,26 @@ e(wls)%0A%0A ...
b69cc15467456a070333ff00f886f27ca391b85b
Add script for appending entries to .gitignore.
webrtc/build/extra_gitignore.py
webrtc/build/extra_gitignore.py
Python
0.000005
@@ -0,0 +1,1333 @@ +#!/usr/bin/env python%0A# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.%0A#%0A# Use of this source code is governed by a BSD-style license%0A# that can be found in the LICENSE file in the root of the source%0A# tree. An additional intellectual property rights grant can be found...
5e07a21cce64e1845832641b6de1951182d41ea0
add back module changed mixin
core/mixins.py
core/mixins.py
Python
0
@@ -0,0 +1,1993 @@ +%22%22%22%0Acore.mixins - Mixins available to use with models%0A%22%22%22%0Afrom django.db.models.signals import post_save%0A%0A%0Adef on_changed(sender, **kwargs):%0A %22%22%22%0A Calls the %60model_changed%60 method and then resets the state.%0A %22%22%22%0A instance = kwargs.get(%22in...
87413a50fa61761f8e669eda641635a0ab7bede3
Create migration for message
API/chat/migrations/0005_auto_20160511_1921.py
API/chat/migrations/0005_auto_20160511_1921.py
Python
0
@@ -0,0 +1,619 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('chat', '0004_auto_20150905_1700'),%0A %5D%0A%0A operations = %5B%0A migrations.RenameFiel...
b38527cccf970e069f55c531a4490cdb6eb7042b
Add a widget.
python/pyqt/pyqt5/hello_as_class.py
python/pyqt/pyqt5/hello_as_class.py
Python
0
@@ -0,0 +1,1809 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2015 J%C3%A9r%C3%A9mie DECOCK (http://www.jdhp.org)%0A%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in t...
b41b2edde5ac7c786b5ce23adec116fe8311d5d7
Add tests for createaccount command
tests/test_account_service_account.py
tests/test_account_service_account.py
Python
0.000001
@@ -0,0 +1,2006 @@ +from unittest.mock import ANY, Mock%0A%0Aimport requests%0Afrom django.core.management import call_command%0A%0Afrom saleor.account.models import ServiceAccount%0Afrom saleor.core.permissions import get_permissions%0A%0A%0Adef test_createaccount_command_creates_service_account():%0A name = %22SA ...
1390de93f8f9703416dc465fc546a8883e96bada
add a header generator
EMControllerManagerHeaderGenerator.py
EMControllerManagerHeaderGenerator.py
Python
0
@@ -0,0 +1,1186 @@ +#!/usr/bin/env python%0A#coding:utf8%0Aimport getopt%0Aimport json%0Aimport sys%0A%0Adef generate_definition(input_file, output_path, prefix):%0A%0A%09with open(input_file, 'r') as json_file:%0A%09%09json_string = json_file.read()%0A%09%09config_dict = json.loads(json_string)%0A%09%09if not isinstan...
10b8043463b6bcc89d4ce559548fa113f3d26190
drop tables no longer needed by application
gem/migrations/0044_remove_deprecated_tables.py
gem/migrations/0044_remove_deprecated_tables.py
Python
0
@@ -0,0 +1,1610 @@ +# Generated by Django 2.2.15 on 2020-08-14 11:23%0A%0Afrom django.db import migrations%0A%0ATABLES = %5B%0A 'surveys_articletagrule',%0A 'surveys_combinationrule',%0A 'surveys_groupmembershiprule',%0A 'surveys_molosurveyformfield',%0A 'surveys_molosurveypage',%0A 'surveys_molosurve...
9a678f5e856a5fcba82a1a9017dfbc841a660686
Create ompotdar.py
Python/ompotdar.py
Python/ompotdar.py
Python
0.000002
@@ -0,0 +1,22 @@ +print(%22Hello World!%22)%0A
0f23004da949b974a071a788ff084c2cb685b95d
use a similar `repair_wheel.py` script as cmake
scripts/repair_wheel.py
scripts/repair_wheel.py
Python
0.000002
@@ -0,0 +1,2039 @@ +import argparse%0Aimport shutil%0Aimport subprocess%0Aimport sys%0Aimport tempfile%0Afrom pathlib import Path%0A%0Afrom convert_to_generic_platform_wheel import convert_to_generic_platform_wheel%0A%0A%0Adef main():%0A if sys.platform.startswith(%22linux%22):%0A os_ = %22linux%22%0A elif...
cafb83befb2cee459d44a1332e5fc7e57edf81a6
Add script to update cvsanaly databases
updateGit.py
updateGit.py
Python
0
@@ -0,0 +1,855 @@ +from jiradb import *%0A%0Aif __name__ == %22__main__%22:%0A log.setLevel(logging.DEBUG)%0A # Add console log handler%0A ch = logging.StreamHandler()%0A ch.setLevel(logging.INFO)%0A ch.setFormatter(logging.Formatter('%25(message)s'))%0A log.addHandler(ch)%0A # Add file log handler...
23c65cc59f1cdf595090a7f25e80c03828aaba68
add `examples/references`
src/openbandparams/examples/references.py
src/openbandparams/examples/references.py
Python
0.000001
@@ -0,0 +1,1175 @@ +#%0A# Copyright (c) 2013-2015, Scott J Maddox%0A#%0A# This file is part of openbandparams.%0A#%0A# openbandparams is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published%0A# by the Free Software Foundation, either...
574659044cb501a2ac61006ddc1c389622172207
add script to calculate cv from energy intervals
compute_cv.py
compute_cv.py
Python
0
@@ -0,0 +1,1484 @@ +import argparse%0Aimport numpy as np%0A%0A%0Adef compute_Z(energies, T, K):%0A beta = 1./T%0A N = len(energies)%0A Z = 0.%0A U = 0.%0A U2 = 0.%0A Cv = 0.%0A Emin = energies%5B-1%5D%0A Ediff = energies - Emin%0A for n in xrange(1, len(energies)-2):%0A# Z += (np.exp(-...
998acbd4b490ef3807d79c245c27700d3e44d5da
Add a dummy pavement file.
tools/win32/build_scripts/pavement.py
tools/win32/build_scripts/pavement.py
Python
0.999859
@@ -0,0 +1,137 @@ +options(%0A setup=Bunch(%0A name = %22scipy-superpack%22,%0A )%0A)%0A%0A@task%0Adef setup():%0A print %22Setting up package %25s%22 %25 options.name%0A