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
1363c12251cb6aaad37f2b3be6890f70e7f80a66
Fix invalid syntax
location_field/widgets.py
location_field/widgets.py
from django.conf import settings from django.forms import widgets from django.utils.safestring import mark_safe GOOGLE_MAPS_V3_APIKEY = getattr(settings, 'GOOGLE_MAPS_V3_APIKEY', None) GOOGLE_API_JS = '//maps.google.com/maps/api/js?sensor=false' if GOOGLE_MAPS_V3_APIKEY: GOOGLE_API_JS = '{0}&key={0}'.format(G...
Python
0.999586
@@ -349,17 +349,16 @@ _APIKEY) -) %0A%0A%0Aclass
b177629c1869fe707ec69ade0927bf9769e1cbe6
Freeze sql parse to 0.2.4
djongo/__init__.py
djongo/__init__.py
__version__ = '1.2.31'
Python
0.999989
@@ -14,11 +14,11 @@ = '1.2.3 -1 +2 '%0A
30c8e4d7a1e6e237772aa89256b83ec37a015803
increment version
terminalone/metadata.py
terminalone/metadata.py
# -*- coding: utf-8 -*- __name__ = 'TerminalOne' __author__ = 'MediaMath' __copyright__ = 'Copyright 2015, MediaMath' __license__ = 'Apache License, Version 2.0' __version__ = '1.9.8' __maintainer__ = 'MediaMath Developer Relations' __email__ = 'developers@mediamath.com' __status__ = 'Stable' __url__ = 'http://www.med...
Python
0.000004
@@ -175,17 +175,17 @@ = '1.9. -8 +9 '%0A__main
c8445a938d9bd9512b8af40ac8e9465a3ab9f04d
Fix exception handling error.
d2to1/core.py
d2to1/core.py
import os import sys import warnings from distutils.core import Distribution as _Distribution from distutils.errors import DistutilsFileError, DistutilsSetupError from setuptools.dist import _get_unpatched from .extern import six from .util import DefaultGetDict, IgnoreDict, cfg_to_args _Distribution = _get_unpatch...
Python
0.000011
@@ -1796,17 +1796,22 @@ six.u( -e +str(e) )))%0A%0A
1fca3a48b0617b19554ab55c54db322090a69c3d
Add with statement tests
magic/tests/test_magic.py
magic/tests/test_magic.py
import unittest import magic import magic.flags class MagicTestCase(unittest.TestCase): def setUp(self): self.magic = magic.Magic() def test_get_version(self): self.assertTrue(isinstance(self.magic.version, int)) def test_from_buffer(self): mimetype = self.magic.from_buffer("ehlo") self.asse...
Python
0.000004
@@ -493,24 +493,190 @@ CII text%22)%0A%0A + def test_with(self):%0A with magic.Magic(mimetype=True) as m:%0A mimetype = self.magic.from_file(%22/etc/passwd%22)%0A self.assertEqual(mimetype, %22text/plain%22)%0A%0A def test_s
436aa56758403b96aa4c0038db6d2a24047cfa16
fix bug
monthertree/monthertree/wsgi.py
monthertree/monthertree/wsgi.py
""" WSGI config for monthertree project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os import sys sys.path.append('/home/jinxp/Documents/shell/mothertree/monthertree/') o...
Python
0.000001
@@ -245,77 +245,77 @@ sys%0A -sys.path.append('/home/jinxp/Documents/shell/mothertree/monthertree/' +from django.conf import settings%0Asys.path.append(settings.PROJECT_DIR )%0Aos
3d7e7c53c5c2809df74a8f8d61a7f929e02a1ce6
Require libunwind
var/spack/packages/gperftools/package.py
var/spack/packages/gperftools/package.py
############################################################################## # Copyright (c) 2013, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 ...
Python
0.998829
@@ -1871,16 +1871,45 @@ r.gz%22)%0A%0A + depends_on(%22libunwind%22)%0A%0A def
9a35e57dbde9360409ea883b6426dc1a355e8d16
Fix Reverb signature for distributed SAC nightly.
tf_agents/experimental/distributed/examples/sac/sac_reverb_server.py
tf_agents/experimental/distributed/examples/sac/sac_reverb_server.py
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Python
0.000002
@@ -3095,16 +3095,95 @@ a_spec)%0A + replay_buffer_signature = tensor_spec.add_outer_dim(replay_buffer_signature)%0A loggin
6d8dbb6621da2ddfffd58303131eb6cda345e37c
Make person experience the default tab for ZA
pombola/south_africa/urls.py
pombola/south_africa/urls.py
from django.conf.urls import patterns, include, url from pombola.south_africa.views import LatLonDetailView,SAPlaceDetailSub urlpatterns = patterns('pombola.south_africa.views', url(r'^place/latlon/(?P<lat>[0-9\.-]+),(?P<lon>[0-9\.-]+)/', LatLonDetailView.as_view(), name='latlon'), url(r'^place/(?P<slug>[-\w]...
Python
0.000001
@@ -46,16 +46,63 @@ e, url%0A%0A +from pombola.core.views import PersonDetailSub%0A from pom @@ -447,10 +447,122 @@ aces'),%0A + url(r'%5Eperson/(?P%3Cslug%3E%5B-%5Cw%5D+)/$', PersonDetailSub.as_view(), %7B 'sub_page': 'experience' %7D, name='person'),%0A )%0A
80618891a11c90bdfc763d9a00e9bdcf2e9302fd
Create resources on deploy
noopy/project_template/deploy.py
noopy/project_template/deploy.py
#!/usr/bin/python import glob import importlib import os import sys import zipfile from StringIO import StringIO import boto3 import noopy from noopy.endpoint import Endpoint from noopy.utils import to_pascal_case import settings def main(): target_dir = 'src' zip_bytes = make_zip(target_dir) for endpoi...
Python
0.000001
@@ -169,16 +169,61 @@ ndpoint%0A +from noopy.endpoint.resource import Resource%0A from noo @@ -253,16 +253,16 @@ al_case%0A - %0Aimport @@ -539,16 +539,17 @@ func)%0A%0A%0A +%0A def make @@ -2009,16 +2009,16 @@ %7D%0A - )%0A%0A%0A if _ @@ -2013,16 +2013,1449 @@ )%0A%0A%0A +class ApiGatewayDeployer(...
76289f734f622227c44487d8f44879e078dbdcb3
Improve gzweb launcher
src/deedee_tutorials/src/deedee_tutorials/launcher.py
src/deedee_tutorials/src/deedee_tutorials/launcher.py
#! /usr/bin/env python import rospy import subprocess class MainLauncher: ''' Node spawning the environment with respect to the global configs ''' def __init__(self): rospy.init_node("middleware_spawner") rospy.sleep(0.5) # Configs self.configs = {"robot_name": "deedee", "si...
Python
0
@@ -1152,32 +1152,71 @@ trieve_config()%0A + if self.configs%5B%22gzweb_enable%22%5D:%0A self.cmd = %22 @@ -1273,45 +1273,8 @@ %22%5D)%0A - if self.configs%5B%22gzweb_enable%22%5D:%0A @@ -1381,17 +1381,18 @@ l=True)%0A -%0A + rosp @@ -1425,16 +1425,18 @@ n_hook)%0A + rosp
61c6f174b1e406955c3e881217ff863d6ff6c3ce
Fix validate/sanitize functions for click
pathvalidate/click.py
pathvalidate/click.py
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import click from ._common import PathType from ._file import sanitize_filename, sanitize_filepath, validate_filename, validate_filepath from .error import ValidationError def validate_filename_arg(ctx, param, value) -> None: if not value:...
Python
0
@@ -282,36 +282,35 @@ aram, value) -%3E -None +str :%0A if not val @@ -319,32 +319,35 @@ :%0A return + %22%22 %0A%0A try:%0A @@ -445,24 +445,42 @@ er(str(e))%0A%0A + return value%0A%0A %0Adef validat @@ -516,20 +516,19 @@ lue) -%3E -None +str :%0A if @@ -553,16 +553,19 @@ return + %...
b65283984b1be7e8bb88d3281bb3654a3dd12233
Make sure test setup is run for subdirectories
nova/tests/scheduler/__init__.py
nova/tests/scheduler/__init__.py
Python
0.000001
@@ -0,0 +1,776 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4%0A%0A# Copyright 2011 Openstack LLC.%0A# All Rights Reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License ...
fd74c411fefac7a633627fd3eb5a3c194e6e2b1c
add never_cache for people_admin views
people_admin/views.py
people_admin/views.py
from django.shortcuts import render, get_object_or_404 from django.db.models import Count from openstates.data.models import LegislativeSession, Person from utils.common import abbr_to_jid, sessions_with_bills, states from people_admin.models import UnmatchedName, NameStatus from django.views.decorators.http import re...
Python
0
@@ -331,16 +331,29 @@ _methods +, never_cache %0Afrom dj @@ -1409,24 +1409,37 @@ a%7D,%0A )%0A%0A%0A +@never_cache%0A @user_passes @@ -1876,24 +1876,37 @@ context%7D)%0A%0A%0A +@never_cache%0A @user_passes
573a774e8c8bb30d15659e678c83be86e3cc82a7
Fix user_login method of google provider
pgoapi/auth_google.py
pgoapi/auth_google.py
""" pgoapi - Pokemon Go API Copyright (c) 2016 tjado <https://github.com/tejado> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
Python
0.999997
@@ -2739,24 +2739,51 @@ cess_token() +%0A return self._login %0A%0A def se
aeb69479a6bf5492411e82bbcb77331daa8da819
add a test to test the monitor
tests/test_bzoing.py
tests/test_bzoing.py
""" test_bzoing ---------------------------------- Tests for `bzoing` module. """ import unittest from bzoing.tasks import Bzoinq, Monitor import time class TestTasksAndMonitor(unittest.TestCase): def test_creating_task(self): a = Bzoinq() a.create_task() self.assertTrue(len(a.task_list...
Python
0.000001
@@ -148,16 +148,17 @@ t time%0A%0A +%0A class Te @@ -513,16 +513,473 @@ == 0)%0A%0A + def test_monitor(self):%0A import datetime%0A a = Bzoinq()%0A b = Monitor(a)%0A b.start()%0A first_time = datetime.datetime.now() + datetime.timedelta(seconds=10)%0A a.create_task(%22My...
ef4a020098bbd81339b36bd41493d2261a97aedd
FIX a MAJOR bug where inference evaluation considers 1 groundtruth caption only
keras_image_captioning/inference.py
keras_image_captioning/inference.py
import fire import heapq import numpy as np import os from collections import namedtuple from keras.engine.training import GeneratorEnqueuer from time import sleep from .config import FileConfigBuilder, active_config from .dataset_providers import DatasetProvider from .io_utils import logging, write_yaml_file from .m...
Python
0
@@ -3863,27 +3863,30 @@ -%5B datum. +all_ caption +s _txt -%5D )%0A
7ce0bff2ca63c830e148385b4cce231152843d58
change bug of readMsg
storm-core/src/multilang/py/storm.py
storm-core/src/multilang/py/storm.py
# -*- 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, Version 2.0 (the # ...
Python
0
@@ -1149,22 +1149,88 @@ adline() -%5B0:-1%5D +%0A if not line:%0A raise Exception('Read EOF from stdin') %0A @@ -1237,16 +1237,22 @@ if line +%5B0:-1%5D == %22end @@ -1300,15 +1300,8 @@ line - + %22%5Cn%22 %0A
148826f75072576d7f0d0f206e3d1dba34688720
Refactor getLongestWord to simplify maximum collection and reduce number of conditionals
stream_processor/stream_processor.py
stream_processor/stream_processor.py
''' Created on Aug 7, 2017 @author: alkaitz ''' import heapq ''' You have a function that will be called with a stream of strings. Every time you receive a new word, you should return the length of the longest word that you have received that has showed in the string only once. Ex: f("Yes") -> 3 ...
Python
0
@@ -477,19 +477,16 @@ estWord( -str )%0A%0A'''%0A @@ -1046,82 +1046,83 @@ ord( -str):%0A (length, _) = (working_set%5B0%5D) if working_set else (None, None)%0A +):%0A if len(working_set) %3E 0:%0A (length, _) = (working_set%5B0%5D)%0A @@ -1139,23 +1139,19 @@ ngth - if length else +%0A ret...
6d267faaf9d18e58b24cf93906961b152ef0fcb7
build vehicle list based on if make is provided
src/vehicles/views.py
src/vehicles/views.py
from django.shortcuts import render, render_to_response, RequestContext # import the custom context processor from vehicles.context_processor import global_context_processor from vehicles.models import Vehicle, Category def home_page(request): return render_to_response("home_page.html", locals(), context...
Python
0.000001
@@ -204,16 +204,29 @@ Vehicle, + VehicleMake, Categor @@ -227,16 +227,16 @@ ategory%0A - %0A%0Adef ho @@ -461,16 +461,21 @@ if make +slug paramete @@ -515,16 +515,21 @@ cle_make +_slug = reque @@ -749,16 +749,21 @@ cle_make +_slug is not @@ -768,16 +768,114 @@ t None:%0A + # get make by slug%0A ...
39ab86b500cc28420aa0062395adc9e6ddf2017c
allow reading fom multiple configuration files
src/vsphere/config.py
src/vsphere/config.py
from ConfigParser import ConfigParser class EsxConfig: def __init__(self): parser = ConfigParser() parser.read("vsphere.conf") self.vs_host = parser.get('server', 'host') self.vs_user = parser.get('server', 'user') self.vs_password = parser.get('server', 'password') ...
Python
0
@@ -1,8 +1,39 @@ +import sys%0Afrom os import path%0A from Con @@ -67,118 +67,850 @@ er%0A%0A -class EsxConfig:%0A def __init__(self):%0A parser = ConfigParser()%0A parser.read(%22vsphere.conf%22)%0A%0A +VSPHERE_CFG_FILE = %22vsphere.conf%22%0A%0Aunix_platforms = %5B%0A %22darwin%22,%0A %22Linu...
1c3d92dc1161fd9441275a3be3e5a0c0e351e876
Add --process-dependency-links support to pip wheel
pip/commands/wheel.py
pip/commands/wheel.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import sys from pip.basecommand import Command from pip.index import PackageFinder from pip.log import logger from pip.exceptions import CommandError, PreviousBuildDirError from pip.req import InstallRequirement, RequirementSet, parse_requirement...
Python
0
@@ -4710,16 +4710,139 @@ ns.pre,%0A + process_dependency_links=%0A options.process_dependency_links,%0A
7cd4bf13b2db52fa3870110ab36e892c693a2a02
version bump
pipenv/__version__.py
pipenv/__version__.py
# ___ ( ) ___ ___ __ # // ) ) / / // ) ) //___) ) // ) ) || / / # //___/ / / / //___/ / // // / / || / / # // / / // ((____ // / / ||/ / __version__ = '11.9.0'
Python
0
@@ -211,7 +211,7 @@ 1.9. -0 +1 '%0A
eb34a93c9c49727489726ae52978efa8898b2654
Update ap_anpa.py
superdesk/io/feed_parsers/ap_anpa.py
superdesk/io/feed_parsers/ap_anpa.py
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from .anpa i...
Python
0.000001
@@ -3303,16 +3303,17 @@ ugline', + '')) %3E 4
01e907635a44fdc1802ca8942daa86b43573a247
Use tell/seek to allow the user to read from the database inside a get_all_keys loop, rather than constructing a temporary list
starbound/btreedb5.py
starbound/btreedb5.py
# -*- coding: utf-8 -*- import binascii import io import struct from starbound import sbon # Override range with xrange when running Python 2.x. try: range = xrange except: pass HEADER = '>8si16si?ixxxxii?ixxxxii?445x' HEADER_SIZE = struct.calcsize(HEADER) # Constants for the different block types. FREE =...
Python
0
@@ -2614,35 +2614,8 @@ %5B0%5D%0A - node_keys = %5B%5D%0A @@ -2721,464 +2721,311 @@ -node_keys.append(cur_key)%0A length = sbon.read_varint(reader)%0A reader.seek(length, 1)%0A # We're yielding here rather than in the loop because LeafReader%0A ...
f9c93d60a18df83205289e46fe5f406e51aa2527
Version 0.3.5
starlette/__init__.py
starlette/__init__.py
__version__ = "0.3.4"
Python
0.000001
@@ -16,7 +16,7 @@ 0.3. -4 +5 %22%0A
170a50eeca4249a488cc9d0c69876c5f2708b743
use two-tail for testing significance and right_tail for redundancy checking
stats/significance.py
stats/significance.py
''' Significance testing methods. @author: anze.vavpetic@ijs.si ''' from fisher import pvalue def is_redundant(rule, new_rule): ''' Computes the redundancy coefficient of a new rule compared to its immediate generalization. Rules with a coeff > 1 are deemed non-redundant. ''' return fisher(n...
Python
0
@@ -305,16 +305,17 @@ return +_ fisher(n @@ -322,19 +322,31 @@ ew_rule) +.right_tail %3E +_ fisher(r @@ -349,23 +349,139 @@ er(rule) -%0A%0A%0Adef +.right_tail%0A%0A%0Adef fisher(rule):%0A '''%0A Fisher's p-value for one rule.%0A '''%0A return _fisher(rule).two_tail%0A%0Adef _ fisher(r @@ -817,2...
8907993e48a59ce39dab1cdb359e287f527b7642
Add --verbose parameter
stbt_control_relay.py
stbt_control_relay.py
#!/usr/bin/python """ Allows using any of the stbt remote control backends remotely using the lirc protocol. Presents the same socket protocol as lircd but sending keypresses using any of stbt's controls. This allows for example controlling a roku over its HTTP interface from some software that only speaks lirc. Exa...
Python
0
@@ -1082,16 +1082,80 @@ ecorder%0A +from _stbt.logging import argparser_add_verbose_argument, debug%0A %0A%0Adef ma @@ -1605,24 +1605,67 @@ ontrol.%22%22%22)%0A + argparser_add_verbose_argument(parser)%0A args = p @@ -1911,32 +1911,21 @@ -sys.stderr.write +debug (%22Receiv @@ -1929,18 +1929,16 @@ ...
84ee720fd2d8403de5f49c54fc41bfcb67a78f78
Add missing vat alias for Turkey
stdnum/tr/__init__.py
stdnum/tr/__init__.py
# __init__.py - collection of Turkish numbers # coding: utf-8 # # Copyright (C) 2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, ...
Python
0.000355
@@ -861,8 +861,55 @@ ers.%22%22%22%0A +from stdnum.tr import vkn as vat # noqa: F401%0A
f32a5e24b39b00b1a74e31560fd22fad4a50a45f
Update utils.py
sublime_jedi/utils.py
sublime_jedi/utils.py
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import subprocess import json import threading import warnings from functools import partial from collections import defaultdict from uuid import uuid1 try: from Queue import Queue except ImportError: from queue import Queue imp...
Python
0.000001
@@ -6643,16 +6643,234 @@ rning)%0A%0A + if python_interpreter.startswith('$project_path'):%0A proejct_dir = os.path.dirname(view.window().project_file_name())%0A python_interpreter = python_interpreter.replace('$project_path', proejct_dir, 1)%0A%0A extr
3c2a8aee155913e63bf36dec7a7afd42e2a810e3
Change buffer overflow exception message.
subsevenzip/buffer.py
subsevenzip/buffer.py
# Copyright (c) 2015, Daniel Svensson <dsvensson@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the # above copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND T...
Python
0
@@ -1681,45 +1681,16 @@ or(%22 -ReadBuffer limit breached! (limit: %25d +Overflow , po @@ -1700,30 +1700,26 @@ ion: - %25d -)%22 %25 (self._limit, + %3E limit:%25d%22 %25 ( self @@ -1729,16 +1729,29 @@ d.tell() +, self._limit ))%0A%0A
e0bd89115c4d103334fe0c751cdbc96a9f005ba6
version up
substance/_version.py
substance/_version.py
__version__ = '1.1.beta.3'
Python
0.998795
@@ -21,7 +21,7 @@ eta. -3 +4 '%0A
f02eb748d33b621368198c10a965b27ee31effca
update tutorial section link
swagger/yamlscript.py
swagger/yamlscript.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # This script, when run, parses the file "swagger.yaml" and strips it down to only # include those paths and methods specified in the included variable. # # As of now, it is called with every "jekyll build" - see jekyll-freme/_plugins/jekyll-pages-directory.rb # line: "...
Python
0
@@ -2116,17 +2116,17 @@ ef=%5C%22../ -T +t utorials
86b698a228ddf1309e8f2006726724af05c5fca1
bump version
symposion/__init__.py
symposion/__init__.py
__version__ = "1.0b1.dev11"
Python
0
@@ -18,11 +18,11 @@ 0b1.dev1 -1 +2 %22%0A
e9a4157ac30d41ab23ac1de344045886a5c4fa02
refactor for consistency
libtaxii/__init__.py
libtaxii/__init__.py
# Copyright (c) 2017, The MITRE Corporation # For license information, see the LICENSE.txt file """ The main libtaxii module """ import six from six.moves import urllib import libtaxii.messages_10 as tm10 import libtaxii.messages_11 as tm11 import libtaxii.clients as tc from .constants import * import cgi from .ve...
Python
0.000011
@@ -2385,24 +2385,40 @@ e_message = +six.ensure_text( http_respons @@ -2425,16 +2425,35 @@ e.read() +, errors='replace') %0A%0A if @@ -2485,142 +2485,8 @@ ne:%0A - if isinstance(response_message, six.binary_type):%0A response_message = response_message.decode(encoding, 'replace')%0A
18d551d2495fc122edb142e416a06ce4129da1f7
Update urls.py
life3/config/urls.py
life3/config/urls.py
"""life3.0 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
Python
0.000002
@@ -785,17 +785,16 @@ url(r'%5E$ -/ ', dashb
ac3a9211725a0538c8c8f7899d86e4e22ceebb71
Update binary_search.py
aids/sorting_and_searching/binary_search.py
aids/sorting_and_searching/binary_search.py
''' In this module, we implement binary search in Python both recrusively and iteratively Assumption: Array is sorted Time complexity: O(log n) ''' def binary_search_recursive(arr, left, right, value): ''' Recursive implementation of binary search of a sorted array Return index of the value found else ...
Python
0.000002
@@ -376,37 +376,44 @@ middle = -( left + +( right + - left ) / 2%0A @@ -918,29 +918,8 @@ le = - (left + right) / 2 # lef
1433106d2e36a08f79b4b2c67e07c1fdd361bda6
fix MAINTENANCE_MODE logic
electionleaflets/urls.py
electionleaflets/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf.urls.static import static from django.views.generic import TemplateView admin.autodiscover() from leaflets.feeds import * from core.views import HomeView, MaintenanceView if getattr...
Python
0.000011
@@ -306,11 +306,26 @@ iew%0A -%0Aif +MAINTENANCE_MODE = get @@ -363,13 +363,34 @@ E', -None) +False)%0Aif MAINTENANCE_MODE :%0A
5605dd1f37f91d0fa627d49332f5550c90e6d2e7
Check child is element before inspecting name
mammoth/docx/xmlparser.py
mammoth/docx/xmlparser.py
import collections import xml.sax XmlElementBase = collections.namedtuple("XmlElement", ["name", "attributes", "children"]) class XmlElement(XmlElementBase): def find_child_or_null(self, name): return self.find_child(name) or _null_xml_element def find_child(self, name): for child in self...
Python
0.000001
@@ -474,16 +474,29 @@ (filter( +%0A lambda c @@ -512,20 +512,74 @@ ld.n -ame == name, +ode_type == node_types.element and child.name == name,%0A sel @@ -588,16 +588,25 @@ children +%0A ))%0A%0A%0Acla
bc9bbe0075f8a6571179e2310a9cfeaff89652b2
Remove unused argument
modules/pipeunion.py
modules/pipeunion.py
# pipeunion.py # from pipe2py import util def pipe_union(context, _INPUT, conf, **kwargs): """This operator merges up to 5 source together. Keyword arguments: context -- pipeline context _INPUT -- source generator kwargs -- _OTHER1 - another source generator _OTHER2 etc. conf: ...
Python
0.000009
@@ -72,14 +72,8 @@ PUT, - conf, **k @@ -300,18 +300,8 @@ tc.%0A - conf:%0A
3053c57a67c4dfb5e20bb93d6a586c7acf84275e
Prepare release v1.3.5.
monitoring/nagios/__init__.py
monitoring/nagios/__init__.py
import monitoring.nagios.logger __version__ = '1.3.2'
Python
0
@@ -49,7 +49,7 @@ 1.3. -2 +5 '%0A
cf07c34fe3a3d7b8767e50e77e609253dd177cff
Use isoformat date RFC 3339
moulinette/utils/serialize.py
moulinette/utils/serialize.py
import logging from json.encoder import JSONEncoder import datetime logger = logging.getLogger('moulinette.utils.serialize') # JSON utilities ------------------------------------------------------- class JSONExtendedEncoder(JSONEncoder): """Extended JSON encoder Extend default JSON encoder to recognize mor...
Python
0
@@ -914,13 +914,20 @@ urn -str(o +o.isoformat( )%0A%0A
161ea323d9d1bff81ccec5ab2a7ac60dea52ca27
Undo color change to lineEdit part
ComboBox.py
ComboBox.py
# CheckableComboBox # Lærke Roager Christensen # 6/30/22 # # This is a costume ComboBox where you can select multiple items on a list. # Used in the Settings Tool. # The code is found on: https://gis.stackexchange.com/questions/350148/qcombobox-multiple-selection-pyqt5 # with some modifications made by Lærke. from PyQ...
Python
0
@@ -1,9 +1,13 @@ # +%0A# Checkab @@ -18,16 +18,20 @@ mboBox%0A# +%0A# L%C3%A6rke R @@ -49,16 +49,18 @@ tensen%0A# + 6/30/22 @@ -63,16 +63,102 @@ 0/22%0A#%0A# + Version 3.5.1 - 7/1/22 - Ron Lockwood%0A# Undo color change to lineEdit part%0A#%0A# This is @@ -165,14 +165,13 @@ a c -ostume +ustom...
a1f2e3a7d32687c8495bf36491a11b885ebe2dee
append to mc log instead of overwrite
mpfmc/commands/mc.py
mpfmc/commands/mc.py
"""Starts the MPF media controller.""" import argparse import logging import os import socket import sys import threading from datetime import datetime import time import errno # Note, other imports are done deeper in this file, which we need to do there # since Kivy does so much with singletons and we don't want MP...
Python
0.000001
@@ -5440,48 +5440,25 @@ ame= -os.path.join(machine_path, args.logfile) +full_logfile_path ,%0A @@ -5493,17 +5493,17 @@ lemode=' -w +a ')%0A%0A
12549cf9b7bc3c2a7baa5aacde91749bd8f2b94d
print crc as well
mppsolar/__init__.py
mppsolar/__init__.py
# !/usr/bin/python3 import logging from argparse import ArgumentParser from .version import __version__ # noqa: F401 # import mppcommands from .mpputils import mppUtils log = logging.getLogger('MPP-Solar') # setup logging (DEBUG, INFO, WARNING, ERROR, CRITICAL) # ch = logging.StreamHandler() # create formatter and a...
Python
0.000002
@@ -2696,34 +2696,16 @@ mmand))%0A - else:%0A @@ -2762,20 +2762,16 @@ a: F821%0A -
5d8b2224bf2864ad7e4bacb0624542dec8549b57
add mpf-mc entry points in machine test
mpf/tests/MpfMachineTestCase.py
mpf/tests/MpfMachineTestCase.py
from mpf.tests.MpfTestCase import MpfTestCase class MpfMachineTestCase(MpfTestCase): def __init__(self, methodName='runTest'): super().__init__(methodName) # only disable bcp. everything else should run self.machine_config_patches = dict() self.machine_config_patches['bcp'] = [] ...
Python
0
@@ -1,8 +1,70 @@ +import inspect%0Afrom mpf.core.machine import MachineController%0A from mpf @@ -456,16 +456,701 @@ = 5.0%0A%0A + @staticmethod%0A def _load_mc_players(cls):%0A mc_players = %7B%0A %22sound_player%22: %22mpfmc.config_players.sound_player%22,%0A %22widget_player%22:...
04745c9c4074ee44e2cfd7ef5fecae1eb796b109
Fix now_utc() to return aware datetime
mycroft/util/time.py
mycroft/util/time.py
# -*- coding: utf-8 -*- # # Copyright 2018 Mycroft AI 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 ...
Python
0
@@ -1581,32 +1581,39 @@ %22%22%22%0A return +to_utc( datetime.utcnow( @@ -1613,16 +1613,17 @@ utcnow() +) %0A%0A%0Adef n
e4ccfdb49951ed9c4073ba389421d89fea273288
make test more robust
mpfmc/tests/MpfSlideTestCase.py
mpfmc/tests/MpfSlideTestCase.py
from mpf.tests.MpfTestCase import MpfTestCase class MpfSlideTestCase(MpfTestCase): def assertSlideOnTop(self, slide_name, target="default"): self.assertEqual(slide_name, self.mc.targets[target].current_slide.name) def assertTextOnTopSlide(self, text, target="default"): self.assertTextInSlide...
Python
0.000329
@@ -820,32 +820,345 @@ t(slide_name))%0A%0A + def _get_texts_from_slide(self, slide):%0A texts = %5B%5D%0A for children in slide.children:%0A if children.children:%0A texts.extend(self._get_texts_from_slide(children))%0A if hasattr(children, %22text%22):%0A ...
102f7f844d30d30eff98836a93b3f62e5bc8eb68
Fix tests
nodeconductor/billing/tests/test_invoices.py
nodeconductor/billing/tests/test_invoices.py
from mock import patch, Mock from datetime import datetime from django.core.management import call_command, CommandError from django.test import TestCase from nodeconductor.billing.tasks import create_invoices from nodeconductor.core.utils import datetime_to_timestamp from nodeconductor.iaas.tests.factories import C...
Python
0
@@ -4415,20 +4415,16 @@ billing. -api. create_i @@ -4887,12 +4887,8 @@ g(). -api. crea
d6c9ac218ca2b4fb3c730b13de6d8079448a9825
return current timestamp for chapter up-/download
mygpo/api/advanced/episode.py
mygpo/api/advanced/episode.py
# # This file is part of my.gpodder.org. # # my.gpodder.org 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 License, or (at your # option) any later version. # # my.gpodder.org i...
Python
0.003125
@@ -1880,16 +1880,83 @@ rname):%0A +%0A now = datetime.now()%0A now_ = int(mktime(now.timetuple()))%0A%0A if r @@ -3069,16 +3069,29 @@ sponse(%7B +%0A 'update_ @@ -3106,16 +3106,60 @@ date_url +,%0A 'timestamp': now_%0A %7D)%0A%0A @@ -4337,24 +4337,95 @@ esponse( ...
6ad60176892df0eabb7faf96277c792c742fc9f0
simplify some codes in _build_request
mechanicalsoup/browser.py
mechanicalsoup/browser.py
import requests import bs4 from six.moves import urllib from six import string_types from .form import Form class Browser: def __init__(self, session=None, soup_config=None): self.session = session or requests.Session() self.soup_config = soup_config or dict() @staticmethod def add_soup(...
Python
0.000117
@@ -1632,16 +1632,38 @@ eckbox%22) + %5C%0A and %22ch @@ -1783,95 +1783,33 @@ -if not name in data:%0A data%5Bname%5D = list()%0A data%5Bname%5D +data.setdefault(name, %5B%5D) .app
5e6bbccc844c64628f5dcd2c9ca19d6f00f1b795
Fix tabs vs spaces from mergetool
mythril/laser/ethereum/svm.py
mythril/laser/ethereum/svm.py
from z3 import BitVec import logging from mythril.laser.ethereum.state import GlobalState, Environment, CalldataType, Account from mythril.laser.ethereum.instructions import Instruction from mythril.laser.ethereum.cfg import NodeFlags, Node, Edge, JumpType from mythril.laser.ethereum.strategy.basic import DepthFirstSea...
Python
0
@@ -566,24 +566,25 @@ ass%0A %22%22%22%0A +%0A def __in @@ -670,16 +670,33 @@ eout=60, +%0A strateg @@ -1100,9 +1100,16 @@ out%0A -%09 + self @@ -5137,24 +5137,16 @@ dress'%5D%0A - %0A @@ -5470,16 +5470,33 @@ ng.info( +%0A %22- Enter @@ -6626,32 +...
8a006ecff95e7699a4ca65f2af5ff566648c3a0d
Add norhh suggestion #1
mythril/analysis/modules/dos.py
mythril/analysis/modules/dos.py
"""This module contains the detection code SWC-128 - DOS with block gas limit.""" import logging from typing import Dict, cast, List from mythril.analysis.swc_data import DOS_WITH_BLOCK_GAS_LIMIT from mythril.analysis.report import Issue from mythril.analysis.modules.base import DetectionModule from mythril.laser.eth...
Python
0
@@ -191,16 +191,82 @@ S_LIMIT%0A +from mythril.laser.ethereum.strategy.custom import JUMPDEST_LIMIT%0A from myt @@ -2556,9 +2556,26 @@ == -3 +JUMPDEST_LIMIT - 1 :%0A%0A
3207e36984e845496dc910ad32e4f5e3ba628836
Fix PEP8 issues.
doc/source/conf.py
doc/source/conf.py
# -*- coding: utf-8 -*- # # Swiftclient documentation build configuration file, created by # sphinx-quickstart on Tue Apr 17 02:17:37 2012. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
Python
0.000009
@@ -427,17 +427,23 @@ port sys -, +%0Aimport os%0A%0A# I
be4d150accd90ec856513576664c90d85d5012c7
add unit to ProcessTypeResourceType admin list_display
valuenetwork/valueaccounting/admin.py
valuenetwork/valueaccounting/admin.py
from django.contrib import admin from valuenetwork.valueaccounting.models import * from valuenetwork.valueaccounting.actions import export_as_csv admin.site.add_action(export_as_csv, 'export_selected objects') admin.site.register(Unit) admin.site.register(AgentType) #admin.site.register(Stage) class HelpAdmin(admin...
Python
0
@@ -2603,16 +2603,24 @@ nt_type' +, 'unit' )%0A li
39a23d06cc09a9dbf0802740aaca8854bfd64b04
Add check for directory access rights in LocalStorage
onitu/drivers/local_storage/local_storage.py
onitu/drivers/local_storage/local_storage.py
from path import path from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler from onitu.api import Plug plug = Plug() # Ignore the next Watchdog event concerning those files events_to_ignore = set() # Store the mtime of the last write of each transfered file last_mtime = {} root ...
Python
0
@@ -1,12 +1,23 @@ +import os%0A%0A from path im @@ -3753,16 +3753,139 @@ oot'%5D)%0A%0A + if not root.access(os.W_OK %7C os.R_OK):%0A plug.logger.error(%22Can't access directory %60%7B%7D%60.%22, root)%0A return%0A%0A obse
2d95b9a4b6d87e9f630c59995403988dee390c20
Fix simple typo: utilty -> utility (#5182)
doc/sphinx_util.py
doc/sphinx_util.py
# -*- coding: utf-8 -*- """Helper utilty function for customization.""" import sys import os import docutils import subprocess READTHEDOCS_BUILD = (os.environ.get('READTHEDOCS', None) is not None) if not os.path.exists('web-data'): subprocess.call('rm -rf web-data;' + 'git clone https://github.com...
Python
0.999997
@@ -31,16 +31,17 @@ per util +i ty funct
d806cc19e058ad63c6be47d8e616b0c869549db7
FIX remote does not have test file wired...
sklearn/decomposition/tests/test_spectra_embedding.py
sklearn/decomposition/tests/test_spectra_embedding.py
import numpy as np from nose.tools import assert_true from nose.tools import assert_equal from scipy.sparse import csr_matrix from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn.decomposition.spectra_embedding import SpectralEmbedding from sklearn.metrics.pairwise import rbf_kernel ...
Python
0
@@ -1,24 +1,4 @@ -import numpy as np%0A%0A from @@ -101,16 +101,35 @@ _matrix%0A +import numpy as np%0A from num
8784162eb60cd23bbbe669c698e9406d43c1a7ff
Explicitly set allow_empty = True
nextcloudappstore/core/views.py
nextcloudappstore/core/views.py
from django.views.generic.detail import DetailView from django.views.generic.list import ListView from nextcloudappstore.core.models import App, Category from django.http import Http404 from django.db.models import Q class AppDetailView(DetailView): model = App template_name = 'app/detail.html' slug_field...
Python
0.999992
@@ -611,16 +611,39 @@ st.html' +%0A allow_empty = True %0A%0A de
22f9ff98e048f47493394570b519d179657d9427
Add `--host/port` options
skylines/commands/tracking/generate_through_daemon.py
skylines/commands/tracking/generate_through_daemon.py
from __future__ import print_function from flask_script import Command, Option import sys import socket import struct from skylines.model import User from skylines.tracking.server import ( datetime, FLAG_LOCATION, FLAG_ALTITUDE, TrackingFix, MAGIC, TYPE_FIX, set_crc, ) from math import sin...
Python
0.000002
@@ -475,102 +475,139 @@ -UDP_IP = %22127.0.0.1%22%0A UDP_PORT = +option_list = (%0A Option(%22--host%22, type=str, default=%22127.0.0.1%22),%0A Option(%22--port%22, type=int, default= 5597 +), %0A -ADDRESS = (UDP_IP, UDP_PORT)%0A%0A option_list = ( + Opti @@ -648,16 +648,21 @@ er ...
62f3a1ce0e2af511e897ac300e3ab32f4bf14463
Fix docs
src/pybel/struct/filters/node_predicates/modifications.py
src/pybel/struct/filters/node_predicates/modifications.py
# -*- coding: utf-8 -*- """Predicates for checking nodes' variants.""" from typing import Tuple, Type, Union from .utils import node_predicate from ..typing import NodePredicate from ....dsl import BaseEntity, CentralDogma, Fragment, GeneModification, Hgvs, ProteinModification, Variant __all__ = [ 'has_variant'...
Python
0.000003
@@ -66,16 +66,44 @@ ts.%22%22%22%0A%0A +from functools import wraps%0A from typ @@ -742,21 +742,145 @@ ate%0A +@wraps(node_has_variant)%0A def _rv(node: BaseEntity):%0A return node_has_variant(node, variant_cls)%0A%0A return _rv%0A%0A%0A def -_ node_has @@ -896,32 +896,45 @@ node: BaseEntity +, ...
65b658d9bb1b9220cfd15724692517c14f5e2cbc
Send more information
openprescribing/frontend/signals/handlers.py
openprescribing/frontend/signals/handlers.py
import logging from allauth.account.signals import user_logged_in from anymail.signals import tracking from requests_futures.sessions import FuturesSession from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver from django.conf import settings ...
Python
0
@@ -2157,16 +2157,32 @@ esp_name +, event.__dict__ ))%0A s
4f6ce9c774a0e5a577a54634a80cb2795f085ac0
update exit code correctly.
vdt/versionplugin/debianize/shared.py
vdt/versionplugin/debianize/shared.py
import argparse import logging import shutil import subprocess import tarfile from os.path import join, basename, dirname from glob import glob from pip.commands.download import DownloadCommand from vdt.version.utils import empty_directory from vdt.version.utils import change_directory log = logging.getLogger(__nam...
Python
0
@@ -2893,24 +2893,45 @@ utput(cmd))%0A + return 0%0A exce @@ -2969,16 +2969,16 @@ r as e:%0A - @@ -3095,16 +3095,37 @@ ))%0A + return 1%0A %0A%0Aclass @@ -3528,16 +3528,121 @@ de = 0%0A%0A + def update_exit_code(self, code):%0A if self.exit_code == 0:%0A ...
09cb8a0fbb10f14d6622bbeed815e025e4eb1751
Update newServer.py
Server/newServer.py
Server/newServer.py
__author__ = 'masudurrahman' import sys import os from twisted.protocols import ftp from twisted.protocols.ftp import FTPFactory, FTPAnonymousShell, FTPRealm, FTP, FTPShell, IFTPShell from twisted.cred.portal import Portal from twisted.cred import checkers from twisted.cred.checkers import AllowAnonymousAccess, FilePa...
Python
0.000001
@@ -1691,16 +1691,18 @@ check +er .addUser @@ -1744,16 +1744,39 @@ TPRealm( +'./', userHome='/Users' )%0A p @@ -1781,15 +1781,8 @@ p = -portal. Port
082d1dde70dba7549d14ea13c3400cdbe8e582ec
Fix since outer_if_first went away. OUTER JOINs are now the default.
mkt/translations/query.py
mkt/translations/query.py
import itertools from django.conf import settings from django.db import models from django.utils import translation as translation_utils from mkt.webapps import query def order_by_translation(qs, fieldname): """ Order the QuerySet by the translated field, honoring the current and fallback locales. Retu...
Python
0
@@ -1343,52 +1343,8 @@ eld, -%0A outer_if_first=True, reu @@ -1409,52 +1409,8 @@ eld, -%0A outer_if_first=True, reu
df5fc7af67aed3aa2d2aeea4cef03d8dd790f1a4
Fix ios enable password regex in terminal plugin (#35741)
lib/ansible/plugins/terminal/ios.py
lib/ansible/plugins/terminal/ios.py
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
Python
0
@@ -2425,16 +2425,17 @@ ssword: +? $%22, erro
b2fce504fd0b1bd72a0d383f8ea207d20d068729
debug stmts
api/src/api/v1/handlers/statsHandler.py
api/src/api/v1/handlers/statsHandler.py
from piston.handler import BaseHandler import json from piston.utils import rc from google.protobuf.message import DecodeError import log_analytics_proto from src.api.v1.settings import apiLogger import apiHelper import traceback # import worker classes/functions from src.api.workers import dbWorker from src.utils impo...
Python
0.000001
@@ -1328,92 +1328,8 @@ %0A %0A - if req_obj.req_type == 1:%0A %0A # default scale is 2 - daily%0A @@ -1381,26 +1381,24 @@ oadStruct()%0A - try: @@ -1404,26 +1404,24 @@ :%0A - req_payload @@ -1446,26 +1446,24 @@ oad%0A - - except Decod @@ -1465,34 +...
25e71a56d48e5bdc4d73522333196d69d735707a
Update the PCA10056 example to use new pin naming
ports/nrf/boards/pca10056/examples/buttons.py
ports/nrf/boards/pca10056/examples/buttons.py
import board import digitalio import gamepad import time pad = gamepad.GamePad( digitalio.DigitalInOut(board.PA11), digitalio.DigitalInOut(board.PA12), digitalio.DigitalInOut(board.PA24), digitalio.DigitalInOut(board.PA25), ) prev_buttons = 0 while True: buttons = pad.get_pressed() if button...
Python
0
@@ -108,17 +108,18 @@ (board.P -A +0_ 11),%0A @@ -149,17 +149,18 @@ (board.P -A +0_ 12),%0A @@ -190,17 +190,18 @@ (board.P -A +0_ 24),%0A @@ -235,9 +235,10 @@ rd.P -A +0_ 25),
3de29a3fdd17beece1fbe26c4f578cd854d16d0d
Fix bug introduced in update_from_old_problemformat.py
problemtools/update_from_old_problemformat.py
problemtools/update_from_old_problemformat.py
# -*- coding: utf-8 -*- import argparse import glob import os.path import yaml def update(problemdir): probyaml = os.path.join(problemdir, 'problem.yaml') if not os.path.isfile(probyaml): raise Exception('Could not find %s' % probyaml) config = yaml.safe_load('%s' % open(probyaml, 'r').read()) ...
Python
0
@@ -1946,16 +1946,27 @@ options +.problemdir :%0A
a3bb1ff203789b6547e241f2ba0108e89bd1aefe
Remove mystery import
profile_collection/startup/80-areadetector.py
profile_collection/startup/80-areadetector.py
from ophyd.controls.area_detector import (AreaDetectorFileStoreHDF5, AreaDetectorFileStoreTIFF, AreaDetectorFileStoreTIFFSquashing) from shutter import sh1 shctl1 = EpicsSignal('XF:28IDC-ES:1{Det:PE1}cam1:ShutterMode', name='shctl1') ...
Python
0
@@ -210,16 +210,18 @@ shing)%0A%0A +# from shu
37062a5695eea63726630e98019c85f7985306a2
Use a clearer attribute name
dataobject.py
dataobject.py
import logging import remoteobjects.fields all_classes = {} def find_by_name(name): """Finds and returns the DataObject subclass with the given name. Parameter `name` should be a full dotted module and class name. """ return all_classes[name] class DataObjectMetaclass(type): def __new__(cls, nam...
Python
0.005027
@@ -2609,20 +2609,28 @@ t(self._ -dict +originaldata )%0A @@ -3728,20 +3728,28 @@ self, '_ -dict +originaldata '):%0A @@ -3762,20 +3762,28 @@ self._ -dict +originaldata = %7B%7D%0A @@ -3794,20 +3794,28 @@ self._ -dict +originaldata .update(
9bd5b66a50def87de2b8a37ba452ee4efc8a17b7
add docstring for update_average
web/aliendb/apps/analytics/helpers.py
web/aliendb/apps/analytics/helpers.py
def update_average(field, value, tracked): return (value + field * tracked) / (1 + tracked)
Python
0
@@ -38,9 +38,320 @@ ked) -: + -%3E float:%0A %22%22%22Updates a previously calculated average with a new value.%0A%0A Args:%0A field: the current average;%0A value: the new value to include in the average;%0A tracked: the number of elements used to form the _original_ average;%0A%0A Retur...
4839c43db77a88a872db07ab99be0fdd29bb24fc
Remove bland from 'irrelevant' preferable tendency
LandPortalEntities/lpentities/indicator.py
LandPortalEntities/lpentities/indicator.py
''' Created on 19/12/2013 @author: Nacho ''' from lpentities.measurement_unit import MeasurementUnit class Indicator(object): """ classdocs """ #Simulated Enum Values INCREASE = "increase" DECREASE = "decrease" IRRELEVANT = "irrelevant " #Possible topics _topics_set = ['CLIMATE...
Python
0.000236
@@ -261,17 +261,16 @@ relevant - %22%0A%0A #
48cf73c12f1c586d5ce71fd872f9054b4209d13b
adds missing colon
GPIOTest.py
GPIOTest.py
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(2, GPIO.OUT) GPIO.setup(4, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP) status = not GPIO.input(2) autoswitch=GPIO.input(4) onswitch=GPIO.input(17) GPIO.output(2, status) if status: ...
Python
0.998656
@@ -465,16 +465,17 @@ onswitch +: %0A%09print
aaac2228119bf965183d30ebf9d4b8cb13699fd8
fix tkinter for python 3
GroupEng.py
GroupEng.py
#!/usr/bin/python # Copyright 2011, Thomas G. Dimiduk # # This file is part of GroupEng. # # GroupEng 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 License, or # (at your opti...
Python
0.000069
@@ -1513,16 +1513,83 @@ use it%0A + try:%0A from tkinter import *%0A except ImportError:%0A from
3e7d433c193bd2e35b2c760297d81973f56b3eec
Fix test cases
node/floor_divide.py
node/floor_divide.py
#!/usr/bin/env python from nodes import Node import math class FloorDiv(Node): char = "f" args = 2 results = 1 @Node.test_func([3,2], [1]) @Node.test_func([6,-3], [-2]) def func(self, a:Node.number,b:Node.number): """a/b. Rounds down, returns an int.""" return a//b ...
Python
0.000241
@@ -1674,19 +1674,19 @@ %5B%5B%5B4 -,4 %5D,%5B -2 +4 ,2%5D,%5B +2, 9,9%5D
a9c9cbac36568676be194024f6f660e4fc3f03b6
Add old list to applist migration
src/yunohost/data_migrations/0010_migrate_to_apps_json.py
src/yunohost/data_migrations/0010_migrate_to_apps_json.py
import os from moulinette.utils.log import getActionLogger from yunohost.app import app_fetchlist, app_removelist, _read_appslist_list, APPSLISTS_JSON from yunohost.tools import Migration logger = getActionLogger('yunohost.migration') BASE_CONF_PATH = '/home/yunohost.conf' BACKUP_CONF_DIR = os.path.join(BASE_CONF_PA...
Python
0
@@ -707,16 +707,122 @@ ove = %5B%0A + %22http://app.yunohost.org/list.json%22, # Old list on old installs, alias to official.json%0A
9316ec9f2246ac14176d9bf9d27287dfccedb3f3
Update to 0.3.0
azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/version.py
azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/version.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ---------------------------------------------------------------------...
Python
0
@@ -337,8 +337,9 @@ %220. -2 +3 .0%22 +%0A
8c89a0d52c43f96d9673b8b84786a7185ddc3f6f
Bump WireCloud version
src/wirecloud/platform/__init__.py
src/wirecloud/platform/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2011-2014 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud 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 v...
Python
0
@@ -856,11 +856,11 @@ _)) + 'b -1 +2 '%0A
a4dcfff5214e3956f45bf0ef853dea871dbd8da9
Fix for missing 'methods' section
delphi-395.py
delphi-395.py
import argparse import os import re from uuid import uuid4 from jinja2 import Environment, PackageLoader from yaml import load, Loader def get_config(): parser = argparse.ArgumentParser(description='Construct Delphi classes from a YAML template.') parser.add_argument('source_files', metavar='SOURCE', type=ar...
Python
0.001131
@@ -1831,32 +1831,110 @@ _methods(data):%0A + if 'methods' in data%5B'type'%5D and data%5B'type'%5D%5B'methods'%5D is not None:%0A data%5B'type'%5D @@ -2078,24 +2078,28 @@ + if 'name_tit @@ -2149,32 +2149,36 @@ + + data%5B'type'%5D%5B'na @@ -2239,16 +2239,20 @@ ...
36bfa8f556941848eb1a809d48aae1aa43f23c3f
Add option to choose if we keep the <none> images
di-cleaner.py
di-cleaner.py
#!/usr/bin/env python import argparse import atexit import logging import sys from pprint import pformat DEFAULT_DOCKER_BASE_URL = 'unix://var/run/docker.sock' HELP_DOCKER_BASE_URL = ('Refers to the protocol+hostname+port where the ' 'Docker server is hosted. Defaults to %s') % DEFAULT_DOCKER_BASE_URL DEFAULT_DO...
Python
0
@@ -774,16 +774,62 @@ _TO_KEEP +%0AHELP_KEEP_NONE_IMAGES = 'Keep %3Cnone%3E images' %0A%0Adef _e @@ -1479,24 +1479,119 @@ , type=int)%0A + parser.add_argument('--keep-none-images', help=HELP_KEEP_NONE_IMAGES, action='store_true')%0A return p
edf099ca644aae12daef65ff65744d99fcd3a634
Remove function we won't actually use.
st2common/st2common/util/compat.py
st2common/st2common/util/compat.py
# -*- coding: utf-8 -*- # 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 "Licen...
Python
0
@@ -801,20 +801,8 @@ e.%0A%0A -import sys%0A%0A impo @@ -808,16 +808,16 @@ ort six%0A + %0A%0A__all_ @@ -860,54 +860,8 @@ i',%0A - 'add_st2actions_pythonrunner_to_sys_path'%0A %5D%0A%0A%0A @@ -1469,24 +1469,24 @@ ue.%0A %22%22%22%0A + return v @@ -1527,643 +1527,4 @@ e')%0A -%0A%0Adef add_st2actions_...
a187bd1f89d40d4274f884bba567a2f6be160dcd
Remove unintended changes from reverthousekeeping command
cla_backend/apps/cla_butler/management/commands/reverthousekeeping.py
cla_backend/apps/cla_butler/management/commands/reverthousekeeping.py
# coding=utf-8 import os import logging from django.conf import settings from django.contrib.admin.models import LogEntry from django.core.management.base import BaseCommand from cla_butler.qs_to_file import QuerysetToFile from cla_eventlog.models import Log from cla_provider.models import Feedback from complaints.mod...
Python
0
@@ -22,22 +22,8 @@ os%0A -import logging %0Afro @@ -1060,46 +1060,8 @@ %0A%5D%0A%0A -logger = logging.getLogger(%22django%22)%0A%0A %0Acla @@ -1294,79 +1294,8 @@ s):%0A - logger.info(%22Running monitor_multiple_outcome_codes cron job%22)%0A
5ffef1beb126fed15851ddc30ea9fca7edbca017
Remove debug code
app/soc/modules/gsoc/views/student_forms.py
app/soc/modules/gsoc/views/student_forms.py
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange 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 applic...
Python
0.000299
@@ -2776,58 +2776,8 @@ ():%0A - import logging%0A logging.warning(%22Sad%22)%0A
123401cb6ed88b77d9a584eea8f2de75e518e5da
remove try except when hintsvm is not installed
libact/query_strategies/__init__.py
libact/query_strategies/__init__.py
""" Concrete query strategy classes. """ import logging logger = logging.getLogger(__name__) from .active_learning_by_learning import ActiveLearningByLearning try: from .hintsvm import HintSVM except ImportError: logger.warn('HintSVM library not found, not importing.') from .uncertainty_sampling import Uncerta...
Python
0
@@ -157,17 +157,8 @@ ing%0A -try:%0A from @@ -186,89 +186,8 @@ SVM%0A -except ImportError:%0A logger.warn('HintSVM library not found, not importing.')%0A from
0e56ed6234e1f28b0aac2e22063bb39faab1d54c
use '!XyZZy!' as value to be sustituted in metric name
librato_python_web/tools/compose.py
librato_python_web/tools/compose.py
# Copyright (c) 2015. Librato, Inc. # 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 conditions a...
Python
0.000231
@@ -1610,13 +1610,15 @@ = %22 +! XyZZy +! %22%0ADU
a31a8aa7d5ef0fb742f909c09c340c3f54104833
clean up comments
linkedin/spiders/linkedin_spider.py
linkedin/spiders/linkedin_spider.py
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector import HtmlXPathSelector from scrapy.http import Request from linkedin.items import LinkedinItem # compile to C using Cython if processing speed becomes a constraint class Linkedi...
Python
0
@@ -1519,60 +1519,8 @@ m()%0A - # TODO: update this xpath to include class id%0A @@ -1585,16 +1585,17 @@ ght page +? %0A i @@ -1619,32 +1619,46 @@ = hxs.select('// +*%5B@id=%22name%22%5D/ span/span/text() @@ -1908,16 +1908,60 @@ resolve%0A + # Fake account and log-in?%0A %0A ...
957e1c2ec602d4ec6aa990cdce4196083f0e5a2d
Fix buggy import setup for embedded bot tests.
zerver/tests/test_embedded_bot_system.py
zerver/tests/test_embedded_bot_system.py
# -*- coding: utf-8 -*- from unittest.mock import patch from typing import Any, Dict, Tuple, Text, Optional from zerver.lib.test_classes import ZulipTestCase from zerver.models import UserProfile, Recipient, get_display_recipient class TestEmbeddedBotMessaging(ZulipTestCase): def setUp(self): # type: () ...
Python
0
@@ -35,21 +35,16 @@ test -.mock import patc @@ -39,21 +39,20 @@ import -patch +mock %0Afrom ty @@ -2525,16 +2525,21 @@ ):%0A @ +mock. patch(%22l
e4aa61b523dc613ff51c6f2192dabfe6ac28edba
update tests
custom/enikshay/integrations/ninetyninedots/tests/test_integration.py
custom/enikshay/integrations/ninetyninedots/tests/test_integration.py
from datetime import datetime import pytz from django.test import SimpleTestCase, TestCase from django.utils.dateparse import parse_datetime from corehq.form_processor.tests.utils import run_with_all_backends, FormProcessorTestUtils from corehq.form_processor.interfaces.dbaccessors import CaseAccessors from custom.en...
Python
0.000001
@@ -88,57 +88,8 @@ ase%0A -from django.utils.dateparse import parse_datetime %0A%0Afr @@ -2050,16 +2050,228 @@ : True,%0A + %7D,%0A %7B%0A %22timestamp%22: %222016-03-05T19:00:01-05:00%22, # next day in india%0A %22numberFromWhichPatientDialled%22: %22+91012345678...
58f9acb9a75cceba2be708347dac55f28794553f
Fix indentation
qiita_pet/handlers/study_handlers/artifact.py
qiita_pet/handlers/study_handlers/artifact.py
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
Python
0.017244
@@ -3097,36 +3097,32 @@ g':%0A - self.write(%7B'sta @@ -3138,20 +3138,16 @@ ccess',%0A -
65751b4243b3baeb47af36a68a167394cb7d292e
fix for python 2.7 not liking yield from
Python/Product/TestAdapter/testlauncher.py
Python/Product/TestAdapter/testlauncher.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import io import os import sys import traceback def main(): cwd, testRunner, secret, port, debugger_search_path, mixed_mode, coverage_file, test_file, args = parse_argv() sys.path[0] = os.getcwd() os.chdir(cwd) ...
Python
0
@@ -5887,18 +5887,19 @@ -yield from +for item in ori @@ -5912,16 +5912,56 @@ ollect() +:%0A yield item%0A %0A
f379d8ce256159a4fc7ce58abf87c609a4a0c3ab
rename present() _present(), indicating private
AlphaTwirl/EventReader/ProgressMonitor.py
AlphaTwirl/EventReader/ProgressMonitor.py
# Tai Sakuma <sakuma@fnal.gov> import multiprocessing import time from ProgressReport import ProgressReport ##____________________________________________________________________________|| class ProgressReporter(object): def __init__(self, queue, pernevents = 1000): self.queue = queue self.perneve...
Python
0.003887
@@ -1966,32 +1966,33 @@ ()%0A self. +_ present()%0A%0A d @@ -2015,24 +2015,25 @@ self. +_ present()%0A%0A @@ -2039,16 +2039,17 @@ def +_ present(
afa8fc0e5d9b38e3e65ff70ef5375dad881272ff
Use C3DFileAdapter read extension in python to select different ForceLocations for expressing force plate data in read-in forces table.
Bindings/Python/tests/test_DataAdapter.py
Bindings/Python/tests/test_DataAdapter.py
""" Test DataAdapter interface. """ import os, unittest import opensim as osim test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)), 'tests') class TestDataAdapter(unittest.TestCase): def test_TRCFileAdapter(self): adapter = osim.TRCFileAdapter() table = ...
Python
0
@@ -1428,16 +1428,19 @@ g2.c3d') +, 0 )%0A @@ -1764,16 +1764,19 @@ g5.c3d') +, 1 )%0A%0A
68fe7ecadeda267b5645fd804bb7bbf29afa3667
add docstring
corehq/apps/cleanup/management/commands/delete_es_docs_in_domain.py
corehq/apps/cleanup/management/commands/delete_es_docs_in_domain.py
from django.core.management import BaseCommand, CommandError from corehq.apps.domain.models import Domain from corehq.apps.es import AppES, CaseES, CaseSearchES, FormES, GroupES, UserES from corehq.apps.es.registry import registry_entry from corehq.apps.es.transient_util import doc_adapter_from_info class Command(Ba...
Python
0.000005
@@ -324,16 +324,141 @@ ommand): +%0A %22%22%22%0A Intended for use in the event that a domain has been deleted, but ES docs have not been fully cleaned up%0A %22%22%22 %0A%0A de
50e729173ba49f0c95ae98266caca16b119f481a
add 3.5.0 (#4375)
var/spack/repos/builtin/packages/arpack-ng/package.py
var/spack/repos/builtin/packages/arpack-ng/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0.000001
@@ -2596,16 +2596,73 @@ ar.gz'%0A%0A + version('3.5.0', '9762c9ae6d739a9e040f8201b1578874')%0A vers
bff3a087ec70ab07fe163394826a41c33f6bc38f
Add extra version of py-jinja2 (#14989)
var/spack/repos/builtin/packages/py-jinja2/package.py
var/spack/repos/builtin/packages/py-jinja2/package.py
# Copyright 2013-2020 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 PyJinja2(PythonPackage): """Jinja2 is a template engine written in pure Python. It provide...
Python
0
@@ -695,16 +695,113 @@ 527de')%0A + version('2.10.1', sha256='065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013')%0A vers
45390a88b94aad6d7f04424bf8e1e9b8bbbe424b
Test new helper get_schema_or_template.
boardinghouse/tests/test_schema_creation.py
boardinghouse/tests/test_schema_creation.py
from django.test import TestCase from django.db import connection from django import forms from ..models import Schema, template_schema from ..schema import get_schema, activate_schema, deactivate_schema SCHEMA_QUERY = "SELECT schema_name FROM information_schema.schemata WHERE schema_name = %s" TABLE_QUERY = "SELECT ...
Python
0
@@ -151,16 +151,22 @@ import +(%0A get_sche @@ -168,16 +168,40 @@ _schema, + get_schema_or_template, activat @@ -227,16 +227,18 @@ e_schema +%0A) %0A%0ASCHEMA @@ -4869,28 +4869,409 @@ rtEquals(None, get_schema()) +%0A %0A def test_get_schema_or_template_helper(self):%0A schema = Schema.object...
1fc208322381438a9bbcb9debcdc0f53a5c52932
Create W_layer_1 and b_layer_1 with shape
TFBoost/TFModels.py
TFBoost/TFModels.py
""" Author: @gabvaztor StartDate: 04/03/2017 This file contains samples and overrides deep learning algorithms. """ """ # -------------------------------------------------------------------------- # -------------------------------------------------------------------------- # IMPORTS # --------------------------------...
Python
0.000074
@@ -4224,32 +4224,205 @@ urn:%0A %22%22%22 +%0A # TODO Create an simple but generic convolutional model to analyce sets.%0A # TODO Define firstLabelNeurons%0A firstLabelNeurons = 8 # First label neurons %0A%0A x = tf @@ -4522,18 +4522,16 @@ sses%5D)%0A%0A -%0A%0A @@ -4541...
2b8716f5a1f0e1f147b6bbda3e45e4abec59811d
fix TB in indexing debug toolbar
abilian/services/indexing/debug_toolbar.py
abilian/services/indexing/debug_toolbar.py
# coding=utf-8 """ """ from __future__ import absolute_import from flask import current_app from flask_debugtoolbar.panels import DebugPanel from abilian.core.util import fqcn from abilian.i18n import _ from abilian.web.action import actions class IndexedTermsDebugPanel(DebugPanel): """ A panel to display term va...
Python
0
@@ -1748,16 +1748,35 @@ lue and +field.analyzer and field.fo
9e6c05a4f5e460d13558d99de3e97e1c31af2d2e
fix bug where only the first cookie gets sent. closes #1.
livetest/__init__.py
livetest/__init__.py
""" LiveTest - Like WebTest, but on a live site. Setup an app to test against with just a hostname: >>> import livetest >>> app = livetest.TestApp('www.google.com') Make requests just like WebTest: >>> resp = app.get('/') Grab forms: >>> resp.forms # doctest: +ELLIPSIS {0: <webtest.Form object at 0x...>} >>> form...
Python
0
@@ -2499,56 +2499,111 @@ -req.headers%5B'Cookie'%5D = str(c).split(': ', 1)%5B1%5D +hc = '; '.join(%5B'='.join(%5Bm.key, m.value%5D) for m in c.values()%5D)%0A req.headers%5B'Cookie'%5D = hc %0A%0A