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
8ab94d992871ba010bbc215cadc9d468722d80ef
Refactor HealthTestView ‘get’ method to reduce number of function calls.
health_monitor/views.py
health_monitor/views.py
""" Copyright 2017 Gracenote 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 writ...
Python
0
@@ -5864,24 +5864,80 @@ entry = %7B%7D%0A + entry%5B'score'%5D = result.get_score()%0A @@ -6053,67 +6053,54 @@ ld)) -%0A entry%5B'score'%5D = result.get_score( + if field == 'time' else getattr(result, field )%0A
83459664b12a44d16c55104e81c989fd1cfb3764
Set the root context as current context during startup
src/asphalt/core/runner.py
src/asphalt/core/runner.py
from __future__ import annotations __all__ = ("run_application",) import asyncio import signal import sys from asyncio.events import AbstractEventLoop from concurrent.futures import ThreadPoolExecutor from logging import INFO, Logger, basicConfig, getLogger, shutdown from logging.config import dictConfig from typing ...
Python
0.001053
@@ -500,16 +500,34 @@ Context +, _current_context %0Afrom as @@ -4435,16 +4435,62 @@ mponent%0A + token = _current_context.set(context)%0A @@ -5610,16 +5610,75 @@ = e.code +%0A finally:%0A _current_context.reset(token) %0A%0A
7f2b3d91550fd6af46ee10e6c68c8633408b12ed
Revert revert to properly fix #125 without cruft. Sigh.
director/scripts/create_dev_projects.py
director/scripts/create_dev_projects.py
""" Create projects for the development database """ from django.conf import settings from accounts.models import Account from projects.models import Project def run(*args): # Ensure that this is only used in development assert settings.DEBUG # Assumes that there are at least 3 accounts accounts = ...
Python
0
@@ -116,16 +116,33 @@ Account +, AccountUserRole %0Afrom pr @@ -172,16 +172,140 @@ oject%0A%0A%0A +def random_account_member(account):%0A return AccountUserRole.objects.filter(account=account).order_by('?').first().user%0A%0A%0A def run( @@ -534,16 +534,68 @@ nts%5B0%5D,%0A + creator=random_account_memb...
0282c7eaecb32b736592c84cda1f7520c130c676
Update basic tests
test/basic.py
test/basic.py
import unittest from anser import Anser class BasicTest(unittest.TestCase): def setUp(self): pass def test_creation(self): server = Anser(__file__) self.assertEquals(server.name, __file__) def test_creation_explicit_no_debug(self): server = Anser(__file__, debug=False)...
Python
0
@@ -32,16 +32,24 @@ rt Anser +, Client %0A%0A%0Aclass @@ -54,16 +54,21 @@ ss Basic +Anser Test(uni @@ -89,44 +89,8 @@ ):%0A%0A - def setUp(self):%0A pass%0A%0A%0A @@ -197,17 +197,16 @@ ile__)%0A%0A -%0A def @@ -322,33 +322,32 @@ (server.debug)%0A%0A -%0A def test_cre @@ -442,33 +442,32...
0fb7a7197d46d52591b4c5ae0767ef98aeb14d94
fix a command line to run a script
src/pymyinstall/installhelper/install_venv_helper.py
src/pymyinstall/installhelper/install_venv_helper.py
""" @file @brief Helpers for virtualenv """ from __future__ import print_function import os import sys from .install_cmd_helper import run_cmd class VirtualEnvError(Exception): """ exception raised by the function implemented in this file """ pass def build_venv_cmd(params, posparams): """ ...
Python
0.000113
@@ -4731,17 +4731,17 @@ pt = %5B%22- -m +u %22, ppath @@ -6110,24 +6110,32 @@ = %22 %22.join( +%5Bexe%5D + script)%0A
db4d5263c38e95ad8c2e253512c563ea97b8772f
Fix adduser script first line
src/adduser.py
src/adduser.py
#!/usr/bin/env python # Licensed under the Apache 2.0 License ''' Add a user to the database Usage: adduser username password The environment variable LIGHTS_WEB_DATABASE must be set to the path of the database Created on Nov 13, 2014 @author: Gary O'Neall ''' import sys import sqlite3 from hashlib impor...
Python
0.000002
@@ -14,17 +14,16 @@ v python -%0D %0A# Licen @@ -381,21 +381,8 @@ SE'%0A -print DB_VAR%0A DB_P @@ -414,37 +414,8 @@ VAR) -%0Aprint DB_VAR + ':' + DB_PATH %0A%0D%0Ad @@ -575,26 +575,8 @@ ':%0D%0A - print 'hello'%0A
a04d97bd9bb62d15201d8cadd1fd3b24980d3507
Fix installation path generation for configuration file
t2u-driver-installer.py
t2u-driver-installer.py
import os PATH = os.getcwd() HOME = os.getenv('HOME') INSTALL_FILES = PATH+'/driver-files' DEV_DIR = HOME+'/test-install' PROD_DIR = '/etc' BIN_DIR = '/usr/bin/' print(('*'*25)+'\n') print() def take_input(): i = input("Please, disconnect all devices you're trying to install and press [I]: ") return i while...
Python
0
@@ -477,94 +477,43 @@ # C -omprobar si existe el directorio de destino de la configuracion y si no existe crearlo +heck for existing installation dirs %0A @@ -545,27 +545,28 @@ .path.isdir( -DEV +PROD _DIR + '/Wir @@ -570,27 +570,16 @@ Wireless -/RT2870STA/ '):%0A @@ -614,19 +614,20 @@ s.mkdir( -DEV +PRO...
3095124fd2484605e49a30dd43778f94e292e0c3
fix 'logger instance not found' fix : missing return on send_suback
nyamuk/bee.py
nyamuk/bee.py
''' @author : Iwan Budi Kusnanto <iwan.b.kusnanto@gmail.com> ''' import sys import nyamuk from MV import MV from mqtt_pkt import MqttPkt class Bee(nyamuk.Nyamuk): def __init__(self, sock, addr, conn_mgr, subs_mgr): nyamuk.Nyamuk.__init__(self) #from nyamuk self.sock = sock ...
Python
0.000001
@@ -211,16 +211,24 @@ subs_mgr +, logger ):%0A @@ -459,32 +459,61 @@ = addr%0A %0A + self.logger = logger%0A self.cm @@ -595,24 +595,100 @@ is bee%0A %0A + def loop(self, timeout = 1):%0A return self.packet_read()%0A %0A def pack @@ -3246,32 +3246,98 @@ lf.addr...
90b1aebe4b67ff9f221aee3b0c668f658d915537
Update bottlespin.py
bottlespin/bottlespin.py
bottlespin/bottlespin.py
import discord from discord.ext import commands from random import choice class Bottlespin: """Spins a bottle and lands on a random user.""" def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, no_pm=True, alias=["bottlespin"]) async def spin(self, ctx, role): ...
Python
0
@@ -350,37 +350,40 @@ -await self.bot.say(str( +roles = ctx.message.server. role -)) +s %0A @@ -383,36 +383,53 @@ les%0A role -s = +discord.utils.get( ctx.message.serv @@ -428,32 +428,83 @@ age.server.roles +, name = role%0A await self.bot.say(str(role)) %0A if role
fb6aa002e13a1d1205da28b20d419419067117f6
Implement basic genome crossover (#44, #36)
xentica/tools/genetics.py
xentica/tools/genetics.py
"""A collection of functions allowing genetics manipulations.""" def genome_crossover(*genomes): """ Crossover given genomes in stochastic way. :param genomes: A list of genomes (integers) to crossover :returns: Single integer, a resulting genome. """ raise NotImplementedError
Python
0.000011
@@ -63,245 +63,972 @@ %22%22%0A%0A -%0Adef genome_crossover(*genomes):%0A %22%22%22%0A Crossover given genomes in stochastic way.%0A%0A :param genomes: A list of genomes (integers) to crossover%0A%0A :returns: Single integer, a resulting genome.%0A%0A %22%22%22%0A raise NotImplementedError +from xent...
9efba71852ae06aaf7e0775fd7719a2d8cb1a26b
remove repair geometry until Esri fixes the bug in 2.6
scripts/nightly/update_fgdb.py
scripts/nightly/update_fgdb.py
# copies data from SGID to the app and makes necessary optimizations import logging import re from collections import namedtuple from os import path import arcpy import settings import spreadsheet from build_json import parse_fields from forklift.exceptions import ValidationException from settings import fieldnames f...
Python
0
@@ -3655,23 +3655,125 @@ e layer%0A +%0A + #: a bug in Pro 2.5.1 prevents this line from running, but will supposedly be fixed in 2.6%0A # arcpy.R
c0d79ba0420f6e0176e98266a02c60b1f53f4a93
apply same simplification to setfield
obj_update.py
obj_update.py
from __future__ import unicode_literals import logging import sys # for python 2/3 compatibility text_type = unicode if sys.version_info[0] < 3 else str logger = logging.getLogger('obj_update') def setfield(obj, fieldname, value): """Fancy setattr with debugging.""" old = getattr(obj, fieldname) if ol...
Python
0.000002
@@ -312,90 +312,81 @@ -if old is None and value is None:%0A changed = False%0A elif old is None and +old_repr = old if old is None else text_type(old)%0A new_repr = value if val @@ -395,86 +395,17 @@ is -not None -:%0A changed = True%0A else:%0A changed = text_type(old) != + e...
e08e50bcaa04f11d6cb3e015f19e704203939cff
fix issue#28
zaifbot/moving_average.py
zaifbot/moving_average.py
# moving_average.py import time from zaifapi import ZaifPublicApi from db import Tradelogs, MovingAverage import numpy as np PERIOD_SECS = {'1d': 86400, '12h': 43200, '8h': 28800, '4h': 14400, '1h': 3600, '1m': 60, '5m': 300, '15m': 900, '30m': 1800} def _check_tradelogs(currency_pair, period, length...
Python
0
@@ -261,16 +261,35 @@ : 1800%7D%0A +LIMIT_COUNT = 1000%0A %0A%0Adef _c @@ -3169,20 +3169,27 @@ , count= -1000 +LIMIT_COUNT , to_epo @@ -3257,31 +3257,8 @@ '):%0A - LIMIT_COUNT = 1000%0A
db4ed3026aae73f9ba8926f2ee11ccfe2d6b9a35
Tweak log level in TaskCompletionQueue.__aexit__
py/g1/asyncs/kernels/g1/asyncs/kernels/utils.py
py/g1/asyncs/kernels/g1/asyncs/kernels/utils.py
"""Utilities for external users.""" __all__ = [ # Task completion queue. 'Closed', 'TaskCompletionQueue', # In-memory stream. 'BytesStream', 'StringStream', ] import collections import io import logging from g1.bases.assertions import ASSERT from . import errors from . import locks LOG = lo...
Python
0
@@ -1988,14 +1988,12 @@ LOG. -warnin +debu g('t
29fa15c46aa18930219fd87c66c3fefcdfc5fa90
use gradient clipping, print running time
model/archaeological_features.py
model/archaeological_features.py
import os from datetime import datetime import numpy as np import sys from keras import Input from keras.callbacks import TensorBoard, EarlyStopping from keras.engine import Model from keras.layers import LSTM, TimeDistributed, Dense, Flatten from keras.optimizers import Adam from sklearn.metrics import accuracy_score...
Python
0
@@ -3,16 +3,38 @@ port os%0A +from time import time%0A from dat @@ -54,16 +54,27 @@ datetime +, timedelta %0A%0Aimport @@ -502,17 +502,17 @@ = '0.1. -6 +7 '%0ASCRIPT @@ -708,16 +708,38 @@ ain.npz' +%0ASCRIPT_START = time() %0A%0A# Hype @@ -1349,16 +1349,29 @@ ING_RATE +, clipnorm=1. )%0A%0Atrain @@ -1862,26 ...
60874bb237bfe8fc2c95499cf7fd37a868ff315c
Cache the image for four days(original is seven)
zhihudaily/views/utils.py
zhihudaily/views/utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from StringIO import StringIO from flask import send_file, g, Blueprint from zhihudaily.configs import Config from zhihudaily.crawler import Crawler utils = Blueprint('utils', __name__) @utils.before_app_reque...
Python
0.999999
@@ -1000,9 +1000,9 @@ *24* -7 +4 ),%0A
5fc17533d66fdaac2ea649578dac0b2feaee5464
fix build script
build_python.py
build_python.py
#!/usr/local/bin/python2.7 # load basic modules only import os, sys, platform, shutil, subprocess def go(): # check what OS we are on. if sys.platform.startswith('win'): if os.path.exists('C:\\Program Files (x86)\\'): programfiles_path = 'C:\\Program Files (x86)\\' else: ...
Python
0.000001
@@ -1014,17 +1014,21 @@ = ' -kill_proc +vc2008cleaner .spe
a1e5ffe0a6964d10f46e81f088e400ce4b192f94
fix param name returned
jmbo_analytics/utils.py
jmbo_analytics/utils.py
import time import uuid import random import urllib from hashlib import md5 from django.conf import settings from jmbo_analytics import CAMPAIGN_TRACKING_PARAMS VERSION = '4.4sh' COOKIE_NAME = '__utmmobile' COOKIE_PATH = '/' COOKIE_USER_PERSISTENCE = 63072000 CAMPAIGN_PARAMS_KEY = 'ga_campaign_params' def get_vis...
Python
0.000003
@@ -3615,16 +3615,20 @@ eturn %7B' +utm_ url': ut
35eadd561a47204c32627e26c5e6e64849e38f2e
improve enrico_config
enrico/config.py
enrico/config.py
"""Central place for config file handling""" import sys from os.path import join from configobj import ConfigObj, flatten_errors from extern.configobj.validate import Validator from environ import CONFIG_DIR def get_config(infile, configspec=join(CONFIG_DIR, 'default.conf')): """Parse config file, and in addition...
Python
0.000002
@@ -1469,16 +1469,30 @@ nfig():%0A + import os%0A %22%22%22M @@ -1653,16 +1653,27 @@ options + %5Bdefault%5D :')%0A @@ -1683,24 +1683,46 @@ fig%5B'out'%5D = + os.getcwd()%0A out = raw_input(' @@ -1737,20 +1737,125 @@ irectory -: ') + %5B'+config%5B'out'%5D+'%5D : ')%0A if not(out=='') :%0A ...
d8d8138c7e6ef7ca3a91cfb3affd342b0d6072ff
Add chronometer
report_py3o_fusion_server/models/py3o_report.py
report_py3o_fusion_server/models/py3o_report.py
# -*- coding: utf-8 -*- # © 2013 XCG Consulting <http://odoo.consulting> # © 2016 ACSONE SA/NV # © 2017 Therp BV <http://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import json import logging import os import requests import tempfile from contextlib import closing from openerp import ...
Python
0.000002
@@ -262,16 +262,46 @@ empfile%0A +from datetime import datetime%0A from con @@ -2805,16 +2805,191 @@ %5D = '1'%0A + url = report_xml.py3o_server_id.url%0A logger.info(%0A 'Connecting to %25s to convert report %25s to %25s',%0A url, report_xml.report_name, filetype)%0A @@...
b0970703d4df2a3072f267855fa348428d01fc93
allow configuration of repl. factor
pcassandra/dj18/tests/dj18test_app/settings.py
pcassandra/dj18/tests/dj18test_app/settings.py
""" Django settings for dj18tests project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ import os ...
Python
0.000023
@@ -516,16 +516,26 @@ %7B +%7B%0A 'class' @@ -554,16 +554,25 @@ rategy', +%0A 'replic @@ -591,19 +591,137 @@ ' : -1 %7D%0A %22%22%22 +%7Breplication_factor%7D%0A %7D%7D%0A %22%22%22.format(%0A replication_factor=os.environ.get('TEST_KEYSPACE_REPL_FACTOR', '1')%0A ) ...
89c3960298f315b448c2aee9dc04d073b6467c12
add notification to tasks
bzoing/tasks.py
bzoing/tasks.py
import datetime import pickle import os from functools import total_ordering from bzoing.playme import Playme import time import threading @total_ordering class Task(): """Defines tasks, their representation and ordering.""" def __init__(self, id, description, alarm, sound, function): self.id = id ...
Python
0.000001
@@ -132,16 +132,34 @@ reading%0A +import subprocess%0A %0A%0A@total @@ -304,16 +304,24 @@ function +, notify ):%0A @@ -431,24 +431,24 @@ = function%0A - self @@ -461,16 +461,45 @@ = sound +%0A self.notify = notify %0A%0A de @@ -1867,33 +1867,106 @@ w(), - sound=True, function=Non +%0A ...
c3587c23f6a5f34cf7bdc0a88b4057381f7752ac
add cascade delete table
flaskutils/test.py
flaskutils/test.py
from flaskutils import app from .models import FlaskModel from pgsqlutils.base import syncdb, Session class ModelTestCase(object): def setup(self): """ Use this test case when no interaction in a view is required """ syncdb() def teardown(self): Session.rollback() ...
Python
0.000001
@@ -762,16 +762,24 @@ from %7B%7D + cascade ;'.forma
750195a169edf643f66e072e0cbde154a787b62c
Fix a bunch of unicode problems in logging.
floo/common/msg.py
floo/common/msg.py
import os import time try: from . import shared as G assert G unicode = str python2 = False except ImportError: python2 = True import shared as G LOG_LEVELS = { 'DEBUG': 1, 'MSG': 2, 'WARN': 3, 'ERROR': 4, } LOG_LEVEL = LOG_LEVELS['MSG'] LOG_FILE = os.path.join(G.BASE_DIR, 'm...
Python
0.999987
@@ -334,16 +334,17 @@ log')%0A%0A%0A +%0A try:%0A @@ -418,16 +418,546 @@ pass%0A%0A%0A +def safe_print(msg):%0A # Some environments can have trouble printing unicode:%0A # %22When print() is not outputting to the terminal (being redirected to%0A # a file, for instance), print() decides that it doe...
e8f941aca9a111eb81c41e0be3a0c6591386083c
change way to get if celery should be used
flowjs/settings.py
flowjs/settings.py
from django.conf import settings # Media path where the files are saved FLOWJS_PATH = getattr(settings, "FLOWJS_PATH", 'flowjs/') # Remove the upload files when the model is deleted FLOWJS_REMOVE_FILES_ON_DELETE = getattr(settings, "FLOWJS_REMOVE_FILES_ON_DELETE", True) # Remove temporary chunks after file have been...
Python
0.000001
@@ -804,39 +804,50 @@ Y = -'celery' in settings.INSTALLED_APPS +getattr(settings, %22FLOWJS_USE_CELERY%22, False)%0A
c2798702a1f2b1dc40c10b481b9989f9a86c71b2
Fix indentation error in some helpers
helpers/fix_fathatan.py
helpers/fix_fathatan.py
# -*- coding: utf-8 -*- import os import re import argparse def fix_fathatan(file_path): with open(file_path, 'r') as file: lines = file.readlines() new_lines = [] for line in lines: new_lines.append(re.sub(r'اً', 'ًا', line)) file_path = file_path.split(os.sep) file_path[-1] = 'fixed_' + file_pat...
Python
0.000017
@@ -481,9 +481,10 @@ _':%0A -%09 + pars
080bccbf8b61edf9f3c9da4163497cc82e287db0
Update roll.py
roll.py
roll.py
import random, re #Update schema __url__ = 'https://raw.githubusercontent.com/KittyHawkIrc/modules/production/' + __name__ + '.py' __version__ = 1.0 # global variable for maximum length max_len = 378 # declare trigger def declare(): return {'roll': 'privmsg'} # response to trigger def callback(sel...
Python
0.000001
@@ -415,22 +415,10 @@ %22)%0D%0A - try:%0D%0A +%0D%0A @@ -460,20 +460,16 @@ ge%0D%0A - - match = @@ -500,28 +500,24 @@ ssage)%0D%0A - - # return rol @@ -526,20 +526,16 @@ result%0D%0A - valu @@ -570,16 +570,135 @@ ch%5B1%5D)%0D%0A + # raise error if length of roll_sum is...
5398f356cab1e98673c253849a1de2bb76fc537a
move lapse archival to staging
scripts/util/autolapses2box.py
scripts/util/autolapses2box.py
"""Send autolapse tar files to box for archival. Run from RUN_MIDNIGHT.sh for the previous date""" import datetime import os import stat import glob from pyiem.box_utils import sendfiles2box def main(): """Run for the previous date, please""" valid = datetime.date.today() - datetime.timedelta(days=1) no...
Python
0
@@ -24,19 +24,23 @@ iles to -box +staging for arc @@ -113,16 +113,34 @@ atetime%0A +import subprocess%0A import o @@ -181,25 +181,20 @@ iem. -box_ util -s import send @@ -189,29 +189,38 @@ import -sendfiles2box +logger%0A%0ALOG = logger() %0A%0A%0Adef m @@ -761,31 +761,19 @@ -print(%22autolapses2b...
f77d3728f5bcf34c396d5855054c679efa908f16
Update field names for school query (#731)
salesforce/management/commands/update_schools.py
salesforce/management/commands/update_schools.py
from django.core.management.base import BaseCommand from salesforce.models import School from salesforce.salesforce import Salesforce class Command(BaseCommand): help = "update schools from salesforce.com" def handle(self, *args, **options): with Salesforce() as sf: query = "SELECT Name, ...
Python
0
@@ -752,32 +752,24 @@ %22 -Current_ Students __c, %22 %5C @@ -756,24 +756,37 @@ %22Students +_Current_Year __c, %22 %5C%0A @@ -855,24 +855,32 @@ %22 +Savings_ Current_ Savings_ @@ -871,23 +871,20 @@ Current_ -Savings +Year __c, %22 %5C @@ -3107,24 +3107,16 @@ ol%5B' -Current_ Students _...
5bd8ac0fd94458836d3abbbac693b3970136d028
use LifoQueue for block replay
mediachain/transactor/blockchain_follower.py
mediachain/transactor/blockchain_follower.py
import threading import time from base58 import b58encode from Queue import Queue, Empty as QueueEmpty from mediachain.transactor.block_cache import get_block_cache from mediachain.proto import Transactor_pb2 # pylint: disable=no-name-in-module from mediachain.datastore.utils import ref_base58 from mediachain.rpc.util...
Python
0
@@ -75,16 +75,27 @@ t Queue, + LifoQueue, Empty a @@ -1016,32 +1016,36 @@ _replay_queue = +Lifo Queue()%0A
97a490db75f0a4976199365c3f654ba8cdb9a781
Test zip, and print format
01_Built-in_Types/tuple.py
01_Built-in_Types/tuple.py
#!/usr/bin/env python import sys import pickle # Check argument if len(sys.argv) != 2: print("%s filename" % sys.argv[0]) raise SystemExit(1) # Write tuples file = open(sys.argv[1], "wb"); line = [] while True: print("Enter name, age, score (ex: zzz, 16, 90) or quit"); line = sys.stdin.readline() ...
Python
0
@@ -41,16 +41,202 @@ pickle%0A%0A +# Test zip, and format in print%0Anames = %5B%22xxx%22, %22yyy%22, %22zzz%22%5D%0Aages = %5B18, 19, 20%5D%0A%0Apersons = zip(names, ages)%0A%0Afor name, age in persons:%0A print %22%7B0%7D's age is %7B1%7D%22.format(name, age)%0A%0A # Check
ba6ef8c9f0881e7236063d5372f64656df1b4bf0
rename package from 'motion_control' to 'kinesis'
msl/equipment/resources/thorlabs/__init__.py
msl/equipment/resources/thorlabs/__init__.py
""" Wrappers around APIs from Thorlabs. """ from .motion_control.motion_control import MotionControl from .motion_control.callbacks import MotionControlCallback
Python
0.000181
@@ -43,30 +43,23 @@ %22%0Afrom . -motion_control +kinesis .motion_ @@ -93,30 +93,23 @@ l%0Afrom . -motion_control +kinesis .callbac
ce56148d04725d3c9c5fd12fb42c44d05d41f774
append more option flags in goober's output
goober.py
goober.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.plugins.base import Plugin from nose.case import Test import logging import unittest import os log = logging.getLogger(__name__) class Goober(Plugin): """ After a multiprocess test run, print out a one-line command that will rerun all the failed / erro...
Python
0.000002
@@ -1082,16 +1082,296 @@ ober'%22)%0A + parser.add_option('--goober-extra',%0A action='store',%0A help=%22append additional nose options to goober's output (give comma separated). For example: --goober-extra=--with-xunit,--with-xcover,--xcoverage-file=coverage.x...
89fbd8ba88edfcbc4877f06434098f628cbc3f9d
Fix client
src/client.py
src/client.py
#!/usr/bin/env python3 import time from scapy.all import ls from tuntap import TunThread import dns import query from packet import Packet addr = '192.168.33.10' hostname = 'vpn.bgpat.net' class VPNClient(TunThread): daemon = True name = 'tun_client' addr = '192.168.200.2' gateway = '192.168.200.1' ...
Python
0.000001
@@ -50,16 +50,20 @@ l import + IP, ls%0Afrom @@ -551,20 +551,46 @@ - # print( +' ini +tialize', ini, ini.__dict__ )%0A @@ -676,42 +676,182 @@ -if query.Error(client.response.an. +while len(pkt):%0A rdata = client.response.an.rdata%0A if isinstance(rdata, bytes):%0A ...
a68f9e0e7f9d99e0052c6c01395dbb131c052797
remove k4
esproxy/views.py
esproxy/views.py
from django.http import HttpResponse, HttpResponseRedirect from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.shortcuts import render_to_response from settings import ELASTICSEARCH_PROXY, ELASTICSEARCH_REA...
Python
0.999691
@@ -1,20 +1,30 @@ +import os%0A from django.http imp @@ -324,16 +324,27 @@ RCH_REAL +,KIBANA_DIR %0A%0A%0Adef l @@ -911,19 +911,33 @@ pen( -'templates/ +os.path.join(KIBANA_DIR,%22 inde @@ -942,17 +942,18 @@ dex.html -' +%22) ).read() @@ -983,8 +983,9 @@ e(html)%0A +%0A
8cd2332871bd246352f23f286ae459c2cf399a35
allow classifier parameter to be configurable
sklearn/sklearn-template/template/trainer/model.py
sklearn/sklearn-template/template/trainer/model.py
# Copyright 2019 Google Inc. 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 applicable law or ...
Python
0.000001
@@ -904,118 +904,125 @@ :%0A -classifier = ensemble.RandomForestClassifier()%0A%0A # TODO(cezequiel): Make use of flags for hparams%0A _ = flags +# TODO: Allow pre-processing to be configurable through flags%0A classifier = ensemble.RandomForestClassifier(**flags) %0A%0A @@ -1836,16 +1836,30 @@ 'ignore' +, sp...
ad8ff0e8d280a8a0b3876382b63a1be4ad0784e5
increment version
version.py
version.py
# -*- coding: utf-8 -*- import platform name = "Fourth Evaz" version = (0, 1, 9) source = "https://github.com/shacknetisp/fourthevaz" def gitstr(): try: return "%s" % (open('.git/refs/heads/master').read().strip()[0:10]) except FileNotFoundError: return "" except IndexError: return...
Python
0.000004
@@ -75,9 +75,10 @@ 1, -9 +10 )%0Aso
185f174b6c1d50ad51987765f42e078a6081e5d3
Remove semi-colon
06-pipeline/tf-06.py
06-pipeline/tf-06.py
#!/usr/bin/env python import sys, re, operator, string # # The functions # def read_file(path_to_file): """ Takes a path to a file and returns the entire contents of the file as a string """ with open(path_to_file) as f: data = f.read() return data def filter_chars_and_normalize(str_da...
Python
0.999991
@@ -1830,9 +1830,8 @@ 1:%5D) -; %0A%0A#%0A
e5963987e678926ad8cdde93e2551d0516a7686b
Increase timeout for bench_pictures on Android
slave/skia_slave_scripts/android_bench_pictures.py
slave/skia_slave_scripts/android_bench_pictures.py
#!/usr/bin/env python # Copyright (c) 2012 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. """ Run the Skia bench_pictures executable. """ from android_render_pictures import AndroidRenderPictures from android_run_bench i...
Python
0.000011
@@ -479,16 +479,207 @@ tures):%0A + def __init__(self, args, attempts=1, timeout=4800):%0A super(AndroidBenchPictures, self).__init__(args, attempts=attempts,%0A timeout=timeout)%0A%0A def _D
d4e890a16fcb155c6df78d378b3ba9429590c74b
fix test
src/unittest/python/aws/kms_tests.py
src/unittest/python/aws/kms_tests.py
import unittest2 from boto.kms.exceptions import InvalidCiphertextException from cfn_sphere.aws.kms import KMS from mock import patch from cfn_sphere.exceptions import InvalidEncryptedValueException class KMSTests(unittest2.TestCase): @patch('cfn_sphere.aws.kms.kms.connect_to_region') def test_decrypt_value(s...
Python
0.000002
@@ -1,12 +1,27 @@ +import base64%0A%0A import unitt @@ -578,24 +578,48 @@ ith( -%22encryptedValue%22 +base64.b64decode(%22ZW5jcnlwdGVkVmFsdWU=%22) )%0A%0A
4ca3fa3a6692facf72bcf73033c9f92053e1fb30
Make missing MSR descriptions a documentation-build-breaker
service/docs/source/_ext/geopm_rst_extensions.py
service/docs/source/_ext/geopm_rst_extensions.py
# Copyright (c) 2015 - 2022, Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # """Add a Sphinx directive to import a json definition of MSR descriptions. Examples: * Render all MSRs in a json file .. geopm-msr-json:: ../../src/msr_data_arch.json * Render only signals .. geopm-msr-json:: ../../src/...
Python
0.000001
@@ -5316,76 +5316,116 @@ # -TODO: Promote from 'info' to 'error' after we ratchet down the count +Change from 'error' to 'info' if you ever need to make%0A # this a non-build-blocking check %0A @@ -5448,20 +5448,21 @@ logger. -info +error ('Missin @@ -5516,32 +5516,33 @@ ...
8e65b0bf3a2c703b452385e5919bdb7282275ff6
fix popen command
src/tasks/save.py
src/tasks/save.py
import couchdb import pyes from pymongo import Connection from celery.task import task from celery.log import get_default_logger import redis import requests from neo4jrestclient.client import GraphDatabase from pycassa.pool import ConnectionPool from pycassa.columnfamily import ColumnFamily from BeautifulSoup import B...
Python
0.00008
@@ -7310,16 +7310,30 @@ python +screenshot.py %7B0%7D %7B1%7D%22
1e7fba11a40c5f477e8a1482638a9bcaaf981348
Make hoomd.data.typeparam.TypeParameter picklable
hoomd/data/typeparam.py
hoomd/data/typeparam.py
from hoomd.data.parameterdicts import AttachedTypeParameterDict from copy import deepcopy class TypeParameter: def __init__(self, name, type_kind, param_dict): self.name = name self.type_kind = type_kind self.param_dict = param_dict def __getattr__(self, attr): try: ...
Python
0
@@ -61,56 +61,83 @@ ict%0A -from copy import deepcopy%0A%0A%0Aclass TypeParameter: +%0A%0Aclass TypeParameter:%0A __slots__ = ('name', 'type_kind', 'param_dict')%0A %0A @@ -313,24 +313,104 @@ elf, attr):%0A + if attr in self.__slots__:%0A return super().__getattr__(attr)%0A try: @@ -...
5af140148f1395e27b392f4236a552be2e81fc10
remove gen_frame()
vizgame.py
vizgame.py
import tables as tb import matplotlib.pyplot as plt from scipy import misc import matplotlib.cm as cm from matplotlib.widgets import Slider class Experience(tb.IsDescription): action = tb.IntCol(pos=1) reward = tb.IntCol(pos=2) def record(action, reward, frame, newfile=False): if not newfile: wi...
Python
0.000001
@@ -1225,107 +1225,8 @@ %5D%0A%0A%0A -def gen_image(frame, frame_number):%0A misc.imsave(%22frame%22 + str(frame_number) + %22.png%22, frame)%0A%0A%0A clas
8425a06fb270e18b7aa7b137cb99b43ce39a4b53
Fix bitrotted function call
haas.wsgi
haas.wsgi
#!/usr/bin/env python import haas.api from haas import config, model, server config.load('/etc/haas.cfg') config.configure_logging() config.load_extensions() server.api_server_init() from haas.rest import wsgi_handler as application
Python
0
@@ -162,19 +162,8 @@ ver. -api_server_ init
a2f389fa321ce2da4e12c10ac17c8b7004977efb
fix tests and conditions
rupypy/objects/stringobject.py
rupypy/objects/stringobject.py
from pypy.rlib.objectmodel import newlist_hint, compute_hash from pypy.rlib.rarithmetic import intmask from pypy.rlib.rerased import new_static_erasing_pair from rupypy.module import ClassDef from rupypy.modules.comparable import Comparable from rupypy.objects.objectobject import W_Object from rupypy.objects.exception...
Python
0
@@ -5794,24 +5794,18 @@ if -len( +not padstr -) is 0 :%0A @@ -5818,20 +5818,25 @@ -space.raise_ +raise space.error (spa @@ -5915,18 +5915,18 @@ padstr) -is +== 1:%0A
e64c9ef0212c9e28781d7bc9e667df4f3c46880a
Add timeing output to fxa import command
news/management/commands/process_fxa_data.py
news/management/commands/process_fxa_data.py
from __future__ import print_function, unicode_literals from email.utils import formatdate from django.conf import settings from django.core.cache import cache from django.core.management import BaseCommand, CommandError import babis import boto3 from apscheduler.schedulers.blocking import BlockingScheduler from dja...
Python
0.000002
@@ -84,16 +84,38 @@ rmatdate +%0Afrom time import time %0A%0Afrom d @@ -5016,24 +5016,48 @@ def main():%0A + start_time = time()%0A download @@ -5105,16 +5105,129 @@ data())%0A + total_time = time() - start_time%0A print('fxa_data: finished import in %25s minutes' %25 int(total_time / 60))%0A %0A%0Ac...
4c0788003c2e579d42200c6ce1da3cedd4dff152
Implement reading from and writing to mfrc522 registers
mfrc522/mfrc522.py
mfrc522/mfrc522.py
class MFRC522: MAX_LEN = 16 class Commands(Enum): PCD_IDLE = 0x00 PCD_AUTHENT = 0x0E PCD_RECEIVE = 0x08 PCD_TRANSMIT = 0x04 PCD_TRANSCEIVE = 0x0C PCD_RESETPHASE = 0x0F PCD_CALCCRC = 0x03 class Regi...
Python
0
@@ -1,12 +1,35 @@ +from enum import Enum%0A%0A class MFRC52 @@ -2589,8 +2589,1340 @@ = 0x3F%0A +%0A def __init__(self, spi_dev):%0A %22%22%22Initializes a MFRC522 module.%0A%0A spi_dev should be an object representing a SPI interface to which%0A the Reader is connected. It should have the fol...
b219823af7188f968d7c52c5273148c510bd7454
Simplify the ckernel pass a bit more
blaze/compute/air/frontend/ckernel_impls.py
blaze/compute/air/frontend/ckernel_impls.py
""" Lift ckernels to their appropriate rank so they always consume the full array arguments. """ from __future__ import absolute_import, division, print_function import datashape from pykit.ir import transform, Op #------------------------------------------------------------------------ # Run #----------------------...
Python
0.000001
@@ -1,95 +1,40 @@ %22%22%22%0A -Lift c +Convert ' kernel -s to their appropriate rank so they always consume the full array%0Aarguments +' Op to 'ckernel' .%0A%22%22 @@ -106,25 +106,8 @@ on%0A%0A -import datashape%0A from @@ -142,456 +142,120 @@ Op%0A%0A -#---------------------------------------------------------...
60dd476337ead3262daaa17ee4a973937cac380d
Add help for sites argument to manage.py scan
securethenews/sites/management/commands/scan.py
securethenews/sites/management/commands/scan.py
import json import subprocess from django.core.management.base import BaseCommand, CommandError from django.db import transaction from sites.models import Site, Scan def pshtt(domain): pshtt_cmd = ['pshtt', '--json', domain] p = subprocess.Popen( pshtt_cmd, stdout=subprocess.PIPE, s...
Python
0
@@ -1430,16 +1430,142 @@ fault='' +,%0A help=(%22Specify one or more domain names of sites to scan. %22%0A %22If unspecified, scan all sites.%22) )%0A%0A%0A
f60399e44afb49d4bab2016deff3992875fb5c8e
Correct some format of 8-1.
8-1policy_network.py
8-1policy_network.py
import numpy as np import tensorflow as tf import gym env = gym.make('CartPole-v0') env.reset() random_episodes = 0 reward_sum = 0 while random_episodes < 10: env.render() observation, reward, done, _ = env.step(np.random.randint(0, 2)) reward_sum += reward if done: random_episodes += 1 ...
Python
0.003769
@@ -76,16 +76,105 @@ ole-v0') +%0A'''from gym import wrappers%0Aenv = wrappers.Monitor(env, '/tmp/cartpole-experiment-1')''' %0A%0Aenv.re @@ -3707,17 +3707,16 @@ olved in - %22, episo @@ -3727,17 +3727,16 @@ umber, ' - episodes
bac39d2e4f1d17d74dc2ac7c6d16c702bbaeaed4
Include the server endpoint in log entries.
jsonrpcclient/server.py
jsonrpcclient/server.py
"""server.py""" import json import pkgutil import logging from requests import Request, Session from requests.exceptions import InvalidSchema, RequestException import jsonschema from jsonrpcclient import rpc from jsonrpcclient import exceptions logger = logging.getLogger(__name__) request_log = logging.getLogger(_...
Python
0
@@ -2707,32 +2707,75 @@ extra=%7B%0A + 'endpoint': self.endpoint,%0A @@ -3510,32 +3510,75 @@ extra=%7B%0A + 'endpoint': self.endpoint,%0A
36d219164b5e7332d72a980368badec9f86e5c5e
Update test_corpus.py
sacremoses/test/test_corpus.py
sacremoses/test/test_corpus.py
# -*- coding: utf-8 -*- """ Tests for corpus.py """ import sys import doctest import unittest from sacremoses.corpus import Perluniprops, NonbreakingPrefixes class CorpusTest(unittest.TestCase): def test_perluniprops_chars_sanity_check(self): perluniprops = Perluniprops() for category in perlun...
Python
0.000001
@@ -1993,17 +1993,17 @@ nguage)) -m +, %0A
53c6e1f1d0939b4c585301427920e0cf1dd9e341
Remove tabs.
panel/main.py
panel/main.py
import ibus import gtk import dbus import dbus.mainloop.glib import panel class PanelApplication: def __init__ (self): self._dbusconn = dbus.connection.Connection (ibus.IBUS_ADDR) self._dbusconn.add_signal_receiver (self._disconnected_cb, "Disconnected", dbus_interface = dbus.LOCAL_IFACE) self._p...
Python
0
@@ -385,21 +385,16 @@ Panel%22)%0A -%09%09%09%09%09 %0A%09%09self.
6bdc16e24e51d16b0fa214d30394317079bc90a9
Throw more user-friendly execption inside get_backend_instance method.
st2auth/st2auth/backends/__init__.py
st2auth/st2auth/backends/__init__.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0
@@ -773,16 +773,33 @@ cense.%0A%0A +import traceback%0A import j @@ -1417,24 +1417,86 @@ e):%0A %22%22%22%0A + Retrieve a class instance for the provided auth backend.%0A%0A :param n @@ -1542,24 +1542,97 @@ r%60%60%0A %22%22%22%0A +%0A LOG.debug('Retrieving backend instance for backend %22%25s%22' ...
212a9a901625605000210ec8c436c8f6e9be7c39
correct the log filename and handler
xutils/log.py
xutils/log.py
# -*- coding: utf-8 -*- import os import os.path import logging from logging.handlers import RotatingFileHandler def init(logger=None, level="INFO", file=None, handler_cls=None, process=False, max_count=30, propagate=True, file_config=None, dict_config=None): root = logging.getLogger() if not logge...
Python
0.000004
@@ -818,36 +818,8 @@ le)%0A - if ext:%0A @@ -889,97 +889,8 @@ xt)%0A - else:%0A file = %22%7B0%7D.%7B1%7D%22.format(filename, os.getpid())%0A @@ -1261,12 +1261,13 @@ .add -Filt +Handl er(h
7733fbcb83491c92dda082a76d9673b2382d1060
Enable dataset_splits to generate test-data using t2t-datagen
tensor2tensor/data_generators/bair_robot_pushing.py
tensor2tensor/data_generators/bair_robot_pushing.py
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
Python
0.000348
@@ -2182,32 +2182,339 @@ return True%0A%0A + @property%0A def dataset_splits(self):%0A %22%22%22Splits of data to produce and number of output shards for each.%22%22%22%0A return %5B%0A %7B%22split%22: problem.DatasetSplit.TRAIN, %22shards%22: 10%7D,%0A %7B%22split%22: problem.DatasetSplit.EVA...
b83b774f6651232afd828bf1ec2c489084832b52
Fix test
bluebottle/funding_pledge/tests/test_api.py
bluebottle/funding_pledge/tests/test_api.py
import json from django.core import mail from django.urls import reverse from rest_framework import status from bluebottle.funding.tests.factories import FundingFactory, DonationFactory from bluebottle.initiatives.tests.factories import InitiativeFactory from bluebottle.test.factory_models.accounts import BlueBottle...
Python
0.000004
@@ -593,16 +593,31 @@ Factory( +can_pledge=True )%0A
0e60c23ce6e40304437218151e895dcaf856f832
Update project version
billing/__init__.py
billing/__init__.py
__version__ = '1.6' __copyright__ = 'Copyright (c) 2020, Skioo SA' __licence__ = 'MIT' __URL__ = 'https://github.com/skioo/django-customer-billing'
Python
0
@@ -14,9 +14,9 @@ '1. -6 +7 '%0A__
6f6aeb99677fd510a13ca1abd4962b64763ca5ec
Update repo_metadata.py
gitmostwanted/tasks/repo_metadata.py
gitmostwanted/tasks/repo_metadata.py
from gitmostwanted.app import app, db, celery from gitmostwanted.models.repo import Repo, RepoMean from gitmostwanted.lib.github import api from sqlalchemy.sql import func, expression from datetime import datetime, timedelta @celery.task() def metadata_maturity(num_months): repos = Repo.query\ .filter(Rep...
Python
0.000002
@@ -2441,16 +2441,17 @@ worth %3C +- 5).delet
22fef4c07a28a96267e1d3f0390bc366790252a0
Use alias for nodejs_tool.
nodejs/def.bzl
nodejs/def.bzl
_js_filetype = FileType([".js"]) SCRIPT_TEMPLATE = """\ #!/bin/bash "{node_bin}" "{script_path}" """ def nodejs_binary_impl(ctx): ctx.file_action( ctx.outputs.executable, SCRIPT_TEMPLATE.format(node_bin=ctx.file._nodejs_tool.short_path, script_path=ctx.file.main_scri...
Python
0
@@ -1033,17 +1033,13 @@ %5D)%0A%0A -filegroup +alias (%0A @@ -1070,17 +1070,21 @@ -srcs = %5B%22 +actual = %22//: bin/ @@ -1088,17 +1088,16 @@ in/node%22 -%5D ,%0A)%0A%22%22%22%0A
26053737aa78301a9632add73af3b815323bc309
Version 0.2.5.
cmsplugin_footnote/__init__.py
cmsplugin_footnote/__init__.py
__version__ = (0, 2, 4) version_string = '.'.join(str(n) for n in __version__)
Python
0
@@ -18,9 +18,9 @@ 2, -4 +5 )%0Ave
e8540104547878e9f8360ba07ca0cbf1ee63e6ca
update Nottingham import script
polling_stations/apps/data_collection/management/commands/import_nottingham.py
polling_stations/apps/data_collection/management/commands/import_nottingham.py
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = "E06000018" addresses_name = "parl.2017-06-08/Version 1/Democracy_Club__08June2017 8.tsv" stations_name = "parl.2017-06-08/Version 1/Democracy_Club__08June2017...
Python
0
@@ -18,372 +18,978 @@ ion. -management.commands import BaseXpressDemocracyClubCsvImporter%0A%0A%0Aclass Command(BaseXpressDemocracyClubCsvImporter):%0A council_id = %22E06000018%22%0A addresses_name = %22parl.2017-06-08/Version 1/Democracy_Club__08June2017 8.tsv%22%0A stations_name = %22parl.2017-06-08/Versio...
17e8a6e72523cbfdecd97b50c0c1bc68863dd86d
update examples/buzz -- now available by invitation, and in 1:1
examples/buzz.py
examples/buzz.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, ...
Python
0
@@ -3481,13 +3481,13 @@ _ON_ -START +ENTER '%5D = @@ -3550,12 +3550,12 @@ _ON_ -STOP +EXIT '%5D = @@ -4083,12 +4083,15 @@ ine. -bond +get_bot (res
be5cbcf4cae5e6cc5d1d4f82c92193c8c9347432
Remove README from debian_service get_all()
salt/modules/debian_service.py
salt/modules/debian_service.py
''' Service support for Debian systems - uses update-rc.d and service to modify the system ''' # Import python libs import glob import re # Import salt libs import salt.utils from .systemd import _sd_booted def __virtual__(): ''' Only work on Debian and when systemd isn't running ''' if __grains__['...
Python
0
@@ -1463,24 +1463,26 @@ -ret.add( +service = line.spl @@ -1498,24 +1498,164 @@ init.d/')%5B1%5D +%0A # Remove README. If it's an enabled service, it will be added back in.%0A if service != 'README':%0A ret.add(service )%0A return @@ -1657,32 +1657,48 @@ eturn sorted(ret + + g...
6647025f3cb44818d0ff403160df35aa827516c7
refactor env var load
src/config.py
src/config.py
import os import sys import socket import platform import util import json import re APP = os.path.basename(sys.argv[0]) USER = os.environ.get('SUDO_USER') if not USER: USER = os.environ.get('USER') HOME = os.path.expanduser(f"~{USER}") HOME_ROOT = os.path.expanduser("~root") BASE_PATH = os.path.dirname(os.path....
Python
0.000062
@@ -153,57 +153,18 @@ SER' -)%0Aif not USER:%0A USER = os.environ.get( +, 'USER')%0A %0AHOM @@ -159,17 +159,16 @@ 'USER')%0A -%0A HOME = o
09234d3084739075e0aba59002419c341a59a47e
Correct import
setuptools/tests/test_msvc.py
setuptools/tests/test_msvc.py
""" Tests for msvc support module. """ import os import contextlib import distutils.errors import six import pytest try: from unittest import mock except ImportError: import mock from . import contexts # importing only setuptools should apply the patch __import__('setuptools') pytest.importorskip("distuti...
Python
0.000031
@@ -86,16 +86,39 @@ errors%0A%0A +from setuptools.extern import s
c13d83146ea89e813acc12a863a70ac82afec3a8
Use the correct encoding when passing the results to buildkite-agent
buildifier/buildifier.py
buildifier/buildifier.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import fnmatch import html import os.path import re import subprocess import sys regex = re.compile( r"(?P<filename>[^:]*):(?P<line>\d*):(?:(?P<column>\d*):)? (?P<message_id>[^:]*): (?P<message>.*) \((?P<message_url>.*)\)" ) def eprint(*args, **kwargs): """ ...
Python
0.000001
@@ -68,16 +68,30 @@ rt html%0A +import locale%0A import o @@ -823,16 +823,59 @@ t=output +.encode(locale.getpreferredencoding(False)) ,%0A )%0A
efacaa8a302133b938e933c61f29d9fa6dca0912
Version bump.
minion/__init__.py
minion/__init__.py
from minion.core import Application from minion.request import Response __version__ = "0.7.0"
Python
0
@@ -86,9 +86,9 @@ %220. -7 +8 .0%22%0A
24110636fd6eaae8962478c9f3e56c9da469be81
bump version to 0.9.0
zs/version.py
zs/version.py
# This file is part of ZS # Copyright (C) 2013-2014 Nathaniel Smith <njs@pobox.com> # See file LICENSE.txt for license information. # This file must be kept very simple, because it is consumed from several # places -- it is imported by zs/__init__.py, execfile'd by setup.py, etc. # We use a simple scheme: # 1.0.0 -...
Python
0.000001
@@ -1051,17 +1051,13 @@ __ = %220. -0 +9 .0 --dev %22%0A
14cf80f75426093fbb5c29656da6abf6c218eac5
Use environment's python
weather.py
weather.py
#!/usr/local/bin/python3 import requests import subprocess from datetime import date, timedelta from multiprocessing.dummy import Pool with open('metoffice_api_key') as keyfile: api_key = keyfile.read() weather_types = {'NA': 'Not available', 0: 'Clear night', 1: 'Sunny day', ...
Python
0.000637
@@ -4,18 +4,16 @@ usr/ -local/ bin/ +env pyth
b0b434f9aca014ad7ca0e722c461322222ab0007
remove unused imports
sevenbridges/meta/resource.py
sevenbridges/meta/resource.py
import os import copy import logging import six from sevenbridges.errors import SbgError from sevenbridges.http.client import HttpClient from sevenbridges.meta.data import DataContainer from sevenbridges.meta.fields import Field from sevenbridges.meta.transformer import Transform logger = logging.getLogger(__name__)...
Python
0.000001
@@ -1,14 +1,4 @@ -import os%0A impo @@ -78,56 +78,8 @@ ror%0A -from sevenbridges.http.client import HttpClient%0A from
970978b5355259fe943d5efed1b8b4ce945fdfa7
Debug control flow and exit on errors
weather.py
weather.py
#! /usr/bin/python2 from os.path import expanduser,isfile from sys import argv from urllib import urlopen location_path="~/.location" def location_from_homedir(): if isfile(expanduser(location_path)): with open(expanduser(location_path)) as f: return "&".join(f.read().split("\n")) else: ...
Python
0
@@ -56,28 +56,18 @@ ile%0A -from sys import -argv +sys %0Afro @@ -355,16 +355,35 @@ n_path)%0A + sys.exit(2) %0A%0Adef lo @@ -399,16 +399,25 @@ om_file( +location_ file):%0A @@ -452,16 +452,25 @@ anduser( +location_ file),'r @@ -533,16 +533,43 @@ ot found +%5CnLooking in home directory %22)%0A ...
a5eb71570c70109ab39285bdc108e54d27c54dba
Change Content-Encoding to gzip in memory_cache_http_server.
telemetry/telemetry/core/memory_cache_http_server.py
telemetry/telemetry/core/memory_cache_http_server.py
# Copyright (c) 2012 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 BaseHTTPServer from collections import namedtuple import mimetypes import os import SimpleHTTPServer import SocketServer import sys import zlib B...
Python
0.000163
@@ -216,16 +216,28 @@ edtuple%0A +import gzip%0A import m @@ -310,19 +310,24 @@ ort -sys +StringIO %0Aimport zlib @@ -322,20 +322,19 @@ %0Aimport -zlib +sys %0A%0A%0AByteR @@ -2181,15 +2181,12 @@ ', ' -deflate +gzip ')%0A @@ -5490,44 +5490,203 @@ -response = zlib.compress(response, 9 +sio = StringIO....
0da8123703355435425ecf4d6aa88a62cdcad7ba
Fix flake8 error.
mozillians/common/authbackend.py
mozillians/common/authbackend.py
import base64 import hashlib import json import re from django.db import transaction from django.conf import settings from django.contrib import messages from django.contrib.auth.models import User from cities_light.models import Country from mozilla_django_oidc.auth import OIDCAuthenticationBackend from waffle impor...
Python
0
@@ -2873,18 +2873,16 @@ 'value') - + %0A @@ -2898,24 +2898,26 @@ + + data.get('l
3472cad9c116caf9a7638d44c7edf5194ee8b228
Allow passing of deployment strategy to disco_deploy.py
bin/disco_deploy.py
bin/disco_deploy.py
#!/usr/bin/env python """ Deploys newly baked hostclasses Usage: disco_deploy.py [options] test --pipeline PIPELINE [--environment ENV] [--ami AMI | --hostclass HOSTCLASS] [--allow-any-hostclass] disco_deploy.py [options] update --pipeline PIPELINE --environment ENV [--a...
Python
0.000001
@@ -206,32 +206,74 @@ -any-hostclass%5D%0A + %5B--strategy STRATEGY%5D%0A disco_deploy @@ -402,32 +402,54 @@ w-any-hostclass%5D + %5B--strategy STRATEGY%5D %0A disco_deplo @@ -1599,16 +1599,124 @@ pipeline +%0A --strategy STRATEGY The deployment strategy to use. Currently supported...
6e024501b76beaccc2daa46f045f4e3444aa146b
update python client library example
examples/send.py
examples/send.py
#!/usr/bin/env python from alerta.client import Alert, ApiClient client = ApiClient() alert = Alert(resource='res1', event='event1') print alert print client.send(alert)
Python
0
@@ -28,21 +28,53 @@ alerta. -clien +api import ApiClient%0Afrom alerta.aler t import @@ -79,17 +79,23 @@ rt Alert -, +%0A%0Aapi = ApiClie @@ -100,29 +100,89 @@ ient -%0A%0Aclient = ApiClient( +(endpoint='http://localhost:8080', key='tUA6oBX6E5hUUQZ+dyze6vZbOMmiZWA7ke88Nvio' )%0A%0Aa @@ -194,16 +194,21 @@ = Ale...
ed31bbdf03f76967616fd272e5835d3ff313d81f
Update qlf_pipeline.py
bin/qlf_pipeline.py
bin/qlf_pipeline.py
import os import sys import logging import subprocess import datetime import glob import yaml import configparser from multiprocessing import Process, Manager from qlf_models import QLFModels # Project main directory qlf_root = os.getenv('QLF_ROOT') cfg = configparser.ConfigParser() try: cfg.read('%s/qlf/config/q...
Python
0
@@ -1585,17 +1585,16 @@ s ID: %25i -i started
cb69b004e46d8d08e6c2419c7e4a83383a14755b
remove reference-based infinite loop
shadho/backend/json/domain.py
shadho/backend/json/domain.py
from shadho.backend.base.domain import BaseDomain from shadho.backend.json.value import Value import uuid class Domain(BaseDomain): def __init__(self, id=None, domain=None, path=None, strategy=None, scaling=None, model=None, values=None, exhaustive=False, exhaustive_idx=None): ...
Python
0.000056
@@ -86,16 +86,68 @@ rt Value +%0Afrom shadho.backend.utils import InvalidObjectError %0A%0Aimport @@ -1482,58 +1482,8 @@ = %5B%5D - if values is None or len(values) == 0 else values %0A @@ -1776,17 +1776,20 @@ values.a -d +ppen d(value) @@ -1838,18 +1838,20 @@ ject -Class Error +(value) %0A%0A
00d006d280960228f249480e7af990cf7df39b59
remove useless function
jsonapi_utils/alchemy.py
jsonapi_utils/alchemy.py
# -*- coding: utf-8 -*- from sqlalchemy.sql.expression import desc, asc, text from jsonapi_utils.constants import DEFAULT_PAGE_SIZE def paginate_query(query, pagination_kwargs): """Paginate query result according to jsonapi rfc :param sqlalchemy.orm.query.Query query: sqlalchemy queryset :param dict pa...
Python
0.001107
@@ -1054,57 +1054,4 @@ ms)%0A -%0A%0Adef include_query(query, include_kwargs):%0A pass%0A
2bf4742656dca9ea3b5ad6fc2c215a09bfb32594
Fix the expected "Dot not know how to make" error message.
test/Win32/bad-drive.py
test/Win32/bad-drive.py
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
Python
0.000553
@@ -3265,32 +3265,50 @@ %25snot_mentioned' + (%25snot_mentioned) . Stop.%5Cn%22 %25 (b @@ -3298,32 +3298,43 @@ ). Stop.%5Cn%22 %25 ( +bad_drive, bad_drive),%0A
1f31ed22627cb1cf5b4323a18435bd9fb7fc7462
add trailing slash
web/url.py
web/url.py
from flask import Flask, render_template, jsonify, redirect, url_for from web.clasher import Clasher import os xml_file = 'https://s3.amazonaws.com/navishack/PC-00-COMP-BBC.xml.gz' clash_data = None app = Flask(__name__) app.debug = 'DEBUG' in os.environ @app.route('/') def index(): return redirect('/clash/') ...
Python
0.000008
@@ -1113,16 +1113,37 @@ /time')%0A +@app.route('/time/')%0A def time
4b3183ac17c9e4316afb535ddc408cd63aa5e2e1
Add solver registry metaclass
bulls_cows/bulls_cows.py
bulls_cows/bulls_cows.py
import argparse import itertools import logging import multiprocessing import random def get_response(guess, secret): bulls, cows = 0, 0 for g, s in zip(guess, secret): if g == s: bulls += 1 elif g in secret: cows += 1 return (bulls, cows) class Solver(object): def __init__(self, possib...
Python
0
@@ -267,29 +267,303 @@ )%0A%0A%0A -class Solver(object): +_solver_classes = set()%0A%0A%0Aclass SolverRegistry(type):%0A%0A def __init__(cls, name, bases, namespace):%0A super(SolverRegistry, cls).__init__(name, bases, namespace)%0A _solver_classes.add(cls)%0A _solver_classes.difference_update(bases)%0A%0A%0...
7c0d8823c849033f5177da92ac42cdea542bd425
allow passing custom application options to HomogenizationEngine
sfepy/homogenization/engine.py
sfepy/homogenization/engine.py
from copy import copy, deepcopy from sfepy.base.base import output, Struct from sfepy.applications import SimpleApp, Application from sfepy.fem.region import sort_by_dependency from coefs_base import MiniAppBase def insert_sub_reqs( reqs, levels, req_info ): """Recursively build all requirements in correct order....
Python
0.000001
@@ -61,16 +61,29 @@ output, + get_default, Struct%0A @@ -1634,33 +1634,32 @@ def __init__( - self, problem, o @@ -1665,16 +1665,34 @@ options, + app_options=None, %0A @@ -1705,18 +1705,15 @@ - volume - = += None @@ -1727,19 +1727,17 @@ t_prefix - = += 'he:', * @@ -1743,17 +1743,16 @@ **...
61a582e968bec7344255d68d143551e1e6c7b278
Use wraps to preserve name, fixes #55
huey/djhuey/__init__.py
huey/djhuey/__init__.py
""" This module contains a lot of cruft to handle instantiating a "Huey" object using Django settings. Unlike more flexible python apps, the huey django integration consists of a single global Huey instance configured via the settings module. """ import sys from django.conf import settings from django.db import close...
Python
0
@@ -241,16 +241,44 @@ le.%0A%22%22%22%0A +from functools import wraps%0A import s @@ -2928,16 +2928,31 @@ ase.%22%22%22%0A + @wraps(fn)%0A def
3dd84fc4dc6cff921329286485e287c13ebebdec
Update version.py
mirdata/version.py
mirdata/version.py
#!/usr/bin/env python """Version info""" short_version = "0.3" version = "0.3.4b0"
Python
0.000001
@@ -74,11 +74,11 @@ %220.3.4b -0 +1 %22%0A
32b287b9d22b22262d291fb7e352a3502fe2e68f
Fix Docker test to wait fixed time (#5858)
test/assembly/docker.py
test/assembly/docker.py
#!/usr/bin/env python import os import socket import subprocess as sp import sys import time def wait_for_port(port, host='localhost', timeout=30.0): start_time = time.time() while True: try: socket.create_connection((host, port), timeout=timeout) return except OSError...
Python
0.000715
@@ -92,494 +92,8 @@ me%0A%0A -%0Adef wait_for_port(port, host='localhost', timeout=30.0):%0A start_time = time.time()%0A while True:%0A try:%0A socket.create_connection((host, port), timeout=timeout)%0A return%0A except OSError as ex:%0A time.sleep(0.01)%0A ...
d8a27a94d90e5611b24c26c331a0016bbbb87af0
update debug set default to false
web/web.py
web/web.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # web # import os import flask import models app = flask.Flask(__name__) app.secret_key = 'some_secret' app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # max 16M #app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER def register_routers(): from routers import home a...
Python
0.000046
@@ -1059,16 +1059,69 @@ '5000'%0A +debug = os.getenv('DEBUG') in ('true', '1') or False%0A if __nam @@ -1184,12 +1184,13 @@ bug= -True +debug , ho
e46d60d1dbcff1d6801a452f56eb638312bd408c
Allow empty-named keys on nix
keyboard/nixkeyboard.py
keyboard/nixkeyboard.py
# -*- coding: utf-8 -*- import struct import traceback from time import time as now from collections import namedtuple from .keyboard_event import KeyboardEvent, KEY_DOWN, KEY_UP, normalize_name from .nixcommon import EventDevice, EV_KEY import os if os.geteuid() != 0: raise ImportError('You must be root to use th...
Python
0.000183
@@ -1587,24 +1587,53 @@ gular_name)%0A + if str_shifted_name:%0A shifted_ @@ -1684,24 +1684,108 @@ ifted_name)%0A + else:%0A shifted_name, is_keypad_shifted = regular_name, is_keypad_regular%0A assert i
776671187a31c860afa1c065549596716e7c6ce9
Work around Python 3.5 limitation
shipyard/templates/volumes.py
shipyard/templates/volumes.py
"""Build rule helpers for pod data volumes. Although strictly speaking volumes are a part of pods, their build process is quite different from pod's; so we put it in this separate module. """ __all__ = [ 'fill_tarball', ] import grp import io import pwd import tarfile from pathlib import Path from garage import...
Python
0.000402
@@ -3098,16 +3098,83 @@ ameter%5D%0A + # XXX %60gettarinfo%60 of Python 3.5 doesn't accept path-like.%0A @@ -3207,16 +3207,20 @@ fo(name= +str( content_ @@ -3223,16 +3223,17 @@ ent_path +) , arcnam @@ -4260,16 +4260,87 @@ ('*'):%0A%0A + # XXX %60gettarinfo%60 of Python 3.5 doesn't acce...
2383648a0f107de92ec47dd0977661514f8024dc
Version bump
exfi/__init__.py
exfi/__init__.py
""" Compute the splice graph from a transcriptome and raw genomic reads using bloom filters. """ __version__ = '1.5.0'
Python
0.000001
@@ -112,9 +112,10 @@ '1. -5.0 +4.13 '%0A
38f09decaeef91e52e765a3a1b0cf5cb03ee4747
Use a 10s timeout for requests to discourse
c2corg_api/views/user.py
c2corg_api/views/user.py
from functools import partial from pyramid.httpexceptions import HTTPInternalServerError from cornice.resource import resource from c2corg_api.models.user import User, schema_user, schema_create_user from c2corg_api.views import ( cors_policy, json_view, restricted_view, restricted_json_view, to_json_...
Python
0
@@ -785,15 +785,17 @@ %0A# 1 +0 second +s tim @@ -829,16 +829,109 @@ rse API%0A +# Using a large value to take into account a possible slow restart (caching)%0A# of discourse.%0A CLIENT_T @@ -940,16 +940,17 @@ EOUT = 1 +0 %0A%0A%0Adef v
6029a6144d7f3c19a3ed556f7429dac24e8d1a4e
Version update -> 1.4.4
exfi/__init__.py
exfi/__init__.py
""" Compute the splice graph from a transcriptome and raw genomic reads using bloom filters. """ __version__ = '1.4.3'
Python
0
@@ -114,7 +114,7 @@ 1.4. -3 +4 '%0A
fe2718af4ba5f5a47b2b2fc59962025466e3caf2
fix some coding errors
mrp_supplier_price/models/mrp.py
mrp_supplier_price/models/mrp.py
# -*- coding: utf-8 -*- # © 2016 Mikel Arregi Etxaniz - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api from openerp.addons import decimal_precision as dp class MrpProductionProductLine(models.Model): _inherit = 'mrp.production.product.line' @...
Python
0.000839
@@ -1036,20 +1036,73 @@ -self +for line in self.filtered('product_id'):%0A line .supplie @@ -1115,20 +1115,20 @@ omain = -self +line .product @@ -5580,24 +5580,41 @@ compute(self +, properties=None ):%0A r @@ -5660,16 +5660,37 @@ compute( +properties=properties )%0A
aea0d98fd7fb5eaa0fd547b5442af6984f8d78e0
fix bugs
exp/exp/tests.py
exp/exp/tests.py
from django.test import TestCase, RequestFactory import json from . import views_model, views_auth class SearchTestCase(TestCase): def setUp(self): self.factory = RequestFactory() def test_general_search(self): post_data = { 'search_query': 'tp3ks', 'query_specifier':...
Python
0.000001
@@ -495,22 +495,26 @@ onte -xt, safe=False +nt.decode('utf-8') )%0A%0A
b738dc7b888aa356e1b7a3dfeee9ff2ca4b14b9e
Add style option to mark_entities
metal/contrib/entity_classification/utils.py
metal/contrib/entity_classification/utils.py
def mark_entities(tokens, positions, markers=[]): """Adds special markers around tokens at specific positions (e.g., entities) Args: tokens: A list of tokens (the sentence) positions: 1) A list of inclusive ranges (tuples) corresponding to the token ranges of the entitie...
Python
0.000001
@@ -40,16 +40,32 @@ rkers=%5B%5D +, style=%22insert%22 ):%0A %22 @@ -680,16 +680,547 @@ ntions)%0A + markers: A list of strings (length of 2 * the number of entities) to%0A use as markers of the entities.%0A style: Where to apply the markers:%0A 'insert': Insert the markers as ...
95a3734b244a09837e58a5c649cda80e6b242cda
call super() with proper args in UpdateActView class
calebasse/actes/views.py
calebasse/actes/views.py
# -*- coding: utf-8 -*- import datetime from django.http import HttpResponseRedirect, HttpResponse from django.db.models import Q from django.shortcuts import redirect from calebasse.cbv import ListView, UpdateView, DeleteView from calebasse.agenda.views import NewAppointmentView from calebasse.agenda.models import ...
Python
0.000001
@@ -4344,24 +4344,27 @@ super(Update +Act View, self).
ebfac180c04d24ea8ff93583eac52e6c0bc8d553
Add contract test for 'v2' email notification
tests/app/public_contracts/test_GET_notification.py
tests/app/public_contracts/test_GET_notification.py
from . import return_json_from_response, validate_v0, validate from app.models import ApiKey, KEY_TYPE_NORMAL from app.dao.api_key_dao import save_model_api_key from app.v2.notifications.notification_schemas import get_notification_response from tests import create_authorization_header def _get_notification(client, n...
Python
0
@@ -671,35 +671,322 @@ _v2_ -notification(client, sample +sms_contract(client, sample_notification):%0A response_json = return_json_from_response(_get_notification(%0A client, sample_notification, '/v2/notifications/%7B%7D'.format(sample_notification.id)%0A ))%0A validate(response_json, get_notificatio...
fc6ad89460dca9e1e5b1a4effe14c868cafc0e54
add looping around math
test.py
test.py
__author__ = 'mike.lyons' print "Hello World!" x = raw_input("Enter any number: ") y = raw_input("Enter another number: ") try: x = float(x) y = float(y) except ValueError: x = 0.0 y = 0.0 print x+y print x/2 print y**2
Python
0.000027
@@ -41,16 +41,33 @@ World!%22%0A +%0Awhile True:%0A x = raw_ @@ -94,16 +94,20 @@ ber: %22)%0A + y = raw_ @@ -143,13 +143,21 @@ %22)%0A%0A + try:%0A + @@ -169,16 +169,20 @@ loat(x)%0A + y = @@ -190,16 +190,20 @@ loat(y)%0A + except V @@ -213,16 +213,20 @@ eError:%0A + ...
e33bbf8cfb7a6aa1a32ff99185f97582cfa60a78
support scans without scan parameter
silab_online_monitor/producer_sim/pybar_fei4.py
silab_online_monitor/producer_sim/pybar_fei4.py
''' This is a producer faking data coming from pyBAR by taking real data and sending these in chunks''' import time import numpy as np import tables as tb import zmq import logging from online_monitor.utils.producer_sim import ProducerSim class pyBarFEI4Sim(ProducerSim): def setup_producer_device(self): ...
Python
0
@@ -537,32 +537,108 @@ oot.raw_data%5B:%5D%0A + self.n_readouts = self.meta_data.shape%5B0%5D%0A%0A try:%0A self @@ -708,32 +708,36 @@ mes%0A + self.scan_parame @@ -774,24 +774,166 @@ rameters%5B:%5D%0A + except tb.NoSuchNodeError:%0A ...