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
648722e2a4b149ce99fc890806128211a44abd0f
Version bump 0.0.2
nirum/__init__.py
nirum/__init__.py
""":mod:`nirum` ~~~~~~~~~~~~~~~ """ __version_info__ = 0, 0, 1 __version__ = '.'.join(str(v) for v in __version_info__)
Python
0.000001
@@ -59,9 +59,9 @@ 0, -1 +2 %0A__v
2f617c6fb331f4e9247a1c04635460e55581d837
add info to nodepy.runtime.scripts that it can also holds an 'args' member
nodepy/runtime.py
nodepy/runtime.py
import os import sys #: This value is set automatically before the Node.py entry point is invoked #: from scripts that are installed via the Node.py package manager. It will be #: a dictionary with the following keys: #: #: * location: Either `system`, `global` or `local` #: * original_path: The original value of `sy...
Python
0
@@ -378,16 +378,89 @@ point.%0A +#: * args: The original value of %60sys.argv%60 when the script was invoked.%0A script =
7adc07b76ac3485f3e577e4a9409421c29a445b0
Change the Http backend to use the new Receiver API.
lib/rapidsms/backends/http.py
lib/rapidsms/backends/http.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import BaseHTTPServer, SocketServer import select import random import re from backend import Backend from rapidsms.message import Message class HttpHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): # if the path is just "/" then start a ...
Python
0
@@ -2177,17 +2177,20 @@ elf. -has_outgo +message_wait ing: @@ -2221,16 +2221,20 @@ elf. -outgoing +next_message ()%0A
d1310e1f0a66ca20d0c1017b0e8e09923491b2cb
Update geogig_init_repo.py
lib/rogue/geogig_init_repo.py
lib/rogue/geogig_init_repo.py
from base64 import b64encode from optparse import make_option import json import urllib import urllib2 import argparse import time import os import subprocess def make_request(url, params, auth=None, data=None): """ Prepares a request from a url, params, and optionally authentication. """ req = urllib2...
Python
0.000001
@@ -3802,17 +3802,16 @@ atastore -s = args. @@ -3827,17 +3827,16 @@ atastore -s %0A pub @@ -4559,17 +4559,16 @@ atastore -s %3E 0 and @@ -6192,17 +6192,16 @@ atastore -s %22, help= @@ -6218,17 +6218,16 @@ atastore -s in GeoS
532a218b3b82d2112ec1d925edeb5ac923be9ac6
Fix race-condition in Referee's startup
onitu/__main__.py
onitu/__main__.py
import sys import signal import socket import argparse import simplejson import circus from circus.exc import ConflictError from zmq.eventloop import ioloop from logbook import Logger, INFO, DEBUG, NullHandler, NestedSetup from logbook.queues import ZeroMQHandler, ZeroMQSubscriber from logbook.more import ColorizedSt...
Python
0.000035
@@ -533,16 +533,71 @@ 'ports') +%0A redis.delete('entries')%0A redis.delete('events') %0A%0A tr @@ -959,36 +959,8 @@ ()%0A%0A - redis.delete('entries')%0A
b50cd7e7a06fe19b6bc68aa9815d33e27d8b9751
Bump version for dev release.
openxc/version.py
openxc/version.py
""" Current OpenXC version constant. This functionality is contained in its own module to prevent circular import problems with ``__init__.py`` (which is loaded by setup.py during installation, which in turn needs access to this version information.) """ VERSION = (0, 11, 1) __version__ = '.'.join(map(str, VERSION))...
Python
0
@@ -268,17 +268,17 @@ (0, 11, -1 +2 )%0A%0A__ver
ca2ce09f0ea9c4322ed300c9f2bd56ff50c270a4
Remove inactive listeners
magentoerpconnect/consumer.py
magentoerpconnect/consumer.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
Python
0.000001
@@ -935,238 +935,8 @@ ##%0A%0A -from openerp.addons.connector.event import (on_record_write,%0A on_record_create,%0A on_record_unlink%0A )%0A from @@ -1140,147 +1140,8 @@ nt%0A%0A -_MODEL_...
9be887abea678af9ee55001f193fd0c7bad21617
Move test_encoding to new integration test framework
nuxeo-drive-client/nxdrive/tests/test_encoding.py
nuxeo-drive-client/nxdrive/tests/test_encoding.py
from nxdrive.tests.common import IntegrationTestCase class TestEncoding(IntegrationTestCase): def setUp(self): super(TestEncoding, self).setUp() # Bind the server and root workspace self.setUpDrive_1(firstSync=True) self.remote_client = self.remote_document_client_1 self...
Python
0
@@ -23,27 +23,30 @@ mmon - import Integration +_unit_test import Unit Test @@ -75,19 +75,12 @@ ing( -Integration +Unit Test @@ -150,16 +150,70 @@ setUp()%0A + self.engine_1.start()%0A self.wait_sync() %0A @@ -254,50 +254,8 @@ ace%0A - self.setUpDrive_1(firstSync=True)%0A @@ -684...
dc3add94174c6b6cf5a744b20300a07b8e1affa7
Test removing dbm
antd/main.py
antd/main.py
#!/usr/bin/python # Copyright (c) 2012, Braiden Kindt. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, t...
Python
0.000001
@@ -1504,16 +1504,17 @@ port os%0A +# impo
9804cc25b224f3087086cca142443536d1eb3537
Fix tests
corehq/apps/export/tests/test_export_instance.py
corehq/apps/export/tests/test_export_instance.py
import mock from django.test import SimpleTestCase from corehq.apps.export.models import ( ExportItem, ExportDataSchema, ExportGroupSchema, ExportInstance, ) class TestExportInstanceGeneration(SimpleTestCase): @classmethod def setUpClass(cls): cls.app_id = '1234' cls.schema =...
Python
0.000003
@@ -101,24 +101,28 @@ rtItem,%0A +Form ExportDataSc @@ -310,32 +310,36 @@ cls.schema = +Form ExportDataSchema @@ -3444,16 +3444,20 @@ chema = +Form ExportDa
3c2b0e061721c592c68fa253bedc5da8ecaf806a
Add function to check old pipeline
tvtk/common.py
tvtk/common.py
"""Common functions and classes that do not require any external dependencies (apart from the standard library of course). """ # Author: Prabhu Ramachandran <prabhu_r@users.sf.net> # Copyright (c) 2005-2007, Enthought, Inc. # License: BSD Style. import string import re ###############################################...
Python
0.000001
@@ -264,16 +264,27 @@ mport re +%0Aimport vtk %0A%0A###### @@ -1172,16 +1172,179 @@ k_name%0A%0A +def is_old_pipeline():%0A vtk_major_version = vtk.vtkVersion.GetVTKMajorVersion()%0A if vtk_major_version %3C 6:%0A return True%0A else:%0A return False %0A%0Aclass
3836d4f58d30555456037f2337c6fa7ce3c13ae2
fix request_token
tweepy/auth.py
tweepy/auth.py
from __future__ import print_function import six import logging from tweepy.error import TweepError from tweepy.api import API import requests from requests_oauthlib import OAuth1Session, OAuth1 from requests.auth import AuthBase from six.moves.urllib.parse import parse_qs WARNING_MESSAGE = """Warning! Due to a Twit...
Python
0.000003
@@ -1390,32 +1390,64 @@ username = None%0A + self.request_token = %7B%7D%0A self.oau
d7f47576b9a129b7c4c209c5075e1d52fff63746
Add new locations.
orchestrator/plugins/compute/ouest_france_immo.py
orchestrator/plugins/compute/ouest_france_immo.py
from lxml import html from io import StringIO import requests import logging import hashlib logger = logging.getLogger("spider.ofi") __url__ = "https://www.ouestfrance-immo.com/" __urls__ = [ "https://www.ouestfrance-immo.com/acheter/maison/?lieux=24303&rayon=30&prix=0_120000", "https://www.ouestfrance-immo.c...
Python
0
@@ -367,16 +367,190 @@ _120000%22 +,%0A %22https://www.ouestfrance-immo.com/acheter/maison/dinard-35-35800/?prix=0_120000%22,%0A %22https://www.ouestfrance-immo.com/acheter/maison/lamballe-22-22400/?prix=0_120000%22 %0A%5D%0A# htt
96465f47e82b6f57b34cd993fb6518771a836113
bump version
cpv/__init__.py
cpv/__init__.py
# __version__ = "0.50.5"
Python
0
@@ -15,11 +15,11 @@ = %220.50. -5 +6 %22%0A
01327d0b692fc2c1a373cbb8ee90c7660df151bb
rename utility --> helper
src/unittest/python/scheduler_tests.py
src/unittest/python/scheduler_tests.py
import datetime from mock import Mock, patch import pytz from unittest import TestCase from alppaca.scheduler import Scheduler from alppaca.compat import OrderedDict class FixedDateTime(datetime.datetime): @classmethod def now(cls, tz=None): return datetime.datetime(2015, 6, 22, tzinfo=tz) class Ref...
Python
0.000001
@@ -1501,23 +1501,22 @@ def -utility +helper (self, e @@ -2062,39 +2062,38 @@ 10%0A self. -utility +helper (expected, expir @@ -2272,39 +2272,38 @@ 0%0A self. -utility +helper (expected, expir @@ -2524,39 +2524,38 @@ 00%0A self. -utility +helper (expected, expir @@ -2753,15 +2753,14 @...
4ac09fa62723200087bacb83449519848c2d413e
Fix importing redirects.
skier/frontend.py
skier/frontend.py
from flask import Blueprint, render_template, url_for, request, redirect from skier import pgp from cfg import cfg from skier.keyinfo import KeyInfo frontend = Blueprint("frontend", __name__) frontend_keys = Blueprint("user_display_keys", __name__) @frontend.route("/") def index(): return render_template("index....
Python
0
@@ -2001,18 +2001,88 @@ info(key -) : + str):%0A if key.startswith(%220x%22):%0A key = key.replace(%220x%22, %22%22) %0A # K
621337bd685a200a37bcbbd5fe3441d2090aab54
Add PYTHON_ARGCOMPLETE_OK to enable completion for argcomplete users
cr8/__main__.py
cr8/__main__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argh import argparse from cr8 import __version__ from cr8.timeit import timeit from cr8.insert_json import insert_json from cr8.insert_fake_data import insert_fake_data from cr8.insert_blob import insert_blob from cr8.run_spec import run_spec from cr8.run_crate imp...
Python
0
@@ -38,16 +38,40 @@ tf-8 -*- +%0A# PYTHON_ARGCOMPLETE_OK %0A%0Aimport
3c151b93f0c122f098642cabf97f755133e41a63
Document --config and make it required.
craftrun/cli.py
craftrun/cli.py
import argparse, sys, yaml, os, logging from craftrun import command class Settings(object): """Cli and config file settings.""" def __init__(self, cli): self.cli = cli with open(cli.config, 'r') as io: self.config = yaml.load(io.read()) @property def base_dir(self): ...
Python
0
@@ -1455,16 +1455,89 @@ %22config%22 +, required=True,%0A help=%22Server configuration.%22 )%0A
e09551ed8fef6c53acb5faab4a0165b61f98eab3
Delete unneeded absolute_import
app/tests.py
app/tests.py
from __future__ import absolute_import import tempfile import unittest import serve import utils class PageCase(unittest.TestCase): def setUp(self): serve.app.config['TESTING'] = True self.app = serve.app.test_client() def test_index_load(self): self.page_test('/', b'Albert Wang') ...
Python
0.000007
@@ -1,44 +1,4 @@ -from __future__ import absolute_import%0A%0A impo
5a3424037afa9ead9cf30a23b7343e788e3ffc01
Add HttpError
crawler/core.py
crawler/core.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'liuzhijun' from datetime import datetime from datetime import timedelta import traceback from bs4 import BeautifulSoup, Comment from tornado import gen from tornado import httpclient @gen.coroutine def crawl_base_info(url): """ 从文章列表页面爬基本信息:title,...
Python
0.000008
@@ -239,16 +239,57 @@ pclient%0A +from tornado.httpclient import HTTPError%0A %0A%0A@gen.c
0a323f4cd789a0b19c1b426c621ab8fb01766b17
Handle race condition with empty next session.
jazzband/account/views.py
jazzband/account/views.py
import logging from datetime import datetime import sentry_sdk from flask import Blueprint, flash, redirect, session, url_for from flask_login import ( current_user, login_user, logout_user, login_required ) from ..decorators import templated from ..github import github from ..members.models import User from ..me...
Python
0
@@ -3005,16 +3005,22 @@ p('next' +, None ) or%0A
1cb49fc209fb4aca854db732588003b704e3ef56
Change resize button label
dbaas/logical/widgets/database_offering_field.py
dbaas/logical/widgets/database_offering_field.py
from django import forms from django.utils.safestring import mark_safe class DatabaseOfferingWidget(forms.widgets.TextInput): def render(self, name, value, attrs=None): html = super(DatabaseOfferingWidget, self).render(name, value,attrs) resize_link = """ </br><a id="resizeDatabase"...
Python
0.000001
@@ -414,24 +414,18 @@ %3EResize -Database +VM %3C/a %3E%22%22%22
56b48f761b3b192ce685370c64aa6952940d0058
rename ban's server field to server
merc/features/rfc1459/ban.py
merc/features/rfc1459/ban.py
import collections import datetime from merc import channel from merc import errors from merc import feature from merc import message from merc import mode BanDetail = collections.namedtuple("BanDetail", ["app", "creation_time"]) class BanFeature(feature.Feature): NAME = __name__ install = BanFeature.install ...
Python
0.000001
@@ -202,19 +202,22 @@ ail%22, %5B%22 -app +server %22, %22crea @@ -1520,19 +1520,22 @@ detail. -app +server ,%0A
d1dd6df37b3061d3595a25a2c12f04de235449a8
Increase logging for Rust CI failures.
mesonbuild/compilers/rust.py
mesonbuild/compilers/rust.py
# Copyright 2012-2017 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
Python
0
@@ -1879,39 +1879,305 @@ me%5D, - cwd=work_dir)%0A pc.wait( +%0A stdout=subprocess.PIPE,%0A stderr=subprocess.PIPE,%0A cwd=work_dir)%0A stdo, stde = pc.communicate()%0A stdo = stdo.decode('utf-8', errors='replac...
e0214f91300be42131da2cb94a563cff724b29ed
add assertLoginRedirect method to SmartminTest
smartmin/tests.py
smartmin/tests.py
from urlparse import urlparse from django.contrib.auth.models import Group, User from django.core.urlresolvers import reverse from django.test.testcases import TestCase class SmartminTest(TestCase): def fetch_protected(self, url, user, post_data=None, failOnFormValidation=True): """ Fetches the g...
Python
0
@@ -162,16 +162,48 @@ estCase%0A +from django.conf import settings %0A%0Aclass @@ -1277,32 +1277,151 @@ eturn response%0A%0A + def assertLoginRedirect(self, response, msg=None):%0A self.assertRedirect(response, settings.LOGIN_URL, msg)%0A%0A def assertRe
ffd1dca603d9bfcf55133ad98013afe8b6b23083
Include nicks in numeric parameters where required
txircd/user.py
txircd/user.py
# -*- coding: utf-8 -*- from twisted.words.protocols import irc import time class IRCUser(object): def __init__(self, parent, user, password, nick): password = password[0] if password else None nick = nick[0] username = user[0] # RFC 2812 allows setting modes in the USER command bu...
Python
0
@@ -1243,16 +1243,19 @@ LCOME, %22 +%25s :Welcome @@ -1312,32 +1312,55 @@ ata%5B%22nickname%22%5D, + self.data%5B%22nickname%22%5D, self.data%5B%22user @@ -1442,16 +1442,19 @@ RHOST, %22 +%25s :Your ho @@ -1478,32 +1478,55 @@ version %25s%22 %25 ( +self.data%5B%22nickname%22%5D, self.parent.fact @@ -1615,1...
18ebd1a843717991a41a5f9901c79b5857e8bc98
Fix duration extraction and update test
youtube_dl/extractor/redtube.py
youtube_dl/extractor/redtube.py
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, str_to_int, unified_strdate, ) class RedTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www\.)?redtube\.com/|embed\.redtube\...
Python
0
@@ -428,40 +428,40 @@ ': ' -7b8c22b5e7098a3e1c09709df1126d2d +fc08071233725f26b8f014dba9590005 ',%0A @@ -613,12 +613,12 @@ '201 -2083 +1081 1',%0A @@ -3430,16 +3430,98 @@ or_none( +self._og_search_property(%0A 'video:duration', webpage, default=None) or self._se @@ -3524,32 +3524,36 @@ ._search_rege...
f95a823ad0a1bc0fd9c65a855785b856b1c94f0a
Support expired query history reload
desktop/libs/notebook/src/notebook/decorators.py
desktop/libs/notebook/src/notebook/decorators.py
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
Python
0
@@ -1430,16 +1430,35 @@ rmission +, ENABLE_NOTEBOOK_2 %0Afrom no @@ -4212,32 +4212,168 @@ ryExpired as e:%0A + if ENABLE_NOTEBOOK_2.get():%0A response%5B'query_status'%5D = %7B'status': 'expired'%7D%0A response%5B'status'%5D = 0%0A else:%0A response%5B'
237a5370ac2e9d9861cc900db74a5871db1b4cc4
allow trove tups to be frozen with or without timestamps
conary/repository/xmlshims.py
conary/repository/xmlshims.py
# # Copyright (c) 2004 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licen...
Python
0
@@ -2398,35 +2398,198 @@ eTup(self, tuple -):%0A +, withTime=False):%0A if withTime:%0A return (tuple%5B0%5D, self.freezeVersion(tuple%5B1%5D), %0A self.fromFlavor(tuple%5B2%5D))%0A else:%0A return ( @@ -2622,24 +2622,45 @@ (tuple%5B1%5D), +%0A ...
760a04a4fecbb74c71bbaed94b0773628b993dac
Fix handling of filespec state in load_files
metatlas/metatlas_objects.py
metatlas/metatlas_objects.py
import os import dataset import pickle from .mzml_loader import mzml_to_hdf from IPython.utils.traitlets import ( HasTraits, CUnicode, CFloat, List, CInt, Bool, Instance) NERSC_WORKSPACE = '/project/projectdirs/metatlas/workspace' class Compound(HasTraits): """ name: str Name of the compound f...
Python
0.000001
@@ -4028,21 +4028,20 @@ -state +keys = files @@ -4048,21 +4048,112 @@ pec. -__getstate__( +trait_names()%0A state = %7B%7D%0A for key in keys:%0A state%5Bkey%5D = getattr(filespec, key )%0A
4cbe9b4cc92d8e866ca125effa1b6ce224506195
add option max_events to summarize() in TwilightTree
behind_scene.py
behind_scene.py
##__________________________________________________________________|| import alphatwirl ##__________________________________________________________________|| class TwilightTree(object): def __init__(self, tree): self.tree = tree def __repr__(self): name_value_pairs = ( ('tree', ...
Python
0.000002
@@ -529,12 +529,30 @@ lcfg +, max_events = -1 ):%0A%0A +%0A @@ -1301,16 +1301,41 @@ elf.tree +, max_events = max_events )%0A
f90950d37127dbff191c0003c1fd57c8d7d7d627
Enable continous saving
atari_dqn.py
atari_dqn.py
from argparse import ArgumentParser from PIL import Image import numpy as np import gym from keras.models import Sequential from keras.layers import Dense, Activation, Flatten, Convolution2D from keras.optimizers import Nadam from keras.callbacks import ModelCheckpoint from rl.agents import DQNAgent from rl.memory i...
Python
0
@@ -2694,18 +2694,32 @@ ilename) -, +%5D%0Acallbacks += %5B FileLogg @@ -2737,17 +2737,35 @@ name -)%5D%0Atry:%0A%09 +, save_continiously=True)%5D%0A dqn. @@ -2889,84 +2889,8 @@ 000) -%0Aexcept KeyboardInterrupt:%0A%09# Ignore this, and continue with the rest.%0A%09pass %0A%0A#
bcf9314bf56a1988b394c9951a50a2df2a16be02
Remove comment about no simulation
Bindings/Python/examples/build_simple_arm_model.py
Bindings/Python/examples/build_simple_arm_model.py
# ----------------------------------------------------------------------- # # The OpenSim API is a toolkit for musculoskeletal modeling and # # simulation. See http://opensim.stanford.edu and the NOTICE file # # for more information. OpenSim is developed at Stanford University # # and supported ...
Python
0
@@ -2115,184 +2115,32 @@ on. -Further, the model does not include forward simulation, #%0A# but instead saves the model to an .osim file which can be used in the #%0A# OpenSim plotter or the graphics window. +
0bda9f455b9872741e19656c3c517ea8fde34748
Version bump
oshino/version.py
oshino/version.py
""" Module just to print out current version. That's all. """ VERSION = (0, 1, 6) def get_version(): """ Returns version """ return ".".join(map(str, VERSION)) if __name__ == '__main__': print(get_version())
Python
0.000001
@@ -77,9 +77,9 @@ 1, -6 +7 )%0A%0A%0A
72567d40c0cb707510918a038dcd1553a1cbe68b
Call udisks.sync in cli.mount/unmount
udiskie/cli.py
udiskie/cli.py
""" Udiskie CLI logic. """ __all__ = [ # entry points: 'daemon', 'mount', 'umount', ] import warnings warnings.filterwarnings("ignore", ".*could not open display.*", Warning) warnings.filterwarnings("ignore", ".*g_object_unref.*", Warning) import os import logging from functools import partial CO...
Python
0
@@ -5054,32 +5054,54 @@ isks.create(bus) +%0A udisks.sync() %0A%0A # create a @@ -6813,24 +6813,46 @@ create(bus)%0A + udisks.sync()%0A mounter
398cacda0209459217271d025115776864fd2d6a
Fix a bug where type comparison is case-sensitive for TIF
mfr/extensions/pdf/render.py
mfr/extensions/pdf/render.py
import logging import os import furl from mako.lookup import TemplateLookup from mfr.core import extension from mfr.extensions.pdf import settings from mfr.extensions.utils import munge_url_for_localdev logger = logging.getLogger(__name__) class PdfRenderer(extension.BaseRenderer): TEMPLATE = TemplateLookup( ...
Python
0
@@ -675,16 +675,24 @@ data.ext +.lower() not in
c804b5753f4805cf3d129fa4e7febef5c032b6ca
Update version to 1.1.0
unpaddedbase64.py
unpaddedbase64.py
# Copyright 2014, 2015 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
0.000001
@@ -614,11 +614,11 @@ %221. -0.1 +1.0 %22%0A%0A%0A
897ec03f075a44f638171e243c7fcebe589466ff
Remove stray debugging output.
app/views.py
app/views.py
import datetime import json import flask import flask_login import mediacloud import mediacloud.api as mcapi import mediacloud.media as mcmedia import pymongo from app import app, login_manager, mc, util from user import User, authenticate_user from forms import * @app.route('/') def index(): content = flask.ren...
Python
0.000001
@@ -2627,24 +2627,8 @@ nd)%0A - print query%0A
65ae7efa88f3c5b2b6518ace53663ef075bc3090
uniqify tweet ids
twnews/print_urls_by_user.py
twnews/print_urls_by_user.py
""" Print users who were found for multiple urls. user average_score_difference url1 score1 url2 score2 ... """ import codecs from collections import defaultdict import json import sys from . import __data__ sys.stdout = codecs.getwriter('utf8')(sys.stdout) def average_distance(scores): total = 0. count = ...
Python
0.999999
@@ -667,16 +667,32 @@ utf-8')%0A + ids = set()%0A for @@ -704,16 +704,16 @@ in inf:%0A - @@ -778,16 +778,56 @@ id line%0A + if js%5B'id'%5D not in ids:%0A @@ -896,24 +896,28 @@ + url2score%5Bjs @@ -952,24 +952,58 @@ rl_score'%5D)%0A + ids...
4b3c24dfce6f430d42ce9f24b72de54d34c9d79e
Fix for Numeric Overflow of `softplus` implementation (#30)
mla/neuralnet/activations.py
mla/neuralnet/activations.py
import autograd.numpy as np """ References: https://en.wikipedia.org/wiki/Activation_function """ def sigmoid(z): return 1.0 / (1.0 + np.exp(-z)) def softmax(z): # Avoid numerical overflow by removing max e = np.exp(z - np.amax(z, axis=1, keepdims=True)) return e / np.sum(e, axis=1, keepdims=True) ...
Python
0
@@ -381,24 +381,105 @@ th relu.%22%22%22%0A + # Avoid numerical overflow by putting possible inf into denominator position%0A return n @@ -472,24 +472,28 @@ n%0A return + z + np.log(1 + @@ -487,24 +487,28 @@ + np.log(1 + + 1 / np.exp(z))%0A
93de55a62a88cba979c9d5e979b26f41546e2105
fix bug. use f-string format (#2681)
mmdet/datasets/wider_face.py
mmdet/datasets/wider_face.py
import os.path as osp import xml.etree.ElementTree as ET import mmcv from .builder import DATASETS from .xml_style import XMLDataset @DATASETS.register_module() class WIDERFaceDataset(XMLDataset): """ Reader for the WIDER Face dataset in PASCAL VOC format. Conversion scripts can be found in https://...
Python
0.000002
@@ -661,16 +661,17 @@ ename = +f '%7Bimg_id
0a76529251c44a694c6a8f2d6fa3d6c2bf6e2de3
Add TODO items inline
nova_api_docs_tracker/main.py
nova_api_docs_tracker/main.py
# -*- coding: utf-8 -*- import glob import os import re SPLIT_FILE_RE = re.compile(r'\n([\w\s]+)\n\=+\n', re.MULTILINE) def main(): # TODO(auggy): args: inc files path path = '' output = {} # get inc files inc_files = get_inc_files(path) for filename in inc_files: contents = inc_fil...
Python
0
@@ -1132,19 +1132,41 @@ auggy): -use +print to local file using Jinja t @@ -1305,16 +1305,16 @@ ds)s%22 %5C%0A - @@ -1329,16 +1329,196 @@ output%0A%0A + # TODO(auggy): post bugs to Launchpad using local files%0A # TODO(auggy): keep track of bugs...?%0A%0A # TODO(auggy): option for r...
aa42301dc8d3f4c3243207e50ad4b5176c29db2a
Clean up the SASL server command
txircd/modules/ircv3_sasl.py
txircd/modules/ircv3_sasl.py
from twisted.words.protocols import irc from txircd.modbase import Command from txircd.server import ModuleMessage # These numerics are defined for use in the IRCv3 SASL documentation # located at http://ircv3.atheme.org/extensions/sasl-3.1 # The names are entirely made up based on their uses. irc.RPL_SASLACCOUNT = "9...
Python
0.000009
@@ -6995,8 +6995,80 @@ rogress) +%0A self.ircd.server_commands%5B%22SASL%22%5D.remove(self.sasl.saslMessage)
a3157191ca23298b33ec8adb328e591fd9264a04
Fix an order related issue
cupy/cusolver.py
cupy/cusolver.py
import numpy import cupy from cupy.cuda import cusolver from cupy.cuda import runtime from cupy.cuda import device _available_cuda_version = { 'gesvdj': (9000, None), 'gesvda': (10010, None), } def check_availability(name): if name not in _available_cuda_version: msg = 'No available version inf...
Python
0.001738
@@ -2276,96 +2276,42 @@ -lda = m%0A if not a.flags%5B'F_CONTIGUOUS'%5D:%0A a = cupy.asfortranarray(a)%0A elif +a = cupy.array(a, order='F', copy= not @@ -2325,30 +2325,21 @@ te_a -: +) %0A - a = a.copy() +lda = m %0A
60d923433aa34dcdd1ce7bafd2431d4778c4d394
remove old config
appConfig.py
appConfig.py
""" Project Bluebox 2015, University of Stuttgart, IPVS/AS """ """ Project Bluebox Copyright (C) <2015> <University of Stuttgart> This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details. """ """ this is the current config file for bluebox. define...
Python
0.000015
@@ -260,266 +260,595 @@ %22%22%22%0A -%0A%0A%22%22%22%0Athis is the current config file for bluebox. define the server connection below as either of the two types:%0A%22%22%22%0A%0A%0A%22%22%22%0Aswift_type = %22BluemixV1Auth%22%0Aswift_url =%22https://swift.ng.bluemix.net/global_auth/?????%22%0Aswift_user = %22?????%...
ff640f4c55740cbee465546152267c6a1ef305d4
add up/down indication for scrolling
conjure/controllers/finish.py
conjure/controllers/finish.py
from conjure.ui.views.services import ServicesView from ubuntui.ev import EventLoop from conjure.juju import Juju from functools import partial from conjure import async from conjure.models.bundle import BundleModel from conjure.utils import pollinate import os.path as path import os import json from subprocess import ...
Python
0
@@ -6538,16 +6538,29 @@ bheader( +%0A 'Deploy @@ -6574,16 +6574,37 @@ - (Q)uit + %7C%7C UP/DOWN to Scroll ')%0A%0A
0decdf5f3c81ffb4422158b1cef3a043cde614bd
put logos in subdir
src/python/expedient/clearinghouse/settings.py
src/python/expedient/clearinghouse/settings.py
''' @author: jnaous ''' # Django settings for clearinghouse project. from os.path import dirname, join SRC_DIR = join(dirname(__file__), '../../../') # For serving static content - dev version only STATIC_DOC_ROOT = join(SRC_DIR, 'static/expedient/clearinghouse') DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2...
Python
0
@@ -4554,16 +4554,31 @@ _DIR = %22 +aggregate_logos /%22%0A%0A# Op
288c0e5913af7baf31c6320c1d648b3e837a65ea
Add tool classpath for ./pants scalafix (#6926)
src/python/pants/backend/jvm/tasks/scalafix.py
src/python/pants/backend/jvm/tasks/scalafix.py
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals from abc import abstractproperty from pants.backend.jvm.tasks.rewrite_base import Rewrit...
Python
0.00002
@@ -1779,16 +1779,93 @@ %5D) +%0A cls.register_jvm_tool(register, 'scalafix-tool-classpath', classpath=%5B%5D) %0A%0A @cla @@ -2533,16 +2533,181 @@ gs = %5B%5D%0A + tool_classpath = self.tool_classpath('scalafix-tool-classpath')%0A if tool_classpath:%0A args.append('--tool-classpath=%7B%7D'.form...
4ccc39e7fdce4281bb02a033385a62d5fb16ec94
The text of the TypeError is different in Python 2 and 3.
testfixtures/tests/test_roundcomparison.py
testfixtures/tests/test_roundcomparison.py
from decimal import Decimal from testfixtures import RoundComparison as R, compare, ShouldRaise from unittest import TestCase class Tests(TestCase): def test_equal_yes_rhs(self): self.assertTrue(0.123457 == R(0.123456, 5)) def test_equal_yes_lhs(self): self.assertTrue(R(0.123456, 5) == 0.1234...
Python
0.99993
@@ -1146,39 +1146,16 @@ ypeError -(%22a float is required%22) ):%0A @@ -1260,31 +1260,8 @@ rror -(%22a float is required%22) ):%0A
e0296b4fc0e7b010ebfb21cb1d34ad1e4916bc5d
Update the mtime on retranslation of existing distributions.
src/python/twitter/common/python/translator.py
src/python/twitter/common/python/translator.py
from __future__ import absolute_import from abc import abstractmethod import os import shutil from uuid import uuid4 from .common import chmod_plus_w, safe_rmtree, safe_mkdir, safe_mkdtemp from .compatibility import AbstractClass from .installer import WheelInstaller from .interpreter import PythonInterpreter from .p...
Python
0
@@ -3483,20 +3483,16 @@ if -not os.path. @@ -3511,16 +3511,25 @@ t_path): +%0A # avoi @@ -3563,16 +3563,108 @@ ribution +, but update its mtime for ttl purposes.%0A os.utime(target_path, None)%0A else: %0A
49f08ce9ede6839ab0c74f7a5f03b6e6abaafb30
Fix typo.
inbox/events/google.py
inbox/events/google.py
"""Provide Google Calendar events.""" from copy import copy import httplib2 import dateutil.parser as date_parser from apiclient.discovery import build from oauth2client.client import OAuth2Credentials from oauth2client.client import AccessTokenRefreshError from inbox.basicauth import ConnectionError, ValidationErro...
Python
0.000007
@@ -9310,25 +9310,16 @@ opy(resp -%5B'items'%5D )%0A
3eab18b0fe7fac4e1ffd5707d112ea9de525cefb
Move sandbox for spawn_local inside sandbox_root
src/python/twitter/mesos/client/spawn_local.py
src/python/twitter/mesos/client/spawn_local.py
import os import socket import subprocess import tempfile import threading import time import urllib2 import webbrowser from twitter.common import log from twitter.common.contextutil import temporary_dir from twitter.common.http import HttpServer from twitter.common.net.tunnel import TunnelHelper from twitter.mesos.cl...
Python
0
@@ -2123,28 +2123,53 @@ ask_id, -sandbox_root +os.path.join(sandbox_root, 'sandbox') )%0A
44300aa1e18edf1ce612791891bbbe7f888cad76
Refactor the group association
moocng/courses/backends.py
moocng/courses/backends.py
# Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es) # Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> # # 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 # # ...
Python
0.999897
@@ -1929,400 +1929,74 @@ +user. group -_id s = -%5B%5D%0A for value in attributes%5Bsaml_attr%5D:%0A try:%0A id = Group.objects.get(name=value).id%0A group_ids.append(id)%0A ...
cba7c7e20911d771ab2fb81e849f2220ccf959ed
Fix format
moulinette/utils/stream.py
moulinette/utils/stream.py
import os import time from multiprocessing.process import Process from multiprocessing.queues import SimpleQueue # Read from a stream --------------------------------------------------- class AsynchronousFileReader(Process): """ Helper class to implement asynchronous reading of a file in a separate th...
Python
0.02182
@@ -1535,16 +1535,41 @@ print( +%0A %22from mo @@ -1631,17 +1631,62 @@ %25s%22 - %25 str(e) +%0A %25 str(e)%0A )%0A
e251e4cb244f017d9ea09cb9cfb4f11f95f234d2
author name correction
mrp_project/__openerp__.py
mrp_project/__openerp__.py
# -*- coding: utf-8 -*- # (c) 2014 Daniel Campos <danielcampos@avanzosc.es> # (c) 2015 Pedro M. Baeza - Serv. Tecnol. Avanzados # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "MRP Project Link", "summary": "Link production with projects", "version": "8.0.1.1.0", "depends": [...
Python
0.99994
@@ -535,16 +535,21 @@ genier%C3%ADa + S.L. ,%22%0A
c97d4cce296e9505633404790847183122638cd7
Revert crippling of test_old_api
nengo/test/test_old_api.py
nengo/test/test_old_api.py
import numpy as np from nengo.old_api import Network from matplotlib import pyplot as plt def rmse(a, b): return np.sqrt(np.mean((a - b) ** 2)) def test_basic_1(show=False): """ Create a network with sin(t) being represented by a population of spiking neurons. Assert that the decoded value from ...
Python
0.000003
@@ -84,17 +84,16 @@ as plt%0A%0A -%0A def rmse @@ -869,17 +869,16 @@ tc=0.1)%0A -%0A in_p @@ -937,26 +937,8 @@ 1)%0A%0A - simtime = 1.0%0A @@ -945,23 +945,19 @@ net.run( -simtime +1.0 )%0A%0A t @@ -988,22 +988,16 @@ (0, -simtime / .001 +1000, 10 ) / @@ -1007,158 +1007,41 @@ 0.)%0A -%0A ...
3fa53801f5b554b9f1687374c471c84cae60fa0f
Make parsing of md5sum command output more robust (#2361)
netmiko/linux/linux_ssh.py
netmiko/linux/linux_ssh.py
import os import re import socket import time from netmiko.cisco_base_connection import CiscoSSHConnection from netmiko.cisco_base_connection import CiscoFileTransfer from netmiko.ssh_exception import NetmikoTimeoutException LINUX_PROMPT_PRI = os.getenv("NETMIKO_LINUX_PROMPT_PRI", "$") LINUX_PROMPT_ALT = os.getenv("N...
Python
0.999993
@@ -5802,16 +5802,24 @@ est_md5) +.strip() %0A
375d39d4412e312a7b5e98afd7940d6c76acb189
Fix so numpy tests will fail when they should on Python 2.7
neukrill_net/tests/base.py
neukrill_net/tests/base.py
#!/usr/bin/env python """ Objects shared by all the test cases """ import os import glob import unittest import numpy as np class BaseTestCase(unittest.TestCase): """ Superclass for all neukrill-net test cases """ @classmethod def setUpClass(self): self.test_dir = os.path.join('neu...
Python
0.000221
@@ -1614,59 +1614,259 @@ -self.failureException(%22This isn't a numpy array.%22 + +# This is how you are supposed to do it%0A # but does not work for me in Python 2.7%0A self.failureException(%22This isn't a numpy array. %25s%22 %25 msg)%0A # This always works%0A self.f...
9372733f370910941a47e735e97f9c5df2c4e8e3
prepare use of print for Python 3
nipy/testing/decorators.py
nipy/testing/decorators.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Extend numpy's decorators to use nipy's gui and data labels. """ from numpy.testing.decorators import * from nipy.utils import templates, example_data, DataError def make_label_dec(label, ds=None): ...
Python
0.000001
@@ -175,16 +175,54 @@ els.%0A%22%22%22 +%0Afrom __future__ import print_function %0A%0Afrom n @@ -958,17 +958,17 @@ %3E%3E print - +( slow.__d @@ -971,16 +971,17 @@ .__doc__ +) %0A Lab
cfd399707d22bc6ef5795e7fbf034f09131f295a
fix counting on small cascades
mcm/sdos/util/treeGeometry.py
mcm/sdos/util/treeGeometry.py
#!/usr/bin/python # coding=utf-8 """ Project MCM - Micro Content Management SDOS - Secure Delete Object Store Copyright (C) <2016> Tim Waizenegger, <University of Stuttgart> This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details. """ import json imp...
Python
0.000004
@@ -361,72 +361,8 @@ th%0A%0A -from mcm.sdos import configuration%0A%0Alog = logging.getLogger()%0A%0A%0A #### @@ -4313,32 +4313,36 @@ + cascade.cascadeP @@ -4457,16 +4457,20 @@ der = (%0A + @@ -4638,24 +4638,314 @@ InGroup = 0%0A + if groupSize == 0:%0A e = %22Error: ...
b386466bb661707a1470866467b34863758baaaa
Make the osf provider compatible with both waterbutler API v0 and v1
mfr/providers/osf/provider.py
mfr/providers/osf/provider.py
import os import asyncio import hashlib import mimetypes import furl import aiohttp from waterbutler.core import streams from mfr.core import exceptions from mfr.core import provider class OsfProvider(provider.BaseProvider): UNNEEDED_URL_PARAMS = ('_', 'token', 'action', 'mode', 'displayName') def __init...
Python
0
@@ -3,16 +3,28 @@ port os%0A +import json%0A import a @@ -946,32 +946,141 @@ _download_url()%0A + if '/file?' in download_url:%0A # TODO Remove this when API v0 is officially deprecated%0A metadata @@ -1130,16 +1130,20 @@ a?', 1)%0A + @@ -1212,32 +1212,36 @@ ta_url)%0A ...
c2bca21718295b6400471395f5da3ca9d42e8a84
Check if error available on output
modoboa_dmarc/tests/mixins.py
modoboa_dmarc/tests/mixins.py
"""Test mixins.""" import os import sys import six from django.core.management import call_command class CallCommandMixin(object): """A mixin to provide command execution shortcuts.""" def setUp(self): """Replace stdin""" super(CallCommandMixin, self).setUp() self.stdin = sys.stdin...
Python
0.000008
@@ -95,16 +95,54 @@ command%0A +from django.utils.six import StringIO%0A %0A%0Aclass @@ -585,16 +585,41 @@ n = buf%0A + out = StringIO()%0A @@ -667,16 +667,58 @@ %22--pipe%22 +, stdout=out)%0A return out.getvalue( )%0A%0A d @@ -1407,32 +1407,38 @@ inue%0A + ret = self.impo...
148cd4b70e1b570c59c03dc79a2ffce01856b55d
fix Trader bug
ctrls/Tester.py
ctrls/Tester.py
#!/bin/python # -*- coding: utf-8 -*- import csv import json import requests from ctrls import * from config import * from os import listdir from datetime import date class Tester(): '''To Test models''' def __init__(self, numbers, Model): # check the number from Database, remove error numbers ...
Python
0.000001
@@ -736,24 +736,30 @@ %5B'Volume'%5D, +round( trade%5B'Value @@ -760,16 +760,25 @@ 'Value'%5D +/1000, 2) , %0A
8c858df942af961ec475461814c32e2769ac310a
Remove unused class
ui2/animate.py
ui2/animate.py
from objc_util import * import time CATransaction = ObjCClass("CATransaction") def animate(animation, duration=0.25, delay=0.0, completion=None): """A drop-in replacement for ui.animate which supports easings.""" if completion is not None: def c(cmd, success): completion(success) ...
Python
0.000002
@@ -35,52 +35,8 @@ e%0A%0A%0A -CATransaction = ObjCClass(%22CATransaction%22)%0A%0A def
beb8f6bacb0bcc5f526bb40d58e2f1251a9fb249
Call `super(MailCmdError, self).__init__()`
daemail/util.py
daemail/util.py
from __future__ import unicode_literals import os import re import signal import six from six.moves import shlex_quote as quote class MailCmdError(Exception): # Raised if the sendmail command returned nonzero def __init__(self, mail_cmd, rc, output): self.mail_cmd = mail_cmd self.rc = rc ...
Python
0.000001
@@ -353,43 +353,131 @@ -### TODO: Invoke %60super().__init__%60 +super(MailCmdError, self).__init__(%0A '%7B0!r%7D: command exited with return code %7B1%7D'.format(mail_cmd, rc)%0A ) %0A%0Ade
c2822ddb0297600c1b70c543f97b719b03d9b202
update routes : /api
buildbuild/buildbuild/urls.py
buildbuild/buildbuild/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from users import views admin.autodiscover() from users.views import Login from users.views import Logout from buildbuild.views import Home urlpatterns = patterns('', # Examples: # url(r'^$', 'buildbuild.views.home', name='...
Python
0.000001
@@ -406,24 +406,81 @@ me='home'),%0A + url(r'%5Eapi/', include('api.urls', namespace=%22api%22)),%0A url(r'%5El
1bd00c892afe52cbce02546140017972a6d08916
add missing import for commented-out code
osmaxx-py/osmaxx/excerptexport/tests/test_conversion_api_client.py
osmaxx-py/osmaxx/excerptexport/tests/test_conversion_api_client.py
import vcr from django.contrib.auth.models import User from django.test.testcases import TestCase from osmaxx.excerptexport.models import Excerpt, ExtractionOrder, ExtractionOrderState, BBoxBoundingGeometry from osmaxx.excerptexport.services import ConversionApiClient class ConversionApiClientAuthTestCase(TestCase)...
Python
0
@@ -5287,16 +5287,40 @@ # + from time import sleep; sleep(1
4fdfee2ab72ea66b1ff42e76063402f4f45563be
Fix argument name
unsubscribe.py
unsubscribe.py
#!/usr/bin/env python import string from passlib.hash import sha1_crypt from random import SystemRandom from sqlalchemy import MetaData, Table, Column, String, ForeignKey, create_engine, Integer from sqlalchemy.orm import mapper, relationship, sessionmaker from sqlalchemy.ext.declarative import declarative_base from s...
Python
0.00481
@@ -1937,16 +1937,22 @@ encrypt( +email_ address,
bdef19ef909fe3d7b8e90fb4b470bbe56765e25d
Bump to 12 gunicorn workers for 8GB linode
conf/gunicorn.py
conf/gunicorn.py
# Paths are relative to $HOME pythonpath = 'vim-awesome/web' pidfile = '.gunicorn.pid' daemon = True accesslog = 'logs/gunicorn/access.log' errorlog = 'logs/gunicorn/error.log' # Recommendation is 2 * NUM_CORES + 1. See # http://gunicorn-docs.readthedocs.org/en/latest/design.html#how-many-workers workers = 2
Python
0
@@ -306,10 +306,11 @@ rkers = +1 2%0A
44f026d434aa4cfe08d1bf0871d28f303b63add8
bump version because of PyPI rules
uproot/version.py
uproot/version.py
#!/usr/bin/env python # Copyright (c) 2017, DIANA-HEP # 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 ...
Python
0
@@ -1589,17 +1589,17 @@ = %222.5.2 -0 +1 %22%0Aversio
c9ccb83f196f3b4e431fd5778233de7e3d6b7624
Make has_hashes a prop
upstream/chunk.py
upstream/chunk.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from upstream.exc import ChunkError class Chunk(object): def __init__(self, filehash=None, decryptkey=None, filename=None, filepath=None): """ Stores information about an encryted chunk. Allows for format conversions. ...
Python
0.000406
@@ -1758,16 +1758,30 @@ )%0A%0A + @property%0A def
ee28ede60ad70c0e23edd743fc9b4ff83c13dfaa
use parameterized test
tests/cupy_tests/math_tests/test_window.py
tests/cupy_tests/math_tests/test_window.py
import unittest from cupy import testing @testing.gpu class TestWindow(unittest.TestCase): _multiprocess_can_split_ = True @testing.numpy_cupy_allclose(atol=1e-5) def check_0(self, name, xp): a = 0 return getattr(xp, name)(a) @testing.numpy_cupy_allclose(atol=1e-5) def check_1(...
Python
0.000001
@@ -50,100 +50,35 @@ ing. -gpu%0Aclass TestWindow(unittest.TestCase):%0A%0A _multiprocess_can_split_ = True%0A +parameterize( %0A -@ +* testing. nump @@ -77,385 +77,183 @@ ing. -numpy_cupy_allclose(atol=1e-5)%0A def check_0(self, name, xp):%0A a = 0%0A return getattr(xp, name)(a)%0A%0A @...
e6b43265e0089646badc8b665a06b1953962202e
fix train error, support "same" config that does not resize image
ptsemseg/loader/mit_sceneparsing_benchmark_loader.py
ptsemseg/loader/mit_sceneparsing_benchmark_loader.py
import os import torch import numpy as np import scipy.misc as m from torch.utils import data from ptsemseg.utils import recursive_glob class MITSceneParsingBenchmarkLoader(data.Dataset): """MITSceneParsingBenchmarkLoader http://sceneparsing.csail.mit.edu/ Data is derived from ADE20k, and can be downl...
Python
0
@@ -2287,26 +2287,38 @@ ead(img_path +, mode='RGB' )%0A - img @@ -2729,32 +2729,113 @@ bl:%0A %22%22%22%0A + if self.img_size == ('same', 'same'):%0A pass%0A else:%0A img = m. @@ -2844,16 +2844,20 @@ resize(%0A + @@ -2902,16 +2902,20 @@ ize%5B1%5...
cac6678a3fd1b697402dd26e20ae637c44443c37
Remove bogus assert that hgrcpath has to exist and add verbose comment as to why this is the case.
util/hgCmds.py
util/hgCmds.py
#!/usr/bin/env python # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import os import platform import re import sys import subprocess from ConfigParser import SafeCo...
Python
0
@@ -3832,39 +3832,343 @@ -assert os.path.isfile(hgrcpath) +# hgrcpath is not needed to be asserted to exist, because this gets called from%0A # parser.set_defaults in buildOptions.py - if the tree is located in another directory, hgrc%0A # will not exist in the assumed default directory of ~/trees/mozilla-c...
864e567cc36d6c303eeac546738fb6c7e2619ecc
Update the file_inject command so that it automatically creates directories.
unix/commands/file_inject.py
unix/commands/file_inject.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2011 Openstack, LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www...
Python
0
@@ -753,16 +753,41 @@ ommands%0A +import os%0Aimport os.path%0A %0A%0Aclass @@ -1150,16 +1150,134 @@ ,', 1)%0A%0A + dirname = os.path.dirname(filename)%0A if not os.path.exists(dirname):%0A os.makedirs(dirname)%0A%0A
b74cdfb920ed1ba2bc617cd22224a5ab795394b1
Add test for single format string.
tests/tabular_output/test_preprocessors.py
tests/tabular_output/test_preprocessors.py
# -*- coding: utf-8 -*- """Test CLI Helpers' tabular output preprocessors.""" from __future__ import unicode_literals from decimal import Decimal from cli_helpers.tabular_output.preprocessors import (align_decimals, bytes_to_string, ...
Python
0.000001
@@ -4316,32 +4316,440 @@ ers == result%0A%0A%0A +def test_format_integer_only():%0A %22%22%22Test that providing one format string works.%22%22%22%0A data = %5B%5B1, 1.0%5D, %5B1000, 1000.0%5D, %5B1000000, 1000000.0%5D%5D%0A headers = %5B'h1', 'h2'%5D%0A result = format_numbers(data, headers, column_types=...
6a7cff02eba1be17a3222869ae425007812c5347
Make test-incoming-call.py a little more race-resistant
tests/twisted/jingle/test-incoming-call.py
tests/twisted/jingle/test-incoming-call.py
""" Test incoming call handling. """ print "FIXME: jingle/test-incoming-call.py disabled due to race condition" # exiting 77 causes automake to consider the test to have been skipped raise SystemExit(77) from gabbletest import exec_test, make_result_iq, sync_stream from servicetest import make_channel_proxy, unwrap,...
Python
0.000152
@@ -1,13 +1,12 @@ -%0A %22%22%22%0ATest inc @@ -327,16 +327,40 @@ h_prefix +, %5C%0A EventPattern %0Aimport @@ -665,32 +665,63 @@ ()%0A%0A q.expect +_many(%0A EventPattern ('dbus-signal', @@ -756,29 +756,42 @@ =%5B1, 1%5D) -%0A +,%0A -q.expect + EventPattern ('stream @@ -806,2...
54e91d8d952cbb4e8f1494a131668a81ad857a50
check if the caller is properly moved to members
tests/twisted/jingle/test-incoming-call.py
tests/twisted/jingle/test-incoming-call.py
""" Test incoming call handling. """ print "FIXME: jingle/test-incoming-call.py disabled due to race condition" # exiting 77 causes automake to consider the test to have been skipped raise SystemExit(77) from gabbletest import exec_test, make_result_iq from servicetest import make_channel_proxy, unwrap, tp_path_pref...
Python
0.000001
@@ -1345,32 +1345,181 @@ ncoming_call()%0A%0A + # The caller is in members%0A e = q.expect('dbus-signal', signal='MembersChanged',%0A args=%5Bu'', %5Bremote_handle%5D, %5B%5D, %5B%5D, %5B%5D, 0, 0%5D)%0A%0A # S-E gets n @@ -2344,24 +2344,173 @@ ing_call()%0A%0A + # The caller is in members%0...
ddd2a12dd72e82f68301c05bdf1bf3ad050849ff
Update interactive agent
opencog/python/pln/examples/interactive_agent.py
opencog/python/pln/examples/interactive_agent.py
from opencog.atomspace import AtomSpace, TruthValue, types __author__ = 'Cosmo Harrigan' class InteractiveAgent: """ Helper class that wraps a PLN Agent object with functionality to display inference steps as they occur for testing purposes @param atomspace Provide the AtomSpace from the context ...
Python
0
@@ -1837,14 +1837,25 @@ nge( -1, 500 +0, self.num_steps ):%0A
3cafa831a5c13a119943dbbf03df5b6820d07abb
Update ada_boost_all_features.py
algorithms/ada_boost_all_features.py
algorithms/ada_boost_all_features.py
import os from scipy.io import loadmat from numpy import array, vstack, reshape, delete from sklearn.metrics import precision_recall_fscore_support from sklearn.ensemble import AdaBoostClassifier from sklearn import preprocessing from sklearn.feature_selection import VarianceThreshold from sklearn.svm import SVC ...
Python
0.000001
@@ -424,16 +424,30 @@ aboost(D +, num_of_files ):%0A @@ -637,10 +637,20 @@ nge( -95 +num_of_files ))) @@ -2248,16 +2248,20 @@ boost(UM +, 95 )%0Aprint @@ -2278,16 +2278,20 @@ oost(UMM +, 96 )%0Aprint @@ -2306,10 +2306,14 @@ boost(UU +, 98 )%0A
51d972941ec8b91d092726b7fed2ba8407ed9d44
Handle rounding errors in stack_nr
plugins/PerObjectSettingsTool/PerObjectSettingVisibilityHandler.py
plugins/PerObjectSettingsTool/PerObjectSettingVisibilityHandler.py
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal from UM.Application import Application from UM.Settings.SettingInstance import SettingInstance from UM.Logger import Logger import UM.Settings.Models from cura.Se...
Python
0
@@ -2750,16 +2750,36 @@ ck_nr = +str(int(round(float( self._st @@ -2824,16 +2824,20 @@ _stack%22) +)))) #Stack @@ -2860,16 +2860,57 @@ ng from. + Round it and remove the fractional part. %0A
4e2df1fbc8342a8e94aea10cc0cc2985a02411e8
fix docstring formatting (#80)
google/cloud/servicecontrol_v1/types/distribution.py
google/cloud/servicecontrol_v1/types/distribution.py
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
0
@@ -892,18 +892,18 @@ ble- -%0A +v alued +%0A sam @@ -955,27 +955,27 @@ ation of -%0A sample +%0A points @@ -1013,27 +1013,26 @@ ation:%0A%0A - - + the arithme @@ -1055,27 +1055,26 @@ samples%0A - - + the minimum @@ -1105,19 +1105,18 @@ les%0A - - + the sum @@ -11...
7fe70d9b6dae010ce8aee5c94c8d5e41496b6723
convert hours back to string in effort to round trip them into the ticket_change table
timingandestimationplugin/ticket_daemon.py
timingandestimationplugin/ticket_daemon.py
from trac.ticket import ITicketChangeListener, Ticket, ITicketManipulator from trac.core import * import datetime import dbhelper def identity(x): return x; def convertfloat(x): "some european countries use , as the decimal separator" if isinstance(x, float) or isinstance(x, int): return x x =...
Python
0.00046
@@ -3629,21 +3629,27 @@ hours'%5D= +str( hours +); %0A
59cca2c867998a936405a87b704f674a271a13d8
Add required dependencies (#9427)
saleor/checkout/migrations/0040_add_handle_checkouts_permission.py
saleor/checkout/migrations/0040_add_handle_checkouts_permission.py
# Generated by Django 3.2.12 on 2022-03-08 10:35 from django.core.management.sql import emit_post_migrate_signal from django.db import migrations def assing_permissions(apps, schema_editor): # force post signal as permissions are created in post migrate signals # related Django issue https://code.djangoproje...
Python
0
@@ -1170,24 +1170,121 @@ dencies = %5B%0A + (%22product%22, %220159_auto_20220209_1501%22),%0A (%22order%22, %220131_rename_order_token_id%22),%0A (%22ch
def612ed80b30c876435064555be01cdc09b721f
Clean up alias retrieval
cactusbot/handlers/command.py
cactusbot/handlers/command.py
"""Handle commands.""" import random from ..commands import COMMANDS from ..commands.command import ROLES from ..handler import Handler from ..packets import MessagePacket class CommandHandler(Handler): """Command handler.""" ARGN_EXPR = r'%ARG(\d+)(?:=([^|]+))?(?:((?:\|\w+)+))?%' ARGS_EXPR = r'%ARGS(?...
Python
0
@@ -2529,16 +2529,49 @@ data):%0A%0A + args = (command, *args)%0A%0A @@ -2617,16 +2617,17 @@ ommand)%0A +%0A @@ -2637,33 +2637,33 @@ response.status -= +! = 200:%0A @@ -2649,32 +2649,48 @@ tus != 200:%0A + return%0A%0A json = a @@ -2710,24 +2710,25 @@ .json...
e35b77cfab4870090146175ddc8a0e97450b3784
fix testimonios
cambiaahora/noticias/views.py
cambiaahora/noticias/views.py
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings from django.views.generic import TemplateView from django.views.generic import ListView, DetailView from .models import Noticias from cambiaahora.historias.models impor...
Python
0.000009
@@ -1463,32 +1463,33 @@ ma=2).order_by(' +- fecha')%5B:6%5D%0A @@ -1581,32 +1581,33 @@ ma=2).order_by(' +- fecha')%5B:6%5D%0A @@ -2312,32 +2312,33 @@ ma=1).order_by(' +- fecha')%5B:6%5D%0A @@ -2430,32 +2430,33 @@ ma=1).order_by(' +- fecha')%5B:6%5D%0A @@ -2842,32 +2842,32 @@ by('fecha')%5B:3%5D...
a495754ee973936badeae603f07dbb56bfaf95b3
make sure _commands is a global
updatebot/cmdline/command.py
updatebot/cmdline/command.py
# # Copyright (c) 2008 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.rpath.com/permanent/...
Python
0
@@ -886,24 +886,45 @@ ister(cmd):%0A + global _commands%0A _command
48f8f1b1e322f8e3fc8b738312e780645211d3e8
Revert "piratebay: New URL"
modules/piratebay/browser.py
modules/piratebay/browser.py
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Julien Veyssier # # This file is part of weboob. # # weboob 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 yo...
Python
0.000001
@@ -1001,18 +1001,18 @@ ratebay. -gl +se '%0A PR @@ -1135,18 +1135,18 @@ ratebay. -gl +se /': Inde @@ -1179,34 +1179,34 @@ ://thepiratebay. -gl +se /search/.*/0/7/0 @@ -1249,34 +1249,34 @@ ://thepiratebay. -gl +se /torrent/.*': To @@ -1383,18 +1383,18 @@ ratebay. -gl +se /search/ @@ -1633,10 +1633,10 @@ b...
781addf1e2ee5eb5cff71ee7b4da14671e208c3a
Fix for #57
feathermodules/classical/columnar_transposition.py
feathermodules/classical/columnar_transposition.py
import cryptanalib as ca import feathermodules def break_columnar_transposition(ciphertexts): arguments=feathermodules.current_options results = [] for ciphertext in ciphertexts: results.append(ca.break_columnar_transposition(ciphertext, num_answers=int(arguments['num_answers']))) print 'Best results...
Python
0
@@ -198,17 +198,11 @@ sult -s.append( + = ca.b @@ -283,16 +283,77 @@ wers'%5D)) +%0A result = '%5Cn'.join(result)%0A results.append(result )%0A pri @@ -400,16 +400,19 @@ on solve +(s) :'%0A pr
e08f8f9487d3e0a914d48cf0abbaca2e26b50468
Fix python 2 issue
Code/Util/SubmoduleDownloader.py
Code/Util/SubmoduleDownloader.py
from __future__ import print_function import os import sys import urllib import zipfile import shutil try: # Include cStringIO in case its available, since its faster from cStringIO import StringIO except: try: # Python 2.7 from StringIO import StringIO except: try: ...
Python
0.000073
@@ -54,29 +54,16 @@ ort sys%0A -import urllib %0Aimport @@ -1341,32 +1341,58 @@ # Python 2.7%0A + import urllib%0A urlo @@ -1412,16 +1412,17 @@ urlopen%0A +%0A @@ -1421,32 +1421,45 @@ except:%0A + %0A # Py
53a2a514500aa19a8fbdcaa5701774d6983ff76d
add some initial email templates
util/email/email_template.py
util/email/email_template.py
Python
0.000002
@@ -0,0 +1,314 @@ +REGISTRATION_NOTIFICATION = %22%22%22Thank you %7B%25username%7D for registering with EPL. To activate your account, you will need to verify your account by navigating to the following URL: %7B%25registration_url%7D%22%22%22%0A%0APASSWORD_RESET_EMAIL = %22%22%22To reset your password, please click on...
98552a4cb683e25ec9af53024e58644c04b55872
Handle missing external files gracefully
molly/external_media/views.py
molly/external_media/views.py
from email.utils import formatdate from datetime import datetime, timedelta from time import mktime from django.shortcuts import get_object_or_404 from django.http import HttpResponse, Http404 from molly.utils.views import BaseView from molly.utils.breadcrumbs import NullBreadcrumb from models import ExternalImageSi...
Python
0
@@ -629,16 +629,33 @@ g=slug)%0A + try:%0A @@ -716,16 +716,52 @@ .read(), +%0A mimetyp @@ -795,16 +795,93 @@ ascii')) +%0A except IOError:%0A eis.delete()%0A raise Http404() %0A%0A
630908ea370ee863f70bbe60a425c825ee5f9d62
Test fix
mopidy_frontpanel/frontend.py
mopidy_frontpanel/frontend.py
from __future__ import unicode_literals import logging from mopidy.core import CoreListener # pylint: disable=import-error import pykka # pylint: disable=import-error from .menu import BrowseMenu from .painter import Painter from .input import Input logger = logging.getLogger(__name__) class FrontPanel(pykka.Thre...
Python
0.000001
@@ -186,18 +186,17 @@ ort -BrowseMenu +MenuModel %0Afro
b1b1c1cad054547370b9015a9c822b29cfb406af
Make sure probabilities are valid
msmbuilder/tests/test_ghmm.py
msmbuilder/tests/test_ghmm.py
from __future__ import print_function, division import numpy as np from msmbuilder.hmm import GaussianFusionHMM from msmbuilder.example_datasets import AlanineDipeptide from msmbuilder.featurizer import SuperposeFeaturizer from sklearn.hmm import GaussianHMM from itertools import permutations import warnings def tes...
Python
0.999993
@@ -1631,16 +1631,198 @@ mStates%0A + assert (model.transmat_ %3E= 0.0).all()%0A assert (model.transmat_ %3C= 1.0).all()%0A totalProbability = sum(model.transmat_.T)%0A assert (abs(totalProbability-1.0) %3C 1e-5).all()%0A %0A
807df371aba8f8bbc161446b99f0c1deb440075f
Use logging, since logger is a NameError.
mysite/profile/controllers.py
mysite/profile/controllers.py
import os.path import sha from itertools import izip, cycle, islice import pygeoip from django.conf import settings import mysite.search.controllers import mysite.search.models import mysite.profile.models import mysite.base.decorators ## roundrobin() taken from http://docs.python.org/library/itertools.html def ro...
Python
0
@@ -1372,18 +1372,19 @@ logg -er +ing .info(%22W
8a553465620ae60012a055cf67940cbb67b89b56
Fix logging
nasman/snapshots/utils/zfs.py
nasman/snapshots/utils/zfs.py
from datetime import datetime import logging from subprocess import check_output, CalledProcessError, STDOUT from pathlib import Path from django.core.cache import cache import pytz from .base import BaseUtil, BaseFilesystem, BaseSnapshot logger = logging.getLogger(__name__) def _parse_cmd_output(cmd): """ ...
Python
0.000007
@@ -1768,28 +1768,21 @@ napshot/ -%7B0%7D'.format( +%25s', self.nam @@ -1783,17 +1783,16 @@ lf.name) -) %0A%0A @p
0efdf0d9b9960a8a026ef0978f11f5bc63b98eec
Updated the expected matching string after the recent flurry of check ins.
test/conditional_break/TestConditionalBreak.py
test/conditional_break/TestConditionalBreak.py
""" Test conditionally break on a function and inspect its variables. """ import os, time import re import unittest2 import lldb from lldbtest import * class ConditionalBreakTestCase(TestBase): mydir = "conditional_break" @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def te...
Python
0.999999
@@ -3093,20 +3093,20 @@ arg +(int) val of - (int) 3%22, @@ -3146,19 +3146,19 @@ = %22 -val = (int) +(int) val = 3%22)
e41c947bd4ce3fdee3793467373fbeba693ca5bd
bump version number
DISTRIBUTION/kapteyn/__init__.py
DISTRIBUTION/kapteyn/__init__.py
"""Kapteyn package. """ from os import path package_dir = path.abspath(path.dirname(__file__)) __all__=['celestial', 'wcs', 'wcsgrat', 'tabarray', 'maputils', 'mplutil', 'positions', 'shapes', 'rulers', 'filters', 'interpolation'] __version__='2.0.3b11'
Python
0.000004
@@ -267,11 +267,11 @@ '2.0.3b1 -1 +3 '%0A
2ecceef5cfff193a0d1168234cad6190f6020a3e
Cleaned up output format
tools/distrib/c-ish/check_documentation.py
tools/distrib/c-ish/check_documentation.py
#!/usr/bin/env python2.7 # Copyright 2015, Google 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 li...
Python
0.999978
@@ -2087,16 +2087,39 @@ things%0A +printed_banner = False%0A for targ @@ -2241,62 +2241,295 @@ -print '%25s: missing README.md' %25 root%0A errors += 1 +if not printed_banner:%0A print 'Missing README.md'%0A print '================='%0A printed_banner = True%0A print root%0A ...
ff8f63b755664d4970577d7ae1ee96316767d52c
remove redundant signal
bulbs/contributions/signals.py
bulbs/contributions/signals.py
from django.core.exceptions import ObjectDoesNotExist from django.dispatch import receiver from django.db.models.signals import m2m_changed, post_save from bulbs.content.models import Content, FeatureType from .models import Contribution, ContributorRole, FeatureTypeRate, ReportContent from .tasks import update_role_...
Python
0.000379
@@ -1,58 +1,4 @@ -from django.core.exceptions import ObjectDoesNotExist%0A from @@ -169,22 +169,8 @@ port - Contribution, Con @@ -202,23 +202,8 @@ Rate -, ReportContent %0Afro @@ -1199,336 +1199,4 @@ or)%0A -%0A%0A@receiver(post_save, sender=Contribution)%0Adef index_relations(sender, instance, **kwargs):%0A ...