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
d80878788ddcc1443c54c11b923da23bc295b496
Fix wget -q flag
charmtest/network.py
charmtest/network.py
import io import argparse class Wget(object): name = "wget" def __init__(self, network): self._network = network def __call__(self, proc_args): parser = argparse.ArgumentParser() parser.add_argument("url") parser.add_argument("-O", dest="output") parser.add_argum...
Python
0.000002
@@ -332,17 +332,38 @@ est=%22qui -t +et%22, action=%22store_tru e%22)%0A
730e765822932b5b0b00832c41140f39a9ae8d11
Bump version
datetimerange/__version__.py
datetimerange/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.3.5" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
Python
0
@@ -208,9 +208,9 @@ 0.3. -5 +6 %22%0A__
e15a1bd925a7fb163ef45e9a8519110d147e623f
Add TODOs to Event RSS
controllers/event_controller.py
controllers/event_controller.py
import datetime import os import logging import PyRSS2Gen from google.appengine.api import memcache from google.appengine.ext import webapp from google.appengine.ext.webapp import template, util from django.utils import simplejson from models import Event, Match from helpers.match_helper import MatchHelper from hel...
Python
0
@@ -3249,16 +3249,231 @@ ar 2011%0A + # TODO: Make this output format something either very machine or very human readable.%0A # Probably opt for human, since machines should be using the API. -gregmarra 12 Mar 2011%0A
0b9a97a4d6d47bd8f442c3fe3783b1d2cd85ac74
Add tests for widgets
jarbas/dashboard/tests/test_dashboard_admin.py
jarbas/dashboard/tests/test_dashboard_admin.py
from collections import namedtuple from unittest.mock import MagicMock from django.test import TestCase from jarbas.core.models import Reimbursement from jarbas.dashboard.admin import ReimbursementModelAdmin, SubuotaListfilter Request = namedtuple('Request', ('method',)) ReimbursementMock = namedtuple('Reimbursemen...
Python
0.000001
@@ -183,50 +183,127 @@ ort -ReimbursementModelAdmin, SubuotaListfilter +(%0A ReceiptUrlWidget,%0A ReimbursementModelAdmin,%0A SubquotaWidget,%0A SubuotaListfilter,%0A SuspiciousWidget,%0A) %0A%0A%0AR @@ -2077,32 +2077,32 @@ ock(), self.qs)%0A - self.qs. @@ -2148,8 +2148,1945 @@ _id=42)%0A +...
6c131821bd91d2353d99daecfe27981d1b09a525
Fix help description
Cogs/Responses.py
Cogs/Responses.py
import discord, re from discord.ext import commands from Cogs import Settings, DisplayName, Utils, Nullify, PickList def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") bot.add_cog(Responses(bot, settings)) class Responses(commands.Cog): # Init with the bot reference, and a refer...
Python
0.996521
@@ -2382,69 +2382,8 @@ me%0D%0A -%09%09%5B%5Bgame%5D%5D = the game name%0D%0A%09%09%5B%5Burl%5D%5D = stream url%0D%0A %09%09%5B%5B
2e23ad9decd01ece3d924e57dabc923cec8f34f7
tidy up some obsolete junk
Commands/Alias.py
Commands/Alias.py
# -*- coding: utf-8 -*- """ Created on May 21, 2014 @author: HubbeKing, Tyranic-Moron """ import re from CommandInterface import CommandInterface from IRCMessage import IRCMessage from IRCResponse import IRCResponse, ResponseType import GlobalVars class Alias(CommandInterface): triggers = ['alias', 'unalias', '...
Python
0.000018
@@ -2121,200 +2121,8 @@ age) -%0A elif newCommand in self.aliases: # command is an alias of another alias%0A newMessage = self._aliasedMessage(message)%0A return self.execute(newMessage) %0A%0A @@ -2911,262 +2911,11 @@ mand -!%22.format(message.ParameterList%5B0%5D.lower()...
35ff017b483bb46b1f942045bd2c9e20ace39483
fix line splitting
Commands/Urban.py
Commands/Urban.py
# -*- coding: utf-8 -*- """ Created on Jan 24, 2014 @author: Tyranic-Moron """ import urllib import json from IRCMessage import IRCMessage from IRCResponse import IRCResponse, ResponseType from CommandInterface import CommandInterface from Utils import WebUtils from twisted.words.protocols.irc import assembleForma...
Python
0.000001
@@ -1564,39 +1564,38 @@ on.strip().split -('%5Cr%5Cn' +lines( )%5D)%0A%0A exa @@ -1698,15 +1698,14 @@ plit -('%5Cr%5Cn' +lines( )%5D)%0A
74e1a3617457a2d690000fd18825e864a70a2d85
print not-installed when in quiet mode
checkdependencies.py
checkdependencies.py
#!/usr/bin/env python2 import imp, os, sys, subprocess from distutils import spawn try: import pip except: pip = None dirname = os.path.dirname(__file__) from lib import wireutils wireutils.cprintconf.name = "Perdyshot" wireutils.cprintconf.color= wireutils.bcolors.DARKCYAN def readBool(text): reply =...
Python
0
@@ -1083,34 +1083,8 @@ if -not args.get(%22quiet%22) and args @@ -1175,32 +1175,10 @@ el -if not args.get(%22quiet%22) +se :%0A @@ -2411,34 +2411,8 @@ if -not args.get(%22quiet%22) and args @@ -2503,32 +2503,10 @@ el -if not args.get(%22quiet%22) +se :%0A
55f3e0e222246bfbc9c1a19f68b06941bac6cd70
Add an option to include spaces on random string generator
base/utils.py
base/utils.py
""" Small methods for generic use """ # standard library import itertools import random import re import string import unicodedata # django from django.utils import timezone def today(): """ This method obtains today's date in local time """ return timezone.localtime(timezone.now()).date() # BROKE...
Python
0.000004
@@ -1520,16 +1520,37 @@ ars=None +, include_spaces=True ):%0A i @@ -1622,16 +1622,61 @@ digits%0A%0A + if include_spaces:%0A chars += ' '%0A%0A retu
5496bd29c4262c252367d7b305d2a78fd1ad2fa7
move debug call
bcdata/wcs.py
bcdata/wcs.py
import logging import requests import bcdata log = logging.getLogger(__name__) def get_dem( bounds, out_file="dem.tif", src_crs="EPSG:3005", dst_crs="EPSG:3005", resolution=25, interpolation=None ): """Get TRIM DEM for provided bounds, write to GeoTIFF. """ bbox = ",".join([str(b) for b in bounds])...
Python
0.000002
@@ -1782,29 +1782,8 @@ oad) -%0A log.debug(r.url) %0A%0A @@ -1991,16 +1991,19 @@ request + %7B%7D failed @@ -2030,16 +2030,23 @@ .format( +r.url, str(r.st
c4ad9519c117edfdc59f229380fa0797bc6bfffa
Update BitshareComFolder.py
module/plugins/crypter/BitshareComFolder.py
module/plugins/crypter/BitshareComFolder.py
# -*- coding: utf-8 -*- from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class BitshareComFolder(SimpleCrypter): __name__ = "BitshareComFolder" __type__ = "crypter" __version__ = "0.03" __pattern__ = r'http://(?:www\.)?bitshare\.com/\?d=\w+' __config__ = [("...
Python
0
@@ -228,17 +228,17 @@ _ = %220.0 -3 +4 %22%0A%0A _ @@ -863,16 +863,17 @@ (?P%3CN%3E.+ +? )%22%3C/h1%3E'
326f0b881d36ed19d0a37495ae34fc24fc1eb707
Load the spotify header file from an absolute path
connect_ffi.py
connect_ffi.py
from cffi import FFI ffi = FFI() print "Loading Spotify library..." #TODO: Use absolute paths for open() and stuff #Header generated with cpp spotify.h > spotify.processed.h && sed -i 's/__extension__//g' spotify.processed.h with open("spotify.processed.h") as file: header = file.read() ffi.cdef(header) ffi.cdef(...
Python
0
@@ -229,16 +229,42 @@ th open( +os.path.join(sys.path%5B0%5D, %22spotify @@ -277,16 +277,17 @@ ssed.h%22) +) as file
278dcb8b2fb3e1f69434ec9c41e566501cdc50bd
Remove unused functionality
organizations/backends/forms.py
organizations/backends/forms.py
# -*- coding: utf-8 -*- # Copyright (c) 2012-2019, Ben Lopatin and contributors # 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 ...
Python
0
@@ -1492,16 +1492,71 @@ zy as _%0A +from django.contrib.auth.forms import UserCreationForm%0A %0A%0Aclass @@ -1572,35 +1572,36 @@ trationForm( -forms.Model +UserCreation Form):%0A %22 @@ -1796,25 +1796,24 @@ del%0A %22%22%22%0A -%0A # TODO d @@ -1814,997 +1814,69 @@ TODO - decouple first/last names fr...
9d6e5a9077add7ddbc3e03799d3a9916350e0baf
Add pre-save and post-delete handlers to custom image model
core/models.py
core/models.py
from django.db import models from wagtail.core.fields import RichTextField from wagtail.core.models import Page, Orderable from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel, InlinePanel from wagtail.search import index from wagtail.snippets.models import register_snippet from wagtail.images.edit_hand...
Python
0
@@ -21,16 +21,111 @@ t models +%0Afrom django.db.models.signals import pre_delete, pre_save%0Afrom django.dispatch import receiver %0A%0Afrom w @@ -3356,16 +3356,566 @@ er%22,)%0A%0A%0A +# Delete the source image file when an image is deleted%0A@receiver(pre_delete, sender=CustomImage)%0Adef image_delete(sender, ins...
331fb50e6a4dcef99c8a6806d3efd7531859542f
add comments
achievements/templatetags/achievement_tags.py
achievements/templatetags/achievement_tags.py
from django import template from achievements.models import Category, Trophy from achievements import settings register = template.Library() @register.inclusion_tag('achievements/single_category.html') def render_category(category, user): return { 'category': category, 'percentage': category.get...
Python
0
@@ -106,17 +106,16 @@ ttings%0A%0A -%0A register @@ -137,16 +137,70 @@ rary()%0A%0A +# call single_category.html with the given parameters%0A @registe @@ -474,32 +474,81 @@ ts(user)%0A %7D%0A%0A +# call navigation.html with the given parameters%0A @register.inclus @@ -776,16 +776,63 @@ %0A %7D%0A%0A +# cal...
66fc121dbe0dbb7a69a62bfdaf98838a4f7a0bf3
Update yeti.py
misp_modules/modules/expansion/yeti.py
misp_modules/modules/expansion/yeti.py
import json import json try: import pyeti except ImportError: print("pyeti module not installed.") misperrors = {'error': 'Error'} mispattributes = {'input': ['ip-src', 'ip-dst', 'hostname', 'domain'], 'output': ['hostname', 'domain', 'ip-src', 'ip-dst', 'url']} # possible module-types: 'ex...
Python
0
@@ -18,16 +18,17 @@ rt json%0A +%0A try:%0A @@ -513,8 +513,482 @@ ver'%5D%7D%0A%0A +moduleconfig = %5B'apikey', 'url'%5D%0A%0A%0Aclass Yeti:%0A%0A def __init__(self, url, key):%0A self.api = pyeti.YetiApi(url, api_key=key)%0A self.dict = %7B'Ip': 'ip-src', 'Domain': 'domain', 'Hostname': 'hostnam...
24124edccd9a822bb300815907c37d6453defed5
Add recursive handling of nested states.
py/statemachines/simple_state_machine_script_test.py
py/statemachines/simple_state_machine_script_test.py
#---------------------------------------------------------------------------------------- # BEGIN: READ_HEXAPOD_CURRENT_POSE # TEMPLATE: ReadTransformState # smach.StateMachine.add('READ_HEXAPOD_CURRENT_POSE', TFListenerState('ur10_1/base', 'hexapod_1/top', 'hexapod_current_pose'), ...
Python
0
@@ -2291,28 +2291,1946 @@ --------------------------%0A%0A +#----------------------------------------------------------------------------------------%0A# BEGIN: OPEN_TOOL_EXCHANGE_1%0A# TEMPLATE: SetOutput%0A#%0AOPEN_TOOL_EXCHANGE_1_request = DigitalOutputRequest(TOOL_EXCHANGE_GPIO, TOOL_EXCHANGE_OPEN)%0A%0Asmach.Stat...
c3dffef7869c0ce19801d78393a336b6b6ecbce7
stop littering /tmp with temporary resource files
pynodegl-utils/pynodegl_utils/tests/cmp_resources.py
pynodegl-utils/pynodegl_utils/tests/cmp_resources.py
#!/usr/bin/env python # # Copyright 2020 GoPro Inc. # # 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...
Python
0.000002
@@ -2179,16 +2179,59 @@ + '%5Cn'%0A%0A + return ret%0A%0A def __del__(self):%0A @@ -2256,36 +2256,16 @@ vfile)%0A%0A - return ret%0A%0A %0Atest_re
deccf656db39ac949f93e562e4f41a32589feb9b
Use a more complex and extendable check for shortcuts in StructuredText
cybox/common/structured_text.py
cybox/common/structured_text.py
# Copyright (c) 2013, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import cybox import cybox.bindings.cybox_common as common_binding class StructuredText(cybox.Entity): _binding = common_binding _namespace = 'http://cybox.mitre.org/common-2' def __init__(self, value=...
Python
0
@@ -795,16 +795,132 @@ (self):%0A + # Shortcut if structuring_format is not defined.%0A if self.is_plain():%0A return self.value%0A%0A @@ -1067,16 +1067,353 @@ t_dict%0A%0A + def is_plain(self):%0A %22%22%22Whether this can be represented as a string rather than a dictiona...
67f6738121a5b8197297b69d11584af50ae15b4d
Fix #2702
module/plugins/hoster/OneFichierCom.py
module/plugins/hoster/OneFichierCom.py
# -*- coding: utf-8 -*- import re from module.network.RequestFactory import getURL as get_url from module.plugins.internal.SimpleHoster import SimpleHoster from module.plugins.internal.misc import format_exc class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" __versio...
Python
0
@@ -323,17 +323,17 @@ _ = %221.0 -2 +3 %22%0A __ @@ -1930,24 +1930,28 @@ PATTERN + = r'%3EFile%5Cs* @@ -2000,24 +2000,28 @@ PATTERN + = r'%3ESize :%3C @@ -2085,16 +2085,20 @@ ATTERN + = r'(?:F @@ -2207,24 +2207,28 @@ PATTERN + = r'%3Ca href= @@ -2273,16 +2273,144 @@ ile%3C...
a2179c0773ad3f09a5d1a6bdced985367ede0cb6
Add ability to upload parent data with case import
corehq/apps/importer/tasks.py
corehq/apps/importer/tasks.py
from celery.task import task from xml.etree import ElementTree from dimagi.utils.parsing import json_format_datetime from corehq.apps.hqcase.utils import submit_case_blocks from corehq.apps.importer.const import LookupErrors import corehq.apps.importer.util as importer_util from corehq.apps.users.models import CouchUse...
Python
0
@@ -3592,16 +3592,678 @@ ', None) +%0A parent_id = fields_to_update.pop('parent_id', None)%0A parent_external_id = fields_to_update.pop('parent_external_id', None)%0A%0A extras = %7B%7D%0A if parent_id:%0A extras%5B'index'%5D = %7B%0A 'parent': (config.case_type, p...
1eae87ee4435b4dda35d64295de13756394dbce9
Add GET to 'Allow-Methods' by default. Fixes #12
crossdomain.py
crossdomain.py
#!/usr/bin/env python from datetime import timedelta from flask import make_response, request, current_app from functools import update_wrapper def crossdomain(origin=None, methods=None, headers=None, max_age=21600, attach_to_all=True, automatic_options=True): if methods is not No...
Python
0
@@ -177,20 +177,23 @@ methods= -None +%5B'GET'%5D , header
40f839b0189af282a387366127588dfc86eaae40
fix incorrect identation
cosmic_ray/commands/format.py
cosmic_ray/commands/format.py
from cosmic_ray.testing.test_runner import TestOutcome from cosmic_ray.work_record import WorkRecord from cosmic_ray.worker import WorkerOutcome import docopt import json import sys import xml.etree.ElementTree def _print_item(work_record, full_report): data = work_record.data outcome = work_record.worker_out...
Python
0.999995
@@ -4964,28 +4964,24 @@ = 1%0A - if is_killed @@ -4996,28 +4996,24 @@ - failed += 1%0A @@ -5012,24 +5012,16 @@ ed += 1%0A - @@ -5070,24 +5070,16 @@ - subeleme @@ -5114,24 +5114,16 @@ m(item)%0A -
33d1422e87d2b0ba97d05bee65e005ac8ae94029
Fix matching undef behavior property
lib/symbioticpy/symbiotic/property.py
lib/symbioticpy/symbiotic/property.py
#!/usr/bin/python from . exceptions import SymbioticException from os.path import abspath, join class Property: def __init__(self, prpfile = None): self._prpfile = prpfile # property as LTL formulae (if available) self._ltl = [] def memsafety(self): """ Check for memory safety...
Python
0.000002
@@ -4965,17 +4965,17 @@ AVIOR' i -s +n prps:%0A
9ec25b6a5f8400b68c51ce9c5667c8c0c1648521
Remove unneeded catch
cucco/regex.py
cucco/regex.py
#-*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import re """ Regular expression to match URLs as seen on http://daringfireball.net/2010/07/improved_regex_for_matching_urls """ URL_REGEX = re.compile( r'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([...
Python
0.000019
@@ -651,17 +651,8 @@ E)%0A%0A -try:%0A EMOJ @@ -708,17 +708,17 @@ (%5B%5CU0001 -f +F 300-%5CU00 @@ -719,17 +719,17 @@ 0-%5CU0001 -f +F 64F%5D)%7C(%5B @@ -734,17 +734,17 @@ (%5B%5CU0001 -f +F 680-%5CU00 @@ -749,156 +749,10 @@ 0001 -f6FF%5D)')%0Aexcept re.error:%0A EMOJI_REGEX = re.compile(u'(%5B%5Cu2600-...
b226a346a5b2402e8bed5386c7a217e81db4a053
Bump to 9.5500.302.
counterpartylib/lib/config.py
counterpartylib/lib/config.py
"""Variables prefixed with `DEFAULT` should be able to be overridden by configuration file and command‐line arguments.""" UNIT = 100000000 # The same across assets. # Versions VERSION_MAJOR = 9 VERSION_MINOR = 5500 VERSION_REVISION = 301 VERSION_STRING = str(VERSION_MAJOR) + '.' + str(VERSION_MINOR) + '.' + s...
Python
0
@@ -239,17 +239,17 @@ ION = 30 -1 +2 %0AVERSION
1c6f53492fc4cdc132769e4ffcfb076557a45c34
Remove English words from Non-English corpus data
modules/preprocessor/emille_preprocessor.py
modules/preprocessor/emille_preprocessor.py
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- """EMILLE Corpus Preprocessor which inherits from BasePreprocessor.""" import regex as re from base_preprocessor import BasePreprocessor from nltk.tokenize import sent_tokenize from bs4 import BeautifulSoup import sys import unicodedata from collections import defaultdi...
Python
0.000083
@@ -571,20 +571,25 @@ anguage= -None +'english' ,%0A @@ -1901,35 +1901,178 @@ -%22%22%22%0A%0A return re.sub( +* Remove English words from Non-English corpus data.%0A %22%22%22%0A if self.language is %22english%22:%0A regex = ur%22((%5Cp%7BP%7D+)%7C(%5Cp%7BS%7D+)%7C(%5B0-9%...
efd96f03d51c1fce3ef370cae88928e16f0b9f17
Parse the response with json
buffer/api.py
buffer/api.py
from rauth import OAuth2Session BASE_URL = 'https://api.bufferapp.com/1/%s' class API(OAuth2Session): ''' Small and clean class that embrace all basic operations with the buffer app ''' def get(self, url): if not self.access_token: raise ValueError('Please set an access token first!') r...
Python
0.999999
@@ -1,8 +1,21 @@ +import json%0A%0A from rau @@ -331,12 +331,16 @@ re -turn +sponse = sup @@ -387,8 +387,49 @@ %25 url)%0A +%0A return json.loads(response.content)%0A
0629183a91046b746d04c1a68e190721a156560b
rename id->fileid (id is a builtin)
build/cook.py
build/cook.py
# # Copyright (c) 2004 Specifix, Inc. # All rights reserved # import recipe import time import files import commit import os import util import sha1helper def cook(repos, cfg, recipeFile): classList = recipe.RecipeLoader(recipeFile) built = [] if recipeFile[0] != "/": raise IOError, "recipe file names mu...
Python
0
@@ -751,16 +751,20 @@ %0A%09%09for ( +file id, path @@ -817,16 +817,20 @@ path%5D = +file id%0A%0A%09ide
29273b0d7473a1efa955cd35686838780d390106
add more counters
monasca_persister/repositories/persister.py
monasca_persister/repositories/persister.py
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # # 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 ap...
Python
0
@@ -961,16 +961,85 @@ timer()%0A +statsd_flush_error_count = statsd_client.get_counter('flush.errors')%0A %0A%0Aclass @@ -1708,35 +1708,27 @@ self.statsd_ -flush_error +msg _count = sta @@ -1755,187 +1755,258 @@ er(' -flush.errors')%0A self.statsd_msg_count = statsd_client.get_counter('messages.processed')...
fa1f4a1420f2ea6d66234dae2189a7fb8fdf1f6f
remove debug print
common/lib/xmodule/xmodule/mongo_utils.py
common/lib/xmodule/xmodule/mongo_utils.py
""" Common MongoDB connection functions. """ import logging import pymongo from pymongo import ReadPreference from mongodb_proxy import MongoProxy logger = logging.getLogger(__name__) # pylint: disable=invalid-name # pylint: disable=bad-continuation def connect_to_mongodb( db, host, port=27017, tz_aware=Tr...
Python
0.000008
@@ -1732,173 +1732,8 @@ ce%0A%0A - print %22host%22%0A print host%0A print %22port%22%0A print port%0A print %22tz_aware%22%0A print tz_aware%0A print %22dict%22%0A print dict%0A print %22db%22%0A print db%0A%0A
ef1f58b89e9b858c1cb8cca32e3cf982bd8d48f3
fix hash import
meerkat_nest/resources/upload_data.py
meerkat_nest/resources/upload_data.py
""" Data resource for upload data """ from flask_restful import Resource from flask import request, Response from sqlalchemy import create_engine import json import os import uuid import datetime import logging import copy from meerkat_nest import model from meerkat_nest import config from meerkat_nest.util import scr...
Python
0.000045
@@ -338,23 +338,20 @@ equest, -encrypt +hash %0Afrom me
1e041c55c7311808a2253ea8aa556db6a3dededc
Some string
clojure/lang/Seqs.py
clojure/lang/Seqs.py
import RT import Util from interfaces import * class ASeq(Obj, ISeq, Sequential, IHashEq): # Note: Java version implements java.util.List & java.io.Serializable also def __init__(self, meta=None): Obj.__init__(self, meta) self._hash = -1 self._hasheq = -1 def empty(self): ret...
Python
0.999999
@@ -3168,16 +3168,118 @@ _more)%0A%0A + def __str__(self):%0A return self.first().__str__() + self.next().__str__() # TODO: better%0A%0A %0Aclass P
a9ff2da085738770e1b3c03162f79454851df3b8
Fix issue #144, getting wrong field name for harakiri_count
newrelic_plugin_agent/plugins/uwsgi.py
newrelic_plugin_agent/plugins/uwsgi.py
""" uWSGI """ import json import logging from newrelic_plugin_agent.plugins import base LOGGER = logging.getLogger(__name__) class uWSGI(base.SocketStatsPlugin): GUID = 'com.meetme.newrelic_uwsgi_agent' DEFAULT_HOST = 'localhost' DEFAULT_PORT = 1717 def add_datapoints(self, stats): """Ad...
Python
0
@@ -1142,17 +1142,22 @@ harakiri -s +_count ', 0)%0A
fac6011b310e8632ceaf3eccbc3123dd5af7687a
fix path to save arrays; add tsdiff arrays
nipy/algorithms/diagnostics/screens.py
nipy/algorithms/diagnostics/screens.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ''' Diagnostic 4d image screen ''' from os.path import join as pjoin import numpy as np from ...core.api import Image, drop_io_dim, append_io_dim from ...io.api import save_image from ..utils import pca f...
Python
0
@@ -3421,16 +3421,41 @@ courses + and some tsdiffana stuff %0A nco @@ -3581,16 +3581,32 @@ p.savez( +pjoin(out_path, 'vectors @@ -3627,32 +3627,33 @@ .npz' %25 out_root +) ,%0A b @@ -3704,16 +3704,152 @@ pcnt_var +,%0A volume_means=res%5B'ts_res'%5D%5B'volume_means'%5D,%0A ...
7d4c6dbd282ea4b8d1a7d4f4a784b972163dbc7f
Fix the fix
datastore/services/bulk_sync.py
datastore/services/bulk_sync.py
import uuid import csv import logging import traceback try: from StringIO import StringIO except ImportError: from io import StringIO from django.db import connection def success_response(): return ({ "status": "success" }, 200) def error_response(): return ({ "status": "error" ...
Python
0.967081
@@ -2144,17 +2144,8 @@ e = -StringIO. Stri
4a83439926181f26e4656d2a2b78021209d3b629
fix the dropout to 0.2 because that is what they use
code/nolearntrail.py
code/nolearntrail.py
from nolearn.dbn import DBN from readfacedatabases import * from sklearn import cross_validation from sklearn.metrics import zero_one_score from sklearn.metrics import classification_report import argparse import numpy as np from common import * parser = argparse.ArgumentParser(description='nolearn test') parser.add...
Python
0.002569
@@ -888,9 +888,9 @@ =%5B0. -8 +2 , 0.
ddc571f32212a57f725101314878d17df9124bb8
fix loop range
commands/cmd_roll.py
commands/cmd_roll.py
import random from lib.command import Command class RollCommand(Command): name = 'roll' description = 'Roll some dice.' def run(self, message, args): if not args: self.reply(message, 'No roll specification supplied. Try */roll 3d6*.', parse_mode='Markdown') return ...
Python
0.000001
@@ -1111,24 +1111,30 @@ e) for _ in +range( dice_count%5D%0A @@ -1131,16 +1131,17 @@ ce_count +) %5D%0A
f92c8c9620524d0414af6f039885c2875a247cd0
add msrest dependency (#7062)
sdk/appconfiguration/azure-appconfiguration/setup.py
sdk/appconfiguration/azure-appconfiguration/setup.py
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
Python
0
@@ -2842,16 +2842,49 @@ quires=%5B + %0A %22msrest%3E=0.5.0%22, %0A
fe06c3a839bdc13384250924a4a30d9dd3455fc7
fix archive resource unit test
service/test/unit/resources/test_archive_resource.py
service/test/unit/resources/test_archive_resource.py
import unittest import json from mockito import mock, when, verify from test.unit.resources import DummySite from twisted.web.test.requesthelper import DummyRequest from pixelated.resources.mails_resource import MailsArchiveResource from twisted.internet import defer class TestArchiveResource(unittest.TestCase): ...
Python
0
@@ -1,12 +1,31 @@ +from twisted.trial import unitt @@ -591,16 +591,44 @@ 'POST'%0A + idents = %5B'1', '2'%5D%0A @@ -636,32 +636,32 @@ ontent = mock()%0A - when(con @@ -717,24 +717,80 @@ ', '2'%5D%7D))%0A%0A + d1 = defer.Deferred()%0A d1.callback(None)%0A when @@ -8...
6ecae8f97723b90193bc64e53f8dcee22c3cbf55
add tag to return settings values to django template.
odm2admin/templatetags/admin_extras.py
odm2admin/templatetags/admin_extras.py
# this came from https://djangosnippets.org/snippets/2196/ # adds a collect tag for templates so you can build lists from django import template from django.contrib import admin from django.contrib.gis.geos import GEOSGeometry from django.core.management import settings register = template.Library() @register.tag d...
Python
0
@@ -2640,16 +2640,121 @@ al%5B0%5D%0A%0A%0A +%0A# settings value%0A@register.simple_tag%0Adef settings_value(name):%0A return getattr(settings, name, %22%22)%0A%0A # https:
4036e62862495dbd41da818af3fa5811dab2b0f6
stop doing cd for Library Checker
onlinejudge/service/library_checker.py
onlinejudge/service/library_checker.py
# Python Version: 3.x """ the module for yosupo's Library Checker (https://judge.yosupo.jp) """ import os import pathlib import re import subprocess import sys import urllib.parse from typing import * import requests import toml import onlinejudge._implementation.logging as log import onlinejudge._implementation.tes...
Python
0
@@ -3579,114 +3579,8 @@ ()%0A%0A - log.status('$ cd %25s', path)%0A with utils.chdir(path):%0A # generate test cases%0A @@ -3613,20 +3613,16 @@ (3, 6):%0A - @@ -3696,20 +3696,16 @@ - if os.na @@ -3720,36 +3720,32 @@ t':%0A - - log.warni...
b9b7ed8f4ddf139bd031ce7650558f7a0e753718
Fix "compilation" error.
solidity/python/constants/PrintMaxExpPerPrecision.py
solidity/python/constants/PrintMaxExpPerPrecision.py
from math import factorial MIN_PRECISION = 32 MAX_PRECISION = 63 NUM_OF_VALUES_PER_ROW = 4 assert((MAX_PRECISION+1) % NUM_OF_VALUES_PER_ROW == 0) NUM_OF_COEFS = 34 maxFactorial = factorial(NUM_OF_COEFS) coefficients = [maxFactorial/factorial(i) for i in range(NUM_OF_COEFS)] def fixedExpUnsafe(x,precision): ...
Python
0.000013
@@ -2875,19 +2875,22 @@ ecision, -max +growth Factor)%0A
abd6438dfc3d930dc71178bac63a6c0bc41efbcd
Update e2e start help text for extras integrations (#3133)
datadog_checks_dev/datadog_checks/dev/tooling/commands/env/start.py
datadog_checks_dev/datadog_checks/dev/tooling/commands/env/start.py
# (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import click import pyperclip from six import string_types from ..console import ( CONTEXT_SETTINGS, abort, echo_failure, echo_info, echo_success, echo_waiting, echo_warning ) from ...e2e import E2...
Python
0
@@ -3032,17 +3032,17 @@ -%22 +' Agent fi @@ -3112,10 +3112,23 @@ ig, -%5C%0A +'%0A ' fall @@ -3158,17 +3158,20 @@ er image -%22 +...' %0A @@ -6350,32 +6350,192 @@ o: ', nl=False)%0A + if ctx.obj%5B'repo_choice'%5D == 'extras' and not ctx.obj.get('repo') == 'extras':%0A echo_...
44a0d99ca8e292bbdecf5f1db307039041ba6485
Fix migration to set account flags field values to a list (not a set) (thanks @hodgestar)
go/vumitools/account/migrations.py
go/vumitools/account/migrations.py
from vumi.persist.model import ModelMigrator class UserAccountMigrator(ModelMigrator): def migrate_from_unversioned(self, mdata): # Copy stuff that hasn't changed between versions mdata.copy_values('username', 'created_at') mdata.copy_indexes('tagpools_bin', 'applications_bin') #...
Python
0
@@ -4896,22 +4896,30 @@ flags', +sorted( flags) +) %0A%0A
1a062decb1f3c4f923f6a0417926021f9cbf10fa
Fix MVN sampling with sum lazy variables
gpytorch/lazy/sum_lazy_variable.py
gpytorch/lazy/sum_lazy_variable.py
from .lazy_variable import LazyVariable from .non_lazy_variable import NonLazyVariable from torch.autograd import Variable class SumLazyVariable(LazyVariable): def __init__(self, *lazy_vars): lazy_vars = list(lazy_vars) for i, lazy_var in enumerate(lazy_vars): if not isinstance(lazy_va...
Python
0
@@ -3902,150 +3902,8 @@ ))%0A%0A - def zero_mean_mvn_samples(self, n_samples):%0A return sum(lazy_var.zero_mean_mvn_samples(n_samples) for lazy_var in self.lazy_vars)%0A%0A
e2e64a117430bc7b4a4e25ad40af4f13570eabd2
Change project to render_project
server_dev.py
server_dev.py
from flask import Flask, request, url_for, render_template, flash, redirect, abort from jinja2 import evalcontextfilter, Markup, escape from flask_mail import Mail, Message from projects_controller import ProjectsController from redirects_controller import RedirectsController import config import re app = Flask(__name...
Python
0.000001
@@ -2617,16 +2617,23 @@ return +render_ project( @@ -2803,16 +2803,23 @@ 4)%0A%0Adef +render_ project(
218b5c90b265fe0d60c4672b27049cf86b5a68cf
Add mkdir
cyhdfs3/cli.py
cyhdfs3/cli.py
from __future__ import division import sys import traceback import click CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) def main(): try: cli(obj={}) except Exception as e: click.echo(traceback.format_exc(), err=True) sys.exit(1) @click.group(context_settings=CONTEXT_S...
Python
0.000003
@@ -24,16 +24,27 @@ division +%0A%0Aimport os %0Aimport @@ -79,16 +79,69 @@ click%0A%0A +import pyximport; pyximport.install()%0Aimport cyhdfs3%0A %0ACONTEXT @@ -653,65 +653,8 @@ t):%0A - import pyximport; pyximport.install()%0A%0A import os%0A @@ -721,27 +721,8 @@ l%22%0A%0A - import cyhdfs3%0A ...
283dd9918bd16202bf799c470e8e5b50d2ef1cd6
Increment version number to 0.7.0
datajoint/version.py
datajoint/version.py
__version__ = "0.6.1"
Python
0.99997
@@ -14,9 +14,9 @@ %220. -6.1 +7.0 %22%0A
0f5fe279d6b4641b2a2741271da4f021238f00a1
fix import in generator
dataset_generator.py
dataset_generator.py
import csv # execfile("C:\\Users\\YONI\\Documents\\Projects\\degree\\attack detection methods\\anomaly_generator\\dataset_generator.py") ROW_NUM = 10 path = "C:\\Users\\YONI\\Documents\\anomally_detector\\data_sets\\example\\" users_num = 100 features_num = 20 directory = "data_sets\\" if not os.path.exists(direct...
Python
0
@@ -3,16 +3,26 @@ port csv +%0Aimport os %0A%0A# exec
7ccb9cb0d6e3ce6e3c6c09604af5e2bbdfae63ae
update urls.py
openstax/urls.py
openstax/urls.py
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from wagtail.contrib.wagtailapi import urls as wagtailapi_urls from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtailcore import urls as wagtail...
Python
0.000001
@@ -469,47 +469,9 @@ ter%0A -from .functions import S3DocumentServe %0A + from @@ -706,112 +706,8 @@ )),%0A - url(r'%5Edocuments/(?P%3Cdocument_id%3E%5Cd+)/(.*)$', S3DocumentServe.as_view(), name='wagtaildocs_serve'),%0A @@ -856,47 +856,8 @@ )),%0A - url(r'%5Eapi/v2/', api_router.urls),%0A @@ -92...
853135b61f34ece1363da9b53244e775a2ba16a8
Add docstring for convert_timezone()
datetime/datetime.py
datetime/datetime.py
import datetime # ============================================================================== # TIMESTAMP 2 STR # ============================================================================== def timestamp2str(t, pattern="%Y-%m-%d %H:%M:%S"): """ ...
Python
0
@@ -498,97 +498,711 @@ rn)%0A -# import datetime%0Afrom dateutil import tz%0Adef convert_timezone(time, a=%22UTC%22, b=%22local%22): +%0A# ==============================================================================%0A# CONVERT_TIMEZONE%0A# ==============...
9d2ef02367380c76f39c4bd84ea2f35897d0bebf
Edit school enrollment management command
education/management/commands/create_school_enrollment_script.py
education/management/commands/create_school_enrollment_script.py
''' Created on May 28, 2013 @author: raybesiga ''' import datetime import logging import itertools from logging import handlers from django.core.management.base import BaseCommand from django.contrib.sites.models import Site from django.contrib.auth.models import User from django.core.mail import send_mail from djan...
Python
0
@@ -864,21 +864,22 @@ termly -polls +script %22%0A %0A @@ -1439,34 +1439,30 @@ ipt_ -headteacher_violence_month +school_enrollment_term ly,%0A @@ -1800,34 +1800,30 @@ ipt_ -headteacher_violence_month +school_enrollment_term ly,%0A
1dfc3909f15f8fcce993fa9eb6aea2a3bd6fef40
update version number
lib/svtplay_dl/__init__.py
lib/svtplay_dl/__init__.py
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import import sys import re import os import logging from optparse import OptionParser from svtplay_dl.log import log from svtplay_dl.utils import get_http_data from svtplay_dl.service import servic...
Python
0.000002
@@ -363,12 +363,12 @@ 13.0 -3.23 +4.02 %22%0A%0Ac
3905fe5c8808eaf57fd1dff38329f3753e652bd9
Add update date to the EIF json if it exists in the session.
activity/activity_ConvertJATS.py
activity/activity_ConvertJATS.py
import activity import json import os from os import path from jats_scraper import jats_scraper from boto.s3.key import Key from boto.s3.connection import S3Connection from provider.execution_context import Session from provider.article_structure import ArticleInfo """ ConvertJATS.py activity """ class activity_Conv...
Python
0
@@ -51,16 +51,46 @@ rt path%0A +from datetime import datetime%0A from jat @@ -119,16 +119,16 @@ scraper%0A - from bot @@ -2652,16 +2652,399 @@ version) +%0A %0A # Add update date if it is in the session%0A update_date = None%0A try:%0A update_date = sessio...
900ddf92a1cf65270a7b420a848c0f2611647899
handle &amp;
freelancefinder/remotes/sources/workinstartups/workinstartups.py
freelancefinder/remotes/sources/workinstartups/workinstartups.py
"""Wrapper for the WorkInStartups source.""" import json import bleach import maya import requests from jobs.models import Post ADDITIONAL_TAGS = ['p', 'br'] class WorkInStartups(object): """Wrapper for the WorkInStartups source.""" json_api_address = 'http://workinstartups.com/job-board/api/api.php?acti...
Python
0.000001
@@ -1324,16 +1324,38 @@ 'title'%5D +.replace(%22&amp;%22, %22&%22) , strip=
2c53bc17f98a3e9fdc71ba77f1ab9c1c06f82509
remove test param on srvy
collection/srvy.py
collection/srvy.py
#!/usr/bin/python import sys import time from time import sleep from datetime import datetime import random import sqlite3 import csv from configparser import ConfigParser if __name__ == '__main__': # Check if running on a Raspberry Pi try: from gpiozero import Button except ImportError: ...
Python
0.000001
@@ -169,315 +169,50 @@ ser%0A -%0Aif __name__ == '__main__':%0A%0A # Check if running on a Raspberry Pi%0A%0A try:%0A from gpiozero import Button%0A except ImportError:%0A print(%22gpiozero is not installed.%22)%0A pass%0A%0A try:%0A import pygame%0A except ImportError:%0A ...
e9eb8317334e21d5e401b03c2eda5c70082ec2e3
add test description in xml reporter
zopkio/reporters/junit_reporter.py
zopkio/reporters/junit_reporter.py
# Copyright 2014 LinkedIn Corp. # # 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....
Python
0
@@ -4381,22 +4381,27 @@ e, test. -result +description , test.m
a2d9edbe8b154858fe89be12ca281a926ad46ac7
Remove double negative
api/init/health/routes.py
api/init/health/routes.py
import os from flask import jsonify from flask_restplus import Resource, Namespace # pylint: disable=unused-variable def register_health(namespace: Namespace): """Method used to register the health check namespace and endpoint.""" @namespace.route('/health') @namespace.doc() class Health(Resource): ...
Python
0.999999
@@ -545,27 +545,18 @@ = ' -production +debug ' if -not is_d @@ -566,21 +566,26 @@ g else ' -debug +production '%0A
9a2b3477dcfd3e8ba6fac43678713f5213fe87b2
Caugh edge cause for initials of n=0 v. n=None
dedupe/predicates.py
dedupe/predicates.py
#!/usr/bin/python # -*- coding: utf-8 -*- import re def tokenFieldPredicate(field): """returns the tokens""" return tuple(field.split()) def commonIntegerPredicate(field): """"return any integers""" return tuple(re.findall("\d+", field)) def nearIntegersPredicate(field): """return any integers N...
Python
0.999999
@@ -1623,12 +1623,20 @@ if n -ot n + is not None or
9dcfab557c30a040580afe5ab8c5d68bf9d64a37
Fix log summary tab. Some odd cacheops problem here. Possibly caching a function that calls other @cached functions does not work. Removed caching on message_fields_recorded and types_recorded.
afterflight/logbrowse/fltdata.py
afterflight/logbrowse/fltdata.py
#Copyright 2013 Aaron Curtis #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 l...
Python
0
@@ -1102,13 +1102,8 @@ ndas -, pdb %0A%0A@c @@ -2066,16 +2066,17 @@ yax))%7D%0A%0A +# @cached( @@ -2272,32 +2272,33 @@ ld',flat=True)%0A%0A +# @cached()%0Adef me @@ -2590,16 +2590,18 @@ recorded +() )%0A x= @@ -2650,16 +2650,18 @@ recorded +() :%0A @@ -2790,16 +2790,18 @@ recorded +() , msgTyp
40d2cebdb41bd13040ab747df4f8046d1c597d50
Fix mets dumping
demetsiiify/tasks.py
demetsiiify/tasks.py
import os.path import smtplib import time from collections import deque, OrderedDict from email.message import EmailMessage import lxml.etree as ET import requests import shortuuid from flask import current_app, g, url_for from rq import get_current_job from . import mets from . import iiif from . import make_queues,...
Python
0.000001
@@ -1117,16 +1117,17 @@ path, %22w +b %22) as fp
2fdfb070aaf7f4ae01721853e71dee0932fea2eb
Replace deprecated API tff.learning.build_federarted_averaging_process() with new API.
tensorflow_federated/python/learning/federated_evaluation_test.py
tensorflow_federated/python/learning/federated_evaluation_test.py
# Lint as: python3 # Copyright 2019, The TensorFlow Federated 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 ...
Python
0.000002
@@ -3491,16 +3491,61 @@ ntial(%5B%0A + tf.keras.layers.Input(shape=(1,)),%0A @@ -3768,148 +3768,8 @@ l')%0A - keras_model.compile(%0A loss='mean_squared_error',%0A optimizer='sgd',%0A metrics=%5Btf.keras.metrics.Accuracy()%5D)%0A @@ -3798,17 +3798,8 @@ rom_ -c...
2b0f4345ff1d4f97f8c00bdad3be035bd5478073
Use a temporary file which exists.
libcloud/test/test_init.py
libcloud/test/test_init.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 "Li...
Python
0
@@ -821,16 +821,32 @@ ort sys%0A +import tempfile%0A import l @@ -877,16 +877,24 @@ paramiko + # NOQA %0A hav @@ -1804,16 +1804,57 @@ ug mode%0A + _, tmp_path = tempfile.mkstemp()%0A @@ -1888,25 +1888,16 @@ %5D = -'/ tmp -/foobartest' +_path %0A
a51a089e90719dfda2e6164b0f4c1aec50c26534
Add ordering
entity/migrations/0006_entity_relationship_unique.py
entity/migrations/0006_entity_relationship_unique.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-12-12 18:20 from __future__ import unicode_literals from django.db import migrations, connection from django.db.models import Count, Max def disable_triggers(apps, schema_editor): """ Temporarily disable user triggers on the relationship table. We d...
Python
0
@@ -1377,16 +1377,72 @@ rder_by( +%0A 'sub_entity_id',%0A 'super_entity_id'%0A ).values @@ -1467,16 +1467,24 @@ ity_id', +%0A 'super_
d3c2eb97d82b74abf3ac44f452a30c54d72a99b2
Bumped version number to 2.0.2alpha1
morfessor/__init__.py
morfessor/__init__.py
#!/usr/bin/env python """ Morfessor 2.0 - Python implementation of the Morfessor method """ import logging __all__ = ['MorfessorException', 'ArgumentException', 'MorfessorIO', 'BaselineModel', 'main', 'get_default_argparser', 'main_evaluation', 'get_evaluation_argparser'] __version__ = '2.0.1' ...
Python
0.998853
@@ -310,16 +310,22 @@ = '2.0. +2alpha 1'%0A__aut
0adcebf6de030a5f158895b6afe2a952269b35e9
Rewrite generation of compressed file for testing
msumastro/conftest.py
msumastro/conftest.py
from tempfile import mkdtemp import os from shutil import rmtree import gzip from socket import timeout import numpy as np import pytest from astropy.io import fits from astropy.coordinates import SkyCoord, name_resolve from .header_processing.patchers import IRAF_image_type @pytest.fixture def triage_setup(request...
Python
0
@@ -2072,21 +2072,12 @@ -filter_file = +with ope @@ -2114,22 +2114,30 @@ rb') -%0A fzipped = + as f_in:%0A with gzi @@ -2182,63 +2182,54 @@ wb') -%0A fzipped.writelines(filter_file)%0A fzipped.close( + as f_out:%0A f_out.write(f_in.read() )%0A
930c96267b0cfda52437764703ac18861fb0c7e6
Add all error context to APIClientException instances
mtvc_client/client.py
mtvc_client/client.py
import logging import hammock from requests.auth import AuthBase logger = logging.getLogger(__name__) class APIClientException(Exception): """ Exception class that contains the error code and message from the MTVC """ def __init__(self, error_code=None, error_message=None, **kwargs): s...
Python
0.000002
@@ -383,16 +383,53 @@ _message +%0A self.__dict__.update(kwargs) %0A%0A de
f83076f722d66ebc27d66bc13798d4e5bc9cc27a
Fix `TypeError: must use keyword argument for key function` on Python 3
scikits/image/transform/tests/test_hough_transform.py
scikits/image/transform/tests/test_hough_transform.py
import numpy as np from numpy.testing import * import scikits.image.transform as tf import scikits.image.transform.hough_transform as ht from scikits.image.transform import probabilistic_hough def append_desc(func, description): """Append the test function ``func`` and append ``description`` to its name. ...
Python
0.000409
@@ -1746,16 +1746,20 @@ ort( +key= lambda x ,y: @@ -1758,27 +1758,14 @@ da x -,y: cmp(x%5B0%5D, y%5B0%5D) +: x%5B0%5D )%0A
c6f1ab2d33c31201c00435f336c7793b4ff8dd2a
Fix for docutils.error_reporting -> docutils.utils.error_reporting
notebook_sphinxext.py
notebook_sphinxext.py
import sys import os.path import re import time from docutils import io, nodes, statemachine, utils from docutils.error_reporting import ErrorString from docutils.parsers.rst import Directive, convert_directive_function from docutils.parsers.rst import directives, roles, states from docutils.parsers.rst.roles import se...
Python
0
@@ -107,16 +107,22 @@ ocutils. +utils. error_re
62b7b8fc1ed346db99e7c993c205081a12d091f9
remove broken metric
hypergan/trainers/depth_trainer.py
hypergan/trainers/depth_trainer.py
import tensorflow as tf import numpy as np import hyperchamber as hc import inspect from hypergan.trainers.base_trainer import BaseTrainer TINY = 1e-12 class DepthTrainer(BaseTrainer): def create(self): self.hist = [0 for i in range(2)] config = self.config self.global_step = tf.train.get...
Python
0.00237
@@ -4085,84 +4085,8 @@ g%7D)%0A - feed_dict%5Bself.mixd%5D=mixd%0A feed_dict%5Bself.mixg%5D=mixg%0A
15016615c5406a56468171ab55c0cc60797dc580
Check author is not NoneType, not author.name
reddit2kindle.py
reddit2kindle.py
import os from flask import Flask, request, jsonify from flask.templating import render_template import util import forms app = Flask(__name__) app.secret_key = os.urandom(24) forms.csrf.init_app(app) @app.route('/') def index(): post = forms.Submission() subreddit = forms.Subreddit() return render_te...
Python
0.021749
@@ -1158,21 +1158,16 @@ n.author -.name is not
f3cada11b253ceea129342040f7e3d75f4f0cf15
use assertions with the form elements in test_new instead of the regex on the html content
test_notes.py
test_notes.py
from webtest import TestApp import os import re import notes import dbaccessor DB = 'notes.db' class TestWebserver(): def test_index(self): dba = dbaccessor.DbAccessor(DB) dba.addNote('eins', 'lorem ipsum') dba.addNote('zwei', 'blabla') bottle = TestApp(notes.app) result ...
Python
0
@@ -611,125 +611,183 @@ -match = re.search(r'%3Cinput type=%22text%22 size=%22100%22 maxlength=%22100%22 name=%22content%22%3E', result.body)%0A assert match +form = result.form%0A assert form.action == '/new'%0A assert form.method == 'GET'%0A assert form%5B'title'%5D.value == ''%0A ...
77e3f0da9bec64c2bf0f34faec735a29f1a74284
remove test for Google+
tests/test.py
tests/test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from you_get import * from you_get.__main__ import url_to_module def test_urls(urls): for url in urls: url_to_module(url).download(url, info_only = True) class YouGetTests(unittest.TestCase): def test_freesound(self): test_ur...
Python
0.00001
@@ -414,655 +414,8 @@ %0A - def test_googleplus(self):%0A test_urls(%5B%0A %22http://plus.google.com/102663035987142737445/posts/jJRu43KQFT5%22,%0A %22http://plus.google.com/+%25E5%25B9%25B3%25E7%2594%25B0%25E6%25A2%25A8%25E5%25A5%2588/posts/jJRu43KQFT5%22,%0A %22http://pl...
bbbd535ecabc6017aec6a3549c917d26036aff3b
Remove checks for testGotTrace unit test until trace event importer is implemented.
tools/telemetry/telemetry/core/chrome/tracing_backend_unittest.py
tools/telemetry/telemetry/core/chrome/tracing_backend_unittest.py
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import cStringIO import json import logging import os import unittest from telemetry.core import util from telemetry.core.chrome import tracing_backend ...
Python
0.000002
@@ -1012,137 +1012,123 @@ g()%0A +%0A -model = self._browser.GetTraceResultAndReset().AsTimelineModel()%0A events = model.GetAllEvents()%0A assert len(events) %3E 0 +# TODO(tengs): check model for correctness after trace_event_importer%0A # is implemented (crbug.com/173327). %0A%0Acl
a440cef4140a4225fc093c9143d7cfd1a0c4e917
Update metric through API
biggraphite/cli/web/namespaces/biggraphite.py
biggraphite/cli/web/namespaces/biggraphite.py
#!/usr/bin/env python # Copyright 2018 Criteo # # 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 agree...
Python
0
@@ -649,16 +649,42 @@ import%0A%0A +from flask import request%0A import f @@ -704,16 +704,60 @@ as rp%0A%0A +from biggraphite import metric as bg_metric%0A from big @@ -956,16 +956,329 @@ API%22)%0A%0A +metric_metadata = api.model(%0A %22MetricMetadata%22,%0A %7B%0A %22aggregator%22: rp.fields.Strin...
4eb34493583a525da52d3464e8c8f6c07dfe0e84
update setup
src/ensae_teaching_cs/automation/win_setup_helper.py
src/ensae_teaching_cs/automation/win_setup_helper.py
""" @file @brief Customize a Windows Setup for these teachings """ import os import shutil from pyquickhelper import remove_folder def last_function(innosetup, folders, verbose=False, fLOG=print): """ applies last modifications to the setup @param innosetup innosetup script which defines the...
Python
0.000001
@@ -693,30 +693,29 @@ ython%22%5D%0A -python +tools = folders%5B%22 @@ -1783,16 +1783,182 @@ s +++%22)%0A + for dist in doc_annee:%0A end = os.path.split(dist)%5B-1%5D%0A to = os.path.join(docs, end)%0A if not os.path.exists(to):%0A os.mkdir(to)%0A for @@ -1990,16 +1...
0c1b706c2804cdc4324b4b0b7d960d6ba07268ea
Remove debug print from discordbot utilspy
discordbot/titanembeds/utils.py
discordbot/titanembeds/utils.py
import discord import time from email import utils as emailutils def format_datetime(datetimeobj): return emailutils.formatdate(time.mktime(datetimeobj.timetuple())) # https://stackoverflow.com/questions/3453177/convert-python-datetime-to-rfc-2822 def get_formatted_message(message): edit_ts = message.edited_a...
Python
0.000001
@@ -2458,40 +2458,8 @@ d))%0A - print(role, role.hoist)%0A
769b4d6d7fb04e095df54d85ab3dcd577298ece7
fix customobject filtering
distance_scripts/filterlevel.py
distance_scripts/filterlevel.py
"""Filter objects from a level or CustomObject.""" import os import sys import argparse import re from io import BytesIO from distance.level import Level from distance.levelobjects import PROBER as LEVEL_PROBER from distance.bytes import ( DstBytes, MAGIC_2, MAGIC_3, MAGIC_32, MAGIC_9, Section, ) from di...
Python
0.000003
@@ -188,30 +188,50 @@ ort -PROBER as LEVEL_PROBER +Group%0Afrom distance.base import BaseObject %0Afro @@ -436,16 +436,49 @@ ber()%0A%0A%0A +PROBER.add_type('Group', Group)%0A%0A @PROBER. @@ -579,42 +579,18 @@ urn -None%0A%0A%0APROBER.extend(LEVEL_PROBER) +BaseObject %0A%0A%0AM @@ -4580,29 +4580,30 @@ ...
1dbb1e0f8751f37271178665a727c4eefc49a88c
Remove subclassing of exception, since there is only one.
partner_firstname/exceptions.py
partner_firstname/exceptions.py
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program 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 versio...
Python
0
@@ -817,32 +817,26 @@ %0A%0Aclass -PartnerNameError +EmptyNames (excepti @@ -898,12 +898,28 @@ lue= -None +_(%22No name is set.%22) ):%0A @@ -1048,185 +1048,4 @@ .id%0A -%0A @property%0A def value(self):%0A raise NotImplementedError()%0A%0A%0Aclass EmptyNames(PartnerNameError):%0A @property%0A ...
34ede8137f28db1836f2df2141d924f092d7372b
Remove debugging print statement
piecewise/piecewise/__main__.py
piecewise/piecewise/__main__.py
import argparse from sqlalchemy import create_engine, MetaData import piecewise.aggregate import piecewise.config import piecewise.ingest import piecewise.query def refine(config, args): modified_aggregations = [] for agg in config.aggregations: if args.only_compute is not None and not agg.name in arg...
Python
0.000012
@@ -2696,27 +2696,8 @@ se:%0A - print args%0A
017889913a1dba443022ee032535bdc4cb40ddb6
Make nodepool git repo caching more robust
modules/openstack_project/files/nodepool/scripts/cache_git_repos.py
modules/openstack_project/files/nodepool/scripts/cache_git_repos.py
#!/usr/bin/env python # Copyright (C) 2011-2013 OpenStack Foundation # # 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 ...
Python
0.000122
@@ -620,18 +620,47 @@ %0Aimport -re +os.path%0Aimport re%0Aimport shutil %0Aimport @@ -882,16 +882,1158 @@ *)$')%0A%0A%0A +def clone_repo(project):%0A remote = 'git://git.openstack.org/%25s.git' %25 project%0A%0A # Clear out any existing target directory first, in case of a retry.%0A try:%0A shutil...
fc3bd4b8f6ce1f688afa86975619b11f64e3cd02
Initialize BaseStaticSiteRenderer.client to None
django_medusa/renderers/base.py
django_medusa/renderers/base.py
from __future__ import print_function from django.conf import settings from django.test.client import Client __all__ = ['COMMON_MIME_MAPS', 'BaseStaticSiteRenderer'] # Since mimetypes.get_extension() gets the "first known" (alphabetically), # we get supid behavior like "text/plain" mapping to ".bat". This list # ove...
Python
0.000022
@@ -993,16 +993,67 @@ %0A %22%22%22 +%0A def __init__(self):%0A self.client = None %0A%0A @c
0b273ce13135e157267009631d460835387d9975
Add Django 3.1 + 3.2 (#327)
djangosnippets/settings/base.py
djangosnippets/settings/base.py
import os import dj_database_url from django.contrib import messages from django.urls import reverse def user_url(user): return reverse("cab_author_snippets", kwargs={"username": user.username}) PROJECT_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir) SITE_ID = 1 SITE_NAME = "djangos...
Python
0
@@ -3615,24 +3615,64 @@ ERSIONS = (%0A + (%223.2%22, %223.2%22),%0A (%223.1%22, %223.1%22),%0A (%223.0%22,
f963cb4edbfabb54eeff76e45ede391aaf5c482f
Fix bug in install script
install.py
install.py
#!/usr/bin/env python # Script to automatically set up the environment # link names are absolute (with '~' allowed, which will be expanded) # target names are relative with respect to this python script # target directories should have a trailing '/' links = { # tmux '~/.tmux.conf': 'tmux.conf', # sc...
Python
0
@@ -888,10 +888,10 @@ s = -%7B%7D +%5B%5D %0A%0A# @@ -937,22 +937,23 @@ tcmds = -%7B +%5B %0A +( 'git upd @@ -967,17 +967,17 @@ modules' -: +, 'Instal @@ -1001,18 +1001,19 @@ modules' -%0A%7D +)%0A%5D %0A%0A###### @@ -3690,24 +3690,16 @@ in cmds -.items() :%0A
ebfd3d465c376f0eb9eb664f93d6656b232c7867
Add 'styp' major brand to compatible brands, and make compatible_brands a set.
isobmff.py
isobmff.py
from base64 import b64encode import bitstring from bitstring import BitStream import json import struct def _to_json(o): if isinstance(o, bytes): try: return o.decode("ASCII") except: return b64encode(o) return o.__dict__ class Box(object): def __init__(self, type)...
Python
0
@@ -243,16 +243,66 @@ code(o)%0A + if isinstance(o, set):%0A return list(o)%0A retu @@ -315,16 +315,16 @@ _dict__%0A - %0Aclass B @@ -776,19 +776,17 @@ e_brands - = += None):%0A @@ -987,32 +987,33 @@ = minor_version%0A +%0A self.com @@ -1033,28 +1033,82 @@ s = -compatible_brands if +se...
86304c4fd78a1ee86caf4f3e181b2d6e48578de1
Fix a bug on extracting phi/psi torsions.
ProteinFeatureAnalyzer/features/BackboneMicroEnvironmentFeature.py
ProteinFeatureAnalyzer/features/BackboneMicroEnvironmentFeature.py
import os import numpy as np import pandas as pd import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d from .Feature import Feature from . import Geometry class BackboneMicroEnvironmentFeature(Feature): '''The BackboneMicroEnvironmentFeature analyzes th...
Python
0
@@ -1350,33 +1350,33 @@ et_parent(), res -1 +2 ) %0A fea @@ -1426,33 +1426,33 @@ et_parent(), res -1 +2 ) %0A excep
b0133c948555c821a9dcae1df4119a2bfcc19304
fix building
packages/dependencies/librubberband.py
packages/dependencies/librubberband.py
{ 'repo_type' : 'git', 'url' : 'https://github.com/breakfastquay/rubberband.git', 'download_header' : [ 'https://raw.githubusercontent.com/DeadSix27/python_cross_compile_script/master/additional_headers/ladspa.h', ], 'env_exports' : { 'AR' : '{cross_prefix_bare}ar', 'CC' : '{cross_prefix_bare}gcc', 'PREFIX...
Python
0.000003
@@ -241,17 +241,16 @@ %7B%0A%09%09'AR' - : '%7Bcros @@ -274,17 +274,16 @@ ,%0A%09%09'CC' - : '%7Bcros @@ -312,17 +312,16 @@ 'PREFIX' - : '%7Btarg @@ -343,17 +343,16 @@ 'RANLIB' - : '%7Bcros @@ -384,13 +384,8 @@ 'LD' - : '%7B @@ -416,18 +416,16 @@ %09'STRIP' - : '%7Bcros @@ -457,12 +457,8 @@ CXX'...
a3cfc0b7fbda0d85b3c483793c258b4d0bf35c94
return back to symmetric724 for shore test
dipy/reconst/tests/test_shore_metrics.py
dipy/reconst/tests/test_shore_metrics.py
import numpy as np from scipy.special import genlaguerre from numpy.testing import (assert_almost_equal, assert_equal, run_module_suite) from dipy.data import get_gtab_taiwan_dsi, default_sphere from dipy.reconst.shore import (ShoreModel, ...
Python
0.000028
@@ -229,22 +229,18 @@ an_dsi, -defaul +ge t_sphere @@ -2557,20 +2557,52 @@ -v = default_ +sphere = get_sphere('symmetric724')%0A v = sphe
a96cb89524f2fa17a015011d972d396e509a1079
Add code for getting and releasing a database connection
journal.py
journal.py
# -*- coding: utf-8 -*- from flask import Flask import os import psycopg2 from contextlib import closing DB_SCHEMA = """ DROP TABLE IF EXISTS entries; CREATE TABLE entries ( id serial PRIMARY KEY, title VARCHAR (127) NOT NULL, text TEXT NOT NULL, created TIMESTAMP NOT NULL ) """ app = Flask(__name_...
Python
0
@@ -100,16 +100,36 @@ closing%0A +from flask import g%0A %0A%0ADB_SCH @@ -865,16 +865,404 @@ mmit()%0A%0A +def get_database_connection():%0A db = getattr(g, 'db', None)%0A if db is None:%0A g.db = db = connect_db()%0A return db%0A%0A@app.teardown_request%0Adef teardown_request(exception):%0A db = ...
6fa8cfa6f02971f773724a212e3024c4a4e31e4f
add relevant unicity constraints to Checksum, SlocCount
web/models.py
web/models.py
# Copyright (C) 2013 Matthieu Caneill <matthieu.caneill@gmail.com> # Stefano Zacchiroli <zack@upsilon.cc> # # This file is part of Debsources. # # Debsources 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 Fre...
Python
0
@@ -856,16 +856,56 @@ eignKey, + UniqueConstraint%0Afrom sqlalchemy import Integer @@ -3520,16 +3520,79 @@ ecksums' +%0A __table_args__ = (UniqueConstraint('version_id', 'path'),) %0A%0A id @@ -5181,16 +5181,89 @@ counts'%0A + __table_args__ = (UniqueConstraint('sourceversion_id', 'language'),)%0A %...
69705079398391cdc392b18dcd440fbc3b7404fd
Set celery to ignore results
celery_cgi.py
celery_cgi.py
import os import logging from celery import Celery from temp_config.set_environment import DeployEnv runtime_env = DeployEnv() runtime_env.load_deployment_environment() redis_server = os.environ.get('REDIS_HOSTNAME') redis_port = os.environ.get('REDIS_PORT') celery_tasks = [ 'hms_flask.modules.hms_controller', ...
Python
0
@@ -697,12 +697,11 @@ ULT= -Fals +Tru e,%0A
9bdc1dbc37a67d726f808e724b862e7de84fa06a
Change function name
changedate.py
changedate.py
""" Calcular Data a partir de uma quantidade de minutos """ def alterar_data(dataEnt, op, minutosEnt): """ Calcular nova data """ dataEnt, horaEnt = dataEnt.split(" ", 2) diaIni, mesIni, anoIni = dataEnt.split("/", 3) horaIni, minuIni = horaEnt.split(":", 2) # transformar tudo em minutos # co...
Python
0.000092
@@ -59,28 +59,27 @@ %22%0A%0A%0Adef -alterar +change _dat -a +e (dataEnt @@ -1300,20 +1300,19 @@ -alterar +change _dat -a +e (%2231 @@ -1334,12 +1334,13 @@ , %22+%22, 2 -5 +00 )%0A%0A
ec29f12fb69ff115cc29702f7230355547de2271
fix getting owners
src/python/expedient/clearinghouse/project/models.py
src/python/expedient/clearinghouse/project/models.py
''' @author jnaous ''' from django.db import models from expedient.common.permissions.models import Permittee, ObjectPermission from expedient.common.permissions.utils import permissions_save_override,\ permissions_delete_override from expedient.clearinghouse.aggregate.models import Aggregate from django.contrib.co...
Python
0
@@ -393,16 +393,90 @@ ort User +%0Afrom expedient.clearinghouse.aggregate.utils import get_aggregate_classes %0A%0Aclass @@ -3142,31 +3142,148 @@ -return ObjectPermission +# Permissions are given to the leaf classes%0A agg_ids = %5B%5D%0A agg_classes = get_aggregate_classes()%0A permittee ...
a10729414971ee454276960fcc1a736c08b3aef7
Fix syntax error
corehq/tests/noseplugins/uniformresult.py
corehq/tests/noseplugins/uniformresult.py
"""A plugin to format test names uniformly for easy comparison Usage: # collect django tests COLLECT_ONLY=1 ./manage.py test -v2 --settings=settings 2> tests-django.txt # collect nose tests ./manage.py test -v2 --collect-only 2> tests-nose.txt # clean up django test output: s/skipped\ \'.*\'$/ok...
Python
0.999991
@@ -1,8 +1,9 @@ +r %22%22%22A plu
50805c2da2889c13485096f53de27af27a06391a
Implement tree preorder traversal
all-domains/data-structures/trees/tree-order-traversal/solution.py
all-domains/data-structures/trees/tree-order-traversal/solution.py
# https://www.hackerrank.com/challenges/tree-preorder-traversal # Python 2 """ Node is defined as self.left (the left child of the node) self.right (the right child of the node) self.data (the value of the node) """ def preOrder(tree): if tree is None: return print(tree.data) return preOrder(tree.left) or ...
Python
0.000002
@@ -210,16 +210,17 @@ de)%0A%22%22%22%0A +%0A def preO @@ -279,16 +279,17 @@ ee.data) +, %0A ret @@ -337,16 +337,20 @@ right)%0A%0A +%22%22%22%0A class No @@ -680,8 +680,12 @@ (three)%0A +%22%22%22%0A
1097889524cf7deb4b87722d3aedd27c071117c1
Simplify exception logging in template render method.
app/soc/views/template.py
app/soc/views/template.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
@@ -764,25 +764,8 @@ ging -%0Aimport traceback %0A%0Afr @@ -1444,37 +1444,19 @@ ng.e -rror(traceback.format_exc +xception (e) -) %0A
5c84f6b733da72f1bab67631b6e7a8638a42e298
Remove help_text of "How did you hear about ..." question
applications/questions.py
applications/questions.py
from collections import OrderedDict from django import forms from django.core.urlresolvers import reverse def get_organiser_menu(city): """ Get menu entries for organiser-visible pages """ menu = [ { 'title': 'Applications', 'url': reverse('applications:applications', ...
Python
0.000001
@@ -6393,452 +6393,8 @@ ?%22,%0A - %22help_text%22: %22Django Girls is a volunteer-run organisation and we %22%0A %22look for people who are active and can help us help more women get %22%0A %22into the field. We want you to share what you learn at the workshop %22%0A %22with others in diff...
a6ed56b37bba3f5abff73c297a8a20271d73cab2
Add configure call to random_agent
example/random-agent/random-agent.py
example/random-agent/random-agent.py
#!/usr/bin/env python import argparse import logging import sys import gym import universe # register the universe environments from universe import wrappers logger = logging.getLogger() def main(): parser = argparse.ArgumentParser(description=None) parser.add_argument('-v', '--verbose', action='count', des...
Python
0.000001
@@ -576,16 +576,100 @@ ce-v0')%0A + env.configure(remotes=1) # automatically creates a local docker container%0A %0A # Re
cd23780fdc39003f2affe7352bc3253f958faaa5
Change assertion so it works with pytest (don't know what its problem is...)
src/zeit/content/cp/browser/tests/test_centerpage.py
src/zeit/content/cp/browser/tests/test_centerpage.py
import mock import zeit.cms.testing import zeit.content.cp import zope.testbrowser.testing class PermissionsTest(zeit.cms.testing.BrowserTestCase): layer = zeit.content.cp.testing.layer def setUp(self): super(PermissionsTest, self).setUp() zeit.content.cp.browser.testing.create_cp(self.brows...
Python
0
@@ -694,34 +694,20 @@ ssertNot -Ellipsis('...%3Ca... +In(' island/@ @@ -710,35 +710,32 @@ nd/@@delete.html -... ', b.contents)%0A%0A @@ -1302,34 +1302,20 @@ ssertNot -Ellipsis('...%3Ca... +In(' island/@ @@ -1314,35 +1314,32 @@ island/@@retract -... ', b.contents)%0A%0A