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
8ca960bc87ead01dfe76a1e258d7191686bf2afc
fix info pm no longer working
hearthscan-bot.py
hearthscan-bot.py
#!/usr/bin/env python3 import logging as log import time from cardDB import CardDB from constants import Constants from helper import HSHelper from praww import RedditBot import commentDB import credentials import formatter # answer pms of the same user only every x seconds PM_RATE_LIMIT = 60 def answerComment(r,...
Python
0
@@ -3263,22 +3263,25 @@ if ' +%5B%5B info +%5D%5D ' in -cards +text :%0A
a202af3e20d1a8d094b1c9683b7eaeb701541f73
Fix broken test
tests/integration/cattletest/core/test_k8s.py
tests/integration/cattletest/core/test_k8s.py
from common_fixtures import * # NOQA def test_create_k8s_container_no_k8s(context): c = context.create_container(labels={ 'io.kubernetes.pod.namespace': 'n', 'io.kubernetes.pod.name': 'p', 'io.kubernetes.container.name': 'POD', }) c = context.client.wait_success(c) assert c.st...
Python
0.000255
@@ -692,17 +692,24 @@ ation='k -8 +ubernete s')%0A
5423a0aeb841e45e84ba3cd856e59692c2805af9
Fix the gen_dict.py script to use the LOCALIZE macro
gen_dict.py
gen_dict.py
#!/usr/bin/python import os, sys, string, pdb import re, fileinput import ctypes import struct import json #Helper functions def hash_djb2(string): """hash a string using djb2 with seed 5381 Args: string (str): string to hash Returns: (int): hashval of string masked to force positive by ma...
Python
0.000001
@@ -596,17 +596,24 @@ egex = %22 -_ +LOCALIZE %5C(%5C%22(?P%3C
301138d302edce2d6e6b3e1d824f6fbc5ab876be
Change workdir back to starting one when testing "cd"
tests/script_parser/test_generic_functions.py
tests/script_parser/test_generic_functions.py
import os import pytest import shutil import zipfile from script_parser import parser def test_pushd_popd(): p = parser.Parser("foo") startdir = os.getcwd() p.execute_line("pushd tests") assert os.getcwd() == os.path.join(startdir, 'tests') p.execute_line("pushd files") assert os.getcwd() ==...
Python
0
@@ -937,16 +937,75 @@ ests')%0A%0A + os.chdir(startdir)%0A assert os.getcwd() == startdir%0A%0A %0Adef tes
98aa59a6f3aba41ce14b4976b7ad92e1feb1b12c
Clean line too long
tensorflow_probability/python/layers/internal/distribution_tensor_coercible.py
tensorflow_probability/python/layers/internal/distribution_tensor_coercible.py
# Copyright 2018 The TensorFlow Probability Authors. # # 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 o...
Python
0.000002
@@ -2171,32 +2171,81 @@ self_class = + type(distcls.__name__, (cls, distcls), %7B%7D)%0A _TensorCoercibl @@ -2283,50 +2283,18 @@ %5D = -type(distcls.__name__, (cls, distcls), %7B%7D) +self_class %0A
133c9f205c74a071b08e6bcaff088b03eea1192a
fix warnings from mysql in tests
test/tablet.py
test/tablet.py
import os import shutil from subprocess import check_call, Popen, CalledProcessError, PIPE import sys import time import MySQLdb import utils vttop = os.environ['VTTOP'] vtroot = os.environ['VTROOT'] tablet_cell_map = { 62344: 'nj', 62044: 'nj', 41983: 'nj', 31981: 'ny', } class Tablet(object): d...
Python
0
@@ -106,16 +106,173 @@ ort time +%0Aimport warnings%0A# Dropping a table inexplicably produces a warning despite%0A# the %22IF EXISTS%22 clause. Squelch these warnings.%0Awarnings.simplefilter(%22ignore%22) %0A%0Aimport
872c7d7a9d5c7ef5551f6d59e7dcbc84e5ef911d
Add teardown to test
tests/views/test_admin_committee_questions.py
tests/views/test_admin_committee_questions.py
import os from builtins import str from tests import PMGLiveServerTestCase from unittest import skip from pmg.models import db, Committee from tests.fixtures import dbfixture, UserData, CommitteeData, MembershipData from flask import escape from io import BytesIO class TestAdminCommitteeQuestions(PMGLiveServerTestCas...
Python
0
@@ -474,16 +474,133 @@ .admin%0A%0A + def tearDown(self):%0A self.delete_created_objects()%0A self.fx.teardown()%0A super().tearDown()%0A%0A def
c06267145205ab7c1272d0d77643aed145b3655c
Add while interrupt.
get_data.py
get_data.py
#!/usr/bin/env python3 from gps.gps_class import GPS import time def main(): gps_data = GPS('/dev/ttyS0') gps_data.start() while True: print("lat: {}, lon: {}, elevation: {}ft, speed: {}mph".format( gps_data.lat, gps_data.lon, gps_data.altitude, gps_data.mph)) time.sleep(1) i...
Python
0.000003
@@ -58,16 +58,27 @@ ort time +%0Aimport sys %0A%0Adef ma @@ -116,16 +116,54 @@ ttyS0')%0A + print(%22Press Control+C to stop.%22)%0A gps_ @@ -176,16 +176,29 @@ tart()%0A%0A + try:%0A whil @@ -209,24 +209,28 @@ ue:%0A + + print(%22lat: @@ -289,24 +289,28 @@ + gps...
557015152e8a1a22f45cc9073773dac2c65409f9
Update resourcegroup.py
azure/resourcegroup.py
azure/resourcegroup.py
######## # Copyright (c) 2015 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.000001
@@ -725,16 +725,26 @@ ort sys%0A +import os%0A from clo
52d65ff926a079b4e07e8bc0fda3e3c3fe8f9437
Remove dependency from remotecv worker on queued detector
thumbor/detectors/queued_detector/__init__.py
thumbor/detectors/queued_detector/__init__.py
from remotecv import pyres_tasks from remotecv.unique_queue import UniqueQueue from thumbor.detectors import BaseDetector class QueuedDetector(BaseDetector): queue = UniqueQueue() def detect(self, callback): engine = self.context.modules.engine self.queue.enqueue_unique(pyres_tasks.DetectTask...
Python
0
@@ -1,37 +1,4 @@ -from remotecv import pyres_tasks%0A from @@ -257,17 +257,39 @@ e_unique -( +_from_string('remotecv. pyres_ta @@ -302,16 +302,27 @@ tectTask +', 'Detect' ,%0A
97ea7b90508741d84927f595eb74d9ce78d2b967
Remove /network/harness and /network/parse*
urls.py
urls.py
# Copyright 2009 Google 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 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000001
@@ -3120,64 +3120,8 @@ '),%0A - (r'%5Enetwork/harness', 'controllers.network.Harness'),%0A (r @@ -3247,270 +3247,8 @@ ),%0A%0A - #TODO(slamm): point these to another place and remove the network/ templates.%0A #(r'%5Enetwork/parse-fix', 'controllers.network.ParseFix'),%0A #(r'%5Enetwork/parse-service', 'contro...
c9f8663e6b0bf38f6c041a3a6b77b8a0007a9f09
Add a name to the index URL
urls.py
urls.py
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin from django.views.generic.simple import direct_to_template admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^i4p/', include('i4p.foo.urls')), # Uncomment the admin/d...
Python
0.000034
@@ -520,24 +520,27 @@ urls)),%0A +url (r'%5E$', dire @@ -581,16 +581,34 @@ e.html'%7D +, name=%22i4p-index%22 ),%0A (
24b58f2bcbff029ce5d399dc1d8f478d7b066af7
fix image provider api
toolbox/pluginsystem/image_provider_plugin.py
toolbox/pluginsystem/image_provider_plugin.py
from yapsy.IPlugin import IPlugin class ImageProviderPlugin(IPlugin): """ This is the base class for all plugins that load images from a given location """ def activate(self): """ Activation of plugin could do something, but not needed here """ pass def deactivate...
Python
0.000001
@@ -599,25 +599,24 @@ %22%22%22%0A -%0A rais @@ -877,34 +877,52 @@ def -_ get -ShapeAndTimeRange(self +ImageShape(self, Resource, PathInResource ):%0A @@ -1023,28 +1023,216 @@ tedError()%0A return %5B%5D +%0A%0A def getTimeRange(self, Resource, PathInResource):%0A %22%22%22%0A ...
0c40a04c6c989f03b97c443d9072b4ec77daeeaf
remove restart from every test
tests/pydevtest/pydevtest_sessions.py
tests/pydevtest/pydevtest_sessions.py
import os import datetime import commands import socket import pydevtest_common as c import icommands import time import inspect global users output = commands.getstatusoutput("hostname") hostname = output[1] users = [] users.append({'name': 'rods', 'passwd': 'rods', 'zone': 'tempZone', 'resc': 'demoResc', 'host': h...
Python
0
@@ -943,16 +943,17 @@ verkill%0A +# os.s
189621713432a5457f766f868c916b7fd4a94ca4
Fix password_match validator.
formalchemy/validators.py
formalchemy/validators.py
# Copyright (C) 2007 Alexandre Conrad, alexandre (dot) conrad (at) gmail (dot) com # # This module is part of FormAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from i18n import _ if 'any' not in locals(): # pre-2.5 support def any(seq): """ ...
Python
0.000007
@@ -7198,16 +7198,24 @@ alue != +getattr( field.pa @@ -7222,13 +7222,14 @@ rent -%5Bfld%5D +, fld) .val
4dff991a3868c2a4d8cf61d07f7a64c5a69e1633
Version bump.
forms_builder/__init__.py
forms_builder/__init__.py
__version__ = "0.4.10"
Python
0
@@ -14,11 +14,11 @@ = %220.4.1 -0 +1 %22%0A
bc0d4c6de289f9d810587a66b50ac0f6d1aa04ca
Version bump to 0.9
forms_builder/__init__.py
forms_builder/__init__.py
__version__ = "0.8.5"
Python
0
@@ -14,9 +14,7 @@ %220. -8.5 +9 %22%0A
fa121a696b0c14c02028e00eb6ee76e4678e0b3a
Fix CSS links for mfr assets
framework/render/tasks.py
framework/render/tasks.py
# -*- coding: utf-8 -*- import os import logging import errno import codecs import mfr from mfr.ext import ALL_HANDLERS from mfr.exceptions import MFRError from framework.tasks import app from website import settings from website.language import ERROR_PREFIX logger = logging.getLogger(__name__) # Ensure all filehan...
Python
0
@@ -2533,21 +2533,24 @@ t%22 href= +%22 %7Buri%7D +%22 /%3E'.form
debd7f689fa0be51b6b02814ae59053b420a9950
Fix bug where message bytes were in wrong scope
python/led.py
python/led.py
from __future__ import print_function from __future__ import division import platform import numpy as np import config # ESP8266 uses WiFi communication if config.DEVICE == 'esp8266': import socket _sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Raspberry Pi controls the LED strip directly elif con...
Python
0.000003
@@ -2241,85 +2241,8 @@ ls)%0A - # Send UDP packets when using ESP8266%0A m = '' if _is_python_2 else %5B%5D%0A @@ -2526,16 +2526,55 @@ in idx:%0A + m = '' if _is_python_2 else %5B%5D%0A
151110aefcd9268b77ecbfe1e6e637bbb5f8bc1d
Update move_motor.py to python3, make it work for all motors
utils/move_motor.py
utils/move_motor.py
#!/usr/bin/env python """ Used to adjust the position of a motor in an already assembled robot where you can"t move the motor by hand. """ from ev3dev.auto import OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D from ev3dev.helper import LargeMotor import argparse import logging import sys # command line args parser = argpars...
Python
0.000002
@@ -14,16 +14,17 @@ v python +3 %0A%0A%22%22%22%0AUs @@ -201,40 +201,10 @@ UT_D -%0Afrom ev3dev.helper import Large +, Moto @@ -621,13 +621,12 @@ ing. -DEBUG +INFO ,%0A @@ -732,83 +732,8 @@ _)%0A%0A -# For this it doesn't really matter if it is a LargeMotor or a MediumMotor%0A if a @@ -754,37 +754,32 @@ A%2...
d6763210d60a7b6caf97e0b5930e1456f1a73bb1
Drop Py2 and six on tests/unit/modules/test_mod_random.py
tests/unit/modules/test_mod_random.py
tests/unit/modules/test_mod_random.py
# -*- coding: utf-8 -*- """ :codeauthor: Rupesh Tare <rupesht@saltstack.com> """ # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt Libs import salt.modules.mod_random as mod_random import salt.utils.pycrypto from salt.exceptions import SaltInvocationError ...
Python
0
@@ -1,28 +1,4 @@ -# -*- coding: utf-8 -*-%0A %22%22%22%0A @@ -59,122 +59,8 @@ %22%22%0A%0A -# Import Python Libs%0Afrom __future__ import absolute_import, print_function, unicode_literals%0A%0A# Import Salt Libs%0A impo @@ -178,86 +178,8 @@ rror -%0A%0A# Import 3rd-party libs%0Afrom salt.ext import six%0A%0A# Impor...
e55df59cfc7dcbc70aefea00fda0a35af70ac28d
add route filtering feature
glim/app.py
glim/app.py
# application initiation script import os, sys, traceback from glim.core import Config as C, Database as D, Orm as O, App from glim.facades import Config, Database, Orm, Session, Cookie from werkzeug.serving import run_simple from werkzeug.wrappers import Request, Response from werkzeug.routing import Map, Rule from w...
Python
0.000001
@@ -1049,16 +1049,152 @@ result%0A + elif isinstance(urls%5Bkey%5D, (list, tuple)):%0A k = ','.join(urls%5Bkey%5D)%0A ruleset%5Bcurrent_key%5D = k%0A @@ -1195,32 +1195,32 @@ else:%0A - @@ -1537,57 +1537,779 @@ '%5D)%0A - endpo...
46989e41c23b3097140ff9dc0f0408f3147ff2f6
Change nsrl_parse.py to use codecs for ouput file
utils/nsrl_parse.py
utils/nsrl_parse.py
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, with_statement) import argparse import codecs import csv import math import os import struct import sys from tqdm import tqdm PY3 = False if sys.version_info[:1] == (3,): PY3 = True def count_lines(...
Python
0
@@ -1197,24 +1197,31 @@ output = +codecs. open(os.path @@ -1255,16 +1255,25 @@ t'), 'w' +, 'utf-8' )%0A of @@ -2492,32 +2492,16 @@ (line%5B3%5D -.encode('utf-8') )%0A
b69cfe67a0881fbe497cc56aec02412db82f08a5
Fix AssetAttributes' format_extension property
gears/asset_attributes.py
gears/asset_attributes.py
import os import re from .utils import cached_property class AssetAttributes(object): def __init__(self, environment, path): self.environment = environment self.path = path @cached_property def search_paths(self): paths = [self.path] if os.path.basename(self.path_without_...
Python
0.000001
@@ -853,24 +853,33 @@ xtension in +reversed( self.extensi @@ -873,32 +873,33 @@ (self.extensions +) :%0A en
72a74a93e376a93f6e015a358ea823f230c5ef52
revert annotate to last commit
gemini/gemini_annotate.py
gemini/gemini_annotate.py
#!/usr/bin/env python import os import sys import sqlite3 import pysam from gemini.annotations import annotations_in_region, guess_contig_naming def add_requested_column(col_name, update_cursor): """ Attempt to add a new, user-defined column to the variants table. Exit if the column already exists. ...
Python
0
@@ -1553,20 +1553,16 @@ cursor)%0A - %0A las @@ -3492,21 +3492,27 @@ urn len( +list( hits) +) %0A%0A re @@ -4244,14 +4244,12 @@ urn -%22 '%25s' -%22 %25 v @@ -4288,14 +4288,12 @@ urn -%22NULL%22 +None %0A @@ -5296,21 +5296,20 @@ equested. Exiting.%22) -%0A
a7c7bbe484183d2dee21f525c28c34c169b3f755
fix parameterization
utils/user_funcs.py
utils/user_funcs.py
#!bin/env python import asyncpg class PGDB: def __init__(self, db_conn): self.db_conn = db_conn async def fetch_user_info(self, member_id: int, column: str): query = f'''SELECT {column} FROM user_info WHERE member_id = {member_id};''' return await self.db_conn.fetchval(query) asy...
Python
0
@@ -454,18 +454,24 @@ ber_id, -$1 +%7Bcolumn%7D ) VALUES @@ -477,13 +477,13 @@ S ($ -2, $3 +1, $2 )%0A @@ -540,15 +540,21 @@ SET -$1 +%7Bcolumn%7D = $ -3 +2 ;''' @@ -602,17 +602,8 @@ ute, - (column, mem @@ -620,10 +620,9 @@ l_value) -) %0A
4920244418412d8a2d985b9d63930b68aaf692dd
put in the improved trained gdbc
src/optimize_model_ensemble.py
src/optimize_model_ensemble.py
from sklearn.metrics import roc_curve import matplotlib.pyplot as plt import dill as pickle from sklearn.cross_validation import train_test_split import pandas as pd from imblearn.under_sampling import RandomUnderSampler from classification_model import * from sklearn.ensemble import VotingClassifier from sklearn.metri...
Python
0
@@ -4869,18 +4869,16 @@ t_b)%0A - # print(%22 @@ -4936,26 +4936,24 @@ tios%5Cn%22)%0A - # etcb = Eval @@ -4980,23 +4980,22 @@ .05, 10 +0 )%0A - # etcb.ev @@ -5029,18 +5029,16 @@ t_b)%0A - # etcb.pl
a6a655837e43c34e7785b857255d99dab7a05467
Reify user profile
geotrek/authent/models.py
geotrek/authent/models.py
# -*- coding: utf-8 -*- """ Models to manage users and profiles """ from django.db import models from django.contrib.auth.models import User, Group from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.dispatch import receiver from django.contrib.auth.signals import u...
Python
0.999927
@@ -3991,15 +3991,12 @@ e = -propert +reif y(la
f799561adb3b76a17e9da30a7cb715ae26b1a5eb
Update tsdb_serialization.py
timeseries/tsdb/tsdb_serialization.py
timeseries/tsdb/tsdb_serialization.py
import json LENGTH_FIELD_LENGTH = 4 def serialize(json_obj): '''Turn a JSON object into bytes suitable for writing out to the network. Includes a fixed-width length field to simplify reconstruction on the other end of the wire.''' # your code here class Deserializer(object): '''A buffering and...
Python
0.000001
@@ -245,17 +245,16 @@ ''%0A # - your cod @@ -259,17 +259,334 @@ ode here -%0A +. Returns the bytes on the wire%0A try:%0A obj = json.dumps(json_obj)%0A b = obj.encode()%0A encoded = (len(b)+LENGTH_FIELD_LENGTH).to_bytes(LENGTH_FIELD_LENGTH,byteorder='little') + b%0A return encoded%...
623f37316c7d09c18a846d437b7ff943060a5521
Add pageTitle params to post routes
timpani/webserver/controllers/user.py
timpani/webserver/controllers/user.py
import flask import os.path import datetime from ... import auth from ... import blog from ... import configmanager from ... import settings from .. import webhelpers TEMPLATE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../templates")) blueprint = flask.Blueprint("user", __name__, template_f...
Python
0
@@ -451,32 +451,115 @@ , %22posts.html%22)%0A +%09postParams = webhelpers.getPostsParameters()%0A%09pageTitle = postParams%5B%22blogTitle%22%5D%0A %09return webhelpe @@ -609,41 +609,43 @@ ts, -**webhelpers.getP +pageTitle = pageTitle, **p ost -s Param -eters() +s )%0A%0A@ @@ -840,16 +840,127 @@ .html%22)%0A +%0...
7f2b41a706cf110e6c9cd888917e6762fad69dbc
Replace session with flask.session in user.py
timpani/webserver/controllers/user.py
timpani/webserver/controllers/user.py
import flask import os.path import datetime from ... import auth from ... import blog from ... import configmanager from .. import webhelpers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../../configs/")) TEMPLATE_PATH = os.path.abspath(os.pat...
Python
0.000008
@@ -2219,24 +2219,30 @@ ssionId)%0A%09%09%09 +flask. session.clea
84fe0f1bde39f007da08c93298f53ae1ad623fd1
Add file that should be deployed to REQUIRED_PATHS, for JPF
benchexec/tools/jpf.py
benchexec/tools/jpf.py
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2018 Dirk Beyer 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 ht...
Python
0
@@ -1006,16 +1006,55 @@ ./build%22 +,%0A %22../jpf.properties%22 %0A
70c3d7dcbcaaca809ef897f2d705227318efbfa8
Add flags to get plugins list and help.
user.py
user.py
#!/usr/bin/env python2.7 import argparse # new in Python2.7 import open_bci_v3 as bci import os import time import string from yapsy.PluginManager import PluginManager import logging logging.basicConfig(level=logging.DEBUG) # Load the plugins from the plugin directory. manager = PluginManager() manager.setPluginPla...
Python
0
@@ -216,15 +216,33 @@ ing. -DEBUG) +CRITICAL) # DEBUG for dev %0A%0A# @@ -1943,24 +1943,26 @@ info:%0A%09%09plug +in =manager.get @@ -1970,33 +1970,33 @@ luginByName( -plug_name +args.info )%0A%09%09if plug @@ -1986,32 +1986,34 @@ .info)%0A%09%09if plug +in == None:%0A%09%09%09# e @@ -2081,33 +2081,33 @@ %...
199761c550e80f8e8c2882a09694f2bde08c8d75
Remove get_repo().
viewer/web/views.py
viewer/web/views.py
""" viewer.web.views ~~~~~~~~~~~~~~~~ Views for the web. :copyright: © 2014 by Petr Zemek <s3rvac@gmail.com> and contributors :license: BSD, see LICENSE for more details """ from flask import render_template from flask import g from viewer import git from . import app def get_repo(): retur...
Python
0
@@ -292,75 +292,8 @@ p%0A%0A%0A -def get_repo():%0A return git.Repo(app.config%5B'GIT_REPO_PATH'%5D)%0A%0A%0A @app @@ -348,16 +348,43 @@ = g -et_repo( +it.Repo(app.config%5B'GIT_REPO_PATH'%5D )%0A%0A%0A
7f4b2cffbe241a3c25fd61de58c663be11d6c72b
Remove range on the distance histogram (and r_max input flag)
bin/calculate_curve.py
bin/calculate_curve.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import sys import numpy as np import scipy.spatial.distance as dist import pdb2sphere as p2s def parse_arguments(): """Parse command line arguments and ensure correct combinations present""" parser = argparse.ArgumentParser( description= '...
Python
0
@@ -754,28 +754,23 @@ lue -to make curve out to +in output curve ')%0A%0A @@ -884,139 +884,8 @@ ')%0A%0A - parser.add_argument('-m','--r_max', nargs='?', type=float,%0A default=160, help = 'Maximum r value to use in histogram')%0A%0A @@ -950,36 +950,35 @@ default= -0.16 +400 , help = 'No. ...
805ba9d93e04ed3991d8d00132e439df02eaff79
Add import_from_dir() function
util.py
util.py
"""Snipppets of potentially reusable code that don't deserve their own library.""" import bisect class Location: def __init__(self, name, line, col): self.name = name self.line = line self.col = col def __str__(self): return "{}:{}.{}".format(self.name, self.line, self.col) ...
Python
0.00001
@@ -919,12 +919,914 @@ line, col)%0A +%0A%0Adef import_from_dir(module_name, dir_name):%0A %22%22%22Import a module form a specific directory.%0A%0A Sometimes you might want to load a package from a specific%0A directory. For example, you may be loading a plugin of some%0A description.%0A%0A This funct...
d0e786d3da03f95870386b195567d5e7f53c3f38
capitalize constant
util.py
util.py
import urlparse import urllib import re base = "http://localhost:9991/" def narrow_url_to_stream_topic(url): parsed_url = urlparse.urlparse(url) unquoted_fragment = urllib.unquote_plus(parsed_url.fragment.replace('.', '%')) split_fragment = re.split('/', unquoted_fragment) if len(split_fragment) < 5: ret...
Python
0.999999
@@ -34,20 +34,20 @@ ort re%0A%0A -base +BASE = %22http @@ -67,16 +67,17 @@ 9991/%22%0A%0A +%0A def narr @@ -673,12 +673,12 @@ l = -base +BASE + z
88f57982d8f93bb9e4d6915081dabaa143708419
Fix method of getting server version, add docstring
virtool/db/mongo.py
virtool/db/mongo.py
import logging import sys from typing import Any, Awaitable, Callable, Dict, List import pymongo.errors import semver from motor.motor_asyncio import AsyncIOMotorClient import virtool.db.core import virtool.db.utils MINIMUM_MONGO_VERSION = "3.6.0" logger = logging.getLogger("mongo") async def connect( con...
Python
0
@@ -1700,24 +1700,227 @@ -return (await db +%22%22%22%0A Gets a server version string from the running MongoDB client.%0A%0A :param db: the application database object%0A :return: MongoDB server version in string format%0A %22%22%22%0A return (await db.motor_client.client .ser
82088fe6f1b05cc978b2b147bff33d889a3127ef
improve report plot
bin/report_gen_plot.py
bin/report_gen_plot.py
#!env python #coding: utf-8 import sys, os, re from collections import defaultdict, namedtuple import matplotlib.pyplot as plt RecordRaw=namedtuple("RecordRaw", "type durtation data_size throughput_total throughput_per_node") Record=namedtuple("Record", "type language durtation data_size throughput_total throughput_p...
Python
0.000005
@@ -3365,16 +3365,134 @@ ain__%22:%0A + try:%0A default_report_fn = sys.argv%5B1%5D%0A except:%0A default_report_fn = %22sparkbench.report%22%0A %0A repo @@ -3546,25 +3546,27 @@ %22.. -/sparkbench. +%22, default_ report -%22 +_fn )) +%0A
84d3dfa785ac8b0ceb9fa739e233def6b88e84bf
remove duplicate test.
vows/config_vows.py
vows/config_vows.py
#!/usr/bin/python # -*- coding: utf-8 -*- # derpconf # https://github.com/globocom/derpconf # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2012 globo.com timehome@corp.globo.com from os.path import abspath, join, dirname from pyvows import Vows, expect from derp...
Python
0.000008
@@ -2469,286 +2469,8 @@ ')%0A%0A - class WhenPathIsNotGiven(Vows.Context):%0A def topic(self):%0A return Config.load(None, defaults=%7B'DEFAULT': 'DEFAULTVALUE'%7D)%0A%0A def should_have_default_values(self, topic):%0A expect(topic.DEFAULT).to_equal('DEFAULTVA...
566e7b17d220eec143487f6d9ea7db647c557b10
Update variantPipeline.py
bin/variantPipeline.py
bin/variantPipeline.py
import os import os.path import argparse import shutil import subprocess as s import sys parser = argparse.ArgumentParser(description='This is a wrapper to set up and run the bpipe command') parser.add_argument('-i',action='store',dest='input_dir',help='Directory containing the input fastqs') parser.add_argument('-...
Python
0
@@ -2266,18 +2266,16 @@ un -n 8 --r %22 + out
85eb6a24aa65c6967e30a9c3f9cbbd84e124140c
Remove comma from docstring
bin/verify-identity.py
bin/verify-identity.py
#!/usr/bin/env python """verify-identity.py <participant_id>, <country_code> """ from __future__ import absolute_import, division, print_function, unicode_literals import sys from gratipay import wireup from gratipay.models.participant import Participant from gratipay.models.country import Country wireup.db(wireup.e...
Python
0.001731
@@ -53,17 +53,16 @@ pant_id%3E -, %3Ccountr
94721a39c4f8352bc8994598d3c1bc9dae1f6784
clarify body of the execute function
birdy/native/client.py
birdy/native/client.py
import types from collections import OrderedDict from copy import copy import six from boltons.funcutils import FunctionBuilder from owslib.util import ServiceException from owslib.wps import WPS_DEFAULT_VERSION, WebProcessingService, SYNC from birdy.exceptions import UnauthorizedException from birdy.native import ut...
Python
0.000024
@@ -63,16 +63,44 @@ ort copy +%0Afrom textwrap import dedent %0A%0Aimport @@ -4353,132 +4353,166 @@ -cleaned_locals = %22%7Bk: v for k, v in locals().items() if k not in %25s%7D%22%0A cleaned_locals = cleaned_locals %25 str(%5B%22self%22%5D +body = dedent(%22%22%22%0A inputs = locals()%0A ...
61fcf804d6e21a00abd7cff9a9b1be627a34d863
Remove six dependency
wsgi.py
wsgi.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module converts an AWS API Gateway proxied request to a WSGI request, then loads the WSGI application specified by FQN in `.wsgi_app` and invokes the request when the handler is called by AWS Lambda. Inspired by: https://github.com/miserlou/zappa Author: Logan Ra...
Python
0.000055
@@ -367,19 +367,8 @@ os%0A -import six%0A impo @@ -2576,12 +2576,8 @@ dy, -six. stri
db6ee1cdcc31c8c1c2899d100cb0d1a9baf0e71e
Remove old initializers
keystone/__init__.py
keystone/__init__.py
# Copyright (C) 2011 OpenStack LLC. # # 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 agreed to in wr...
Python
0.000047
@@ -884,484 +884,4 @@ __%0A%0A -'''%0ATODO(Ziad): Commenting out so we don't load this always - remove eventually%0A#TOKEN AUTH%0Afrom auth_protocols.auth_token %5C%0A import filter_factory as tokenauth_factory%0A%0A#BASIC AUTH%0Afrom auth_protocols.auth_basic %5C%0A import filter_factory as basicauth_fa...
7b9f84d365ef0eeb43238fc6779c6d0adfe29ac7
clean up imports
kibot/modules/woo.py
kibot/modules/woo.py
import kibot.BaseModule import random from kibot.irclib import nm_to_n class woo(kibot.BaseModule.BaseModule): def __init__(self, bot): random.seed() kibot.BaseModule.BaseModule.__init__(self, bot) def _on_pubmsg(self, conn, event): import string, re message = event.args[0] ...
Python
0.000006
@@ -30,16 +30,26 @@ t random +%0Aimport re %0A%0Afrom k @@ -267,35 +267,8 @@ t):%0A - import string, re%0A%0A
7868e46cd6d0b7071c41d8032a65049db41bb75a
Move import.
lambda_local/main.py
lambda_local/main.py
''' Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.) Licensed under MIT. ''' import imp import sys import traceback import json import logging import os import timeit import multiprocessing from . import event from . import context from .environment_variables import set_environment_variables, export_vari...
Python
0
@@ -88,19 +88,8 @@ ''%0A%0A -import imp%0A impo @@ -2712,16 +2712,35 @@ r == 2:%0A + import imp%0A
3df89cb9705b3475132940e50d15e422ec3ea7ab
fix itertools import for mapproxy-util scales --repeat
mapproxy/compat/itertools.py
mapproxy/compat/itertools.py
from __future__ import absolute_import import sys PY2 = sys.version_info[0] == 2 PY3 = not PY2 if PY2: from itertools import ( izip, izip_longest, imap, islice, chain, groupby, ) else: izip = zip imap = map from itertools import ( zip_longe...
Python
0
@@ -221,24 +221,39 @@ groupby,%0A + cycle,%0A )%0A%0Aelse: @@ -392,19 +392,34 @@ groupby,%0A + cycle,%0A )%0A%0A
8b9aa53a6b1f4e4cf1da2a13a4d756d5706d68c6
Fix fkeys.
marshmallow_peewee/fields.py
marshmallow_peewee/fields.py
import datetime as dt from marshmallow import fields from marshmallow.compat import PY2, string_types class Timestamp(fields.Field): default_error_messages = { 'invalid': 'Not a valid timestamp.' } def _serialize(self, value, attr, obj): """Serialize given datetime to timestamp.""" ...
Python
0.000002
@@ -2254,19 +2254,16 @@ -return str( +value = obj. @@ -2277,17 +2277,98 @@ et(attr) -) +%0A if value is not None:%0A value = str(value)%0A return value %0A%0A%0Aif PY
fe54e9c665cd87a343c479a85a52a890329a774f
make conversion reply threaded
plugins/conversion.py
plugins/conversion.py
import logging log = logging.getLogger(__name__) import datetime import re import requests import requests.exceptions import botologist.plugin def format_number(number): if not isinstance(number, int): number = float(number) if number % 1 == 0.0: number = int(number) if isinstance(number, int): f_number...
Python
0
@@ -3093,16 +3093,29 @@ n.reply( +threaded=True )%0A%09def c
d4f1bbd1ceeb8b0adae97f0d688b3fa4585d5614
add references
odtbrain/__init__.py
odtbrain/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- u""" Algorithms for scalar diffraction tomography. This package provides reconstruction algorithms for diffraction tomography in two and three dimensions. Installation ------------ ODTbrain is a python library that is compatible to Python 2 and Python 3. To install via th...
Python
0
@@ -931,52 +931,14 @@ ble -on%0A%60arXiv %3Chttp://arxiv.org/abs/1507.00466%3E%60 +in %5B1%5D _.%0A%0A @@ -3019,18 +3019,826 @@ quation%0A - +%0AHow to cite%0A-----------%0AIf you use ODTbrain in a scientific publication, please cite at least%0A%5B2%5D_. %0A%0A%0AReferences%0A----------%0A.. %5B1%5D P. M%C3%BClle...
b39dbe18468ba360d626d118457d3a301aabcf3a
Add a version number for the XLA code targetting jaxlib.
jax/lib/__init__.py
jax/lib/__init__.py
# Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000001
@@ -2472,32 +2472,339 @@ da_prng = None%0A%0A +# Jaxlib code is split between the Jax and the Tensorflow repositories.%0A# Only for the internal usage of the JAX developers, we expose a version%0A# number that can be used to perform changes without breaking the master%0A# branch on the Jax github.%0A_xla_extension_ver...
bd8a5b53b0d38cf1610cd21426832073d041ed8d
fix Mezzanine warning
jdleden/settings.py
jdleden/settings.py
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep th...
Python
0.000001
@@ -152,146 +152,8 @@ ))%0A%0A -%0A# Quick-start development settings - unsuitable for production%0A# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/%0A%0A # SE @@ -489,18 +489,157 @@ TES = %5B%7B +%0A 'OPTIONS': %7B%0A 'builtins': %5B%0A 'mezzanine.template.loader_tags', ...
551b590115da4d6eac356b7f94ec6f2197da3ce0
bump version
django_rest_utils/__init__.py
django_rest_utils/__init__.py
__version__ = '0.0.0'
Python
0
@@ -12,11 +12,11 @@ = '0.0. -0 +1 '%0A
11e64afa2192a8e71cba9357f332f4e8edd66bba
bump to 2.1.2
premailer/__init__.py
premailer/__init__.py
from premailer import Premailer, transform __version__ = '2.1.1'
Python
0.000015
@@ -56,11 +56,11 @@ = '2.1. -1 +2 '%0A
daad652e307a47e81cba3bd5e2c905126a2817c9
Fix lint warning
prestoadmin/deploy.py
prestoadmin/deploy.py
# -*- coding: utf-8 -*- # # 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 agreed to in writing, software ...
Python
0.000558
@@ -4610,20 +4610,16 @@ - text=esc
2ef86fa9ecc0c6f8ec8480a545123e66fdb90af5
Improve unicode parsing. From https://github.com/bmander/gtfs/commit/e0390740ef951bebc2e1a5448abc68e51891833d
gtfs/feed.py
gtfs/feed.py
from codecs import iterdecode from zipfile import ZipFile import os import csv class CSV(object): """A CSV file.""" def __init__(self, header, rows): self.header = header self.rows = rows def __repr__(self): return '<CSV %s>' % self.header def __iter__(self): return s...
Python
0.999999
@@ -766,16 +766,271 @@ lename%0A%0A + def unicode_csv_reader(self, file_handle, encoding='utf-8'):%0A reader = csv.reader(%5Bx.encode(encoding) for x in iterdecode(file_handle, encoding)%5D)%0A for row in reader:%0A yield %5Bunicode(x, encoding) for x in row%5D%0A return%0A%0A d...
fb153b560eac3d46789db50d5359b14fece028d1
Add URLs for static redesign pages
python/ecep/urls.py
python/ecep/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.conf.urls.static import static from portal.sms import Sms, Conversation, SmsCallback from django.views.generic import TemplateView, RedirectView from sitemap import LocationS...
Python
0
@@ -1463,22 +1463,26 @@ ign/ -index$', Index +connect$', Connect Rede @@ -1506,17 +1506,25 @@ ame= -%22 +'connect- redesign -hom @@ -1523,14 +1523,9 @@ sign --home%22 +' ),%0A @@ -1543,34 +1543,26 @@ edesign/ -connect$', Connect +faq$', FAQ Redesign @@ -1571,39 +1571,35 @@ s_view(), name=' -connect +faq -re...
59b09f9251c5a41f5362e2d6e1438f2c33274f89
Bump version
the_big_username_blacklist/__init__.py
the_big_username_blacklist/__init__.py
# -*- coding: utf-8 -*- """ the-big-username-blacklist -------------------------- A opinionated username blacklist """ __title__ = "the_big_username_blacklist" __version__ = "1.5.0" __build__ = 150 __author__ = "Martin Sandström" __license__ = "MIT" __copyright__ = "Copyright 2015-2017 Martin Sandström" from .valid...
Python
0
@@ -174,17 +174,17 @@ = %221.5. -0 +2 %22%0A__buil @@ -191,17 +191,17 @@ d__ = 15 -0 +2 %0A__autho @@ -284,9 +284,9 @@ -201 -7 +8 Mar
4fdc274a42d49fbb938d9adaaef3cabed05b26da
Add -c, --simulate-table-size-change option to hpackmake.py
python/hpackmake.py
python/hpackmake.py
#!/usr/bin/env python # # This script reads input headers from json file given in the # command-line (each file must be written in the format described in # https://github.com/Jxck/hpack-test-case but we require only # 'headers' data). Then it encodes input header set and write the # encoded header block in the same fo...
Python
0.000004
@@ -678,16 +678,58 @@ ble_size +,%0A simulate_table_size_change ):%0A r @@ -1303,158 +1303,595 @@ -for casenum, item in enumerate(testdata%5B'cases'%5D):%0A outitem = %7B%0A 'seqno': casenum,%0A 'headers': item%5B'headers'%5D%0A %7D +num_item = len(testdata%5...
8f0ea48bbe3ccad44ccb0e98185d34c32678db7e
Fix test_tombstone_failure_v3 error handling for 2.1 (#1430)
read_failures_test.py
read_failures_test.py
from cassandra import ConsistencyLevel, ReadFailure, ReadTimeout from cassandra.policies import FallthroughRetryPolicy from cassandra.query import SimpleStatement from dtest import Tester from tools.decorators import since KEYSPACE = "readfailures" class TestReadFailures(Tester): """ Tests for read failures...
Python
0.000001
@@ -57,16 +57,35 @@ dTimeout +, OperationTimedOut %0Afrom ca @@ -3418,25 +3418,31 @@ _expt = -Read +Operation Time -o +dO ut%0A @@ -3536,81 +3536,297 @@ -self._perform_cql_statement(session, %22SELECT value FROM tombstonefailure%22 +# ReadTimeout will be wrapped by OperationTimedOut and is contained in...
a185daef07c38900dc6306c8027dcec288bb7e54
Use textwrap.
test_joyent.py
test_joyent.py
from datetime import ( datetime, timedelta, ) import json from mock import patch from unittest import TestCase from joyent import ( Client, ISO_8601_FORMAT, parse_args, ) def make_machine(state='running', hours=2): then = datetime.utcnow() - timedelta(hours=hours) return { 'id': '...
Python
0
@@ -82,16 +82,44 @@ t patch%0A +from textwrap import dedent%0A from uni @@ -2170,17 +2170,28 @@ alues = -( +%5Bdedent(%22%22%22%5C %0A @@ -2199,13 +2199,15 @@ -' 123 + 45:3 @@ -2225,35 +2225,32 @@ -e joyent ./juju -%5Cn' %0A '45 @@ -2246,17 +2246,16 @@ -' 456 03:4 @@ -228...
7a3f8adf66ce2de398ad7168a11ecaa526c26db5
Check content of public IP response against a list of valid characters.
blessclient/user_ip.py
blessclient/user_ip.py
import contextlib import logging import time from urllib2 import urlopen class UserIP(object): def __init__(self, bless_cache, maxcachetime, ip_urls, fixed_ip=False): self.fresh = False self.currentIP = None self.cache = bless_cache self.maxcachetime = maxcachetime self.ip...
Python
0
@@ -26,16 +26,30 @@ logging%0A +import string%0A import t @@ -81,16 +81,63 @@ rlopen%0A%0A +VALID_IP_CHARACTERS = string.hexdigits + '.:'%0A%0A %0Aclass U @@ -1490,22 +1490,25 @@ -return +content = f.read( @@ -1517,16 +1517,261 @@ strip()%0A + for c in content%5B:40%5D:%0A ...
f3e5a70bb5f04a63f891a740cad01d95bd00822d
update nox file and modernize to new interface (#3156)
python/py_gapic.bzl
python/py_gapic.bzl
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0
@@ -1524,24 +1524,28 @@ g.srcjar nox +file .py setup.py @@ -1605,16 +1605,20 @@ -rf nox +file .py setu
7c816832aa57065cd37100ebd088ad49782ecfa6
Fix names displayed in admin
quiz/admin.py
quiz/admin.py
__author__ = 'jesuejunior' from quiz.models import Question, Lesson, Answer, Unity, Media, Result from django.contrib import admin class UnityAdmin(admin.ModelAdmin): list_display = ('id', 'number', 'name', 'description', ) list_filter = ('number', 'name', 'description', ) search_fields = ('id', 'number'...
Python
0
@@ -453,16 +453,23 @@ 'name', +'extra' )%0A li @@ -488,16 +488,25 @@ ('name', + 'extra', )%0A%0Aadmin
a22d8285d290f16e46557145e90e5ba42f4ce607
Return underlying block device as 'slave' for LUKS with integrity
blivet/devices/luks.py
blivet/devices/luks.py
# devices/luks.py # # Copyright (C) 2009-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in t...
Python
0
@@ -2622,16 +2622,161 @@ .slave%0A%0A + @property%0A def slave(self):%0A if self._has_integrity:%0A return self.parents%5B0%5D.parents%5B0%5D%0A return self.parents%5B0%5D%0A%0A @pro @@ -3057,24 +3057,129 @@ eturn size%0A%0A + @property%0A def _has_integrity(self):%0A ...
2517f8c75050abb29932d73c98ca2ea242016346
Add system pages
radar/fixtures/groups.py
radar/fixtures/groups.py
from radar.fixtures.utils import add from radar.models.groups import ( Group, GroupPage, GROUP_CODE_RADAR, GROUP_CODE_NURTURE, GROUP_CODE_NHS, GROUP_CODE_CHI, GROUP_CODE_UKRR, GROUP_CODE_HSC, GROUP_CODE_UKRDC, GROUP_CODE_NHSBT, GROUP_CODE_BAPN, GROUP_TYPE, ) from radar.pa...
Python
0.000001
@@ -605,129 +605,523 @@ -%7D,%0A %7B%0A 'type': GROUP_TYPE.SYSTEM,%0A 'code': GROUP_CODE_NURTURE,%0A 'name': 'NURTuRE' + 'pages': %5B%0A (PAGE.DEMOGRAPHICS, 100),%0A (PAGE.CONSULTANTS, 200),%0A (PAGE.COHORTS, 300),%0A ...
40602b244aa36897a51b945d68323f6e8931bd2d
Fix machine rotation
enigma.py
enigma.py
from builtins import KeyError import string class Steckerbrett: def __init__(self, *args): self.map = {} for arg in args: if arg[0] in self.map or arg[1] in self.map: raise KeyError('Same letter used twice in plugboard') self.map[arg[0]] = arg[1] ...
Python
0.000002
@@ -3668,33 +3668,24 @@ lf):%0A - wiring = self.rotors @@ -3692,69 +3692,20 @@ %5B0%5D. -wiring%0A self.rotors%5B0%5D.wir +sett ing ++ = -wiring%5B1:%5D + wiring%5B0%5D +1 %0A%0A @@ -3768,154 +3768,93 @@ -if self.rotors%5Bindex%5D.notch == self.rotors%5Bindex%5D.wiring%5B0%5D:%0A ...
73ff56f4b8859e82b0d69a6505c982e26de27859
Add randcolor function to uitl
util.py
util.py
def product(nums): r = 1 for n in nums: r *= n return r def choose(n, k): if 0 <= k <= n: ntok = 1 ktok = 1 for t in range(1, min(k, n - k) + 1): ntok *= n ktok *= t n -= 1 return ntok // ktok else: return 0 def ...
Python
0.000001
@@ -1,12 +1,245 @@ +import colorsys%0Aimport random%0A%0Adef randcolor():%0A hue = random.random()%0A sat = random.randint(700, 1000) / 1000%0A val = random.randint(700, 1000) / 1000%0A return tuple(int(f*255) for f in colorsys.hsv_to_rgb(hue, sat, val))%0A %0Adef product
458fb73759b6bc450e6d3dffdb0831d7b68ea2b1
remove diff target and algo type from generated ROM file name
randomizer.py
randomizer.py
#!/usr/bin/python import argparse, random, os.path, json, sys from itemrandomizerweb.stdlib import Random from itemrandomizerweb import Items from itemrandomizerweb.Randomizer import Randomizer from tournament_locations import locations from parameters import easy, medium, hard, harder, hardcore, mania, text2diff, di...
Python
0
@@ -4591,14 +4591,8 @@ _' + - 'O' + str @@ -4616,44 +4616,8 @@ eset - + '_' + diff2text%5BdifficultyTarget%5D %0A%0A @@ -5121,18 +5121,8 @@ ns%0A%0A -# try:%0A
416dc5c9a57033c1ab310b16479ddc3449dbee93
Change to application/json Content-Type for svdata.
util.py
util.py
import datetime import functools import json import math import os import random import string import time import warnings import constants ROOT_DIR = os.path.abspath(os.path.dirname(__file__)) def svdata(obj: object, code: int = 1, message: str = "成功", errormsg: str = "Invalid API request.") -> tuple: """ ...
Python
0
@@ -1146,17 +1146,23 @@ %22: %22 -text/plai +application/jso n%22%7D%0A
4a3f1bed441232e9a53001f5c76d79d46a255c89
use /p:CL_MPcount=2 on windows
python_lib/setup.py
python_lib/setup.py
import os import re import sys import platform import subprocess from setuptools import setup, Extension from setuptools.command.build_ext import build_ext from distutils.version import LooseVersion class CMakeExtension(Extension): def __init__(self, name, sourcedir=''): Extension.__init__(self, name, sources=[])...
Python
0.000008
@@ -1426,11 +1426,85 @@ , '/ -m'%5D +p:CL_MPcount=2'%5D%09%09# see https://gitlab.kitware.com/cmake/cmake/-/issues/20564 %0A%09%09e @@ -1580,15 +1580,16 @@ %5B'-- -', '-j2 +parallel '%5D%0A%0A
e463cff89aa244e2241d6b71d81fd04f6d16a53a
Fix variable names
util.py
util.py
import glob import subprocess def generate_report(): '''Generate a PDF report containing magnetization data and lattice snapshots.''' n_lattices = len(glob.glob("data/lattice*.csv")) #R code template report_template = open("templates/report.template.r", 'r').read() #R code template for a ...
Python
0.999822
@@ -649,16 +649,25 @@ s += lat +ticeplot_ template @@ -674,17 +674,17 @@ .format( -i +n )%0D%0A #
d875bc9b3ac08649ad37088dacb4a4550c788be5
allow ctrl+c to break the wait; fix easy_install.exe launching new cmd prompts
venv.py
venv.py
"""Virtualenv utilities for fabric""" import os from os import path import sys import shutil import time from fabric.api import * WIN = sys.platform == 'win32' def clean(): """Delete all files/directories ignored in source control The following source control systems are supported: svn -- ...
Python
0.000002
@@ -2864,16 +2864,20 @@ print(' +*** Waiting @@ -2880,16 +2880,38 @@ ing for +the detached process ( virtuale @@ -2912,16 +2912,17 @@ rtualenv +) to fini @@ -2929,23 +2929,87 @@ sh ( -10 secs) ...')%0A +50s)')%0A print('*** Press Ctrl+C to forcibly continue')%0A try:%0A @@ -3027,12 +...
fc30af765493f8ba1be5113992ff5d8beb043554
Update test script for new website (#25)
test_script.py
test_script.py
""" A simple selenium test example written by python """ import unittest from selenium import webdriver from selenium.common.exceptions import NoSuchElementException class TestTemplate(unittest.TestCase): """Include test cases on a given url""" def setUp(self): """Start web driver""" chrome_o...
Python
0
@@ -503,16 +503,79 @@ e-gpu')%0A + chrome_options.add_argument(%22--window-size=1920,1080%22)%0A @@ -605,23 +605,16 @@ .Chrome( -chrome_ options= @@ -813,13 +813,17 @@ top- -right +left logo but @@ -958,18 +958,20 @@ me(' -btn- header +__logo ')%0A @@ -1125,18 +1125,36 @@ ick -Learn more +t...
b5d0694fe9d5e22ea82be9a78bbe4f755bec250d
Remove unneeded funfactory defaults (Jinja and LocaleURLMiddleware)
remo/settings/base.py
remo/settings/base.py
# This is your project's main settings file that can be committed to your # repo. If you need to override a setting locally, use settings_local.py from funfactory.settings_base import * # Bundles is a dictionary of two dictionaries, css and js, which list css files # and js files that can be bundled together by the mi...
Python
0
@@ -1975,8 +1975,315 @@ )%0A +%0A# Remove jinja template engine. To be revisited%0ATEMPLATE_LOADERS = filter(lambda x: x != 'jingo.Loader', TEMPLATE_LOADERS)%0A%0A# Remove LocaleURLMiddleware since we are not localing our website%0AMIDDLEWARE_CLASSES = filter(%0A lambda x: x!='funfactory.middleware.LocaleURLM...
d0b59867445dff01c31f90dcaad865a4b82d3e42
refactor DBWorker to get sql from method get_process_item_sql
hkhouse/worker.py
hkhouse/worker.py
import json import urllib import urllib2 from hkhouse.db import HousingDB, SOURCE_TYPE_591, REVERSE_GEOCODING_STATUS_SUCCESS, REVERSE_GEOCODING_STATUS_FAIL, \ REVERSE_GEOCODING_STATUS_PENDING, SOURCE_TYPE_CENTANET from hkhouse.opencage import OpenCage __author__ = 'warenix' class DBWorker(object): __db = Non...
Python
0.000012
@@ -507,27 +507,27 @@ -cur +sql = self. __db.con @@ -522,354 +522,514 @@ elf. -__db.con.cursor()%0A success = True%0A while success:%0A sql = 'select * from House where reverse_geocoding_status=%7Breverse_geocoding_status%7D limit 1'.format(%0A source_type=self.get_...
7801c5d7430233eb78ab8b2a91f5960bd808b2c7
Move admin authentication into before_request handler
app/admin/views.py
app/admin/views.py
from flask import Blueprint, render_template from flask_security import login_required admin = Blueprint('admin', __name__) @admin.route('/') @admin.route('/index') @login_required def index(): return render_template('admin/index.html', title='Admin')
Python
0.000001
@@ -37,16 +37,35 @@ template +, redirect, url_for %0Afrom fl @@ -84,30 +84,28 @@ import -login_required +current_user %0A%0Aadmin @@ -182,24 +182,8 @@ x')%0A -@login_required%0A def @@ -253,8 +253,160 @@ Admin')%0A +%0A%0A@admin.before_request%0Adef require_login():%0A if not current_user.is_authenticated...
87cba98b0cd2b3ad0ea1f69a05ed431803359801
Add exception indicating user (as opposed to developer) made an error
pyxb/exceptions_.py
pyxb/exceptions_.py
# Copyright 2009, Peter A. Bigot # # 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 agreed to ...
Python
0.000002
@@ -5842,16 +5842,123 @@ ss%0A %0A +class UsageError (PyXBError):%0A %22%22%22Raised when the code detects arguments to a public%0A operation.%22%22%22%0A%0A class Lo
9e2c9e9df0ac6904b3e0b91c0e71c1a122f59cc2
Fix accidental variable rename: `to_addr_lista`
redi/utils/redi_email.py
redi/utils/redi_email.py
# Contributors: # Christopher P. Barnes <senrabc@gmail.com> # Andrei Sura: github.com/indera # Mohan Das Katragadda <mohan.das142@gmail.com> # Philip Chase <philipbchase@gmail.com> # Ruchi Vivek Desai <ruchivdesai@gmail.com> # Taeber Rapczak <taeber@ufl.edu> # Nicholas Rejack <nrejack@ufl.edu> # Josh Hanna <josh@hanna....
Python
0.000083
@@ -5929,17 +5929,16 @@ ddr_list -a ), str(s
0087a2c0c07050ea29d0a25847eab4a7f88e44a9
Remove unused marker
hoomd/conftest.py
hoomd/conftest.py
import pytest import hoomd import atexit import numpy import itertools from hoomd.snapshot import Snapshot from hoomd import Simulation devices = [hoomd.device.CPU] if hoomd.device.GPU.is_available(): devices.append(hoomd.device.GPU) @pytest.fixture(scope='session', params=devices) def device(request): """Pa...
Python
0.000003
@@ -6479,130 +6479,8 @@ s%22)%0A - config.addinivalue_line(%0A %22markers%22,%0A %22validation: Long running tests that validate simulation output%22)%0A
e87adc4e1d2c191f7d72ba80c2fe048d9c392eeb
Test SCEs
pyxb/utils/xmlre.py
pyxb/utils/xmlre.py
# Copyright 2009, Peter A. Bigot # # 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 agreed to ...
Python
0
@@ -775,20 +775,133 @@ r):%0A -pass +def __init__ (self, position, description):%0A self.position = position%0A ValueError.__init__(description) %0A%0Adef Ma @@ -1009,16 +1009,38 @@ sition%5D%0A + np = position + 1%0A if ' @@ -1085,26 +1085,18 @@ ardEsc, +n p -osition+1 )%0A if @@ -1...
fd47b4c6554b4d0a631c8c6564500429bedc1747
Remove unused import
app/config/urls.py
app/config/urls.py
from django.conf import settings from django.conf.urls import include from django.contrib import admin from django.template.response import TemplateResponse from django.urls import re_path, path from django.views.generic import TemplateView, RedirectView from grandchallenge.core.views import comicmain from grandchalle...
Python
0.000001
@@ -177,17 +177,8 @@ port - re_path, pat
f58c83b0f635bff7d461d3392c25ae30d60445be
Test added and passing.
src/poioapi/tests/test_elan.py
src/poioapi/tests/test_elan.py
# -*- coding: utf-8 -*- # # Poio Tools for Linguists # # Copyright (C) 2009-2013 Poio Project # Author: António Lopes <alopes@cidles.eu> # URL: <http://media.cidles.eu/poio/> # For license information, see LICENSE.TXT import os import re from xml.dom import minidom from xml.etree.ElementTree import Element, SubElement...
Python
0
@@ -226,173 +226,54 @@ os%0A +%0A import -re%0Afrom xml.dom import minidom%0Afrom xml.etree.ElementTree import Element, SubElement, tostring%0Aimport xml.etree.ElementTree as ET%0A%0Afrom poioapi.io import elan +poioapi.io.elan%0Aimport poioapi.io.graf %0A%0Acl @@ -723,16 +723,27 @@ .elan = +poioapi.io. elan.Pa...
5b757b29b4ea69dcc4e432e7c54b92b241d8e3a0
Send proper HTTP headers for files
relaygram/http_server.py
relaygram/http_server.py
import http.server from threading import Thread import os.path class HTTPHandler: def __init__(self, config): self.config = config handler = HTTPHandler.make_http_handler(self.config['media_dir']) self.httpd = http.server.HTTPServer(('', self.config['media']['port']), handler) se...
Python
0
@@ -56,16 +56,32 @@ os.path%0A +import mimetypes %0A%0Aclass @@ -1260,30 +1260,342 @@ -self.send_response(200 +mimetype = mimetypes.guess_type(file_path)%0A%0A self.send_response(200)%0A if mimetype%5B0%5D:%0A self.send_header('Content-Ty...
c4e0c99ab14ba9ad3a5f5084798be0297a28865b
add decision_function to example
examples/decoding/plot_decoding_time_generalization.py
examples/decoding/plot_decoding_time_generalization.py
""" ========================================================== Decoding sensor space data with Generalization Across Time ========================================================== This example runs the analysis computed in: Jean-Remi King, Alexandre Gramfort, Aaron Schurger, Lionel Naccache and Stanislas Dehaene, "T...
Python
0.000014
@@ -1852,16 +1852,81 @@ dation', +%0A predict_type='decision_function', n_jobs=
8a39150dcfd3d1d2244563f9029fc24011381efa
Update tutorial_atari_pong.py
examples/reinforcement_learning/tutorial_atari_pong.py
examples/reinforcement_learning/tutorial_atari_pong.py
#! /usr/bin/python # -*- coding: utf-8 -*- """Monte-Carlo Policy Network π(a|s) (REINFORCE). To understand Reinforcement Learning, we let computer to learn how to play Pong game from the original screen inputs. Before we start, we highly recommend you to go through a famous blog called “Deep Reinforcement Learning: Po...
Python
0.000001
@@ -591,16 +591,20 @@ a batch, + but he stor @@ -625,34 +625,28 @@ for -a episode only, they store +only one episode and gra @@ -655,16 +655,8 @@ ents - instead . (s @@ -720,31 +720,9 @@ e.)%0A -FEEL FREE TO JOIN US ! %0A + TODO @@ -791,16 +791,16 @@ vation!%0A - - tensor @@ -815,16 +815,17 @@ ail.com%0A...
cf542d214cfe07b97c578cac1b1538e59ba7b408
Version bump
rbtools/__init__.py
rbtools/__init__.py
# # __init__.py -- Basic version and package information # # Copyright (c) 2007-2009 Christian Hammond # Copyright (c) 2007-2009 David Trowbridge # # 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 So...
Python
0
@@ -1364,17 +1364,17 @@ 'beta', -5 +6 , True)
436029de6194e05fd630a963604ee5a21917afd7
add readthedocs logo link to docs footer
readthedocs/conf.py
readthedocs/conf.py
import os import subprocess # in dependency order pkgs = ['pr_bgl','ompl_lemur','or_lemur','prpy_lemur'] for ipkg,pkg in enumerate(pkgs): # previous tagfiles tagfiles=' '.join(['_build/html/{p}.tag=../{p}'.format(p=p) for p in pkgs[:ipkg]]) # doxygen files fn_config = 'config.txt' fn_header = 'h...
Python
0
@@ -22,16 +22,194 @@ rocess%0A%0A +def multisplit(s, *needles):%0A ret = %5B%5D%0A for needle in needles:%0A pre,s = s.split(needle,1)%0A ret.append(pre)%0A ret.append(needle)%0A ret.append(s)%0A return ret%0A%0A # in dep @@ -1776,12 +1776,29 @@ a, -_ = +b,_,d,e = multisplit( head @@ -1799...
11702e33ed9f7493270f8750d475b4fea6fb0d8d
use .get()
Files/warranty_dell.py
Files/warranty_dell.py
import sys import time import random import requests import shared as config from uploader import Device42 try: requests.packages.urllib3.disable_warnings() except: pass class DELL(): def __init__(self, url, api_key, debug, retry, order_no): self.url = url self.api_key = api_ke...
Python
0
@@ -3918,26 +3918,39 @@ er in orders +%5B'purchases'%5D :%0A - @@ -4053,25 +4053,29 @@ = line_item -%5B +.get( 'line_end_da @@ -4069,33 +4069,33 @@ ('line_end_date' -%5D +) %0A @@ -4112,17 +4112,21 @@ ine_item -%5B +.get( 'line_st @@ -4130,25 +4130,25 @@ _start_date' -%5D +) %0A ...
196cf804fddb1f2943ddee60d0219b6c8dc4e439
Add email field to User model. We will use this field as the unique user identifier.
app/models/user.py
app/models/user.py
from app.models import Model from app.factory import mongodb import datetime from marshmallow import Schema, fields, ValidationError from flask import current_app, json from bson import ObjectId from app.helpers import generate_sid now = datetime.datetime.now() class User(Model): collection = mongodb.db.users ...
Python
0
@@ -1804,10 +1804,37 @@ ds.Str() +%0A email = fields.Email() %0A%0A
b75ac4d0cdb7d3181c26e4a989c71a2ed7ed17b1
Version bump
wagtailmodelchooser/__init__.py
wagtailmodelchooser/__init__.py
__version__ = '0.1.0'
Python
0.000001
@@ -14,9 +14,9 @@ '0. -1 +2 .0'%0A
f1b1536baa308b97cbd7e148c014e3a48ec08696
Refactor names pi_sqr_1_4, norma
wavelet_analyse/cuda_backend.py
wavelet_analyse/cuda_backend.py
# -*- coding: utf-8 -*- import numpy as np import pycuda.autoinit import pycuda.driver as cuda import pycuda.gpuarray as gpuarray from pycuda.elementwise import ElementwiseKernel from pyfft.cuda import Plan BACKEND = 'cuda' PI2 = 2 * np.pi gpu_morlet = ElementwiseKernel( 'pycuda::complex<float> *dest, ' 'f...
Python
0.000215
@@ -3368,16 +3368,25 @@ %22%0A%0A p +i_sqr_1_4 = 0.751 @@ -3570,16 +3570,20 @@ n +orma = norma @@ -3645,12 +3645,25 @@ = n - * p +orma * pi_sqr_1_4 * %5C
904e15ff00db59662681b4ae169f6aed0aba9dbc
update manage and populate to initialize questions.
web/project/project/settings.py
web/project/project/settings.py
"""Django settings for project project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
Python
0
@@ -876,89 +876,8 @@ 51', - '10.132.129.218', '10.42.143.118', '10.42.159.66', '10.42.143.116', '127.0.0.1', 'dh
bdc800f7dc00933cd8fec0fa6ea13bd0dfc1050d
fix wsgi
wsgi.py
wsgi.py
""" WSGI config for mong project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` set...
Python
0.000002
@@ -715,13 +715,8 @@ %22, %22 -mong. sett
094166d613d910e2a0c4a3e540b645bdbb3c5cf9
Remove unused imports, comment and executable flag
controller_manager/src/controller_manager/controller_manager_interface.py
controller_manager/src/controller_manager/controller_manager_interface.py
#! /usr/bin/env python # Wrappers around the services provided by MechanismControlNode import roslib; roslib.load_manifest('controller_manager') import sys import rospy from controller_manager_msgs.srv import * def list_controller_types(): rospy.wait_for_service('controller_manager/list_controller_types') s...
Python
0
@@ -20,144 +20,8 @@ hon%0A -# Wrappers around the services provided by MechanismControlNode%0A%0Aimport roslib; roslib.load_manifest('controller_manager')%0A%0Aimport sys%0A%0A impo
74fd7a24bdde74222dac0b4725947e27abdfb469
remove video before retrying
kalite_zim/utils.py
kalite_zim/utils.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import logging import os import urllib from colorlog import ColoredFormatter from django.conf import settings from fle_utils.videos import get_outside_video_urls from . import __name__ as base_path b...
Python
0
@@ -1591,16 +1591,58 @@ except:%0A + delete_download_garbage()%0A
a8b370a97c9545aa70896eae7d637b72ce75d6bc
reduce silly lengt constraint
relations/models.py
relations/models.py
from django.db import models from django.contrib.auth.models import Group, User from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from django.db.models.signals import post_save from core.models import Common class GroupCategory(models.Model): name = models.CharFi...
Python
0.998385
@@ -1374,9 +1374,9 @@ gth= -8 +3 0)%0A
ede774c9ee9ff8d3eb6093298eb7265a9e755f09
Make SIP recipe work with homebrew-installed PyQt:
py2app/recipes/sip.py
py2app/recipes/sip.py
""" Py2app support for project using sip, which basicly means PyQt and wrappers for other Qt-based libraries. This will include all C modules that might be used when you import a package using sip because we have no way to fine-tune this. The problem with SIP is that all inter-module depedencies (for example from PyQ...
Python
0.000021
@@ -1406,27 +1406,41 @@ r = -cfg.default_sip +os.path.dirname(cfg.pyqt_mod _dir +) %0A @@ -1838,32 +1838,81 @@ tdir(fullpath):%0A + if %22.py%22 not in sub:%0A @@ -1957,27 +1957,399 @@ sub -))%0A +.replace(%22.so%22,%22%22))) ...
e1975cef5457537bd3d2482d4286fb908f40f15d
add support for numpy objects
compss/programming_model/bindings/python/src/pycompss/util/serializer.py
compss/programming_model/bindings/python/src/pycompss/util/serializer.py
# # Copyright 2.02-2017 Barcelona Supercomputing Center (www.bsc.es) # # 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 requir...
Python
0.000002
@@ -1816,25 +1816,32 @@ ort -has_numpy_objects +object_belongs_to_module %0A%0Atr @@ -2208,32 +2208,83 @@ g order%0A %22%22%22%0A + if object_belongs_to_module(obj, 'numpy'):%0A return %5Bnump @@ -2304,17 +2304,16 @@ ll%5D%0A -# return %5B @@ -5155,18 +5155,40 @@ rializer -s( +_priority(numpy....