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
f49cc16d96b5a833293ebbc777b4268142d07bd1
ADD example
examples/visualization/plot_report_slider.py
examples/visualization/plot_report_slider.py
Python
0.000001
@@ -0,0 +1,1044 @@ +%22%22%22%0A=======================================%0APlot Time-Series Slider with MNE-Report%0A=======================================%0A%0AIn this example, MEG evoked data are plotted in an html slider.%0A%22%22%22%0A%0A# Authors: Teon Brooks %3Cteon.brooks@gmail.com%0A#%0A# License: BSD (3-clause...
50c3fca5576237a1757574b6b24b259567c1bee1
Fix committed real DBHOSTNAME.
flask/app.py
flask/app.py
from flask import Flask, jsonify, request from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import create_engine from random import randint try: import MySQLdb mysql_schema = "mysql:" except ImportError: mysql_schema = "mysql+pymysql:" app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI']...
Python
0
@@ -370,17 +370,18 @@ ass@ -localhost +DBHOSTNAME :330
dcf49377defe8ce3debadc8d0c09b683663f7b73
Add migration for the new PrivateAPIKey model (Bravo Nils !)
space/migrations/0011_privateapikey.py
space/migrations/0011_privateapikey.py
Python
0
@@ -0,0 +1,1034 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Afrom django.conf import settings%0Aimport uuid%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A migrations.swappable_dependency(settings.AUTH_USER_MOD...
0460c3d8e25e6f060b42e19bdfdd8213e02d6c7b
Add Exercise 9.11.
Kane1985/Chapter5/Ex9.11.py
Kane1985/Chapter5/Ex9.11.py
Python
0
@@ -0,0 +1,2242 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22Exercise 9.11 from Kane 1985.%22%22%22%0A%0Afrom __future__ import division%0Afrom sympy import Dummy%0Afrom sympy import collect, expand, sin, cos, symbols%0Afrom sympy.physics.mechanics import ReferenceFrame, Point%0Afrom sympy.physics.mec...
56a434a7f180e86ae5be99622b79fdf19a4422e0
1436. Destination City
LeetCode/DestinationCity.py
LeetCode/DestinationCity.py
Python
0.999999
@@ -0,0 +1,604 @@ +# given there's exactly one destination city, just find one that appears in the list but never first in a pair%0Aclass Solution:%0A def destCity(self, paths: List%5BList%5Bstr%5D%5D) -%3E str:%0A not_destination = set() # cities with outgoing paths%0A destination_candidate = set()%0A...
bd080d7cb36c5471ba1d13700f0a1a4debb07b82
add tests for ext changes
async2rewrite/tests/test_ext_changes.py
async2rewrite/tests/test_ext_changes.py
Python
0
@@ -0,0 +1,1173 @@ +import async2rewrite%0A%0A%0Adef test_remove_pass_context_true():%0A converted_code = async2rewrite.from_text(%22@bot.command(pass_context=True)%5Cnasync def test(ctx):%5Cn pass%22)%0A assert converted_code == %22@bot.command()%5Cnasync def test(ctx):%5Cn pass%22%0A%0A%0Adef test_dont_re...
f4628678066c72309d3fd121af1aaf54d9905ca3
Make sure xla_client is always imported before TPU client extension.
tensorflow/compiler/xla/python/tpu_driver/client/tpu_client.py
tensorflow/compiler/xla/python/tpu_driver/client/tpu_client.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000005
@@ -897,16 +897,201 @@ ogging%0A%0A +# Import xla_client to load shared C++ extensions (just CompileOptions at the%0A# time of writing).%0Afrom tensorflow.compiler.xla.python import xla_client # pylint: disable=unused-import%0A from ten
e78e56e38dfa7bfac79bc3a699ca76236d700e2a
Add tests creation of grammar with terminals as parameters
tests/grammar_term-nonterm_test/TerminalAddWhenCreatingTest.py
tests/grammar_term-nonterm_test/TerminalAddWhenCreatingTest.py
Python
0
@@ -0,0 +1,1875 @@ +#!/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%0Afrom unittest import TestCase%0Afrom grammpy import Grammar%0Afrom grammpy.Terminal import Terminal%0A%0A%0Aclass TerminalAddWhenCreatingTest(TestCase):%0A d...
7d604af457a17fdf6cb433ce46a3f691ad566658
Implement client side component of b0wser
ooni/plugins/b0wser.py
ooni/plugins/b0wser.py
Python
0
@@ -0,0 +1,2687 @@ +%22%22%22%0AThis is a self genrated test created by scaffolding.py.%0Ayou will need to fill it up with all your necessities.%0ASafe hacking :).%0A%22%22%22%0Afrom zope.interface import implements%0Afrom twisted.python import usage%0Afrom twisted.plugin import IPlugin%0Afrom twisted.internet import p...
0fc65182b269de4975eba9060a1afe7a5ecacd67
add empty shell for tests
source/jormungandr/tests/schema_tests.py
source/jormungandr/tests/schema_tests.py
Python
0.000001
@@ -0,0 +1,1646 @@ +# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.%0A#%0A# This file is part of Navitia,%0A# the software to build cool stuff with public transport.%0A#%0A# Hope you'll enjoy and contribute to this project,%0A# powered by Canal TP (www.canaltp.fr).%0A# Help us si...
a32b033b8c30fa038ce8845333c1560059475f39
Add regression test for #4002
spacy/tests/regression/test_issue4002.py
spacy/tests/regression/test_issue4002.py
Python
0
@@ -0,0 +1,935 @@ +# coding: utf8%0Afrom __future__ import unicode_literals%0A%0Aimport pytest%0Afrom spacy.matcher import PhraseMatcher%0Afrom spacy.tokens import Doc%0A%0A%0A@pytest.mark.xfail%0Adef test_issue4002(en_vocab):%0A %22%22%22Test that the PhraseMatcher can match on overwritten NORM attributes.%0A %2...
52b4c3b5a2e633b209c933dce772f695ed8ec83c
Remove configuration details
homeassistant/components/sensor/time_date.py
homeassistant/components/sensor/time_date.py
""" homeassistant.components.sensor.time_date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Date and Time service. Configuration: To use the Date and Time sensor you will need to add something like the following to your configuration.yaml file. sensor: platform: time_date display_options: - 'time' - 'date' ...
Python
0
@@ -109,428 +109,141 @@ e.%0A%0A -Configuration:%0A%0ATo use the Date and Time sensor you will need to add something like the%0Afollowing to your configuration.yaml file.%0A%0Asensor:%0A platform: time_date%0A display_options:%0A - 'time'%0A - 'date'%0A - 'date_time'%0A - 'time_date'%0A - 'time_utc'%0...
03f2440374a69aa9194891b0e8a9cbf0355b034f
Rename the former test settings file to be 'test_settings'. This settings file is used to run unit tests.
ab_testing_tool/settings/test_settings.py
ab_testing_tool/settings/test_settings.py
Python
0.021673
@@ -0,0 +1,642 @@ +from .base import *%0A%0A# SECURITY WARNING: don't run with debug turned on in production!%0ADEBUG = True%0A%0ATEMPLATE_DEBUG = True%0A%0AALLOWED_HOSTS = %5B%5D%0A%0ASTATIC_ROOT = normpath(join(SITE_ROOT, 'http_static'))%0A%0ALOGGING = %7B%0A 'version': 1,%0A 'handlers': %7B%0A 'null': %...
1b899b29cf66174712722d25e53a76137860fab1
Make approx_max_file_size_bytes Python3 compatible. Was getting invalid syntax.
airflow/contrib/operators/mysql_to_gcs.py
airflow/contrib/operators/mysql_to_gcs.py
import json import logging from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook from airflow.hooks import MySqlHook from airflow.models import BaseOperator from airflow.utils import apply_defaults from collections import OrderedDict from MySQLdb.constants import FIELD_TYPE from tempfile import NamedTempor...
Python
0.000001
@@ -794,17 +794,16 @@ 00000000 -L ,%0A
8f8a1b4d3613908ed7b26af04ec83f27f1f095fb
add solution for Summary Ranges
algorithms/summaryRanges/summaryRanges.py
algorithms/summaryRanges/summaryRanges.py
Python
0
@@ -0,0 +1,307 @@ +class Solution:%0A # @param %7Binteger%5B%5D%7D nums%0A # @return %7Bstring%5B%5D%7D%0A%0A def summaryRanges(self, nums):%0A res = %5B%5D%0A for num in nums:%0A if not res or num-res%5B-1%5D%5B-1%5D %3E 1:%0A res += %5B%5D,%0A res%5B-1%5D%5B...
e97d98aba638cd58d9f0822cf486aad7f85c23c6
Add 04-nodes.py
04-nodes.py
04-nodes.py
Python
0.000001
@@ -0,0 +1,1090 @@ +#!/usr/bin/env python%0A%0Aimport csv%0Aimport sys%0A%0Asynsets, index = %7B%7D, %7B%7D%0A%0Awith open('03-cw.txt') as f:%0A reader = csv.reader(f, delimiter='%5Ct', quoting=csv.QUOTE_NONE)%0A for row in reader:%0A synsets%5Bint(row%5B0%5D)%5D = %5Bword for word in row%5B2%5D.split(', '...
f46bd0f572698689fdef6b777cecd8219c542ef5
Create 20_lines.py
20_lines.py
20_lines.py
Python
0.000025
@@ -0,0 +1,983 @@ +#Same as fractastic.py but squeezed down to 20 lines%0A%0Aimport turtle%0A%0Amax_iterations = 500%0Abob = turtle.Turtle()%0Abob.speed(0)%0A%0Adef mandel(zx, zy):%0A%09z = zx + zy * 1j%0A%09c = z%0A%09for i in xrange(max_iterations):%0A%09%09if abs(z) %3E 2.0: break%0A%09%09z = z * z + c%0A%09return i...
a2216c5a8626fb7d18e9c1f16870123aabbde389
Fix so MindReader can player against itself
axelrod/strategies/mindreader.py
axelrod/strategies/mindreader.py
from axelrod import Player, RoundRobin, Game import copy import inspect class MindReader(Player): """A player that looks ahead at what the opponent will do and decides what to do.""" name = 'Mind Reader' def strategy(self, opponent): """Pretends to play the opponent 50 times before each match. ...
Python
0
@@ -198,32 +198,57 @@ = 'Mind Reader' +%0A max_look_ahead = 200 %0A%0A def strate @@ -812,27 +812,28 @@ if calname -== +in ( 'strategy':%0A @@ -822,32 +822,51 @@ e in ('strategy' +, 'simulate_match') :%0A re
7f2a598f70ac45af00395faa64e91e51de0cab47
Update storage tests
tests/laser/state/storage_test.py
tests/laser/state/storage_test.py
Python
0
@@ -0,0 +1,1439 @@ +import pytest%0Afrom mythril.laser.smt import symbol_factory%0Afrom mythril.laser.ethereum.state.account import Storage%0Afrom mythril.laser.smt import Expression%0A%0ABVV = symbol_factory.BitVecVal%0A%0Astorage_uninitialized_test_data = %5B(%7B%7D, 1), (%7B1: 5%7D, 2), (%7B1: 5, 3: 10%7D, 2)%5D%0A%...
629553ec992c59500ef64b04b8fc9fb0500bcaee
Add tests for cookie verification
wqflask/tests/wqflask/test_user_session.py
wqflask/tests/wqflask/test_user_session.py
Python
0
@@ -0,0 +1,450 @@ +%22%22%22Test cases for some methods in user_session.py%22%22%22%0A%0Aimport unittest%0Afrom wqflask.user_session import verify_cookie%0A%0A%0Aclass TestUserSession(unittest.TestCase):%0A def test_verify_cookie(self):%0A %22%22%22%0A Test cookie verification%0A %22%22%22%0A ...
a5e2a923d10e8e5ba2fdfc10ce48cd02dc10bc95
Switch to RawSQL instead of .extra
judge/views/ranked_submission.py
judge/views/ranked_submission.py
from django.core.urlresolvers import reverse from django.utils.html import format_html from django.utils.translation import ugettext as _ from judge.models import Submission from judge.views.submission import ProblemSubmissions, ForceContestMixin from judge.utils.problems import get_result_table __all__ = ['RankedSub...
Python
0.000002
@@ -38,16 +38,106 @@ reverse%0A +from django.db.models import IntegerField%0Afrom django.db.models.expressions import RawSQL%0A from dja @@ -258,16 +258,66 @@ mission%0A +from judge.utils.problems import get_result_table%0A from jud @@ -384,58 +384,8 @@ ixin -%0Afrom judge.utils.problems import get_result_table %...
4d8c83ccfc61b2faa6852cf0718117566c4cef81
Use six for strings / unicodes / bytes
tests/unit/partner/model_tests.py
tests/unit/partner/model_tests.py
from decimal import Decimal as D from django.db.models import get_model from django.test import TestCase from oscar.test import factories, decorators from oscar.apps.partner import abstract_models Partner = get_model('partner', 'Partner') PartnerAddress = get_model('partner', 'PartnerAddress') Country = get_model('a...
Python
0.000007
@@ -1,12 +1,23 @@ +import six%0A from decimal @@ -3252,14 +3252,20 @@ -unicod +six.text_typ e(st
f4e2135f23f768da2923b48b4d3567071c386148
Add Google backend
template_shortcuts/providers/google.py
template_shortcuts/providers/google.py
Python
0.000004
@@ -0,0 +1,1062 @@ +from provider import CDNProvider%0A%0A%0Aclass Google(CDNProvider):%0A base_url = %22//ajax.googleapis.com/ajax/libs/%25s/%25s/%25s%22%0A%0A def angular(self, version):%0A return self._build_js_url(%22angularjs%22, version, %22angular%22)%0A%0A def chrome_frame(self, version):%0A ...
7b8dd399851a6210ecda0734a9d63bfb8585d5ae
Fix missing print format error
nova/virt/zvm/utils.py
nova/virt/zvm/utils.py
# Copyright 2017,2018 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
Python
0.998931
@@ -1291,16 +1291,17 @@ s %25(url) +s which i
f79288e4c7c39b1555f5c100078b59ee12ef4414
Update dom_perf to use results.AddValue
tools/perf/benchmarks/dom_perf.py
tools/perf/benchmarks/dom_perf.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import math import os from telemetry import benchmark from telemetry.core import util from telemetry.page import page_measurement from telemetry...
Python
0.000001
@@ -1643,17 +1643,104 @@ ults.Add -( +Value(scalar.ScalarValue(%0A results.current_page, '%25s.%25s' %25 (suite%5B'name'%5D, SCORE_TR @@ -1743,36 +1743,25 @@ E_TRACE_NAME -, SCORE_UNIT +) ,%0A @@ -1764,23 +1764,27 @@ - +SCORE_UNIT, suite%5B' @@ -1796,26 +1796,8 @@ '%5D, ...
8957ad97b560251e02c857683a5b77301ee49293
add performance test for a few client server queries
manhattan/tests/perf/test_clientserver.py
manhattan/tests/perf/test_clientserver.py
Python
0
@@ -0,0 +1,552 @@ +import time%0A%0Afrom manhattan.client import Client%0A%0A%0Aclient = Client()%0A%0A%0Adef test(f, trials=500):%0A start = time.time()%0A for ii in range(trials):%0A f()%0A end = time.time()%0A elapsed = end - start%0A print (%22Ran %25d trials, %250.2f ms each%22 %25%0A ...
d3712e9f567ba0924810768e5c6e1d208fd99816
Add visualize_filters.py
cnn/cifar10/visualize_filters.py
cnn/cifar10/visualize_filters.py
Python
0.000003
@@ -0,0 +1,678 @@ +import os%0Aimport json%0Aimport matplotlib.pyplot as plt%0Afrom keras.models import model_from_json%0A%0A%0Aif __name__ == '__main__':%0A model_file = os.path.join('result', 'model.json')%0A weight_file = os.path.join('result', 'model.h5')%0A%0A with open(model_file, 'r') as fp:%0A m...
4d30dd240e3b66cf3c35bbac24a2ae6043a7a081
Add accuracy test
tests/functions_tests/test_accuracy.py
tests/functions_tests/test_accuracy.py
Python
0.000019
@@ -0,0 +1,974 @@ +from unittest import TestCase%0Aimport numpy%0Afrom chainer import cuda, Variable%0Afrom chainer.cuda import to_cpu, to_gpu%0Afrom chainer.gradient_check import assert_allclose%0Afrom chainer.functions import accuracy%0A%0Acuda.init()%0A%0Aclass TestAccuracy(TestCase):%0A def setUp(self):%0A ...
932d6c10af549307547aeb5c920283ae68a0c114
Create ShinyeiPPD42.py
pigpio/ShinyeiPPD42.py
pigpio/ShinyeiPPD42.py
Python
0.000001
@@ -0,0 +1,1406 @@ +import pigpio%0Aimport time%0A%0Aclass Shinyei(object):%0A%09def __init__(self, pi, gpio):%0A%09%09self.pi = pi%0A%09%09self.gpio = gpio%0A%0A%09%09self._start_tick = None%0A%09%09self._last_tick = None%0A%09%09self._low_ticks = 0%0A%09%09self._high_ticks = 0%0A%0A%09%09pi.set_mode(gpio, pigpio.INPU...
7bf3337a1b632590cf22ecb99c1cb3d97cf35af6
Implement test_build_pawn
ELiDE/ELiDE/tests/test_sprite_builder.py
ELiDE/ELiDE/tests/test_sprite_builder.py
Python
0.000012
@@ -0,0 +1,1854 @@ +from pprint import pprint%0A%0Afrom ..pallet import Pallet%0Afrom .util import ELiDEAppTest, idle_until, window_with_widget%0A%0A%0Aclass TestSpriteBuilder(ELiDEAppTest):%0A def test_build_pawn(self):%0A app = self.app%0A win = window_with_widget(app.build())%0A app.manager.c...
9a4dade853455d7ce4118c50a5a5ea4184936ada
update the manydigits demo script
demo/manydigits.py
demo/manydigits.py
""" This script calculates solutions to some of the problems from the "Many Digits" competition: http://www.cs.ru.nl/~milad/manydigits/problems.php Run with: python manydigits.py """ from mpmath import * from mpmath.lib import * dps = 100 mp.dps = dps + 10 def pr(x): """Return the first ...
Python
0.000001
@@ -232,24 +232,27 @@ math.lib +mpf import *%0D%0A%0D%0Adps @@ -243,17 +243,38 @@ import -* +to_fixed, bin_to_radix %0D%0A%0D%0Adps @@ -2334,12 +2334,14 @@ )), +%5B 0, 1 +%5D ))%0D%0A
8a8848b3e790301c26a1f19b71e10f9cee2923a9
Revert "Fix a problem with ipaddr not being importable in management commands"
djangae/sandbox.py
djangae/sandbox.py
# None of this is django-specific. Don't import from django. import os import sys import contextlib import subprocess import getpass import djangae.utils as utils _SCRIPT_NAME = 'dev_appserver.py' def _find_sdk_from_python_path(): import google.appengine return os.path.abspath(os.path.dirname(google.__pat...
Python
0
@@ -5833,288 +5833,8 @@ l)%0A%0A - # appcfg tries to import ipaddr and fails when called from inside a management command%0A # Might be a bug in the sdk, or something specific might be required in management commands, but this fixes it for now.%0A sys.path.insert(0, os.path.join(sdk_path, %22lib%22, %22ipaddr...
06d4a93ecbce90e752712f69b8ffd435019337b2
Create metric_table script for comparing metrics
app/scripts/metric_table.py
app/scripts/metric_table.py
Python
0.000002
@@ -0,0 +1,906 @@ +from tabulate import tabulate%0Aimport csv%0Aimport yaml%0Aimport sys%0Aimport os.path as path%0A%0Abase_directory = path.dirname(path.dirname(path.abspath(__file__)))%0Asys.path.append(base_directory)%0A%0Aimport parse%0Aimport deparse%0Aimport metrics%0A%0A%0Adef main():%0A target_words = %5B'b%...
428d57040b35b3d644cda05c3c9cbdb630622146
Create Udpclient.py
Udpclient.py
Udpclient.py
Python
0
@@ -0,0 +1,971 @@ +import socket #for sockets%0Aimport sys #for exit%0Afrom random import randint%0Aimport time%0Afrom thread import *%0Aimport threading%0Afrom threading import Thread, current_thread%0A%0Ahost =%22172.20.10.3%22;%0Aport = 6667;%0A%0Adef sentthread(num):%0A %0A# create dgram udp socket%0A %0A tr...
a4f86e11bbdcf2f478fd9cfb8df33a150f8a086e
Add poolstat api example to project root.
poolstatapi-example.py
poolstatapi-example.py
Python
0
@@ -0,0 +1,498 @@ +import requests%0Aimport hmac%0Aimport hashlib%0Aimport base64%0A%0APUBLIC_KEY = '##'%0APRIVATE_KEY = '##'%0AURL = 'https://www.poolstat.net.au/restapi/v1/ladders'%0A%0Adigest = hmac.new(PRIVATE_KEY, URL, digestmod=hashlib.sha256).hexdigest()%0A# signature = base64.b64encode(digest).decode()%0A%0Apri...
dc386a432e23425667f05a8b2ff943d12e44dac8
bump version to 0.8.19
mycroft/version/__init__.py
mycroft/version/__init__.py
# Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
Python
0
@@ -980,17 +980,17 @@ UILD = 1 -8 +9 %0A# END_V
3173bab666f890cb2a2b3fa7c93956fe920be98b
generate internal and external snakefood reports
src/main/python/pybuilder/plugins/python/snakefood_plugin.py
src/main/python/pybuilder/plugins/python/snakefood_plugin.py
# This file is part of Python Builder # # Copyright 2011 The Python Builder Team # # 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
@@ -1411,16 +1411,25 @@ %22)%0A%0A +internal_ report_f @@ -1473,24 +1473,115 @@ ts/snakefood +-internal%22)%0A external_report_file = project.expand_path(%22$dir_reports/snakefood-external %22)%0A colle @@ -1597,32 +1597,63 @@ encies(project, +internal_report_file, external_ report_file)%0A%0A @@ -16...
3a48a8919b633a1244024d96445f880f9d03247b
add problem0002.py
python3/problem0002.py
python3/problem0002.py
Python
0.002217
@@ -0,0 +1,369 @@ +from itertools import takewhile%0A%0A%0Adef fibonacci(first=1, second=2):%0A '''yields fibonacci sequence'''%0A x = first%0A x_ = second%0A yield first%0A yield second%0A while True:%0A x__ = x + x_%0A yield x__%0A x = x_%0A x_ = x__%0A%0Aif __name__ == '...
64bfcf8e87ef8186a446bce0ec73502e48b3b9a4
Create construct-binary-tree-from-string.py
Python/construct-binary-tree-from-string.py
Python/construct-binary-tree-from-string.py
Python
0.000534
@@ -0,0 +1,878 @@ +# Time: O(n)%0A# Space: O(h)%0A%0A# Definition for a binary tree node.%0A# class TreeNode(object):%0A# def __init__(self, x):%0A# self.val = x%0A# self.left = None%0A# self.right = None%0A%0Aclass Solution(object):%0A def str2tree(self, s):%0A %22%22%22%0A ...
55ccaad47c2e3a1432b012218c72bca28fe06d73
Create a GreetingsPlugin as a sample plugin
greetings.py
greetings.py
Python
0
@@ -0,0 +1,1622 @@ +from fnexchange.core.plugins import AbstractPlugin%0A%0A%0Aclass GreetingsPlugin(AbstractPlugin):%0A %22%22%22%0A GreetingsPlugin provides an interface to generate greetings in different languages%0A for given users (provided their names and locales).%0A At this time, only the following ...
0b83d7baf6cd02fb673aaf9a9e7b4b7498f4240a
Create rsa_monitor.py
rsa_monitor.py
rsa_monitor.py
Python
0.000001
@@ -0,0 +1,1138 @@ +#!/usr/bin/env python%0Aimport os%0A%0Alog=file('RSA_check.log','a')%0A%0Adef check_rsa_result(rsa_server):%0A ''' use os.putenv to set shell env is very important used in cron'''%0A os.putenv('HOME','/root/')%0A os.putenv('USER','root')%0A os.putenv('USERNAME','root')%0A tocken_f=os....
1cccfd3eb0ea34450555fab444eb055ff56a7dd6
Move decorators to special file
afnumpy/decorators.py
afnumpy/decorators.py
Python
0
@@ -0,0 +1,1007 @@ +import afnumpy%0A%0Adef outufunc(func):%0A def wrapper(*args, **kws):%0A out = kws.pop('out', None)%0A ret = func(*args, **kws)%0A if out is not None:%0A out%5B:%5D = ret%0A return ret%0A return wrapper%0A%0Adef iufunc(func):%0A def wrapper(*args, **kw...
be8b7c27b25b60540c2e53504ce42543724577df
Add utilities for the clients
napalm_logs/utils/__init__.py
napalm_logs/utils/__init__.py
Python
0
@@ -0,0 +1,2504 @@ +# -*- coding: utf-8 -*-%0A'''%0Anapalm-logs utilities%0A'''%0Afrom __future__ import absolute_import%0Afrom __future__ import unicode_literals%0A%0A# Import pythond stdlib%0Aimport ssl%0Aimport socket%0A%0A# Import python stdlib%0Aimport umsgpack%0Aimport nacl.secret%0Aimport nacl.signing%0Aimport n...
ee5bb79565c2557a243ac4e9109e69c019294d2a
make groonga path is specified by environment variable.
doc/ja/source/update_execution_example.py
doc/ja/source/update_execution_example.py
#!/usr/bin/env python # -*- coding: utf-8; -*-  from subprocess import * from select import select from sys import argv,stdout import os GROONGA_PATH = "groonga" DB_PATH = "/tmp/example.db" os.system('rm -rf %s*' % DB_PATH) ioobj = Popen([GROONGA_PATH, '-n', DB_PATH], stdin = PIPE, stdout = PIPE) ioin = ioobj.stdin...
Python
0
@@ -132,16 +132,84 @@ ort os%0A%0A +GROONGA_PATH = os.environ.get(%22GROONGA%22)%0Aif GROONGA_PATH is None:%0A GROONGA_
1ecb594b945bff57ad60c703740cdbb8d8509d9d
Add systemd utils module
salt/utils/systemd.py
salt/utils/systemd.py
Python
0.000001
@@ -0,0 +1,803 @@ +'''%0AContains systemd related help files%0A'''%0A# import python libs%0Aimport os%0A%0A%0Adef sd_booted(context):%0A '''%0A Return True if the system was booted with systemd, False otherwise.%0A Pass in the loader context %22__context__%22, this function will set the%0A systemd.sd_booted...
848b5f0984844eb2d1d32d0cf96038e597a634eb
add automobile csv_upload
amaascore/csv_upload/assets/automobile.py
amaascore/csv_upload/assets/automobile.py
Python
0
@@ -0,0 +1,2114 @@ +import logging.config%0Aimport csv%0A%0Afrom amaascore.tools.csv_tools import csv_stream_to_objects%0Afrom amaascore.assets.automobile import Automobile%0Afrom amaascore.assets.interface import AssetsInterface%0Afrom amaasutils.logging_utils import DEFAULT_LOGGING%0A%0Aclass AutomobileUploader(objec...
b9d4ad23eb1bd08cae006350dc6c219f838ecdd7
add tests
project/tests/test_mail.py
project/tests/test_mail.py
Python
0
@@ -0,0 +1,496 @@ +from sqlalchemy.exc import StatementError%0Afrom project.models import MailTemplate%0Afrom project.tests.utils import ProjectTestCase%0A%0A%0Aclass TestMailTemplateBl(ProjectTestCase):%0A%0A def test_get(self):%0A mail1 = MailTemplate.bl.get(MailTemplate.MAIL.CV)%0A mail2 = MailTempl...
6d76193a9f6e8beee29d92ec3c79efb4f6218e86
Add IslaAukate and IslaAukateColor
dosagelib/plugins/i.py
dosagelib/plugins/i.py
# -*- coding: utf-8 -*- # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2015-2017 Tobias Gruetzmacher from __future__ import absolute_import, division, print_function from re import compile, escape from ..scraper import _BasicScraper from ....
Python
0.999959
@@ -306,16 +306,32 @@ cScraper +, _ParserScraper %0Afrom .. @@ -1758,24 +1758,874 @@ mat: nnn'%0A%0A%0A +class IslaAukate(_ParserScraper):%0A url = 'https://overlordcomic.com/archive/default/latest'%0A stripUrl = 'https://overlordcomic.com/archive/default/pages/%25s'%0A firstStripUrl = stripUrl %25 '001'%0A...
afaaef761ca394f1db4516252ffb89789c606890
Add search.py
octokit/resources/search.py
octokit/resources/search.py
Python
0.000001
@@ -0,0 +1,92 @@ +# encoding: utf-8%0A%0A%22%22%22Methods for the Search API%0Ahttp://developer.github.com/v3/search/%0A%22%22%22%0A
db65e94e53d98fc98b2ee911fb64a09e75994a06
Update APNS documentation url
push_notifications/apns.py
push_notifications/apns.py
""" Apple Push Notification Service Documentation is available on the iOS Developer Library: https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html """ import json import ssl import struct import urllib2 from binascii import unh...
Python
0
@@ -126,17 +126,16 @@ ary/ios/ -# document @@ -192,32 +192,24 @@ tionsPG/ -ApplePushService +Chapters /ApplePu
9ed06812ec8da6f1364acd00261935c334994e62
add support for streamcherry.com
youtube_dl/extractor/streamango.py
youtube_dl/extractor/streamango.py
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_chr from ..utils import ( determine_ext, ExtractorError, int_or_none, js_to_json, ) class StreamangoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:streamango\....
Python
0
@@ -332,16 +332,34 @@ sts%5C.net +%7Cstreamcherry%5C.com )/(?:f%7Ce @@ -1266,24 +1266,127 @@ ing': True,%0A + %7D, %7B%0A 'url': 'https://streamcherry.com/f/clapasobsptpkdfe/',%0A 'only_matching': True,%0A %7D%5D%0A%0A
26f153877ad141032bc78e2ca89026cf125c71d7
Create PedidoCadastrar.py
backend/Models/Matricula/PedidoCadastrar.py
backend/Models/Matricula/PedidoCadastrar.py
Python
0
@@ -0,0 +1,720 @@ +from Framework.Pedido import Pedido%0Afrom Framework.ErroNoHTTP import ErroNoHTTP%0A%0Aclass PedidoCadastrar(Pedido):%0A%0A%09def __init__(self,variaveis_do_ambiente):%0A%09%09super(PedidoCadastrar, self).__init__(variaveis_do_ambiente)%0A%09%09try:%0A%09%09%09self.ano = self.corpo%5B'ano'%5D%0A%09%0...
80261391bf75c4904825d97ae7b3168e4652463a
Create most_digits.py
most_digits.py
most_digits.py
Python
0.999879
@@ -0,0 +1,191 @@ +#Kunal Gautam%0A#Codewars : @Kunalpod%0A#Problem name: Most digits%0A#Problem level: 7 kyu%0A%0Adef find_longest(arr):%0A return arr%5B%5Blen(str(x)) for x in arr%5D.index(max(%5Blen(str(x)) for x in arr%5D))%5D%0A
986ee0ffae416cf1dc833f581a89d718dc2ff2fe
Add a first draft of the evaluation module.
bird/evaluate.py
bird/evaluate.py
Python
0
@@ -0,0 +1,1276 @@ +from models.cuberun import CubeRun%0Aimport numpy as np%0Aimport utils%0Aimport loader%0A%0Anb_classes = 19%0Ainput_shape = (257, 624, 1)%0A(cols, rows, chs) = input_shape%0Aimage_shape = (cols, rows)%0Abatch_size=32%0A%0Adef evaluate(model, data_filepath, file2labels_filepath):%0A model.compile(...
020f78b6aa265f925db6a21435a074f6ca1a3cbf
update ipython notebook runner to accomodate specific usages of matplotlib (i.e. import matplotlib.pyplot as plt) and ipython magic functions (ignore them) within the demo testing framework.
h2o-py/tests/utils/ipynb_demo_runner.py
h2o-py/tests/utils/ipynb_demo_runner.py
import json import os def ipy_notebook_exec(path,save_and_norun=False): notebook = json.load(open(path)) program = '' for block in ipy_blocks(notebook): for line in ipy_lines(block): if "h2o.init" not in line: program += line if '\n' in line else line + '\n' if save_...
Python
0
@@ -137,24 +137,29 @@ lock in ipy_ +code_ blocks(noteb @@ -184,24 +184,30 @@ line in ipy_ +valid_ lines(block) @@ -849,16 +849,130 @@ ndled%22%0A%0A +def ipy_code_blocks(notebook):%0A return %5Bcell for cell in ipy_blocks(notebook) if cell%5B'cell_type'%5D == 'code'%5D%0A%0A def ipy_ @@ -1115,32 +1115,32 @@ p...
ca5bb05b1b002edbadda030d86c63d4303f5cbc1
Initialise api and tweets globally so only called once per invocation, not for every proposed headline
cyberprefixer.py
cyberprefixer.py
# Copyright (c) 2013-2015 Molly White # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, di...
Python
0
@@ -1477,16 +1477,175 @@ rser()%0A%0A +auth = tweepy.OAuthHandler(C_KEY, C_SECRET)%0Aauth.set_access_token(A_TOKEN, A_TOKEN_SECRET)%0Aapi = tweepy.API(auth)%0Atweets = api.user_timeline('CyberPrefixer')%0A%0A %0Adef get @@ -3316,183 +3316,8 @@ e):%0A - auth = tweepy.OAuthHandler(C_KEY, C_SECRET)%0A auth.set_ac...
944d0ff3995916d80e871e47d73d9b9df7848e6e
Add wsgi
server/wsgi.py
server/wsgi.py
Python
0.999777
@@ -0,0 +1,86 @@ +from main import app as application%0A%0Aif __name__ == %22__main__%22:%0A application.run()%0A
34979240ae3cd9ed617a358a0097376badfdc229
add announcement view
pybossa/view/announcements.py
pybossa/view/announcements.py
Python
0
@@ -0,0 +1,1343 @@ +# -*- coding: utf8 -*-%0A# This file is part of PYBOSSA.%0A#%0A# Copyright (C) 2017 Scifabric LTD.%0A#%0A# PYBOSSA is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published by%0A# the Free Software Foundation, either version ...
546c38310ff49af4f9490ba32ce3ab2cfc4d5e8d
Create sherpa_test.py
sherpa_test.py
sherpa_test.py
Python
0.000139
@@ -0,0 +1,1104 @@ +#!/usr/bin/env python%0A%0Aimport optparse%0Afrom sherpa import Sherpa%0Afrom sherpa_helpers import debug_results, distribution, quartermaster%0Afrom perf import *%0A%0Aparser = optparse.OptionParser()%0Aparser.add_option('-p', '--packages', dest='packages', help='specify the minimum number of packa...
21d73b5afc04a718c0db2bff899e7d1f4020deb3
set blank=True on editoritem.licence
editor/migrations/0019_auto_20160601_1528.py
editor/migrations/0019_auto_20160601_1528.py
Python
0.000013
@@ -0,0 +1,433 @@ +# -*- 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 ('editor', '0018_site_broadcasts'),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(...
5e401d2f2a2f9c874667a4aa372fd07755ab9c31
add Brain.save_movie() example
examples/save_movie.py
examples/save_movie.py
Python
0
@@ -0,0 +1,1423 @@ +%22%22%22%0ACreate movie from MEG inverse solution%0A=======================================%0A%0AData were computed using mne-python (http://martinos.org/mne)%0A%0A%22%22%22%0Aprint __doc__%0A%0Aimport os%0Aimport numpy as np%0A%0Afrom surfer import Brain%0Afrom surfer.io import read_stc%0A%0A%22%...
a482ac3b96e4c8b72d1055b7f29a474c85101f67
Create solution.py
leetcode/easy/power_of_two/py/solution.py
leetcode/easy/power_of_two/py/solution.py
Python
0.000018
@@ -0,0 +1,165 @@ +class Solution(object):%0A def isPowerOfTwo(self, n):%0A %22%22%22%0A :type n: int%0A :rtype: bool%0A %22%22%22%0A return n %3E 0 and (n & (n - 1)) == 0%0A
4b0221ca503be9450919e4ed4e6a75ce92cd2d63
Create new module for continuous design variables
csdms/dakota/variables/continuous_design.py
csdms/dakota/variables/continuous_design.py
Python
0
@@ -0,0 +1,3356 @@ +%22%22%22Implementation of a Dakota continous design variable.%22%22%22%0A%0Afrom .base import VariableBase%0A%0A%0Aclassname = 'ContinuousDesign'%0A%0A%0Aclass ContinuousDesign(VariableBase):%0A%0A %22%22%22Define attributes for Dakota continous design variables.%22%22%22%0A%0A def __init__(s...
9f8f5e731d0cd9096e230c78b40a60be7eceef56
update : minor changes
ptop/plugins/disk_sensor.py
ptop/plugins/disk_sensor.py
Python
0.000001
@@ -0,0 +1,795 @@ +'''%0A Disk Sensor Plugin%0A'''%0Afrom ptop.core import Plugin%0Aimport psutil%0A%0Aclass DiskSensor(Plugin):%0A def __init__(self,**kwargs):%0A super(DiskSensor,self).__init__(**kwargs)%0A%0A # overriding the update method%0A def update(self):%0A # there can be many text (k...
6064f3897699903b85a469a9ee77e44116f7df4c
add a network utility to check for ipv6
radosgw_agent/util/network.py
radosgw_agent/util/network.py
Python
0
@@ -0,0 +1,607 @@ +import socket%0A%0A%0Adef is_ipv6(address):%0A %22%22%22%0A Check if an address is an IPV6 one, but trim commonly used brackets as the%0A %60%60socket%60%60 module complains about them.%0A %22%22%22%0A if not isinstance(address, str):%0A return False%0A%0A if address.startswi...
0a4984fa49ec53ae5b2908e0518b4e72c031fc1b
add python3 encoder for bytes and sets
phovea_server/python3_encoder.py
phovea_server/python3_encoder.py
Python
0
@@ -0,0 +1,556 @@ +%22%22%22%0AThis encoder is required to handle changes of data types in Python 3.7 by decoding bytes objects to strings and adding list() to set().%0A%22%22%22%0A%0A%0Aclass Python3Encoder(object):%0A def __contains__(self, obj):%0A if isinstance(obj, bytes):%0A return True%0A if isinstan...
9b1b66f72b3e9ca383d2396a368f8ce5e85d9e7c
Add a snippet (python/matplotlib).
python/matplotlib/plot2d.py
python/matplotlib/plot2d.py
Python
0.000004
@@ -0,0 +1,735 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport math%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0A%0Adef main():%0A x_vec = np.arange(-10, 10, 0.01)%0A y_vec = np.sin(2 * 2 * np.pi * x_vec) * 1/np.sqrt(2*np.pi) * np.exp(-(x_vec**2)/2)%0A%0A fig = plt.figure(figsize=(1...
dd53b54fbf64a51231a35f0f87ed6b543a8666fe
add genia cache
clicon/features_dir/genia/genia_cache.py
clicon/features_dir/genia/genia_cache.py
Python
0
@@ -0,0 +1,632 @@ +import cPickle as pickle%0Aimport os%0A%0Aclass GeniaCache:%0A def __init__(self):%0A try:%0A prefix = os.path.dirname(__file__)%0A self.filename = os.path.join( prefix, 'genia_cache' )%0A self.cache = pickle.load( open( self.filename , %22rb%22 ) ) ;%0A ...
2fbec137ba9efcbfc657a469856507ea8da079e3
Create draw_shapes_gui.py
draw_shapes_gui.py
draw_shapes_gui.py
Python
0.000002
@@ -0,0 +1,1750 @@ +# Import Myro library and connect to the robot%0Afrom Myro import *%0Ainit(%22/dev/tty.Fluke2-0216-Fluke2%22)%0A%0A# We also need to import the graphics library!%0Afrom Graphics import *%0A%0A# Print the current battery level%0Aprint(%22Battery level:%22, getBattery())%0A%0A# Make a graphics window ...
6498d0112a3357ca89daa642565f7f0262463ff2
Update oauth app too
readthedocs/oauth/models.py
readthedocs/oauth/models.py
"""OAuth service models""" import json from django.db import models from django.db.models import Q from django.conf import settings from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.core.validators import URLValidator from django.core.urlresolvers import r...
Python
0
@@ -5232,32 +5232,33 @@ Q(repo__ +i endswith=fuzzy_u @@ -5299,16 +5299,17 @@ Q(repo__ +i endswith
17146ea739f714ffe2ad2a4c6f6b65f866f3f401
Create heuristic1.py
heuristic1.py
heuristic1.py
Python
0.000003
@@ -0,0 +1,1232 @@ +import csv %0Aimport pandas%0Aimport json %0Aimport operator%0A%0Adef preprocess():%0A%09trainHandle = open('train.json').read()%0A%0A%09j = json.loads(trainHandle)%0A%09#######################################%0A%0A%09unqCus = list()%0A%09tempInList = list()%0A%09try:%0A%09%09count = 0 %0A%09%09whil...
ed03e44ec58b6f757b0e62d25ea8f2bf822c0498
Create LongComPrefix_002.py
leetcode/014-Longest-Common-Prefix/LongComPrefix_002.py
leetcode/014-Longest-Common-Prefix/LongComPrefix_002.py
Python
0
@@ -0,0 +1,448 @@ +#author: cchen%0A%0Aclass Solution:%0A # @param %7Bstring%5B%5D%7D strs%0A # @return %7Bstring%7D%0A def longestCommonPrefix(self, strs):%0A res = ''%0A if strs == %5B%5D:%0A return res%0A %0A lens = %5Blen(s) for s in strs%5D%0A mi = min(len...
41af5deac1332302b478b57376053d03721bade7
Add the missing legend module
dyngraph/legend.py
dyngraph/legend.py
Python
0.000008
@@ -0,0 +1,341 @@ +import pyqtgraph as pg%0A__all__ = %5B'MyLegendItem'%5D%0A%0Aclass MyLegendItem(pg.LegendItem):%0A def __init__(self, size=None, offset=(40,5)):%0A super().__init__(size, offset)%0A %0A def paint(self, p, *args):%0A p.setPen(pg.mkPen(0,0,0,255))%0A p.setBrush(pg.mkBr...
3c057dcf61292bc4c268e430aa7a11b2fc0a56f8
Create generate_cloud.py
generate_cloud.py
generate_cloud.py
Python
0.00005
@@ -0,0 +1,1163 @@ +'''%0A%09Author: Prakhar Mishra%0A%09Date: 11/01/2016%0A'''%0A%0A# Importing packages%0Aimport sys%0Aimport matplotlib.pyplot as plt%0Afrom wordcloud import WordCloud, STOPWORDS%0Afrom scipy.misc import imread%0Aimport csv%0A%0A# Opening and getting marker for input file%0Adata = open(str(sys.argv%5...
c54105d2721a2e5bbb5d74e61de8fc8469a1dc57
Fix unicode error on some queries
beetsplug/badfiles.py
beetsplug/badfiles.py
# This file is part of beets. # Copyright 2015, François-Xavier Thomas. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use...
Python
0.000002
@@ -2869,20 +2869,32 @@ b.items( -args +ui.decargs(args) ):%0A%0A
74388ceaacb7eedf98eb03f1263ea2ec6db596e1
Add initial script to export feed downloads.
python_scripts/media_export_through_api.py
python_scripts/media_export_through_api.py
Python
0
@@ -0,0 +1,1871 @@ +# -*- coding: utf-8 -*-%0A%0Aimport psycopg2%0Aimport psycopg2.extras%0Aimport requests%0Aimport json%0A%0Aimport mc_database%0Aimport mediacloud%0A%0Adef get_download_from_api( mc_api_url, api_key, downloads_id ):%0A %0A r = requests.get( mc_api_url +'/api/v2/downloads/single/' + str( downloa...
0426b0e91712afa1911a5b640fcdaee456d7a8e7
handle case where calling a method with no arguments
script_runner/ctx_proxy.py
script_runner/ctx_proxy.py
######### # Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
Python
0.000005
@@ -3317,16 +3317,72 @@ ex += 1%0A +%0A if callable(current):%0A current = current()%0A%0A retu
b9f464491a6131940ff2b88586ccdd44431ce992
add fpga-bit-to-bin.py
scripts/fpga-bit-to-bin.py
scripts/fpga-bit-to-bin.py
Python
0.000007
@@ -0,0 +1,1774 @@ +#!/usr/bin/python%0A%0A# copied from https://github.com/topic-embedded-products/meta-topic/blob/master/recipes-bsp/fpga/fpga-bit-to-bin/fpga-bit-to-bin.py%0A%0Aimport sys%0Aimport os%0Aimport struct%0A%0Adef flip32(data):%0A%09sl = struct.Struct('%3CI')%0A%09sb = struct.Struct('%3EI')%0A%09b = buffe...
1359a099e7019767cfd904eee0c510c3b33a7d03
add script to generate pcap files
generate_pcap_files.py
generate_pcap_files.py
Python
0
@@ -0,0 +1,1644 @@ +#!/usr/bin/env python%0A%0Afrom scapy.all import *%0Aimport sys%0Aimport argparse%0A%0Aclass Paxos(Packet):%0A name =%22PaxosPacket %22%0A fields_desc =%5B %0A XByteField(%22msgtype%22, 0x3),%0A XShortField(%22instance%22, 0x1),%0A XByt...
8b834db0b7632c31c06a2958799fa7e29b505aaf
add robust kinematic example
examples/robust_kinematics.py
examples/robust_kinematics.py
Python
0.000003
@@ -0,0 +1,2764 @@ +import toppra as ta%0Aimport toppra.constraint as constraint%0Aimport toppra.algorithm as algo%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Aimport argparse%0A%0A%0Adef main():%0A parser = argparse.ArgumentParser(description=%22An example showcasing the usage of robust constraints.%22%...
f82998254b5b93c6fafc36fa23fa4c1566d42125
Add interpreter stump
shakespeare_interpreter.py
shakespeare_interpreter.py
Python
0.000002
@@ -0,0 +1,466 @@ +from shakespeare_parser import shakespeareParser%0Aimport argparse%0A%0Aargparser = argparse.ArgumentParser(description = %22Run files in Shakespeare Programming Language.%22)%0Aargparser.add_argument('filename', type=str, help=%22SPL file location%22)%0A%0Aargs = argparser.parse_args()%0A%0Aif(args....
d5435f2b0548f762985652b07ef047b68552b069
add guided backprop relu
treeano/sandbox/nodes/guided_backprop.py
treeano/sandbox/nodes/guided_backprop.py
Python
0
@@ -0,0 +1,533 @@ +%22%22%22%0Afrom %22Striving for Simplicity - The All Convolutional Net%22%0Ahttp://arxiv.org/abs/1412.6806%0A%0A%22%22%22%0A%0Aimport treeano%0Aimport treeano.sandbox.utils%0A%0A%0Aclass _GuidedBackprop(treeano.sandbox.utils.OverwriteGrad):%0A%0A %22%22%22%0A based on Lasagne Recipes on Guided...
91396ed246166f610e9cfc4519862f061af4e6b2
Enable Django Admin for some of our data
cat/admin.py
cat/admin.py
Python
0
@@ -0,0 +1,454 @@ +from django.contrib import admin%0Afrom models import MuseumObject,FunctionalCategory%0A%0Aclass MOAdmin(admin.ModelAdmin):%0A fields = ('registration_number','country','description','comment')%0A%0A list_display = ('registration_number','country','description','comment')%0A%0A list_filter =...
d44edfbb3561c136c9bf53dfafa42e34f96e476b
Add tests for rhs_reuse
qutip/tests/test_rhs_reuse.py
qutip/tests/test_rhs_reuse.py
Python
0
@@ -0,0 +1,3172 @@ +# This file is part of QuTiP: Quantum Toolbox in Python.%0A#%0A# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.%0A# All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the fol...
1541259e885ee498f05e42633d1bad3bac9d054d
Implement the LOADMODULE command
txircd/modules/core/cmd_loadmodule.py
txircd/modules/core/cmd_loadmodule.py
Python
0.000021
@@ -0,0 +1,2170 @@ +from twisted.plugin import IPlugin%0Afrom twisted.words.protocols import irc%0Afrom txircd.ircd import ModuleLoadError%0Afrom txircd.module_interface import Command, ICommand, IModuleData, ModuleData%0Afrom zope.interface import implements%0A%0A# We're using the InspIRCd numerics, as they seem to be...
edc982bdfaece6aaf23b3e7f9c967de800eacbd6
Implement links server notice type
txircd/modules/extra/snotice_links.py
txircd/modules/extra/snotice_links.py
Python
0
@@ -0,0 +1,1139 @@ +from twisted.plugin import IPlugin%0Afrom txircd.modbase import IModuleData, ModuleData%0Afrom zope.interface import implements%0A%0Aclass SnoLinks(ModuleData):%0A%09implements(IPlugin, IModuleData)%0A%09%0A%09name = %22ServerNoticeLinks%22%0A%09%0A%09def actions(self):%0A%09%09return %5B (%22server...
2466bbb11f706520dd422cfebc232f1ee6da1c48
Optimize form query
corehq/apps/domain/tasks.py
corehq/apps/domain/tasks.py
from celery.schedules import crontab from celery.task import periodic_task, task from django.conf import settings from django.core.urlresolvers import reverse from django.template.loader import render_to_string from corehq.apps.domain.views import EditInternalDomainInfoView from corehq.apps.es.domains import DomainES...
Python
0.999661
@@ -537,16 +537,30 @@ orms=200 +, domains=None ):%0A f @@ -577,90 +577,141 @@ s = -(%0A FormES()%0A .domain_facet()%0A .run()%0A +FormES().domain_facet()%0A if not domains:%0A form_domains = form_domains.domain(domains)%0A form_domains = form_domains.run(...
c65f59c6a6048807d29e5ce123447afd006ce05f
Add missing migration for username length
users/migrations/0007_username_length.py
users/migrations/0007_username_length.py
Python
0
@@ -0,0 +1,754 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.2 on 2016-11-02 11:53%0Afrom __future__ import unicode_literals%0A%0Aimport django.contrib.auth.validators%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('users', '00...
50f33b1ae3b3ce6c1fb00a53145a7fe2fe822680
Add redis tests
dbaas/drivers/tests/test_driver_redis.py
dbaas/drivers/tests/test_driver_redis.py
Python
0.000001
@@ -0,0 +1,2843 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import, unicode_literals%0Aimport mock%0Aimport logging%0Afrom django.test import TestCase%0Afrom drivers import DriverFactory%0Afrom physical.tests import factory as factory_physical%0Afrom logical.tests import factory as factory_logical%0Af...
e175cfda1e54586823e6bf0ad78145d175929b83
add entrypoints analysis module
vivisect/analysis/generic/entrypoints.py
vivisect/analysis/generic/entrypoints.py
Python
0
@@ -0,0 +1,272 @@ +%0Adef analyze(vw):%0A '''%0A Analysis module which processes entries in VaSet %22EntryPoints%22 as Functions%0A This is a vital analysis module, only made into a module to allow for %0A control over when in the process it gets executed.%0A '''%0A vw.processEntryPoints()%0A
68e675f4531bf07cdc484837b02121941d4c8ad0
add engine_config.py
engine_config.py
engine_config.py
Python
0.000003
@@ -0,0 +1,155 @@ +# default connection string info here%0Adriver = 'postgresql'%0Ausername = 'tdobbins'%0Apassword = 'tdobbins'%0Ahost = 'localhost'%0Aport = '5432'%0Adefault_db = 'bls'
e32e4500676f043ca137bf5f8af04848f149e067
Add contribution.py
script/contribution.py
script/contribution.py
Python
0.000001
@@ -0,0 +1,1638 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0Aimport urllib.request%0Aimport json%0Aimport sys%0A%0AOWNERS = %5B'AwesomeTickets'%5D%0AREPOS = %5B'Dashboard', 'Integration', 'ServiceServer', 'StaticPageServer', 'DatabaseServer', 'CacheServer'%5D%0AURL = 'https://api.github.com/repos/%25s/%25s...
cbf3c6140aafefbaef7186e0cb97d0758b1d38b2
add the dna algorithm (#6323)
strings/dna.py
strings/dna.py
Python
0
@@ -0,0 +1,486 @@ +import re%0A%0A%0Adef dna(dna: str) -%3E str:%0A%0A %22%22%22%0A https://en.wikipedia.org/wiki/DNA%0A Returns the second side of a DNA strand%0A%0A %3E%3E%3E dna(%22GCTA%22)%0A 'CGAT'%0A %3E%3E%3E dna(%22ATGC%22)%0A 'TACG'%0A %3E%3E%3E dna(%22CTGA%22)%0A 'GACT'%0A %3E%3E...
1ef84c24c60cf802aeb4bf6084f9b7fc7696f79a
Add a script to print the scheduling times of albums
scripts/album_times.py
scripts/album_times.py
Python
0.000001
@@ -0,0 +1,2674 @@ +#!/usr/bin/env python3%0A%0A%22%22%22Radio scheduling program.%0A%0AUsage:%0A album_times.py %5B--host=HOST%5D PORT%0A%0AOptions:%0A --host=HOST Hostname of MPD %5Bdefault: localhost%5D%0A -h --help Show this text%0A%0APrints out the last scheduling time of every album.%0A%22%22%22%0A%0Afrom ...
bab9866d6e255cfe74a5eaf325f8cc8a16648621
Add migration
lowfat/migrations/0089_auto_20170301_2349.py
lowfat/migrations/0089_auto_20170301_2349.py
Python
0.000002
@@ -0,0 +1,999 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.5 on 2017-03-01 23:49%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('lowfat', '0088_auto_20170301_1411'),%0A %5D%0A%0...
c0aa01adcf6385bb4d0b6ddd13299b6b0c3af566
Remove accidental leftovers
sympy/geometry/__init__.py
sympy/geometry/__init__.py
""" A geometry module for the SymPy library. This module contains all of the entities and functions needed to construct basic geometrical data and to perform simple informational queries. Usage: ====== Notes: ====== Currently the geometry module supports 2-dimensional and 3 -dimensional Euclidean space. Exa...
Python
0.00012
@@ -858,45 +858,4 @@ rve%0A -from sympy.geometry.entity import R2, R3%0A
2fadb52dae11ad0910c33f689074f65e8651a005
add script to sniff for prohibited files
scripts/prohibited/general.py
scripts/prohibited/general.py
Python
0
@@ -0,0 +1,1370 @@ +#!/usr/bin/env python%0Aimport os%0Aimport json%0Aimport re%0A%0A%0Aerrors = list()%0Amy_file = __file__%0Amy_dir = os.path.dirname(my_file)%0Amy_filename = my_file.rsplit(os.path.sep, 1)%5B1%5D%0A%0A%0A# assert that only one tempfile is visible%0Afor tmpdir in ('/tmp', '/var/tmp'):%0A for files ...
25561dab146c3bcd8b2ea8f0d7b3dfcf9cf0b8cc
add test with one null status coverage
source/jormungandr/tests/coverage_tests.py
source/jormungandr/tests/coverage_tests.py
Python
0
@@ -0,0 +1,1724 @@ +# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.%0A#%0A# This file is part of Navitia,%0A# the software to build cool stuff with public transport.%0A#%0A# Hope you'll enjoy and contribute to this project,%0A# powered by Canal TP (www.canaltp.fr).%0A# Help us si...
f64183528d4a44d4ac0f3d97e7847f8895d58039
implement the receiver
lexos/receivers/rolling_windows_receiver.py
lexos/receivers/rolling_windows_receiver.py
Python
0.000045
@@ -0,0 +1,2952 @@ +from enum import Enum%0Afrom typing import NamedTuple, Optional%0A%0Afrom lexos.receivers.base_receiver import BaseReceiver%0A%0A%0Aclass RWACountType(Enum):%0A average = %22average%22%0A ratio = %22ratio%22%0A%0A%0Aclass RWATokenType(Enum):%0A string = %22string%22%0A regex = %22regex%2...
408a541fc1cdd5198444db7703e0baffda493d82
Create mp3test.py
home/Markus/mp3test.py
home/Markus/mp3test.py
Python
0.000002
@@ -0,0 +1,784 @@ +# this is a test script%0A# i have a folder with the mp3 files named from music1 to music8.%0A# it random choses the files . no problem%0A# but i want to change the sleep(120) so the next starts when the previous is finished%0A%0Afrom java.lang import String%0Afrom org.myrobotlab.service import S...