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
9358060c648c0ee71498f173dcbf6fc839ba6ff8
Update expected release date
src/penn_chime/constants.py
src/penn_chime/constants.py
"""Constants.""" from datetime import date """ This reflects a date from which previously-run reports will no longer match current results, indicating when users should re-run their reports """ CHANGE_DATE = date(year=2020, month=4, day=6) VERSION = 'v1.1.3' DATE_FORMAT = "%b, %d" # see https://strftime.org DOCS_UR...
Python
0
@@ -236,9 +236,9 @@ day= -6 +8 )%0AVE
da6c8157e688c8c721bd66e5779ce6f550a5a7e2
remove useless code in PathPayment
stellar_sdk/operation/path_payment.py
stellar_sdk/operation/path_payment.py
import warnings from decimal import Decimal from typing import List, Union from .operation import Operation from ..asset import Asset from ..keypair import Keypair from ..xdr import Xdr from ..strkey import StrKey from .utils import check_ed25519_public_key, check_amount class PathPayment(Operation): """The :cla...
Python
0.000077
@@ -79,160 +79,88 @@ om . -operation import Operation%0Afrom ..asset import Asset%0Afrom ..keypair import Keypair%0Afrom ..xdr import Xdr%0Afrom ..strkey import StrKey +path_payment_strict_receive import PathPaymentStrictReceive %0Afrom . -utils +.asset import chec @@ -159,76 +159,58 @@ ort -check_ed25519_publi...
f126155a832ce1af26a09353338613727e319ac2
Fix worker stat parting
worker/worker.py
worker/worker.py
import os import os.path import stat import platform import tempfile from time import sleep import trueskill import zip import backend from compiler import * from sandbox import * import smtplib from email.mime.text import MIMEText import configparser parser = configparser.ConfigParser() parser.read("../halite....
Python
0.018142
@@ -3054,16 +3054,21 @@ for line +Index in rang @@ -3124,16 +3124,28 @@ s = line +s%5BlineIndex%5D .split(%22
0b6f3e85b5aa427125d6b4e8e4ee8223825c5c51
add more test cases
numpy/random/tests/test_random.py
numpy/random/tests/test_random.py
from numpy.testing import * from numpy import random import numpy as np class TestRegression(TestCase): def test_VonMises_range(self): """Make sure generated random variables are in [-pi, pi]. Regression test for ticket #986. """ for mu in np.linspace(-7., 7., 5): r = ...
Python
0
@@ -3924,33 +3924,33 @@ n array%0A -a +n = np.array(%5B10, @@ -3950,32 +3950,71 @@ ay(%5B10, 20, 5%5D)%0A + p = np.array(%5B0.4, 0.7, 0.2%5D)%0A%0A b = np.r @@ -4028,17 +4028,17 @@ inomial( -a +n , 0.4)%0A @@ -4069,24 +4069,172 @@ ape, (3,))%0A%0A + b = np.random.binomial(5, p)%0A...
2de30c0acdbcc2560ee7c9c472df956441cb2bab
use better filterType
nvchecker_source/vsmarketplace.py
nvchecker_source/vsmarketplace.py
# MIT licensed # Copyright (c) 2013-2021 Th3Whit3Wolf <the.white.wolf.is.1337@gmail.com>, et al. from nvchecker.api import ( VersionResult, Entry, AsyncCache, KeyManager, TemporaryError, session, GetVersionError, ) API_URL = 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' HEADERS = { ...
Python
0
@@ -735,10 +735,9 @@ e': -10 +7 ,%0A @@ -1196,16 +1196,17 @@ return version +%0A
355372ff51a84c0a6d7d86c0ef1fb12def341436
Add the score to Engine.chat return values
invada/engine.py
invada/engine.py
# -*- coding: utf-8 -*- class Engine: def __init__(self, response_pairs, knowledge={}): self.response_pairs = response_pairs self.knowledge = knowledge def chat(self, user_utterance, context): best_score = 0 best_response_pair = None ...
Python
0.000033
@@ -738,12 +738,29 @@ re -turn +sponse, new_context = bes @@ -804,28 +804,77 @@ d, context, self.knowledge)%0A + return response, new_context, best_score%0A
ef29e402c58751a938cb11cee480ac4f4e31aef5
Add warning
invoke/config.py
invoke/config.py
from .vendor.etcaetera.config import Config as EtcConfig from .vendor.etcaetera.adapter import File class Config(object): """ Invoke's primary configuration handling class. See :doc:`/concepts/configuration` for details on the configuration system this class implements, including the :ref:`configurat...
Python
0.000002
@@ -672,16 +672,243 @@ ig.foo%0A%0A + .. warning::%0A Any %22real%22 attributes (methods, etc) on %60Config%60 take precedence over%0A settings values - so if you e.g. have a top level setting named%0A %60%60load%60%60, you *must* use dict syntax to access it.%0A%0A Nest
e7154e767f3c82bc06e36aad4618a7518912144f
Decode the output text into a str
invoke/runner.py
invoke/runner.py
import os import pty import select import sys from .vendor import pexpect from .monkey import Popen, PIPE from .exceptions import Failure class Result(object): """ A container for information about the result of a command execution. `Result` instances have the following attributes: * ``stdout``: T...
Python
1
@@ -3916,16 +3916,44 @@ end(text +.decode(sys.stdout.encoding) )%0A
aa459c2db7f1995fda486ef80c30b541ff1895d8
Remove unnessesaty params
ocds/databridge/contrib/client.py
ocds/databridge/contrib/client.py
import requests import requests.adapters from gevent.pool import Pool import logging logger = logging.getLogger(__name__) class APIClient(object): def __init__(self, api_key, api_host, api_version, **options): self.base_url = "{}/api/{}".format(api_host, api_version) self.session = requests.S...
Python
0.000007
@@ -1308,29 +1308,16 @@ ender_id -, params=None ):%0A @@ -1400,31 +1400,16 @@ nder_id) -, params=params %0A @@ -1662,16 +1662,21 @@ in resp + if r %5D%0A%0A%0Adef
48cb3e901917c598294c5431c66efe6ed56e465a
set DEBUG to true
wsgi/settings.py
wsgi/settings.py
import os MONGO_HOST = os.getenv('OPENSHIFT_NOSQL_DB_HOST') MONGO_PORT = os.getenv('OPENSHIFT_NOSQL_DB_PORT') MONGO_USERNAME = os.getenv('OPENSHIFT_NOSQL_DB_USERNAME') MONGO_PASSWORD = os.getenv('OPENSHIFT_NOSQL_DB_PASSWORD') PRIV_KEY = os.getenv('OPENSHIFT_DATA_DIR') + '/server_private.pem' PUB_KEY = os.getenv('OPEN...
Python
0.999549
@@ -349,12 +349,26 @@ public.pem'%0A +%0ADEBUG = True%0A
99f45d201b3513096bf8ebe7c877c836d8e6611a
Add logging to web client
clients/web/rewebclient/rewebclient.py
clients/web/rewebclient/rewebclient.py
from flask import Flask, request, render_template, flash, redirect, url_for from reclient.client import ReClient, ReClientException import os DEBUG = False SECRET_KEY = 'CHANGE ME' app = Flask(__name__) app.config.from_object(__name__) app.config.from_envvar('REWEBCLIENT_SETTINGS', silent=True) app.config['RE_FRONT...
Python
0.000001
@@ -135,16 +135,31 @@ mport os +%0Aimport logging %0A%0ADEBUG @@ -383,11 +383,86 @@ one) - or +%0Aif app.config%5B'RE_FRONTEND_URL'%5D is None:%0A app.config%5B'RE_FRONTEND_URL'%5D = os. @@ -649,16 +649,249 @@ end!%22)%0A%0A +# Logging%0Aif app.config.get('LOG', None) is not None:%0A file_handler = logging...
bffb0c7fb099039afb444cfc641ae7b1978c59f8
Exit main script when no observations found
ircelsos/main.py
ircelsos/main.py
# -*- coding: utf-8 -*- """ Created on Wed Apr 07 23:11:39 2015 @author: Joris Van den Bossche """ from __future__ import print_function def main(): import argparse parser = argparse.ArgumentParser( prog='ircelsos', description='Download air quality data from the SOS of IRCEL - CELINE.') ...
Python
0
@@ -1271,16 +1271,54 @@ found') +%0A import sys%0A sys.exit() %0A%0A fo
641c7da63b2d7255ed3039d5c26574faa060b333
Stop altering the glance API URL
openstack_dashboard/api/glance.py
openstack_dashboard/api/glance.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
Python
0.000011
@@ -925,50 +925,8 @@ ings -%0Aimport six.moves.urllib.parse as urlparse %0A%0Aim @@ -1121,30 +1121,14 @@ -o = urlparse.urlparse( +url = base @@ -1157,52 +1157,8 @@ ge') -)%0A url = %22://%22.join((o.scheme, o.netloc)) %0A
8dcca03935514321a35f8aabe6e3367dfd8b802e
Version bump
jasy/__init__.py
jasy/__init__.py
# # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # """ **Jasy - Web Tooling Framework** Jasy is a powerful Python3-based tooling framework. It makes it easy to manage heavy web projects. Its main goal is to offer an API which could be used by developers to write their custom build/deployment script...
Python
0.000001
@@ -342,11 +342,18 @@ %221. -0.2 +1.0-alpha1 %22%0A__
e85e1021ae20ebecb344c592f60f2ad6607a1db1
refactor rename variables for clarity
src/main/python/pybuilder/plugins/filter_resources_plugin.py
src/main/python/pybuilder/plugins/filter_resources_plugin.py
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2014 PyBuilder Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/l...
Python
0.000002
@@ -1886,24 +1886,25 @@ er(object):%0A +%0A def __in @@ -1996,29 +1996,51 @@ -default_value +fallback_when_no_substitution_found = %22$%7B%25s @@ -2056,24 +2056,44 @@ +project_property_or_ fallback _value = @@ -2084,22 +2084,16 @@ fallback -_value = self. @@ -2121,22 +2121,109 @@ key, ...
ab49b0be58975156f96bd5340da8d06f5b8626a5
Change to batch_size = 64
tensorflow_examples/models/nmt_with_attention/distributed_test.py
tensorflow_examples/models/nmt_with_attention/distributed_test.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000689
@@ -1645,11 +1645,10 @@ e': -128 +64 %7D)%0A
dd800a1b0ea3dfc1043d3a9ba867d8634d512613
version 0.3.2
YesssSMS/const.py
YesssSMS/const.py
"""constants for YesssSMS.""" VERSION = "0.3.2a2" _UNSUPPORTED_CHARS_STRING = "<strong>Achtung:</strong> Ihre SMS konnte nicht \ versendet werden, da sie folgende ungültige Zeichen enthält:" _LOGIN_ERROR_STRING = "<strong>Login nicht erfolgreich" _LOGIN_LOCKED_MESS = "Wegen 3 ungültigen Login-Versuchen ist Ihr Account ...
Python
0.000003
@@ -43,10 +43,8 @@ .3.2 -a2 %22%0A_U
a59ec3963e0726c291dbde0d26a5f3468e88966c
Add call to audit_orders from cli.py.
2017-code/cli.py
2017-code/cli.py
# cli.py # Ronald L. Rivest (with Karim Husayn Karimi) # July 22, 2017 # python3 """ Command-line parser and dispatch """ import argparse import multi import election_specification import ids import audit import reported ############################################################################## # Command-lin...
Python
0
@@ -3135,24 +3135,69 @@ ke_orders%22)%0A + audit_orders.compute_audit_orders(e)%0A elif arg
75c6a6d602d7a9ce5bbad076eefcd8ecb60e88ed
Set un-compile-able working_scope error message to CRITICAL
AutoSetSyntax.py
AutoSetSyntax.py
import logging import os import re import sublime import sublime_plugin import sys sys.path.insert(0, os.path.dirname(__file__)) from SyntaxMappings import SyntaxMappings PLUGIN_NAME = 'AutoSetSyntax' PLUGIN_DIR = "Packages/%s" % PLUGIN_NAME PLUGIN_SETTINGS = PLUGIN_NAME + '.sublime-settings' LOG_LEVEL_DEFAULT = 'I...
Python
0.000406
@@ -2315,21 +2315,24 @@ logger. -error +critical (errorMe
ab22a41382f739313d8e5484b4f3d54745e0a888
Removed urllib2 import. should fix #1
BitcoinTicker.py
BitcoinTicker.py
import sublime import sublime_plugin try: from urllib.request import urlopen from urllib.parse import urlparse import urllib2 except ImportError: from urlparse import urlparse from urllib import urlopen import json import re class BitcoinTicker(sublime_plugin.EventListener): def check_for_calc(self): ...
Python
0.999632
@@ -113,25 +113,8 @@ rse%0A - import urllib2%0A exce
11e0bf0c39893077b18a0c395f23e42751cf7b44
Update model documentation
Luna/Model.py
Luna/Model.py
#!/usr/bin/env python #This is free and unencumbered software released into the public domain. # #Anyone is free to copy, modify, publish, use, compile, sell, or distribute this #software, either in source code form or as a compiled binary, for any purpose, #commercial or non-commercial, and by any means. # #In jurisd...
Python
0
@@ -1334,17 +1334,17 @@ m.%0A%0A -For a saf +To use th e mo @@ -1357,187 +1357,400 @@ stem -, every model should follow the following rules:%0A- All data must be private inside a class (with field names starting with two%0A underscores).%0A- All functions that change + properly, the following code changes are requi...
df0434112364e984cff3fc6d00ea53335d90477a
Fix caclulation of lambda. Lambda should use B_theta at edge, here called b_theta_vacuum.
external_stability.py
external_stability.py
# -*- coding: utf-8 -*- """ Created on Mon Sep 08 20:42:30 2014 @author: Jens von der Linden """ from __future__ import print_function from __future__ import division from __future__ import absolute_import from future.builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map,...
Python
0.000002
@@ -4553,22 +4553,22 @@ b_theta_ -plasma +vacuum / (b_z*
93ad5396bb1d574c86a6b3323199e75fe3bb34f4
implement protection for non existing directories
PyAnalysisTools/base/ShellUtils.py
PyAnalysisTools/base/ShellUtils.py
import shutil import os import subprocess def make_dirs(path): path = os.path.expanduser(path) if os.path.exists(path): return try: os.makedirs(path) except OSError as e: raise OSError def resolve_path_from_symbolic_links(symbolic_link, relative_path): def is_symbolic_lin...
Python
0
@@ -1052,24 +1052,72 @@ afe=False):%0A + if not os.path.exists(path):%0A return%0A if safe:
188affe12f31973741ae9b429d8aed757fff0d85
Fixing timestamp = sec * 1000
rockmylight/rockmylight/rml/views.py
rockmylight/rockmylight/rml/views.py
from django.shortcuts import render from django.http import JsonResponse import time # Create your views here. def main(request): context = {} return render(request, 'rml/main.html', context) def jam(request): context = {} return render(request, 'rml/jam.html', context) # API part INTERVAL = 0.5 ...
Python
0.998776
@@ -878,16 +878,17 @@ amp'%5D = +( start_ti @@ -894,15 +894,8 @@ ime -* 1000 + fr @@ -914,16 +914,24 @@ INTERVAL +) * 1000 %0A
bd3af9f250dc49a0872447b57493c69ba6dad09c
Fix encoding
RadioBox/RadioBox/player/player.py
RadioBox/RadioBox/player/player.py
import vlc import urllib2 import threading class Player: """Represent radio Player.""" def __init__(self): self.vlc_player = None self.error_callback = None self.title_recieved_callback = None self.media_state_changed_callback = None self._init_vlc_player() def _i...
Python
0.998377
@@ -2126,31 +2126,16 @@ (%22'%22)%5B1%5D -.encode('utf8') %0A%0A @@ -2434,23 +2434,8 @@ ader -.encode('utf8') )%0A
fc48d25a4fa5b3b623e2796ce6ddb3aa40e99163
Add test for drift vector C lib
CDJSVis/tests/test_filtering.py
CDJSVis/tests/test_filtering.py
""" Unit tests for filtering C module """ import unittest import numpy as np from ..filtering import _filtering ################################################################################ class TestSpecieFilterC(unittest.TestCase): """ Test specie filter """ def test_specieFilter(self):...
Python
0
@@ -215,17 +215,16 @@ ieFilter -C (unittes @@ -3512,8 +3512,875 @@ %5B6%5D, 9)%0A +%0A################################################################################%0A%0Aclass TestCalculateDrift(unittest.TestCase):%0A %22%22%22%0A Test calculate drift vector%0A %0A %22%22%22%0A def test_calculateDri...
632f70d64bac45365974db834a3a6ddcb16e13ad
Add GuardianModelMixin in users/models.py
feder/users/models.py
feder/users/models.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib.auth.models import AbstractUser from django.utils.encoding import python_2_unicode_compatible # from django.db import models # from django.utils.translation import ugettext_lazy as _ @python_2_unicode_compatible cla...
Python
0
@@ -193,98 +193,54 @@ ble%0A -%0A%0A# from -django.db import models%0A# from django.utils.translation import ugettext_lazy as _ +guardian.mixins import GuardianUserMixin%0A %0A%0A@p @@ -277,16 +277,35 @@ ss User( +GuardianUserMixin, Abstract
1386527d268b99aac41ee8ddb047d60fe4948274
Modify exception handler
appkit/app.py
appkit/app.py
#!/usr/bin/env python # coding=utf8 from gi.repository import Gtk, WebKit import urlparse import os import tempfile import mimetypes import codecs import sys import re Gtk.init('') class UrlMappingError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(...
Python
0.000002
@@ -181,158 +181,8 @@ )%0A%0A%0A -class UrlMappingError(Exception):%0A def __init__(self, value):%0A self.value = value%0A%0A def __str__(self):%0A return repr(self.value)%0A%0A%0A clas @@ -2347,12 +2347,11 @@ st) -== 0 +%3E 1 :%0A @@ -2370,36 +2370,38 @@ ise -UrlMappingError('Can%5C't find...
81b2519f575d35d2f1b735bcaef1901539ee06fa
refactor mgmt cmd update-toplist to use just CouchDB
mygpo/directory/management/commands/update-toplist.py
mygpo/directory/management/commands/update-toplist.py
from datetime import datetime from django.core.management.base import BaseCommand from couchdbkit import ResourceConflict from mygpo.core.models import Podcast, SubscriberData from mygpo.users.models import PodcastUserState from mygpo.utils import progress, multi_request_view from mygpo.decorators import repeat_on_c...
Python
0
@@ -81,49 +81,8 @@ nd%0A%0A -from couchdbkit import ResourceConflict%0A%0A from @@ -215,28 +215,8 @@ ress -, multi_request_view %0Afro @@ -328,24 +328,75 @@ *options):%0A%0A + # couchdbkit doesn't preserve microseconds%0A star @@ -414,103 +414,81 @@ ime. +utc now() -%0A entries = multi_req...
689ac4c7bea84cbebe2c0183d70cf78ecd64bdc7
fix pylint error
tensorflow/python/keras/layers/preprocessing/text_vectorization_distribution_test.py
tensorflow/python/keras/layers/preprocessing/text_vectorization_distribution_test.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000002
@@ -1547,52 +1547,8 @@ ion%0A -from tensorflow.python.platform import test%0A %0A%0A@d
98c0d5ffbf16f7ef35f366370ab2c7e0d719d84e
change timezone
hbapi/settings/base.py
hbapi/settings/base.py
""" Django settings for hbapi project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os impo...
Python
0.00006
@@ -3066,11 +3066,25 @@ = ' -UTC +America/Vancouver '%0A%0AU
54f8c9e50cdd24532b6c9fe5e6fdf410b60dc79f
Change to fresh environment before loading bmis.
bmibabel/build.py
bmibabel/build.py
#! /usr/bin/env python """Build a BMI implementation.""" from __future__ import print_function import os import sys import types import subprocess import yaml from scripting.contexts import setenv, homebrew_hidden from .fetch import load_bmi_components from .files import install_data_files from .utils import cd, re...
Python
0
@@ -3450,16 +3450,58 @@ 'bin'), + # '/usr/local/gfortran/bin',%0A '/usr/b @@ -4506,16 +4506,201 @@ nstall%0A%0A + with homebrew_hidden():%0A with setenv(setup_build_env(prefix)):%0A for k, v in os.environ.items():%0A print('%7Bkey%7D=%7Bval%7D'.format(key=k, val=v))%...
85761d00814d1835ace72adb13a43b07b1f5536d
Fix issue #18, don't follow symlinks by default
botbot/checker.py
botbot/checker.py
"""Base class for checking file trees""" import stat import os import time from botbot import problist as pl class Checker: """ Holds a set of checks that can be run on a file to make sure that it's suitable for the shared directory. Runs checks recursively on a given path. """ # checks is a ...
Python
0
@@ -1093,24 +1093,36 @@ e(self, path +, link=False ):%0A %22 @@ -1705,16 +1705,98 @@ if +not link and is_link(chk_path):%0A continue%0A elif stat.S_I @@ -2865,17 +2865,16 @@ tWriter%0A -%0A
48e09e446943b695cc7208bc2a7cad7e53437957
Bump to 0.1.1 since I apparently pushed 0.1.0 at some point =/
botox/__init__.py
botox/__init__.py
__version__ = "0.1.0"
Python
0
@@ -12,11 +12,11 @@ = %220.1. -0 +1 %22%0A
b56eb07e06c41dd46d7adaeb0a9b9863c3e165c6
Fix mono
executors/mono_executor.py
executors/mono_executor.py
import sys import os import re import errno from collections import defaultdict from cptbox import CHROOTSecurity, ALLOW from cptbox.syscalls import * from .base_executor import CompiledExecutor from judgeenv import env CS_FS = ['.*\.so', '/proc/(?:self/|xen)', '/dev/shm/', '/proc/stat', '/usr/lib/mono', '/...
Python
0.000018
@@ -3440,16 +3440,30 @@ lize(cls +, sandbox=True ):%0A @@ -3620,10 +3620,25 @@ tialize( +sandbox=sandbox )%0A
7b46291dcfd4dd77fd4b41f22d1a382dac722c4a
allow store_temp_file to take a file-like object for chunked copy
lib/cuckoo/common/utils.py
lib/cuckoo/common/utils.py
# Copyright (C) 2010-2012 Cuckoo Sandbox Developers. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import os import ntpath import string import tempfile import xmlrpclib from datetime import datetime from lib.cuckoo.common.exceptions import ...
Python
0
@@ -2709,24 +2709,258 @@ , %22wb%22)%0A +%0A # if filedata is file object, do chunked copy%0A if hasattr(filedata, 'read'):%0A chunk = filedata.read(1024)%0A while chunk:%0A tmp_file.write(chunk)%0A chunk = filedata.read(1024)%0A else:%0A tmp_file.wri @@ -2972,...
68b1b9d824da9225b8b568348a56d5770195d8f8
Fix method with classmethod
openassessment/xblock/openassesment_template_mixin.py
openassessment/xblock/openassesment_template_mixin.py
class OpenAssessmentTemplatesMixin(object): """ This helps to get templates for different type of assessment that is offered. """ @classmethod def templates(cls): """ Returns a list of dictionary field: value objects that describe possible templates. VALID_ASSESSMENT_TY...
Python
0
@@ -749,16 +749,33 @@ plates%0A%0A + @classmethod%0A def
c966f50fb63875fed88cf00a6e793796c315577e
Change default Balancer.{x,y,z} to True
hoomd/tuner/balance.py
hoomd/tuner/balance.py
from hoomd.operation import _Tuner from hoomd.parameterdicts import ParameterDict from hoomd.typeconverter import OnlyType from hoomd.util import trigger_preprocessing from hoomd.trigger import Trigger from hoomd import _hoomd class LoadBalancer(_Tuner): R""" Adjusts the boundaries of a domain decomposition on a ...
Python
0.999991
@@ -4070,30 +4070,27 @@ , x= -Fals +Tru e, y= -Fals +Tru e, z= -Fals +Tru e, t
f3be05b95d7692d0891ee80d3d9c8fb87810dc5c
update unit test
every_election/apps/api/tests/test_api_election_endpoint.py
every_election/apps/api/tests/test_api_election_endpoint.py
import json from datetime import datetime, timedelta import vcr from rest_framework.test import APITestCase from elections.tests.factories import ElectionFactory from organisations.tests.factories import ( OrganisationFactory, OrganisationDivisionFactory) class TestElectionAPIQueries(APITestCase): lat = 51....
Python
0
@@ -6531,16 +6531,54 @@ ion_id%22: + null,%0A %22metadata%22: null%0A @@ -6654,11 +6654,8 @@ %22%22%22)%0A -%0A%0A%0A
fa0b16b46fe014be9009bc595bee719cc1fdcc31
don't divide by zero
apps/amo/management/commands/clean_redis.py
apps/amo/management/commands/clean_redis.py
import logging import os import socket import subprocess import sys import tempfile import time from django.core.management.base import BaseCommand import redisutils import redis as redislib log = logging.getLogger('z.redis') # We process the keys in chunks of size CHUNK. CHUNK = 3000 # Remove any sets with less th...
Python
0.999407
@@ -2225,16 +2225,35 @@ 100, 1) + if total%5B0%5D else 0 %0A
69582dd80518ccc29fc8de9cf5bff54caf62468b
Truncate to exact length
src/sentry/utils/strings.py
src/sentry/utils/strings.py
""" sentry.utils.strings ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import base64 import zlib def truncatechars(value, arg): """ Truncates a string after a certain number of chars. Argument: Number of ...
Python
0.000002
@@ -529,16 +529,20 @@ %5B:length + - 3 %5D + '...
81543597b6ac33d46615cca4f66683a0e03e384b
Set username better
fabric/testing/fixtures.py
fabric/testing/fixtures.py
""" `pytest <https://pytest.org>`_ fixtures for easy use of Fabric test helpers. To get Fabric plus this module's dependencies (as well as those of the main `fabric.testing.base` module which these fixtures wrap), ``pip install fabric[pytest]``. The simplest way to get these fixtures loaded into your test suite so Py...
Python
0.000013
@@ -1323,17 +1323,96 @@ ifically -, +:%0A%0A - the hostname is set to %60%60%22host%22%60%60 and the username to %60%60%22user%22%60%60;%0A - the pri @@ -1447,20 +1447,16 @@ on.run%60, -%0A %60.Conne @@ -1477,16 +1477,22 @@ etc) are +%0A replace @@ -1525,27 +1525,19 @@ nces -.%0A +; %0A -Fu...
a8fb92840ff487c61564175efbf637fec538b480
Add signup view to fix error
features/gestalten/urls.py
features/gestalten/urls.py
from allauth.socialaccount import views as socialaccount_views from allauth.socialaccount.providers.facebook import views as facebook_views from django.conf.urls import url from . import views urlpatterns = [ url( r'^stadt/gestalten/$', views.List.as_view(), name='gestalten'), url( ...
Python
0
@@ -1064,24 +1064,133 @@ n_error'),%0A%0A + url(r'%5Estadt/login/signup/$',%0A socialaccount_views.signup,%0A name='socialaccount_signup'),%0A%0A url(r'%5Es
1d52996a88eb5aed643fe61ee959bd88373401b3
Throw a linebreak in there upon completion
filebutler_upload/utils.py
filebutler_upload/utils.py
from datetime import datetime, timedelta import sys class ProgressBar(object): def __init__(self, filename, fmt): self.filename = filename self.fmt = fmt self.progress = 0 self.total = 0 self.time_started = datetime.now() self.time_updated = self.time_started d...
Python
0.000003
@@ -406,16 +406,56 @@ = total +%0A final_update = current == total %0A%0A @@ -518,16 +518,32 @@ nds=0.5) + or final_update :%0A @@ -755,16 +755,86 @@ output)%0A +%0A if final_update:%0A sys.stdout.write('%5Cn')%0A%0A
fba588f2df41a698adcf96382856c1fa80c191a7
change genexp back to list comprehension in multinomial_coefficients
sympycore/arithmetic/number_theory.py
sympycore/arithmetic/number_theory.py
"""Provides algorithms from number theory. """ from .numbers import FractionTuple, normalized_fraction, Complex, Float, div __all__ = ['gcd', 'lcm', 'factorial', 'integer_digits', 'real_digits', 'multinomial_coefficients'] __docformat__ = "restructuredtext en" def factorial(n, memo=[1...
Python
0
@@ -4662,16 +4662,17 @@ _tuple( +%5B aa+bb fo @@ -4692,16 +4692,17 @@ ip(t2,t) +%5D )%0D%0A
42eae4634f4bab5649298a65889a4b1a3149d586
Use new invalidate_many cache invalidation to invalidate the event_push_actions cache appropriately.
synapse/storage/event_push_actions.py
synapse/storage/event_push_actions.py
# -*- coding: utf-8 -*- # Copyright 2015 OpenMarket Ltd # # 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 la...
Python
0
@@ -1422,35 +1422,98 @@ -yield self.runInteraction(%0A +def f(txn):%0A for uid, _, __ in tuples:%0A txn.call_after(%0A @@ -1524,42 +1524,135 @@ -%22 se -t_actions_for_event_and_users%22, +lf.get_unread_event_push_actions_by_room_for_user.invalidate_many,%0A ...
07f96a22afe2d010809d03077d9cdd5ecb43d017
Update data source unique name migration to support another name of constraint
migrations/0020_change_ds_name_to_non_uniqe.py
migrations/0020_change_ds_name_to_non_uniqe.py
from redash.models import db from playhouse.migrate import PostgresqlMigrator, migrate if __name__ == '__main__': migrator = PostgresqlMigrator(db.database) with db.database.transaction(): # Change the uniqueness constraint on data source name to be (org, name): db.database.execute_sql("ALTER ...
Python
0
@@ -22,16 +22,30 @@ port db%0A +import peewee%0A from pla @@ -300,87 +300,559 @@ -db.database.execute_sql(%22ALTER TABLE data_sources DROP CONSTRAINT unique_name%22) +success = False%0A for constraint in %5B'unique_name', 'data_sources_name'%5D:%0A try:%0A db.database.execute_sq...
bc5621afa044a486ef7514e1654224102b3cfd54
Rename chunk list
RecordingApp/app/src/scripts/get_chunks.py
RecordingApp/app/src/scripts/get_chunks.py
""" Script to generate a json file containing book name, number of chapters, number of chunks """ import json import urllib.request import re RESULT_JSON_NAME = "chunks.json" with open("catalog.json") as file: DATA = json.load(file) OUTPUT = [] #skip obs for now, loop over all books for x in range(1, 67): ...
Python
0.000004
@@ -1237,24 +1237,30 @@ 0%0A ch -unk_list +apters_in_book = %5B%5D%0A @@ -1595,32 +1595,38 @@ ch -unk_list +apters_in_book .append(num_ @@ -1720,24 +1720,30 @@ r%0A ch -unk_list +apters_in_book .append( @@ -1879,24 +1879,30 @@ = len(ch -unk_list +apters_in_book )-1%0A @@ -1986,24 +1986,30...
d949c21c4b0a54a9a697a07bf12e22a98dc59ff1
Add `attach` method so we can wrap apps like WSGI middleware
flask_mustache/__init__.py
flask_mustache/__init__.py
# flask-mustache Flask plugin import os from jinja2 import Template from flask import current_app, Blueprint __all__ = ('FlaskMustache',) mustache_app = Blueprint('mustache', __name__, static_folder='static') class FlaskMustache(object): "Wrapper to inject Mustache stuff into Flask" def __init__(self, app=...
Python
0
@@ -709,16 +709,184 @@ lates)%0A%0A + @staticmethod%0A def attach(app):%0A %22This is written so it can work like WSGI middleware%22%0A # noop%0A _ = FlaskMustache(app)%0A%0A return app%0A%0A %0A# conte
d4d21340bb6b86a510c16ceeb6c27fe3a5a5b90e
add DataNode to carry inputs to Flows
flow/orchestrator/types.py
flow/orchestrator/types.py
#!/usr/bin/env python import redisom as rom import time __all__ = ['NodeBase', 'Flow', 'NodeFailedError', 'NodeAlreadyCompletedError', 'Status', 'StartNode', 'StopNode'] # FIXME: collect service names ORCHESTRATOR = "orchestrator" def _timestamp(redis_ts): return redis_ts[0] + redis_ts[1] * 1e-6 cla...
Python
0
@@ -3169,19 +3169,19 @@ for -idx +key , props @@ -3221,60 +3221,50 @@ -idx = int(idx)%0A node = self.flow.node(idx +node = rom.get_object(self.connection, key )%0A @@ -5628,24 +5628,89 @@ services)%0A%0A%0A +class DataNode(NodeBase):%0A outputs = rom.Property(rom.Hash)%0A%0A%0A class Fl...
c1c5fbdc2d7cda67668df38d91a2becf546fa852
Update transform config in development
backdrop/transformers/config/development.py
backdrop/transformers/config/development.py
TRANSFORMER_AMQP_URL = 'amqp://transformer:notarealpw@localhost:5672/%2Ftransformations' STAGECRAFT_URL = 'http://localhost:3204' STAGECRAFT_OAUTH_TOKEN = 'development-oauth-access-token' BACKDROP_READ_URL = 'http://localhost:3038/data' BACKDROP_WRITE_URL = 'http://localhost:3039/data'
Python
0
@@ -122,11 +122,11 @@ st:3 -204 +103 '%0AST @@ -213,22 +213,32 @@ p:// -localhost:3038 +backdrop-read.dev.gov.uk /dat @@ -273,22 +273,33 @@ p:// -localhost:3039 +backdrop-write.dev.gov.uk /dat
13c74e663dd511f53e6c0b1bb37b5baa12bba016
add tokens for fco transaction buckets
backdrop/write/config/development_tokens.py
backdrop/write/config/development_tokens.py
TOKENS = { '_foo_bucket': '_foo_bucket-bearer-token', 'bucket': 'bucket-bearer-token', 'foo': 'foo-bearer-token', 'foo_bucket': 'foo_bucket-bearer-token', 'licensing': 'licensing-bearer-token', 'licensing_journey': 'licensing_journey-bearer-token' }
Python
0
@@ -264,11 +264,563 @@ r-token' +,%0A 'pay_legalisation_post_journey': 'pay_legalisation_post_journey-bearer-token',%0A 'pay_legalisation_drop_off_journey': 'pay_legalisation_drop_off_journey-bearer-token',%0A 'pay_register_birth_abroad_journey': 'pay_register_birth_abroad_journey-bearer-token',%0A 'pay_re...
700af658169cdb861ff15341c3a03443f207c02e
Update __init__.py
tendrl/node_agent/manager/__init__.py
tendrl/node_agent/manager/__init__.py
import signal import threading from tendrl.commons import manager as commons_manager from tendrl.commons import TendrlNS from tendrl.commons.utils import log_utils as logger from tendrl.node_agent.provisioner.gluster.manager import \ ProvisioningManager as GlusterProvisioningManager from tendrl import node_agent ...
Python
0.000072
@@ -829,86 +829,8 @@ )%0A%0A - node_sync.platform_detect.sync()%0A node_sync.sds_detect.sync()%0A%0A %0Adef
7b27423bef813befe1bb9dd5cb14843d847bff42
Fix mailhog settings
backend/project_name/settings/local_base.py
backend/project_name/settings/local_base.py
from .base import * # noqa DEBUG = True HOST = "http://localhost:8000" SECRET_KEY = "secret" DATABASES = { "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": base_dir_join("db.sqlite3"),} } STATIC_ROOT = base_dir_join("staticfiles") STATIC_URL = "/static/" MEDIA_ROOT = base_dir_join("mediafiles") M...
Python
0
@@ -637,17 +637,38 @@ %0A# Email + settings for mailhog %0A - EMAIL_BA @@ -738,162 +738,35 @@ T = -config(%22EMAIL_HOST%22)%0AEMAIL_HOST_USER = config(%22EMAIL_HOST_USER%22)%0AEMAIL_HOST_PASSWORD = config(%22EMAIL_HOST_PASSWORD%22)%0AEMAIL_PORT = 587%0AEMAIL_USE_TLS = True +'mailhog'%0AEMAIL_PORT = 1025 %0A%0A#
bce815a12a3ce18d23644c08beda5f97271e559e
update token
forge/tests/test_github.py
forge/tests/test_github.py
# Copyright 2017 datawire. 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 agr...
Python
0.000001
@@ -757,58 +757,345 @@ ee%0A%0A -token = %228c91e6c758b16e7b5d7f0676d3475f9fa33693dd%22 +# github will deactivate this token if it detects it in our source, so%0A# we obfuscate it slightly%0Anumbers = %5B48, 49, 51, 99, 99, 101, 52, 51, 48, 53, 54, 100, 57, 56, 97, 50,%0A 55, 97, 54, 53, 55, 55, 49, 48, 49, ...
9722390c4fa1a6bb5b9e8d66a53219bcc2447b39
Use zoom 13 tiles for station tests, so that the station is more likely to not be the only one in the tile, which provides a better test of the rank.
test/507-routes-via-stop-positions.py
test/507-routes-via-stop-positions.py
stations = [ (17, 38596, 49262, 'Penn Station', 895371274L, 1, [ '2100-2297', # Acela Express '68-69', # Adirondack '50-51', # Cardinal '79-80', # Carolinian '19-20', # Crescent '230-296', # Empire Service '600-674', # Keystone Service '63', # Maple Le...
Python
0
@@ -16,23 +16,21 @@ (1 -7, 38596, 49262 +3, 2412, 3078 , 'P @@ -539,23 +539,21 @@ (1 -7, 37639, 49960 +3, 2352, 3122 , 'C @@ -580,17 +580,17 @@ 10705L, -2 +5 , %5B'Camd @@ -611,23 +611,21 @@ (1 -7, 20958, 50 +3, 1309, 31 66 -7 , 'C @@ -688,22 +688,20 @@ (1 -7 +3 , +2 38 -163, 4964 +5, 310 2, '
307e0c4bbd7e76c9a8becf39df539413fef20e60
Add line magic %cpp
bindings/pyroot/ROOTaaS/iPyROOT/cppmagic.py
bindings/pyroot/ROOTaaS/iPyROOT/cppmagic.py
import IPython.core.magic as ipym import ROOT import utils @ipym.magics_class class CppMagics(ipym.Magics): @ipym.cell_magic def cpp(self, line, cell=None): """Inject into root.""" if cell: utils.processCppCode(cell) def load_ipython_extension(ipython): ipython.register_magics(...
Python
0.000003
@@ -112,16 +112,21 @@ @ipym. +line_ cell_mag @@ -128,16 +128,16 @@ l_magic%0A - def @@ -211,16 +211,100 @@ if cell + is None: # this is a line magic%0A utils.processCppCode(line)%0A else :%0A @@ -374,16 +374,16 @@ ython):%0A + ipyt @@ -413,9 +413,8 @@ Magics)%0A -%0A
e90ee25e43cc284e9b6db9eab8413f22b2292fa3
Allow to force registration
frontend/custom/courses.py
frontend/custom/courses.py
# -*- coding: utf-8 -*- # # Copyright (c) 2014 Université Catholique de Louvain. # # This file is part of INGInious. # # INGInious is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the...
Python
0
@@ -3213,19 +3213,32 @@ ord=None +, force=False ):%0A - @@ -3328,24 +3328,50 @@ e else. %22%22%22%0A + if not force:%0A if n @@ -3410,32 +3410,36 @@ ():%0A + return False%0A @@ -3427,32 +3427,36 @@ return False%0A + if self. @@ -3538,16 +3538,20 @@ ...
0a3164a47854ed17765d567afc7fc6a05aa0fd21
Fix bug in commonsdownloader with argument names
commonsdownloader/commonsdownloader.py
commonsdownloader/commonsdownloader.py
#!/usr/bin/python # -=- encoding: latin-1 -=- """Download files from Wikimedia Commons.""" import os import logging import argparse from thumbnaildownload import download_file def get_file_names_from_textfile(textfile_handler): """Yield the file names and widths by parsing a given text fileahandler.""" for ...
Python
0
@@ -714,21 +714,16 @@ extfile( -args. file_lis @@ -759,21 +759,16 @@ e_name, -args. output_p
082cc2590f7b263e37fe214e3c4e6fc86039327a
correct pyunit
h2o-py/tests/testdir_algos/deeplearning/pyunit_tweedie_weightsDeeplearning.py
h2o-py/tests/testdir_algos/deeplearning/pyunit_tweedie_weightsDeeplearning.py
import sys sys.path.insert(1, "../../../") import h2o #def tweedie_weights(ip,port): h2o.init() data = h2o.import_frame(h2o.locate("smalldata/glm_test/cancar_logIn.csv")) data["C1M3"] = (data["Class"] == 1 and data["Merit"] == 3).asfactor() data["C3M3"] = (data["Class"] == 3 and data["Merit"] == 3).asfactor() data["C...
Python
0.998797
@@ -48,17 +48,16 @@ rt h2o%0A%0A -# def twee @@ -82,20 +82,13 @@ t):%0A -h2o.init()%0A%0A +%0A data @@ -158,16 +158,20 @@ .csv%22))%0A + data%5B%22C1 @@ -228,24 +228,28 @@ .asfactor()%0A + data%5B%22C3M3%22%5D @@ -302,24 +302,28 @@ .asfactor()%0A + data%5B%22C4M3%22%5D @@ -376,24 +376,28 @@ ....
f4c96433a3b42eb13dced4d7c00a5ab78c8ee38f
add pickle tests for Hit as well
test_elasticsearch_dsl/test_result.py
test_elasticsearch_dsl/test_result.py
import pickle from datetime import date from pytest import raises, fixture from elasticsearch_dsl import response, Search, DocType, Date, Object from elasticsearch_dsl.aggs import Terms from elasticsearch_dsl.response.aggs import AggData, BucketData, Bucket @fixture def agg_response(aggs_search, aggs_data): retur...
Python
0
@@ -685,24 +685,200 @@ t r == res%0A%0A +def test_hit_is_pickleable(dummy_response):%0A res = response.Response(Search(), dummy_response)%0A hits = pickle.loads(pickle.dumps(res.hits))%0A%0A assert hits == res.hits%0A%0A def test_res
169dda227f85f77ac52a4295e8fb7acd1b3184f5
Make byte-separator mandatory in MAC addresses
core/observables/mac_address.py
core/observables/mac_address.py
from __future__ import unicode_literals import re from core.observables import Observable class MacAddress(Observable): regex = r'(?P<search>(([0-9A-Fa-f]{1,2}[.:-]?){5,7}([0-9A-Fa-f]{1,2})))' exclude_fields = Observable.exclude_fields DISPLAY_FIELDS = Observable.DISPLAY_FIELDS @classmethod d...
Python
0
@@ -165,17 +165,16 @@ ,2%7D%5B.:-%5D -? )%7B5,7%7D(%5B @@ -431,37 +431,32 @@ (self):%0A -self. value = re.sub(r @@ -484,40 +484,8 @@ lue) -%0A self.value = self.value .upp @@ -510,17 +510,25 @@ value = -%5C +':'.join( %0A @@ -536,23 +536,8 @@ -':'.join(%5Bself. valu @@ -556,16 +556...
a28f8fe4427c12c2523b16903325d0362b53123e
Drop version dependency
acme/setup.py
acme/setup.py
import sys from setuptools import setup from setuptools import find_packages version = '0.2.0.dev0' install_requires = [ # load_pem_private/public_key (>=0.6) # rsa_recover_prime_factors (>=0.8) 'cryptography>=0.8', 'ndg-httpsclient', # urllib3 InsecurePlatformWarning (#304) 'pyasn1', # urllib...
Python
0.000001
@@ -396,41 +396,8 @@ .13) -, X509Req.get_extensions (%3E=0.15) %0A @@ -412,17 +412,17 @@ SSL%3E=0.1 -5 +3 ',%0A '
cf2af12d926370d83e909e0d38d2c774553e0408
Fix handshake
YamTorrent.py
YamTorrent.py
#!/usr/bin/env python3 import sys import requests import hashlib import bencodepy import struct import socket def DEBUG(s): if debugging: print(s) def ERROR(s): print(s) exit() def main(): # open file in binary try: torrentfile = open(sys.argv[1], "rb").read() except IOError...
Python
0.000004
@@ -105,17 +105,16 @@ ocket%0A%0A%0A -%0A def DEBU @@ -115,16 +115,17 @@ f DEBUG( +* s):%0A @@ -156,12 +156,14 @@ int( +* s)%0A%0A +%0A def @@ -168,16 +168,17 @@ f ERROR( +* s):%0A @@ -183,16 +183,17 @@ print( +* s)%0A e @@ -1489,20 +1489,16 @@ event%7D%0A - %0A #CO @@ -1955,17 +1955,...
877a7ff09056ea7ca03f0b31eb4ef8e30ac9d3fa
Change names we expect in spreadsheet
openprescribing/pipeline/management/commands/import_pcns.py
openprescribing/pipeline/management/commands/import_pcns.py
from django.core.management import BaseCommand from django.db import transaction from frontend.models import PCN, Practice from openpyxl import load_workbook class Command(BaseCommand): help = "This command imports PCNs and PCN mappings" def add_arguments(self, parser): parser.add_argument("--filena...
Python
0
@@ -467,17 +467,16 @@ ame(%22PCN - Details%22 @@ -1958,17 +1958,18 @@ %22Partner - +%5Cn Organisa @@ -1972,17 +1972,18 @@ nisation - +%5Cn Code%22)%0A
6495a032d61d24df3c86b7cdf1d02debb6dcbfda
fix doc of camvid
chainercv/datasets/camvid/camvid_dataset.py
chainercv/datasets/camvid/camvid_dataset.py
import glob import os import shutil import numpy as np import chainer from chainer.dataset import download from chainercv import utils from chainercv.utils import read_image root = 'pfnet/chainercv/camvid' url = 'https://github.com/alexgkendall/SegNet-Tutorial/archive/master.zip' camvid_label_names = ( 'Sky', ...
Python
0
@@ -2601,48 +2601,8 @@ age. - Both of them are in CHW%0A format. %0A%0A
14cee1112f2a506f4ec547b80e897036f601ab6d
Fix tests/utils/http_requests.py
chroma-manager/tests/utils/http_requests.py
chroma-manager/tests/utils/http_requests.py
#!/usr/bin/env python # # ======================================================== # Copyright (c) 2012 Whamcloud, Inc. All rights reserved. # ======================================================== import json import requests from urlparse import urljoin class HttpRequests(object): def __init__(self, server_...
Python
0.000001
@@ -433,16 +433,39 @@ session( +)%0A self.session. headers @@ -496,16 +496,48 @@ n/json%22, +%0A %22Conten @@ -564,17 +564,52 @@ n/json%22%7D -) +%0A self.session.verify = False %0A%0A de
af819b3758d87b2214211a4bb0300e0c4b0a3057
Add a test for issue #1934
tests/functional/test_install_reqs.py
tests/functional/test_install_reqs.py
import os.path import textwrap import pytest from tests.lib import (pyversion, path_to_url, _create_test_package_with_subdirectory) from tests.lib.local_repos import local_checkout def test_requirements_file(script): """ Test installing from a requirements file. """ other_lib...
Python
0
@@ -4685,24 +4685,275 @@ str(res)%0A%0A%0A +def test_install_collected_dependancies_first(script):%0A result = script.pip(%0A 'install', 'paramiko',%0A )%0A text = %5Bline for line in result.stdout.split('%5Cn')%0A if 'Installing' in line%5D%5B0%5D%0A assert text.endswith('paramiko')%0A%...
e7a632718f379fb1ede70d1086f55279e4251e11
fix geotag access - not an obj
cinder/scheduler/filters/geo_tags_filter.py
cinder/scheduler/filters/geo_tags_filter.py
# Copyright (c) 2014 Intel # 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 app...
Python
0.000001
@@ -1536,17 +1536,18 @@ geo_tag -. +%5B' valid_in @@ -1551,16 +1551,18 @@ _invalid +'%5D .lower()
16ab5dcf1f6e52f89435adccdfa7021ce24e29a8
fix formatting via make fix
tests/metal/contrib/test_baselines.py
tests/metal/contrib/test_baselines.py
import numpy as np import torch from metal.end_model import SparseLogisticRegression def test_sparselogreg(self): """Confirm sparse logreg can overfit, works on padded data""" F = 1000 # total number of possible features N = 50 # number of data points S = [10, 100] # range of features per data po...
Python
0
@@ -1,13 +1,12 @@ -%0A import numpy
9535fcb8cb811ed570bf20dd29857722dc46a1f3
update expressions test to use unittest2 assertItemsEqual
tests/modeltests/expressions/tests.py
tests/modeltests/expressions/tests.py
from django.test import TestCase from django.db.models import F from django.core.exceptions import FieldError from models import Employee, Company class ExpressionsTestCase(TestCase): fixtures = ['f_expression_testdata.json'] def assertItemsEqual(self, a, b): #fixme, replace with unittest2 function ...
Python
0.000001
@@ -231,149 +231,8 @@ '%5D%0A%0A - def assertItemsEqual(self, a, b):%0A #fixme, replace with unittest2 function%0A return self.assertEqual(sorted(a), sorted(b))%0A%0A
0341c38dff42ae5e86353c6d53c2d30aabca555e
update py-jupyter-client and new setuptools dependency (#13425)
var/spack/repos/builtin/packages/py-jupyter-client/package.py
var/spack/repos/builtin/packages/py-jupyter-client/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyJupyterClient(PythonPackage): """Jupyter protocol client APIs""" homepage = "https:...
Python
0
@@ -431,16 +431,112 @@ ar.gz%22%0A%0A + version('5.3.4', sha256='2af6f0e0e4d88009b11103490bea0bfb405c1c470e226c2b7b17c10e5dda9734')%0A vers @@ -1332,16 +1332,112 @@ .8,3.3:' +, type=('build', 'run'))%0A depends_on('python@2.7:2.8,3.5:', type=('build', 'run'), when='@5:' )%0A de @@ -1575,28 +1575,232 @@...
79bf0829769e456750d7904866e65ae289f1cd46
add missing logfile write flushes
_log/dslog.py
_log/dslog.py
# -*- coding:utf8 -*- import io import os import sys import traceback LOG_STDOUT=sys.stdout LOG_STDERR=sys.stderr logging_to_file=True logfile="devsetup.log" def init(project_folder, write_to_log=True): global LOG_STDOUT global LOG_STDERR global logging_to_file global logfile # special case - we want to log di...
Python
0.000031
@@ -1117,24 +1117,45 @@ ode(line))%0A%0A +%09LOG_STDOUT.flush()%0A%0A def log_comm @@ -1608,24 +1608,45 @@ msg + %22%5Cn%22)) +%0A%09%09LOG_STDOUT.flush() %0A%0Adef log_co @@ -1773,32 +1773,53 @@ + msg + %22%5Cn%5Cn%22)) +%0A%09%09LOG_STDOUT.flush() %0A%0Adef log_last_e @@ -1997,16 +1997,37 @@ output)) +%0A%09%0...
186c509f14968e9d51a6a7d3a7a23ed07eabc286
Enable spam bug detection in all products (#1106)
auto_nag/scripts/spambug.py
auto_nag/scripts/spambug.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from auto_nag import people from auto_nag.bugbug_utils import get_bug_ids_classification from auto_nag.bzcleaner import ...
Python
0
@@ -1091,16 +1091,74 @@ bugs%22%0A%0A + def has_default_products(self):%0A return False%0A%0A def
2cdec051040aeb49cde4e4d8425b675b1c395d3c
Allow specifying edge properties (color/width)
autonetkit/ank_messaging.py
autonetkit/ank_messaging.py
#!/usr/bin/python # -*- coding: utf-8 -*- import socket import autonetkit.ank_json import autonetkit.config as config import autonetkit.log as log from autonetkit.ank_utils import call_log use_http_post = config.settings['Http Post']['active'] if use_http_post: import urllib @call_log def format_http_url(host=N...
Python
0
@@ -2364,24 +2364,515 @@ nodes%5D%0A +#TODO: allow node annotations also%0A%0A filtered_edges = %5B%5D%0A for edge in edges:%0A if isinstance(edge, dict) and 'edge' in edge:%0A edge_data = dict(edge) # use as-is (but make copy)%0A else:%0A edge_data = %7B'edge': edge%7D #...
bbe835c8aa561d8db58e116f0e55a5b19c4f9ca4
Fix sitemap memory consumption during generation
firecares/sitemaps.py
firecares/sitemaps.py
from django.contrib import sitemaps from firecares.firestation.models import FireDepartment from django.db.models import Max from django.core.urlresolvers import reverse class BaseSitemap(sitemaps.Sitemap): protocol = 'https' def items(self): return ['media', 'models_performance_score', 'models_commu...
Python
0
@@ -688,16 +688,55 @@ d=False) +.only('population', 'featured', 'name') %0A
2596cdfa5cb194e2fbfd7e2317f53938b222203f
Change template variable to TEMPLATE_DIR.
firmant/writers/j2.py
firmant/writers/j2.py
# Copyright (c) 2010, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of condition...
Python
0
@@ -1880,15 +1880,8 @@ gs%5B' -JINJA2_ TEMP
9c7d1deba7dbde9285e49cb2966b1d242ac8ddc2
Use sphinxapi if available
flask_sphinxsearch.py
flask_sphinxsearch.py
import sphinxsearch from flask import current_app # Find the stack on which we want to store the database connection. # Starting with Flask 0.9, the _app_ctx_stack is the correct one, # before that we need to use the _request_ctx_stack. try: from flask import _app_ctx_stack as stack except ImportError: from fl...
Python
0
@@ -1,12 +1,78 @@ +try:%0A import sphinxapi as sphinxsearch%0Aexcept ImportError:%0A import sphin
726fa619627f449371f8cdd6df266d4c92aaad5d
Fix flaky NL test
samples/snippets/ocr_nl/main_test.py
samples/snippets/ocr_nl/main_test.py
#!/usr/bin/env python # Copyright 2016 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...
Python
0.999382
@@ -1802,20 +1802,16 @@ ert -len( entities ) == @@ -1810,14 +1810,8 @@ ties -) == 2 %0A
e959f849550fe4cfd2f2230c149a9bc0cb01bfe4
bump version
jose/__init__.py
jose/__init__.py
__version__ = "2.0.0" __author__ = 'Michael Davis' __license__ = 'MIT' __copyright__ = 'Copyright 2016 Michael Davis' from .exceptions import JOSEError from .exceptions import JWSError from .exceptions import ExpiredSignatureError from .exceptions import JWTError
Python
0
@@ -13,17 +13,17 @@ = %222.0. -0 +1 %22%0A__auth
7f38e297dcfc9a664af092f48a9dc596f5f6c27b
Fix PermissionError: [Errno 13] Permission denied on Windows
scipy/sparse/tests/test_matrix_io.py
scipy/sparse/tests/test_matrix_io.py
import numpy as np import tempfile from numpy.testing import assert_array_almost_equal, run_module_suite, assert_ from scipy.sparse import csc_matrix, csr_matrix, bsr_matrix, dia_matrix, coo_matrix, save_npz, load_npz def _save_and_load(matrix): with tempfile.NamedTemporaryFile(suffix='.npz') as file: ...
Python
0
@@ -1,12 +1,22 @@ +import os%0A import numpy @@ -256,102 +256,84 @@ ix): - %0A with tempfile.NamedTemporaryFile(suffix='.npz') as file:%0A file = file.name +%0A fd, tmpfile = tempfile.mkstemp(suffix='.npz')%0A os.close(fd)%0A try: %0A @@ -342,24 +342,27 @@ save_npz( +tmp file, matri...
b5e234185d8032db5d7193a46326cac7a17acedf
Add days_back argument to consume, and set null emails to '' rather than None
scrapi/consumers/scitech/consumer.py
scrapi/consumers/scitech/consumer.py
from scrapi_tools import lint from scrapi_tools.document import RawDocument, NormalizedDocument from lxml import etree import requests import datetime import re TODAY = datetime.date.today() YESTERDAY = TODAY - datetime.timedelta(1) NAME = 'SciTech' def consume(start_date=YESTERDAY.strftime('%m/%d/%Y'), end_date=Non...
Python
0.000354
@@ -262,49 +262,19 @@ ume( -start_date=YESTERDAY.strftime('%25m/%25d/%25Y') +days_back=1 , en @@ -552,16 +552,94 @@ es.%22%22%22%0A%0A + start_date = (TODAY - datetime.timedelta(days_back)).strftime('%25m/%25d/%25Y')%0A base @@ -2360,20 +2360,18 @@ ail'%5D = -None +'' %0A
ea8aee109883d0f1efc9041e5219f893512d2e26
Fix comment
src/olympia/reviews/serializers.py
src/olympia/reviews/serializers.py
import re from urllib2 import unquote from django.utils.translation import ugettext as _ from rest_framework import serializers from rest_framework.relations import PrimaryKeyRelatedField from olympia.addons.serializers import SimpleVersionSerializer from olympia.reviews.forms import ReviewForm from olympia.reviews....
Python
0
@@ -2116,17 +2116,17 @@ # -s +S erialize
81b64f139dba88b744e6067f7a48ce1bdaff785c
Change variable names.
avenue/web.py
avenue/web.py
# -*- coding: utf-8 -*- # Copyright (c) 2012 Michael Babich # See LICENSE.txt or http://opensource.org/licenses/MIT '''Acts as an interface between what Flask serves and what goes on in the rest of the application. ''' from avenue import app, api from flask import render_template, make_response, redirect def url_gene...
Python
0.000001
@@ -1213,22 +1213,16 @@ html -_title = '%25s : @@ -1271,49 +1271,8 @@ m'%5D, -%0A dat @@ -1278,25 +1278,24 @@ ta%5B'site'%5D)%0A -%0A main @@ -1294,22 +1294,16 @@ main -_title = '%25s - @@ -1374,22 +1374,16 @@ : html -_title ,%0A @@ -1413,14 +...
bc62bd28340d27fbfde164ea3c2f184922ddb9e9
add Spirent like profile
scripts/astf/http_manual_tunables.py
scripts/astf/http_manual_tunables.py
# Example for creating your program by specifying buffers to send, without relaying on pcap file from trex_astf_lib.api import * # we can send either Python bytes type as below: http_req = b'GET /3384 HTTP/1.1\r\nHost: 22.0.0.3\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5....
Python
0
@@ -1025,16 +1025,42 @@ p_req))%0A + prog_s.delay(10);%0A @@ -1559,16 +1559,161 @@ = 1100%0A + info.tcp.rxbufsize = 1102 # split the buffer to MSS and ack every buffer, no need the no_delay option%0A info.tcp.txbufsize = 1100%0A @@ -1733,32 +1733,33 @@ wnd = 1%0A +#...
fbc1ee6391734175a603aff5c95108a499d6001b
add more agronomic fields
scripts/cscap/set_dashboard_links.py
scripts/cscap/set_dashboard_links.py
""" Assign links in the dashboard to generated spreadsheets? """ import util import ConfigParser import gdata.spreadsheets.client import gdata.docs.client config = ConfigParser.ConfigParser() config.read('mytokens.cfg') # Get me a client, stat spr_client = util.get_spreadsheet_client(config) docs_client = util.get_do...
Python
0
@@ -777,32 +777,1336 @@ gronomic Data',%0A + 'agr2': 'Agronomic Data',%0A 'agr3': 'Agronomic Data',%0A 'agr4': 'Agronomic Data',%0A 'agr5': 'Agronomic Data',%0A 'agr6': 'Agronomic Data',%0A 'agr7': 'Agronomic Data',%0A 'agr8': '...
b1277cd79102a30a894e370ab15773e6d86569ec
fix n/a causing issues for OT0010 ingest, sigh
scripts/ingestors/other/parse0010.py
scripts/ingestors/other/parse0010.py
"""ISU Agronomy Hall Vantage Pro 2 OT0010""" from __future__ import print_function import datetime import re import os import sys import pytz from pyiem.datatypes import speed, temperature, humidity from pyiem.observation import Observation from pyiem.meteorology import dewpoint from pyiem.util import get_dbconn def ...
Python
0
@@ -1631,24 +1631,57 @@ ta%5B'srad'%5D = + None if tokens%5B18%5D == 'n/a' else float(token
76e46db3248f8612c01a3fd598c95e08f864bc08
version 1.0.0
src/stratis_cli/_version.py
src/stratis_cli/_version.py
# Copyright 2016 Red Hat, 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
@@ -683,12 +683,12 @@ = ( -0, 9 +1, 0 , 0)
c7a79f81734f360a232b2f91630872ad56a1ffa4
clean up audio init
amen/audio.py
amen/audio.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import librosa from amen.timing_list import TimingList class Audio(object): """ Audio object: should wrap the output from libRosa. """ def __init__(self, file_path, convert_to_mono=False, sample_rate=22050): """ Opens a file path, loads i...
Python
0.000025
@@ -532,174 +532,91 @@ -if convert_to_mono:%0A self.num_channels = 1%0A else:%0A self.num_channels = 2%0A self.duration = len(self.raw_samples) / self.sample_rate +self.num_channels = y.ndim%0A self.duration = librosa.get_duration(y=y, sr=sr) %0A
4aca30e376b2310e2436fdb799bf3cae1c9a1d2b
Define global variables to clean up tests
dakota_utils/tests/test_file.py
dakota_utils/tests/test_file.py
#! /usr/bin/env python # # Tests for dakota_utils.file. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) from nose.tools import * import os import tempfile import shutil from dakota_utils.file import * def setup_module(): print('File tests:') os.environ['_test_tmp_dir'] = tempfile.m...
Python
0.000003
@@ -224,16 +224,96 @@ port *%0A%0A +nondir = 'vwbwguv00240cnwuncdsv'%0Anonfile = nondir + '.pro'%0Abname = 'delete_me'%0A%0A def setu @@ -1153,44 +1153,8 @@ %0A - fname = 'vwbwguv00240cnwuncdsv'%0A @@ -1207,20 +1207,22 @@ _dir'%5D, -fnam +nonfil e))%0A%0Adef @@ -1354,44 +1354,8 @@ %0A - dname =...
489f230b618a84f1cd94aad73038ada73e526a4a
fix a crash
dashboard/containers/web/app.py
dashboard/containers/web/app.py
from flask import Flask, render_template, send_from_directory import rethinkdb as r import json import os app = Flask(__name__, static_url_path='') @app.route('/css/<path>/') def send_css(path): return send_from_directory('static/css', path) @app.route('/js/<path>/') def send_js(path): return send_from_dir...
Python
0.0005
@@ -3254,16 +3254,47 @@ ev != %5B%5D + and k in family_dev%5B'summary'%5D :%0A
50b8195bf34244d7e5cc9595818227db83999566
Fix type error updating the failures count.
api/common.py
api/common.py
#!/usr/bin/python # Copyright (C) 2012 Humbug, Inc. All rights reserved. import simplejson import requests import time import traceback import urlparse import sys # Check that we have a recent enough version # Older versions don't provide the 'json' attribute on responses. assert(requests.__version__ > '0.12') class...
Python
0
@@ -887,40 +887,8 @@ name -%0A request%5B%22failures%22%5D = 0 %0A%0A @@ -1057,16 +1057,49 @@ s(val)%0A%0A + request%5B%22failures%22%5D = 0%0A%0A
1c56aeb3d96dbb26da62203d690b4ff49b4b5c0e
bump version to 0.5.2
abstar/version.py
abstar/version.py
# Store the version here so: # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module __version__ = '0.5.1'
Python
0.000001
@@ -202,10 +202,10 @@ = '0.5. -1 +2 '
609cffb674ba0494bbe450d8ce7839168a3d5a0a
remove unnecessary code from forms
accounts/forms.py
accounts/forms.py
# -*- coding: utf-8 -*- try: from django.contrib.auth import get_user_model except ImportError: from django.contrib.auth.models import User else: User = get_user_model() from django import forms from django.utils.translation import ugettext_lazy as _ class ProfileEditForm(forms.ModelForm): email = for...
Python
0.000007
@@ -21,17 +21,8 @@ -*-%0A -try:%0A from @@ -68,110 +68,8 @@ del%0A -except ImportError:%0A from django.contrib.auth.models import User%0Aelse:%0A User = get_user_model()%0A from @@ -146,16 +146,40 @@ y as _%0A%0A +User = get_user_model()%0A %0Aclass P
35848b160341f3528cdeac59f2027820a33ba39d
Add the always-'0' indicator field to the header record.
account_hmrc_esl_declaration/wizard/account_vat_esl.py
account_hmrc_esl_declaration/wizard/account_vat_esl.py
# -*- coding: utf-8 -*- ############################################################################## # # ECSL Export for HMRC # Copyright (C) 2015 OpusVL (<http://opusvl.com/>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
Python
0
@@ -3889,16 +3889,97 @@ ficient%0A + '0', # %22the indicator field (this will always be '0')%22%0A
67be76a3d65fa846c8888ef5415ec3df5ef9ab87
Add test for expired tokens
accounts/tests.py
accounts/tests.py
"""accounts app unittests """ import base64 from time import sleep from django.contrib.auth import get_user_model from django.test import TestCase from accounts.token import LoginTokenGenerator TEST_EMAIL = 'newvisitor@example.com' class WelcomePageTest(TestCase): """Tests relating to the welcome_page view. ...
Python
0
@@ -1947,32 +1947,87 @@ oken(TEST_EMAIL) +%0A%0A # Modify the email address which is 'signed'. %0A split_t @@ -2116,16 +2116,17 @@ it('@')%0A +%0A @@ -2271,24 +2271,25 @@ ).decode()%0A +%0A self @@ -2349,8 +2349,342 @@ token))%0A +%0A def test_expired_token_fails(self):%0A ...
5a4f05cb0f3a00a2d4faf828bd7850085c302541
Implement functionality to delete logs created by digital justice users
cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py
cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py
import sys from django.core.management.base import BaseCommand from dateutil.relativedelta import relativedelta from legalaid.models import Case from cla_butler.tasks import DeleteOldData class FindAndDeleteCasesUsingCreationTime(DeleteOldData): def get_eligible_cases(self): two_years = self.now - relati...
Python
0.002474
@@ -139,16 +139,52 @@ rt Case%0A +from cla_eventlog.models import Log%0A from cla @@ -464,16 +464,150 @@ years)%0A%0A + def get_digital_justice_user_logs(self):%0A return Log.objects.filter(created_by__email__endswith=%22digital.justice.gov.uk%22)%0A%0A %0Aclass C @@ -638,17 +638,38 @@ help = -( +%22%2...
f5c5c7de8af6ae5251ac1d878569c2692e119a04
Set the login/logout URLs so authentication works.
adapt/settings.py
adapt/settings.py
""" Django settings for adapt project. Generated by 'django-admin startproject' using Django 1.8.5. 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/ """ # Build paths ...
Python
0
@@ -3410,8 +3410,66 @@ *24*365%0A +%0ALOGIN_URL = '/admin/login/'%0ALOGOUT_URL = '/admin/logout/'
5530b4f99c22d9734cafefa89c6b7fc12ce339ed
Fix bug in create_html_page - undefined variable (#8700)
contrib/confluence/src/python/pants/contrib/confluence/util/confluence_util.py
contrib/confluence/src/python/pants/contrib/confluence/util/confluence_util.py
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import getpass import logging import mimetypes from os.path import basename from urllib.parse import quote_plus from xmlrpc.client import Binary from xmlrpc.client import Error as XMLRPCEr...
Python
0
@@ -5226,16 +5226,17 @@ ntent = +f '''%3Cac:m @@ -5295,18 +5295,22 @@ !%5BCDATA%5B -%25s +%7Bhtml%7D %5D%5D%3E%3C/ac: @@ -5350,23 +5350,16 @@ acro%3E''' - %25 html %0A els @@ -5385,24 +5385,25 @@ luenceError( +f %22Don't know @@ -5421,28 +5421,39 @@ ert -%25s to HTML%22 %25 format +%7Bself._content_forma...
3e7d52cc9715963eb9a31c2a5e4085d323ddb78f
Fix how silence_coroutine handles exceptions on handler
again/decorate.py
again/decorate.py
from functools import wraps RED = '\033[91m' BLUE = '\033[94m' BOLD = '\033[1m' END = '\033[0m' def _default_handler(e, *args, **kwargs): pass def silence(target_exceptions:list, exception_handler=_default_handler): def decor(func): @wraps(func) def wrapper(*args, **kwargs): try: ...
Python
0.000536
@@ -133,16 +133,20 @@ kwargs): +%0A pass%0A%0A%0A @@ -1286,26 +1286,22 @@ -yield from +return excepti @@ -1402,32 +1402,101 @@ et_exceptions):%0A + return exception_handler(e, *args, **kwargs)%0A @@ -7250,29 +7250,28 @@ logic%0A%0A return decorator -%0A