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
f5668fec4423179eac8bd996b0ae906af66c5563
Remove arg.
great/cli.py
great/cli.py
import argparse from great import extract from great.models.core import db from great.app import create_app def main(arguments): app = create_app(arguments.db_uri) if arguments.command == "itunes": tracks = extract.itunes_tracks(arguments.library_file) for track in tracks: db.ses...
Python
0.000005
@@ -150,24 +150,8 @@ app( -arguments.db_uri )%0A%0A
4690073007eda7a825169f7d9453230823bb4c3e
fix Werkzeug `BaseResponse` import (#2940)
tensorboard/backend/security_validator_test.py
tensorboard/backend/security_validator_test.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
Python
0
@@ -1169,22 +1169,8 @@ pers -.base_response imp
72e3ab97eeb9759183a0a88e13c74928d971f52c
Add check for duplicate parameters.
utilities/convert_frosst/convert.py
utilities/convert_frosst/convert.py
#!/bin/env python import lxml.etree as etree import numpy as np from smarty import ForceField # Define what file we will parse and where we will write to infile = 'example.frcmod' inxml = 'template.ffxml' outxml = 'example.ffxml' # Function definitions for parsing sections within parameter file def parse_nonbon_line...
Python
0
@@ -4018,24 +4018,266 @@ e=='DIHE'):%0A + # Check for duplicates first%0A if ff.getParameter( smirks, force_type = force_section%5Bidx%5D ):%0A raise ValueError(%22Error: parameter for %25s is already present in forcefield.%22 %25 smirks )%0A else:%0A @...
12098d9e362e22ba3d83bdcfe9a9a53e80506738
Add argument filename to UrlInfo
tensorflow_datasets/core/download/checksums.py
tensorflow_datasets/core/download/checksums.py
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets 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 appl...
Python
0.000003
@@ -1304,16 +1304,49 @@ sum: str +%0A filename: Optional%5Bstr%5D = None %0A%0A def
b00a4b25a2694b68ab980c40df55aed8ffa05731
Support table detail values as lines of text
guild/cli.py
guild/cli.py
# Copyright 2017 TensorHub, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000001
@@ -2217,19 +2217,28 @@ %5Bcol%5D = +_ str +_or_list (item0.g @@ -2272,16 +2272,86 @@ matted%0A%0A +def _str_or_list(x):%0A return x if isinstance(x, list) else str(x)%0A%0A def _col @@ -3223,32 +3223,90 @@ False, err=err)%0A + formatted = _format_detail_val(item%5Bkey%5D, indent)%0A click.ec ...
2ca647bbf30a25503bf824b574d015e12063329a
Remove naming fixing/guessing from the handler
waterbutler/server/handlers/core.py
waterbutler/server/handlers/core.py
import os import json import time import asyncio import aiohttp import tornado.web from raven.contrib.tornado import SentryMixin from waterbutler.core import utils from waterbutler.core import signing from waterbutler.core import exceptions from waterbutler.server import settings from waterbutler.server.identity impo...
Python
0.000001
@@ -4568,162 +4568,8 @@ %5D)%0A%0A - if self.json%5B'destination'%5D%5B'path'%5D.endswith('/'):%0A self.json%5B'destination'%5D%5B'path'%5D += os.path.split(self.json%5B'source'%5D%5B'path'%5D)%5B1%5D%0A%0A
c06d900cba308da2bbcf093618bde8a1c470f1e0
revise search_match test to properly find match
web/aliendb/apps/analytics/tests.py
web/aliendb/apps/analytics/tests.py
from django.test import TestCase, Client from django.test.utils import override_settings from django.core.cache import cache from .models import * from .views import * import datetime import logging # raise logger level for tests to reduce noise logger = logging.getLogger('django.request') logger.setLevel(logging.ERRO...
Python
0.000001
@@ -4972,13 +4972,11 @@ ime= -today +all &sub
c194d9b2244f3c9779442d71605a5c9f17ad763b
FIX make brat.utils compatible with python 3 (and 2.6+)
snorkel/contrib/brat/utils.py
snorkel/contrib/brat/utils.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import * from urllib2 import urlopen, URLError, HTTPError def download(url, outfname): """ Download target URL :param url: :param outfname...
Python
0
@@ -175,31 +175,82 @@ rom -urllib2 import urlopen, +six.moves.urllib.request import urlopen%0Afrom six.moves.urllib.error import URL @@ -513,25 +513,27 @@ pt HTTPError -, + as e:%0A @@ -598,17 +598,19 @@ URLError -, + as e:%0A
b15a6649f30072ca0184ab72ea4db350bbe40278
fix value error exception
ryu/app/rest.py
ryu/app/rest.py
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp> # # 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 # # h...
Python
0.000017
@@ -3234,32 +3234,36 @@ ork_id, int(dpid +, 16 ), int(port_id)) @@ -3568,32 +3568,36 @@ ork_id, int(dpid +, 16 ), int(port_id)) @@ -4103,16 +4103,20 @@ int(dpid +, 16 ), int(p
9aee6d2fa65859811e44fc1410053f27243f5610
Edit to test_logit
Tests/test_tools.py
Tests/test_tools.py
"""This is the test suite for Tools.""" import unittest import os from Datasnakes.Tools import LogIt, Multiprocess class TestTools(unittest.TestCase): """Test the Tools module.""" def setUp(self, logfile='test.log'): self.logfile = logfile def test_logit(self): logit = LogIt() ...
Python
0
@@ -334,16 +334,24 @@ default( +logname= 'testlog @@ -353,16 +353,24 @@ stlog', +logfile= self.log
5baae6dded891bc12c5676078fedd4ee222ae016
fix tests and add some more
scripts/test.py
scripts/test.py
#!/usr/bin/env python import requests import json base_url='http://127.0.0.1:8000/court/' court_file='../data/sample_court.json' oauth_token='foobar' with open('../data/sample_court.json') as f: sample_court_json = f.read() headers = {'Authorization': 'Bearer '+oauth_token} def is_in(small, big): s = json....
Python
0
@@ -43,16 +43,27 @@ ort json +%0Aimport sys %0A%0Abase_u @@ -100,47 +100,8 @@ t/'%0A -court_file='../data/sample_court.json'%0A oaut @@ -118,16 +118,17 @@ oobar'%0A%0A +# with ope @@ -164,16 +164,17 @@ ) as f:%0A +# samp @@ -203,133 +203,326 @@ ()%0A%0A -headers = %7B'Authorization': 'Bearer '+oauth_token%...
8f99e8c5da240f964c4d8363275713bd92552576
remove the full page cache
crate_project/settings/base.py
crate_project/settings/base.py
# -*- coding: utf-8 -*- # Django settings for basic pinax project. import os.path import datetime import time from django.utils.http import http_date import djcelery djcelery.setup_loader() PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) DEBUG = False TEMPLATE_DEBUG = True ...
Python
0
@@ -1479,61 +1479,8 @@ = %5B%0A - %22django.middleware.cache.UpdateCacheMiddleware%22,%0A @@ -2085,64 +2085,8 @@ e%22,%0A - %22django.middleware.cache.FetchFromCacheMiddleware%22,%0A %5D%0A%0AR @@ -3825,48 +3825,8 @@ %0A%5D%0A%0A -CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True%0A%0A FIXT
3377a1663f875a25bcec1424f840505c3abf654c
Fix scope of request response
cumulus/starcluster/logging.py
cumulus/starcluster/logging.py
from __future__ import absolute_import import logging import sys import contextlib import requests import json import threading import starcluster.logger import functools import uuid import traceback class StarClusterLogHandler(logging.Handler): def __init__(self, token, url, level=logging.NOTSET): super(S...
Python
0.000002
@@ -590,32 +590,49 @@ err, self._url%0A + r = None%0A try:%0A
137c813a143e25ec9d9927ec23340d23ecc2d549
use a shorter key by doing md5 hash
custom/nic_compliance/utils.py
custom/nic_compliance/utils.py
from __future__ import absolute_import from __future__ import unicode_literals import re import base64 from datetime import timedelta from django.conf import settings from django.urls import resolve from django.contrib.auth.hashers import get_hasher from dimagi.utils.couch.cache.cache_core import get_redis_client fr...
Python
0.000037
@@ -96,16 +96,31 @@ base64%0A +import hashlib%0A from dat @@ -3146,18 +3146,8 @@ urn -'_'.join(%5B REDI @@ -3174,17 +3174,49 @@ T_PREFIX -, + + hashlib.md5(%22%25s%25s%22 %25 (%0A usernam @@ -3237,17 +3237,34 @@ password -%5D +%0A )).hexdigest( )%0A%0A%0Adef
c39b0aa2314d354d85735e9ef024443e58088133
add docstrings
sequana/kmer.py
sequana/kmer.py
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>, # <d.desvillechabrol@gmail.com> # # Distributed u...
Python
0.000012
@@ -629,16 +629,17 @@ rtools%0A%0A +%0A def buil @@ -670,16 +670,121 @@ ='CG'):%0A + %22%22%22Return list of kmer of given length based on a set of letters%0A%0A :return: list of kmers%0A %22%22%22%0A # bu @@ -1020,16 +1020,108 @@ , k=7):%0A + %22%22%22Given a sequence, return consecutive kmers%0A%...
23ad1cda8a2e48e1871471868b06c58d424ec3fb
add normpdf
sequana/misc.py
sequana/misc.py
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>, # <d.desvillechabrol@gmail.com> # # Distributed u...
Python
0
@@ -857,17 +857,301 @@ cluster' -%5D +, %22normpdf%22%5D%0A%0A%0Adef normpdf(x, mu, sigma):%0A %22%22%22Return the normal pdf evaluated at *x*; args provides *mu*, *sigma*%22%0A%0A .. note:: same as scipy.stats.norm but implemented to avoid scipy dependency%0A %22%22%22%0A%0A return 1./(np.sqrt(2*np.pi)*si...
9b330d37243036f95d5a07c40fd8e49c009c7554
change target function for TIM algorithm
PYTHON/tim.py
PYTHON/tim.py
from util import read_file import random def generate_set(adj_list, threshold, start): queue = [(start, 0)] visited = set() visited.add(start) while len(queue) > 0: front = queue.pop(0) if front[1] > threshold: return visited for adj in adj_list[front[0]]: ...
Python
0.000013
@@ -468,16 +468,34 @@ ain__%22:%0A + random.seed()%0A grap @@ -521,16 +521,39 @@ t.txt%22)%0A + graph.preprocess()%0A adj_ @@ -583,17 +583,17 @@ _sets = -1 +5 00%0A t @@ -607,9 +607,9 @@ d = -2 +1 %0A @@ -1532,19 +1532,19 @@ t graph. -max +avg _dist(re
5751f6cf1d6a5f1b373d048c114df91f035dfcf2
modify how we import callable methods
sfa/util/api.py
sfa/util/api.py
# # Geniwrapper XML-RPC and SOAP interfaces # ### $Id: api.py 15596 2009-10-31 21:42:05Z anil $ ### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/plc/api.py $ # import sys import os import traceback import string import xmlrpclib from sfa.trust.auth import Auth from sfa.util.config import * from sfa.util.faults ...
Python
0
@@ -3001,24 +3001,56 @@ ames%0A + %0A self.methods_module = methods_mod @@ -3077,54 +3077,29 @@ hods -)%0A self.methods_module = methods_module +, fromlist=%5Bmethods%5D) %0A @@ -3133,24 +3133,16 @@ _module. -methods. all%0A%0A @@ -4060,16 +4060,8 @@ ule. -methods. __na
a78a1efa6989c88bab2240454e9c8d9cfdf20b57
fix docstring typo
shadeset/lib.py
shadeset/lib.py
# -*- coding: utf-8 -*- ''' Simple pipeline api used to find projects, assets and published shadesets. ''' # Standard library imports import os from glob import glob # Local imports from . import config from . import pat session = { 'project': None, 'asset': None, } def normalize(*parts): return os.pa...
Python
0.000072
@@ -4004,16 +4004,20 @@ ublish/s +hade sets%0A
a8aa8ca27e5690ed6a58a15490e605af57b5f32b
Undo change to SO name
shapely/geos.py
shapely/geos.py
""" Exports the libgeos_c shared lib, GEOS-specific exceptions, and utilities. """ import atexit from ctypes import cdll, CDLL, CFUNCTYPE, c_char_p from ctypes.util import find_library import os import sys import shapely if sys.platform == 'win32': try: local_dlls = os.path.abspath(os.__file__ + "../../....
Python
0.000002
@@ -946,17 +946,17 @@ os_c.so. -2 +1 ')%0A e
2df2b7fdfa232a575a2441f6883a5e7817098d44
function name
shuffleboard.py
shuffleboard.py
import xbmc import json from random import shuffle import sys def executeLogCommand(cmd): raw_req = json.dumps(cmd) xbmc.log("JSONRPC request: {}".format(raw_req), xbmc.LOGDEBUG) raw_resp = xbmc.executeJSONRPC(raw_req) xbmc.log("JSONRPC result: {}".format(raw_resp), xbmc.LOGDEBUG) return json.loa...
Python
0.998138
@@ -1178,25 +1178,29 @@ executeLogC -m +omman d(playCmd)%0Ae @@ -1358,17 +1358,21 @@ cuteLogC -m +omman d(playli @@ -1632,17 +1632,21 @@ cuteLogC -m +omman d(active @@ -1754,21 +1754,23 @@ pe%22%5D == +%22 video +%22 )%0A%0Aif no @@ -2250,17 +2250,21 @@ cuteLogC -m +omman d(addAll
a06dfae8219959af9db68a64ee9b471fc335c2d5
Add TipoDesglose for get_factura_recibida
sii/resource.py
sii/resource.py
# coding=utf-8 from sii import models, __SII_VERSION__ from datetime import datetime def get_base_imponible_iva(tax_line): for tax in tax_line: if 'IVA' in tax.name: return tax.base return '' def get_factura_expedida(invoice): base_imponible = get_base_imponible_iva(invoice.tax_line...
Python
0
@@ -1573,39 +1573,45 @@ ' -DesgloseFactura +InversionSujetoPasivo ': %7B%0A @@ -1612,38 +1612,43 @@ ' -Sujeta +DesgloseIVA ': %7B%0A @@ -1661,49 +1661,22 @@ ' -NoExenta': %7B # TODO Exenta o no exenta?? +DetalleIVA': %7B %0A @@ -1697,38 +1697,38 @@ 'Tipo ...
38917c4a3cb3c120cbe26b35bd5483d99c5392ba
support matrix conversion syntax for r_ and c_
simupy/array.py
simupy/array.py
from sympy.tensor.array import Array from numpy.lib.index_tricks import RClass, CClass class SymAxisConcatenatorMixin: """ A mix-in to convert numpy AxisConcatenator classes to use with sympy N-D arrays. """ def __getitem__(self, key): return Array(super().__getitem__(tuple( k ...
Python
0
@@ -30,16 +30,65 @@ t Array%0A +from sympy import ImmutableDenseMatrix as Matrix%0A from num @@ -128,16 +128,34 @@ , CClass +, AxisConcatenator %0A%0A%0Aclass @@ -282,24 +282,415 @@ ys.%0A %22%22%22%0A +%0A # support numpy %3E= 1.13%0A concatenate = staticmethod(%0A lambda *args, **kwargs: Array(%0...
2db6df175c82be21a243e80893f04bab6b754d87
Create the logging directory
TestConfig.py
TestConfig.py
import os import sys import subprocess import Configs import ZfsApi # This class will quickly test if your machine is properly configured for # these perf tests. # TODO check that zfs is installed, perhaps get version def check_all(): permissions_check() check_filesystems() def permissions_check(): # Che...
Python
0
@@ -1927,16 +1927,277 @@ '/runs') +%0A # Create the log directory, and its two sub directories%0A ZfsApi.create_filesystem(Configs.test_filesystem_path + '/logs')%0A # The two sub directories are not zfs filesystems%0A os.mkdir(Configs.results_directory)%0A os.mkdir(Configs.stats_directory) %0A%0Adef c...
de24084cefa9320e220d35bf56d8c21c77265e9b
make balanced sumsample by default
kilogram/entity_types/test.py
kilogram/entity_types/test.py
import sys from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.layers.recurrent import LSTM from gensim.models import word2vec def get_features(sentence, index): vector = np.array([]) vector = vector.reshape((0, 128)) # get the context and create a train...
Python
0.000001
@@ -173,16 +173,34 @@ rd2vec%0A%0A +CONTEXT_SIZE = 2%0A%0A %0Adef get @@ -371,18 +371,42 @@ dex- -3, index+4 +CONTEXT_SIZE, index+1+CONTEXT_SIZE ):%0A @@ -1352,9 +1352,22 @@ ES, -6 +CONTEXT_SIZE*2 , 12 @@ -1503,16 +1503,41 @@ dex = 0%0A + true_label_index = 0%0A prin @@ -1857,16 +1857,18 @@ +...
33894846ce841497eb17aca2973d0f58de94d748
Bump version to Development 0.3
__tryton__.py
__tryton__.py
#This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. { 'name': 'Nereid CMS', 'version': '2.0.0.2', 'author': '''Open Labs Business Solutions, Openlabs Technologies & Consulting (P) Ltd.''', 'email': 'info@o...
Python
0
@@ -185,17 +185,17 @@ '2.0.0. -2 +3 ',%0A '
56b8e94f651ee6204d62323716d3272ab747d087
remove package-mimicking syntax
labbookdb/report/selection.py
labbookdb/report/selection.py
if not __package__: import os, sys print(os.path.realpath(__file__)) pkg_root = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)),"../..")) sys.path.insert(0,pkg_root) from labbookdb.db import query def data_selection(db_path, data_type, treatment_start_dates=[]): """Select dataframe from a...
Python
0.998838
@@ -1,213 +1,9 @@ -if not __package__:%0A%09import os, sys%0A%09print(os.path.realpath(__file__))%0A%09pkg_root = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)),%22../..%22))%0A%09sys.path.insert(0,pkg_root)%0Afrom labbookdb +from .db @@ -1486,77 +1486,4 @@ df%0A -%0Aif __name__ == '__mai...
16e2d1231f2e8670e09940a3eea3c5a5c517e9fe
split complex function up
functions.py
functions.py
import unittest import praw import httplib import re from itertools import groupby def getLiquipediaEvents(game): conn = httplib.HTTPConnection('wiki.teamliquid.net') conn.connect() request = conn.putrequest('GET','/' + game + '/api.php?format=txt&action=query&titles=Liquipedia:Tournament_News&prop=revisions&rvp...
Python
0.000066
@@ -5720,19 +5720,22 @@ %22)%0A%0Adef -s +g et +New Sidebar( @@ -5884,20 +5884,14 @@ )%0A -newSidebar = +return cle @@ -5948,16 +5948,118 @@ wTable)) +%0A%0Adef setSidebar(prawLogin, subreddit, game):%0A newSidebar = getNewSidebar(prawLogin, subreddit, game) %0A prawL
5e78505276efd6cbf3da71864daec690afc901ba
Fix somehow view.settings().get("syntax", "") emits error
functions.py
functions.py
import bisect import sublime def find_color_regions_by_region(view: sublime.View, region) -> list: """ @brief Found intersected color regions from view by region @param view The view @param region The region @return list[] Found color regions """ view_color_regions = view_color_region...
Python
0.000003
@@ -4880,62 +4880,176 @@ -return bool(view and view.settings().get(%22syntax%22, %22%22) +if not view:%0A return False%0A%0A syntax = view.settings().get(%22syntax%22)%0A%0A if not syntax or not isinstance(syntax, str):%0A return False%0A%0A return syntax .end @@ -5076,17 +5076,16 @@ synt...
86bbe563cdedb66d3bf04a69ab9066733276ea4b
remove unnecessary gem front end users resource, profiles resource will do it
gem/admin.py
gem/admin.py
from collections import Counter from django.contrib import admin from django.contrib.auth.models import User from django.db.models import Q from django.utils.timezone import localtime from django.conf import settings from gem.models import GemUserProfile, GemCommentReport from gem.rules import ProfileDataRule, Comment...
Python
0
@@ -107,116 +107,9 @@ ser%0A -from django.db.models import Q%0Afrom django.utils.timezone import localtime%0Afrom django.conf import settings %0A + from @@ -221,203 +221,8 @@ le%0A%0A -from import_export.fields import Field%0Afrom import_export.widgets import DateTimeWidget, DateWidget%0Afrom import_export.resource...
2f7d5bab636282ca6fac80d0713a1559692986a7
Update documentation in CommandLine.
nipype/interfaces/base.py
nipype/interfaces/base.py
""" Package contains interfaces for using existing functionality in other packages Exaples FSL, matlab/SPM , afni Requires Packages to be installed """ __docformat__ = 'restructuredtext' import subprocess class OneTimeProperty(object): """A descriptor to make special properties that become normal attributes. ...
Python
0.000021
@@ -3656,32 +3656,42 @@ args : string(s) +, optional %0A Arg @@ -3714,32 +3714,24 @@ the command -, if any .%0A kw @@ -3746,16 +3746,26 @@ tring(s) +, optional %0A @@ -3798,24 +3798,65 @@ command -, if any +.%0A This parameter is currently IGNORED .%0A @@ -4399,17 +43...
c120ca630b3902d104f958ee7e9a8b3b8de23962
Fix a bug in the Win PGO profiler.
tools/telemetry/telemetry/core/platform/profiler/win_pgo_profiler.py
tools/telemetry/telemetry/core/platform/profiler/win_pgo_profiler.py
# Copyright 2014 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 glob import os import subprocess import sys from telemetry.core.platform import profiler _PGOSWEEP_EXECUTABLE = 'pgosweep.exe' class WinPGOProfil...
Python
0.00389
@@ -1670,16 +1670,28 @@ s:%0A + max_index = max(max
a9533109d48214ad4dcf3048e175aa16e89731f5
Increase version to 0.3.2
storm/__init__.py
storm/__init__.py
version = '0.3.1'
Python
0.002073
@@ -12,7 +12,7 @@ 0.3. -1 +2 '%0A
ff2da6b37dba5f5d144a08cb922a8742a50de98d
fix test to expect correct error type
pupa/tests/importers/test_organization_importer.py
pupa/tests/importers/test_organization_importer.py
import pytest from pupa.scrape import Organization as ScrapeOrganization from pupa.importers import OrganizationImporter from opencivicdata.models import Organization @pytest.mark.django_db def test_full_organization(): org = ScrapeOrganization('United Nations', classification='international') org.add_identif...
Python
0.000001
@@ -4269,33 +4269,18 @@ ses( -Organization.DoesNotExist +ValueError ):%0A
fd40eff6d4b00d1cefdc0b43252ca4a58a3e3c30
add type hinting to psql module
strumenti/psql.py
strumenti/psql.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """PostgreSQL Module Utilities for interfacing with PostgreSQL databases. .. moduleauthor:: Timothy Helton <timothy.j.helton@gmail.com> """ import psycopg2 def connection(db_name, user, password): """Connect to PostgreSQL database and establish a cursor. :pa...
Python
0
@@ -228,25 +228,85 @@ name +: str , user -, password) +: str,%0A password: str) -%3E psycopg2.extensions.cursor :%0A @@ -711,16 +711,21 @@ name +: str , schema , se @@ -724,16 +724,22 @@ hema +: list , serial =Fal @@ -738,28 +738,76 @@ rial +: bool =False, - unique=None) +%0A ...
23010dce67fe8c7b9e101838d87026bfec65840a
Add not null value check to Event value_after/value_before for IndexError fix
amocrm/v2/entity/events.py
amocrm/v2/entity/events.py
from datetime import datetime from .. import fields, manager, model from ..interaction import GenericInteraction EVENT_TYPES_WITH_BLANK_VALUE = ( "lead_deleted", "lead_restored", "contact_deleted", "contact_restored", "company_deleted", "company_restored", "customer_deleted", "entity_m...
Python
0
@@ -2481,16 +2481,45 @@ status%22%5D + if len(value) != 0 else None %0A @@ -2611,16 +2611,45 @@ %5B%22text%22%5D + if len(value) != 0 else None %0A @@ -2763,32 +2763,61 @@ %22helpbot%22%5D%5B%22id%22%5D + if len(value) != 0 else None %0A if inst @@ -2899,32 +2899,61 @@ nsaction%22%5D%5B%22id...
88dc8d4c03989b080039e59384b19709a31bbe89
Fix negative values reported for the number of dropped i/o requests.
SipLogger.py
SipLogger.py
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved. # # This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA. # # SIPPY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
Python
0
@@ -5265,15 +5265,8 @@ d += - 1000 - len @@ -5274,16 +5274,23 @@ self.wi) + - 1000 %0A
67ddc41e6599cd2e438534fc6b32f19c5ee159ff
Fix erroneous `batch_size` argument in StackOverflow LR.
tensorflow_federated/python/research/optimization/stackoverflow_lr/federated_stackoverflow_lr.py
tensorflow_federated/python/research/optimization/stackoverflow_lr/federated_stackoverflow_lr.py
# 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 by applicable law o...
Python
0.000161
@@ -5463,16 +5463,22 @@ (%0A +train_ batch_si
ddfccfba918b5d63f9f238dce3f892dd0e41512b
fix querying for credentials on public cloud bootstrap
conjure/controllers/newcloud/gui.py
conjure/controllers/newcloud/gui.py
from conjure.ui.views.newcloud import NewCloudView from conjure.models.provider import Schema from conjure import utils from conjure import controllers from conjure import juju from conjure import async from conjure.app_config import app import os.path as path import yaml import petname import sys import json import os...
Python
0
@@ -6323,33 +6323,16 @@ xist():%0A - try:%0A @@ -6358,17 +6358,20 @@ edential -( +s()%5B this.clo @@ -6376,258 +6376,44 @@ loud -, app.current_controller)%0A except:%0A creds = juju.get_credentials()%0A if juju.get_current_model():%0A if not juju.get_model(ju...
e53f9a8af0a0df73c8d60f70fa08036f8cec8a36
fix hashability
hwt/hdl/types/union.py
hwt/hdl/types/union.py
from collections import OrderedDict from hwt.doc_markers import internal from hwt.hdl.types.hdlType import HdlType from hwt.hdl.types.struct import HStructField from hwt.hdl.value import Value from hwt.serializer.generic.indent import getIndent protectedNames = {"clone", "staticEval", "from_py", "_...
Python
0.000305
@@ -4667,71 +4667,105 @@ elf. -fields = self.fields%0A self.__bit_length_val = bit_length +__bit_length_val = bit_length%0A self.__hash = hash((self.name, tuple(self.fields.items()))) %0A%0A @@ -6033,22 +6033,19 @@ urn -hash(id(self)) +self.__hash %0A%0A
c8c4697d35307e5937c38ebc57376541376b29f6
Raise version
aiodns/__init__.py
aiodns/__init__.py
import asyncio import functools import pycares from typing import ( Any, List, Optional, ) # TODO: Work out mypy no attribute error and remove ignore from . import error # type: ignore __version__ = '2.0.0b0' __all__ = ('DNSResolver', 'error') READ = 1 WRITE = 2 query_type_map = {'A' : pycares....
Python
0
@@ -216,17 +216,17 @@ '2.0.0b -0 +1 '%0A%0A__all
9d0d6a9c895876f28ec719ea54feb614b408bf5c
Test project: fix import of djmercadopago urls
test_project/test_project/urls.py
test_project/test_project/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin import djmercadopago urlpatterns = patterns('', url(r'^$', 'test_app.views.home', name='home'), url(r'^mp/', include(djmercadopago.urls)), url(r'^admin/', include(admin.site.urls)), )
Python
0.000001
@@ -81,29 +81,8 @@ dmin -%0Aimport djmercadopago %0A%0Aur @@ -183,16 +183,17 @@ include( +' djmercad @@ -198,24 +198,25 @@ adopago.urls +' )),%0A url(
a93d9252d9b910ba9a931e3c7a8858617cc86922
fix Mi32Builder.buff
hwtLib/mi32/builder.py
hwtLib/mi32/builder.py
from hwtLib.amba.axi_comp.builder import AxiBuilder from hwtLib.mi32.axi4Lite_to_mi32 import Axi4Lite_to_Mi32 from hwtLib.mi32.sliding_window import Mi32SlidingWindow from hwtLib.mi32.to_axi4Lite import Mi32_to_Axi4Lite from hwtLib.amba.axi4Lite import Axi4Lite class _Mi32Buff(): """Mi32Buff constructor which ign...
Python
0.000001
@@ -255,16 +255,54 @@ xi4Lite%0A +from hwtLib.mi32.buff import Mi32Buff%0A %0A%0Aclass @@ -311,16 +311,24 @@ i32Buff( +Mi32Buff ):%0A %22
7b58bcb798d32e07bba7391dd98c7405e2523095
Bump version to 3.0.0
aiodns/__init__.py
aiodns/__init__.py
import asyncio import functools import pycares import socket from typing import ( Any, List, Optional, Set ) from . import error __version__ = '2.0.0' __all__ = ('DNSResolver', 'error') READ = 1 WRITE = 2 query_type_map = {'A' : pycares.QUERY_TYPE_A, 'AAAA' : pycares.QUER...
Python
0
@@ -158,17 +158,17 @@ on__ = ' -2 +3 .0.0'%0A%0A_
d3998e64c837f87ad574964b4325335172ca8c5d
add a create and delete view for newsletter subscription models
newsletters/views.py
newsletters/views.py
from django.shortcuts import render # Create your views here.
Python
0
@@ -9,55 +9,287 @@ ngo. -shortcuts import render%0A%0A# Create your views here. +views.generic import CreateView, DeleteView%0A%0Afrom newsletters.models import Subscription%0Afrom newsletters.forms import SubscriptionForm%0A%0A%0Aclass SubscriptionCreateView(CreateView):%0A form_class = SubscriptionForm%0A%0A%0Acl...
75559384702f6b985718ecf8ccba11160ed0aa02
Test the id and the fullid in condition
weboob/tools/application/results.py
weboob/tools/application/results.py
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Christophe Benz # # 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.000006
@@ -2869,30 +2869,20 @@ d = -dict(obj.iter_fields() +obj.to_dict( )%0A @@ -3093,24 +3093,428 @@ # + in the case of id, test id@backend and id%0A if condition.left == 'id':%0A tocompare = condition.right%0A evalfullid = functions%5Bconditi...
c70678cafb9f6d2bb1db2c64513de5e9853d58e0
check uuid_generate
find_uuid.py
find_uuid.py
# -*- python -*- # stdlib imports --- import os import os.path as osp # waf imports --- import waflib.Utils import waflib.Logs as msg from waflib.Configure import conf # _heptooldir = osp.dirname(osp.abspath(__file__)) def options(ctx): ctx.load('hep-waftools-base', tooldir=_heptooldir) return def configur...
Python
0.000009
@@ -281,32 +281,145 @@ ir=_heptooldir)%0A + ctx.add_option(%0A '--with-uuid',%0A default=None,%0A help=%22Look for UUID at the given path%22)%0A return%0A%0Adef @@ -994,12 +994,16 @@ uid_ -init +generate %22,%0A @@ -1146,16 +1146,68 @@ gv%5B%5D) %7B%0A + uuid_t out;%0A ...
fbe72e14b9d53570614538b59e5d9128d0a3832d
Add a catchall dialplan entry when matching users.
aiosip/dialplan.py
aiosip/dialplan.py
import logging from . import utils from collections import MutableMapping LOG = logging.getLogger(__name__) class Dialplan: def __init__(self, default=None): self._users = {} self.default = default async def resolve(self, username, protocol, local_addr, remote_addr): LOG.debug('Res...
Python
0
@@ -438,29 +438,31 @@ l)%0A r -eturn +outer = self._users @@ -478,23 +478,110 @@ name -, self.default) +)%0A if not router:%0A router = self._users.get('*', self.default)%0A return router %0A%0A
11e23916b47cf8b9c35f32ad379e66336cf53f8b
Change from double to single quotes
_lib/wordpress_view_processor.py
_lib/wordpress_view_processor.py
import sys import json import os.path from string import Template from wordpress_post_processor import process_post import requests import dateutil.parser def posts_at_url(url): url = os.path.expandvars(url) current_page = 1 max_page = sys.maxint while current_page <= max_page: resp = requ...
Python
0.000006
@@ -1551,12 +1551,12 @@ is -%22ok%22 +'ok' :%0A
a1e6da6eb6048d42fef3a5669743b855709acc2b
Add some new API calls
erply_api.py
erply_api.py
# -*- coding: utf-8 -*- """ erply ~~~~~ Simple Python wrapper for Erply API :copyright: (c) 2014 by Priit Laes :license: BSD, see LICENSE for details. """ from contextlib import closing from datetime import datetime import csv import requests class ErplyAuth(object): def __init__(self, code...
Python
0.000001
@@ -592,80 +592,494 @@ = ( -'getCustomerGroups', 'getCustomers', 'getDocuments', %5C%0A +%0A # TODO: This list is still incomplete%0A 'getAddresses'%0A ,'getAddressTypes'%0A ,'getCustomers'%0A ,'getCustomerGroups'%0A ,'getProducts'%0A ,'getProductCategories'...
8f9a466dee5cd9bcd794e95f3d6cc22103dc4fb7
Add incubating specifier to version
airflow/version.py
airflow/version.py
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
Python
0
@@ -580,10 +580,28 @@ '1.8.0b1 ++apache.incubating '%0A
024323984b7d3c6d45cd49ae37d54f7c0e35e34a
Handle `load` request
flask_spf.py
flask_spf.py
# # Flask-SPF # # Copyright (C) 2017 Boris Raicheff # All rights reserved # import flask from bs4 import BeautifulSoup from flask import jsonify, render_template, request from htmlmin import Minifier class SPF(object): """ Flask-SPF Documentation: https://flask-spf.readthedocs.io Usage: ...
Python
0.000004
@@ -1292,10 +1292,19 @@ f') -== +in ('load', 'na @@ -1310,16 +1310,17 @@ avigate' +) :%0A
20d5de67106a2aee9ead3c896a91951ad7202ad1
add storages to installed apps
hypodrical/settings.py
hypodrical/settings.py
import os from sys import path as pythonpath production = os.environ.get('PRODUCTION', None) if production: DEBUG = True else: DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'dev.db',}} # Base application directory APP_DIR = os.path.nor...
Python
0
@@ -2142,16 +2142,32 @@ arkup',%0A + 'storages',%0A 'tag
cabc82eb1b371bb9c732907e19cd64ef7eaf9956
remove unused and invalid import
laserchicken/test_read_las.py
laserchicken/test_read_las.py
import os import shutil import unittest import pytest import numpy as np from laserchicken.read_las import read from laserchicken.write_las import write from laserchicken.test_utils import generate_test_point_cloud class TestReadWriteLas(unittest.TestCase): _test_dir = 'TestLoad_dir' _test_file_name = '5poi...
Python
0.000001
@@ -45,73 +45,34 @@ ort -pytest%0Aimport numpy as np%0A%0Afrom laserchicken.read_las import read +numpy as np%0Aimport pytest%0A %0Afro @@ -86,21 +86,20 @@ chicken. -write +read _las imp @@ -106,74 +106,11 @@ ort -write%0Afrom laserchicken.test_utils import generate_test_point_clou +rea d%0A%0A%0A
b04f3bd19b508140b0b4feee46d590b61da46bed
Switch Swift trunk to 1.4.1, now that the 1.4.0 release branch is branched out.
swift/__init__.py
swift/__init__.py
import gettext class Version(object): def __init__(self, canonical_version, final): self.canonical_version = canonical_version self.final = final @property def pretty_version(self): if self.final: return self.canonical_version else: return '%s-dev' ...
Python
0
@@ -371,9 +371,9 @@ 1.4. -0 +1 ', F
f77e5f3263dd5d981581d51e55e14a3f89bb8c15
throw error if user tries to nest keys where it makes no sense
i3configger/message.py
i3configger/message.py
import logging from pathlib import Path from i3configger import base, config, exc, partials, context log = logging.getLogger(__name__) I3STATUS = "i3status" """reserved key for status bar setting files""" DEL = 'del' """signal to delete a key in shadow or set""" class CMD: SELECT_NEXT = "select-next" SELE...
Python
0.000001
@@ -941,32 +941,36 @@ else ''%0A + if self.command @@ -1008,32 +1008,36 @@ ey:%0A + raise exc.UserEr @@ -1037,24 +1037,28 @@ .UserError(%0A +
aa9a7e1d794967e9fec91711772d03cb6042b277
Improve documentation of the 'constants' module
iati/core/constants.py
iati/core/constants.py
"""A module containing constants required throughout IATI library code. The contents of this file are not designed to be user-editable. Only edit if you know what you are doing! Warning: This contents of this module should currently be deemed private. Todo: Allow logging constants to be user-definable. """ ...
Python
0.000005
@@ -304,24 +304,25 @@ -definable.%0A +%0A %22%22%22%0A%0ASTANDAR @@ -407,16 +407,17 @@ andard.%0A +%0A Todo:%0A @@ -643,16 +643,17 @@ ocess).%0A +%0A %22%22%22%0A%0ASTA @@ -878,16 +878,17 @@ inable.%0A +%0A %22%22%22%0ALOGG @@ -946,32 +946,32 @@ gger.%0A%0AWarning:%0A - This should @@ -1008,16 +1008,17...
53455dfc811854532b651d6a59909cc0514105c8
work around empty IN clause
iatidq/dqprocessing.py
iatidq/dqprocessing.py
# IATI Data Quality, tools for Data QA on IATI-formatted publications # by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith # # Copyright (C) 2013 Publish What You Fund # # This programme is free software; you may redistribute and/or modify # it under the terms of the GNU Affero General Public License v3...
Python
0.00047
@@ -2510,16 +2510,47 @@ ults%5D)%0A%0A + if result_identifiers:%0A resu @@ -2583,32 +2583,36 @@ filter(%0A + + models.Result.ru @@ -2631,32 +2631,36 @@ runtime%0A + ).filter(%0A @@ -2645,32 +2645,36 @@ ).filter(%0A + models.R @@ -2704,32 +2704,36 @@ ka...
feb27b3971547daf45449e9dff4283bf3e752c17
Add extension for mention-bot
identify/extensions.py
identify/extensions.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals EXTENSIONS = { 'apinotes': {'text', 'apinotes'}, 'asar': {'binary', 'asar'}, 'bash': {'text', 'shell', 'bash'}, 'bat': {'text', 'batch'}, 'bmp': {'binary', 'image', 'bitmap'}, 'bz2': {'binary...
Python
0.000002
@@ -4750,24 +4750,77 @@ 'mailmap'%7D,%0A + '.mention-bot': %7B'text', 'json', 'mention-bot'%7D,%0A '.npmign
9ac12e4d552aabd91a6ad79da4f45cca4190be20
add test album cover.
imager_images/tests.py
imager_images/tests.py
import factory from django.test import TestCase from imager_images.models import Album, Photo from django.contrib.auth.models import User from django.core.files.uploadedfile import SimpleUploadedFile import datetime import os import glob THE_FILE = SimpleUploadedFile('test.png', 'a photo') def clean_up(): for fi...
Python
0
@@ -3845,21 +3845,21 @@ the_ -photo +album = Album @@ -3898,37 +3898,37 @@ ssertEquals(the_ -photo +album .title, %22Album T @@ -3956,37 +3956,37 @@ ssertEquals(the_ -photo +album .description, %22A @@ -4017,37 +4017,37 @@ ssertEquals(the_ -photo +album .published, %22pvt @@ -4071,37 +4071,37 @@ ssertEqua...
f3b37146c70ac40f714ed89e205327a8a2d8e4a9
Fix for case when graphite returns None as the value of a non-existent metric.
vumidash/holodeck_pusher.py
vumidash/holodeck_pusher.py
# -*- test-case-name: vumidash.tests.test_holodeck_pusher -*- """Service that pushes metrics to Holodeck.""" import heapq import math from datetime import datetime, timedelta from twisted.application.service import Service from twisted.internet.defer import ( inlineCallbacks, gatherResults, maybeDeferred) from t...
Python
0.000001
@@ -2321,16 +2321,165 @@ yield d%0A + # 'or 0.0' is to protect against case where None is returned for%0A # the metric value (e.g. when a Graphite metric is missing)%0A @@ -2526,16 +2526,23 @@ lues%5B-1%5D + or 0.0 %5D)%0A
c85c4ee0bec8c785f04484584eace6eb4d6a3610
Add cut to end of line (C-k)
vx/keybindings/hopscotch.py
vx/keybindings/hopscotch.py
import vx from vx.keybindings import bind, alt, ctrl, keys, KeybindingTable import vx.movement as move import vx.utils as utils import vx.window import vx.test import vx.prompt import vx.undo as undo from ..pointer import panes, organizer from functools import partial def load(window): return Hopscotch(window) ...
Python
0
@@ -2282,16 +2282,66 @@ /paste%0A%0A + self.bind(ctrl + keys.k, self.cut_to_eol)%0A @@ -3484,8 +3484,567 @@ la, ca)%0A +%0A def cut_to_eol(self):%0A (la, ca) = self.for_window.cursor%0A with self.for_window.cursor_wander():%0A move.eol()%0A (lb, cb) = self.for_w...
31754278f173a0303da9407845549e41edad31a3
Update formatting
wagtailgeowidget/widgets.py
wagtailgeowidget/widgets.py
import json import six from django.forms import HiddenInput from django.utils.html import format_html from django.utils.safestring import mark_safe try: from django.contrib.gis.geos.point import Point except: Point = None from wagtailgeowidget.helpers import geosgeometry_str_to_struct from wagtailgeowidget.a...
Python
0.000001
@@ -207,16 +207,24 @@ %0Aexcept: + # NOQA %0A Poi @@ -1380,21 +1380,16 @@ .render( -name, %0A @@ -1397,144 +1397,33 @@ - value,%0A attrs=attrs,%0A +name, value, attrs=attrs, ren @@ -1...
0e2cfb52e16bf2a76dd3684cb2d548dd81e3b8ab
Update default User-Agent to DataONE_Python/x.y.z +http://dataone.org/
lib_common/src/d1_common/const.py
lib_common/src/d1_common/const.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2016 DataONE # # Licensed under the Apache...
Python
0
@@ -1736,15 +1736,25 @@ = ' -pyd1/%25s +DataONE_Python/%7B%7D +ht @@ -1770,18 +1770,16 @@ one.org/ -%7B%7D '.format @@ -2037,16 +2037,17 @@ PE_OCTET +_ STREAM = @@ -3249,24 +3249,51 @@ ITK %7B%7D'.format(VERSION)%0A +%0ADEFAULT_CHUNK_SIZE = 1024%0A
6ef01afcc9e27a16d20dea5b516462a0a1261265
bump version number
wagtailmetadata/__init__.py
wagtailmetadata/__init__.py
__version__ = "0.0.1"
Python
0.000004
@@ -16,7 +16,7 @@ 0.0. -1 +2 %22%0A
1233a6d963a9cdfcf7a2a33b17533de945148c08
Change storage version to 'dev-version'
wal_e/storage/s3_storage.py
wal_e/storage/s3_storage.py
#!/usr/bin/env python """ S3 Storage Abstraction This module is used to define and provide accessors to the logical structure and metadata for an S3-backed WAL-E prefix. """ import collections import wal_e.exception from urlparse import urlparse CURRENT_VERSION = '005' SEGMENT_REGEXP = (r'(?P<filename>(?P<tli>[...
Python
0
@@ -265,19 +265,27 @@ SION = ' -005 +dev-version '%0A%0ASEGME @@ -2159,35 +2159,43 @@ bar/basebackups_ -005 +dev-version /'%0A %3E%3E%3E sl.wa @@ -2213,35 +2213,43 @@ ()%0A 'bar/wal_ -005 +dev-version /'%0A %3E%3E%3E sl.bu @@ -2387,19 +2387,27 @@ backups_ -005 +dev-version /'%0A %3E @@ -2441,19 +244...
f5254d446c99e3e52f444173c2cbfff82089f2cf
Fix rgb -> grayscale coeffs
ale_environment.py
ale_environment.py
# The MIT License (MIT) # # Copyright (c) 2016 Yu Ishihara # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy,...
Python
0.000005
@@ -1407,19 +1407,20 @@ ayscale= -Tru +Fals e):%0A @@ -3149,10 +3149,11 @@ 0.2 -99 +126 + s @@ -3175,11 +3175,12 @@ * 0. -587 +0722 + s @@ -3202,11 +3202,12 @@ * 0. -114 +7152 %0A
6d0ec24e1d084150ccc9227c60bfde064b54ee57
Update ngram.py
ngram_utils/ngram.py
ngram_utils/ngram.py
from nltk import FreqDist, BigramCollocationFinder, TrigramCollocationFinder from nltk.collocations import TrigramAssocMeasures as trigram_measures from nltk.collocations import BigramAssocMeasures as bigram_measures from .ngram_service import NgramService SUBSTITUTION_TOKEN = 'SUB' class Ngram(object): @sta...
Python
0.000001
@@ -249,18 +249,18 @@ mService -%0A%0A +, SUBSTITU @@ -273,16 +273,8 @@ OKEN - = 'SUB' %0A%0Acl
e9b422c74382d88787114796e7e4b6dfd2b25225
Correct path to frontend views
codesharer/app.py
codesharer/app.py
from flask import Flask from flaskext.redis import Redis def create_app(): from codesharer.apps.classifier.views import frontend app = Flask(__name__) app.config.from_object('codesharer.conf.Config') app.register_module(frontend) db = Redis(app) db.init_app(app) app.db = db ret...
Python
0.000007
@@ -98,18 +98,16 @@ pps. -classifier +snippets .vie
90ec1e2c521e82b1c6fc6ba9e14983a0294261b5
bump version to 3.0.0dev
altair/__init__.py
altair/__init__.py
# flake8: noqa __version__ = '2.5.0dev0' from .vegalite import * from . import examples def load_ipython_extension(ipython): from ._magics import vega, vegalite ipython.register_magic_function(vega, 'cell') ipython.register_magic_function(vegalite, 'cell')
Python
0
@@ -27,11 +27,11 @@ = ' -2.5 +3.0 .0de
e78bc918a05a0b0c76d6cdaf228dc9507db58ffe
Fix TestStubSetSID after unification in to a single lldb-server binary.
test/tools/lldb-gdbserver/commandline/TestStubSetSID.py
test/tools/lldb-gdbserver/commandline/TestStubSetSID.py
import unittest2 # Add the directory above ours to the python library path since we # will import from there. import os.path import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..")) import gdbremote_testcase import os import select import tempfile import time from lldbtest import * class TestStubSet...
Python
0.000085
@@ -296,16 +296,100 @@ port *%0A%0A +%0Adef get_common_stub_args():%0A return %5B%5D if 'darwin' in sys.platform else %5B'g'%5D%0A%0A%0A class Te @@ -1167,16 +1167,19 @@ ub_sid(%22 + %25s --setsi @@ -1180,16 +1180,51 @@ -setsid%22 + %25 ' '.join(get_common_stub_args()) )%0A @@ -1353,11 +1353,49 @@ d(%2...
b9f43757b4d6bd63d15b75f5a40f26fb56904ba7
Fix fields import
amocrm/__init__.py
amocrm/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import sys import logging from .settings import settings as amo_settings from .api import * from .apimodels import * __all__ = [ 'BaseCompany', 'BaseContact', 'BaseLead', 'amo_settings', 'AmoApi', 'ContactNote', 'ContactTask', '...
Python
0.000001
@@ -192,16 +192,37 @@ import * +%0Afrom . import fields %0A%0A__all_
a40dd88e8cb9a9202ecb451a22b3717f861502c6
generic name for folder if ambiguous
analyze/process.py
analyze/process.py
#process.py """ TODO: compare differences in sort order: -filename -creation date find duplicate barcodes determine most likely image classification and use for filename change filename, all names unique, no overwritten files record changes leave any problem files unchanged flag folder images and record which folders...
Python
0.999056
@@ -1968,82 +1968,8 @@ s'%5D%0A - if 'folder' in image_classifications:%0A print(%22FOLDER%22)%0A @@ -3673,16 +3673,122 @@ l_name:%0A + if 'ambiguous' in row%5B'image_classifications'%5D:%0A model_name = 'folder'%0A
a58a25c49b5eed9564bbcb9adab819a576cbfddb
use the method properlike
acq4/devices/zeiss/ZeissShutter.py
acq4/devices/zeiss/ZeissShutter.py
from pyqtgraph.util.mutex import Mutex from acq4.devices.Device import Device, TaskGui from acq4.drivers.zeiss import ZeissMtbSdk from acq4.util import Qt class ZeissShutter(Device): """ Config Options -------------- transOrReflect : str "Transmissive" | "Reflective" Which of the two standard...
Python
0.000466
@@ -2412,16 +2412,36 @@ vChange( +self.dev.getIsOpen() )%0A
ab6df33d990f5a7da6b2696dfe51222105d1c26d
Enable icdf test
tests/chainer_tests/distributions_tests/test_laplace.py
tests/chainer_tests/distributions_tests/test_laplace.py
import unittest from chainer.backends import cuda from chainer import distributions from chainer import gradient_check from chainer import testing from chainer.testing import attr import numpy @testing.parameterize(*testing.product({ 'shape': [(3, 2), (1,)], 'is_variable': [True, False], 'sample_shape': ...
Python
0.000001
@@ -702,16 +702,24 @@ _shape%22, + %22icdf%22, %22log_pr
938f5d8a28bb96ec1d19d814badcc6d1d11b6f39
Make it possible to use StringIO instead of files for binary attachments.
angus/rest.py
angus/rest.py
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # ...
Python
0
@@ -903,10 +903,10 @@ -04- -07 +28 %22%0A__ @@ -2367,26 +2367,25 @@ if -isinstance(o, file +hasattr(o, 'read' ):%0A
df02879c51c4f87514e376e3a2a0f7db7a75a285
Improve configuration schema for Geniushub integration (#23155)
homeassistant/components/geniushub/__init__.py
homeassistant/components/geniushub/__init__.py
"""This module connects to the Genius hub and shares the data.""" import logging import voluptuous as vol from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_USERNAME) from homeassistant.helpers import config_validation as cv from homeassistant.helpers.aiohttp_client import async_get_clientsession fr...
Python
0
@@ -20,19 +20,17 @@ ects to -the +a Genius @@ -162,16 +162,28 @@ ASSWORD, + CONF_TOKEN, CONF_US @@ -451,14 +451,15 @@ b'%0A%0A -CONFIG +_V1_API _SCH @@ -485,111 +485,148 @@ -DOMAIN: vol.Schema(%7B%0A vol.Optional(CONF_USERNAME): cv.string,%0A vol.Optional(CONF_PASSWORD +vol.Required(CONF_T...
8bb67642fd8b3c6c4e89174bc28faae5de5833f7
Add support for city ids to weather module.
bumblebee/modules/weather.py
bumblebee/modules/weather.py
# -*- coding: UTF-8 -*- # pylint: disable=C0111,R0903 """Displays the temperature on the current location based on the ip Requires the following python packages: * requests Parameters: * weather.location: Set location (ISO 3166 country code), defaults to 'auto' for getting location from http://ipinfo.io ...
Python
0
@@ -225,32 +225,8 @@ tion - (ISO 3166 country code) , de @@ -405,16 +405,85 @@ ocations +.%0A Locations should be city names or city ids. %0A * w @@ -3903,54 +3903,8 @@ ,%22)%0A - self._city = location%5B%22city%22%5D%0A @@ -4027,41 +4027,123 @@ el -se:%0A ...
f61329f70cf9acb3c2717ba90765fa1b7fca2799
fix GitRepo.ancestor when revs are unrelated
anyvcs/git.py
anyvcs/git.py
import re import stat import subprocess from common import * GIT = 'git' ls_tree_rx = re.compile(r'^(?P<mode>[0-7]{6}) (?P<type>tree|blob) (?:[0-9a-f]{40})(?: +(?P<size>\d+|-))?\t(?P<name>.+)$', re.I | re.S) branch_rx = re.compile(r'^[*]?\s+(?P<name>.+)$') rev_rx = re.compile(r'^[0-9a-fA-F]{40}$') class GitRepo(VCSR...
Python
0.000095
@@ -5361,39 +5361,335 @@ -return self._command(cmd).rstrip( +p = subprocess.Popen(cmd, cwd=self.path, stdout=subprocess.PIPE,%0A stderr=subprocess.PIPE)%0A stdout, stderr = p.communicate()%0A if p.returncode == 0:%0A return stdout.rstrip()%0A elif p.returncode == 1:%0A r...
da5c2c7f4d0ccd49a7a5e43a4bb0220fc76bb5cd
support for generators
wishful_agent/controller_monitor.py
wishful_agent/controller_monitor.py
import logging import time import sys import datetime import threading import wishful_framework as msgs __author__ = "Piotr Gawlowicz" __copyright__ = "Copyright (c) 2015, Technische Universitat Berlin" __version__ = "0.1.0" __email__ = "gawlowicz@tkn.tu-berlin.de" class ControllerMonitor(object): def __init__(s...
Python
0
@@ -2895,19 +2895,16 @@ get_ -capabilitie +function s(): @@ -2949,32 +2949,32 @@ functions.add()%0A - @@ -2992,16 +2992,154 @@ me = f%0A%0A + for g in module.get_generators():%0A generator = moduleMsg.generators.add()%0A generator.name = g%0A%0A%0A ...
858d04cf3f5ddb9fef99e86b2c337d0920adaea9
add qha plot tool (function version)
workflows/tools/get_qha_function.py
workflows/tools/get_qha_function.py
from aiida import load_dbenv load_dbenv() from aiida.orm import load_node, load_workflow from aiida.orm import Code, DataFactory import matplotlib.pyplot as plt StructureData = DataFactory('structure') ParameterData = DataFactory('parameter') ArrayData = DataFactory('array') KpointsData = DataFactory('array.kpoints'...
Python
0
@@ -2860,16 +2860,60 @@ yData()%0A + qha_output.set_array(np.array(%5B1,2,3%5D))%0A # qh @@ -3442,24 +3442,48 @@ perature))%0A%0A + qha_output.store()%0A%0A return %7B @@ -4933,39 +4933,8 @@ s)%0A%0A -qha_result%5B'qha_data'%5D.store()%0A prin
917781dc95abb065601f51295a01e2baa02cf505
Add blank line
tests/integration/cloud/providers/test_digital_ocean.py
tests/integration/cloud/providers/test_digital_ocean.py
# -*- coding: utf-8 -*- ''' Integration tests for DigitalOcean APIv2 ''' # Import Python Libs from __future__ import absolute_import import os import random import string # Import Salt Testing Libs from tests.support.case import ShellCase from tests.support.paths import FILES from tests.support.helpers import expensi...
Python
0.073685
@@ -721,16 +721,17 @@ %0A )%0A%0A +%0A # Create
82ca99b142676e54f80897133a0955c07039ed17
Make `dddp` management command a subclass of the `runserver` command so that staticfiles works as expected.
dddp/management/commands/dddp.py
dddp/management/commands/dddp.py
"""Django DDP WebSocket service.""" from __future__ import print_function, absolute_import import collections import inspect import optparse import random import signal import socket from django.core.management.base import BaseCommand from django.db import connection, close_old_connections from django.utils.module_l...
Python
0
@@ -179,16 +179,84 @@ socket%0A%0A +from django.core.management import get_commands, load_command_class%0A from dja @@ -2218,22 +2218,71 @@ )%0A%0A%0A -class Command( +app_name = get_commands()%5B'runserver'%5D%0Aif isinstance(app_name, Base @@ -2295,539 +2295,272 @@ d):%0A -%0A -%22%22%22C +c ommand - to ...
1d8acdfc0a729197dda3e1d52582f1ac317cc005
fix indentation problem
ddf_utils/ddf_reader.py
ddf_utils/ddf_reader.py
# -*- coding: utf-8 -*- import pandas as pd import os SEARCH_PATH = '' def ddf_concepts(ddf_id): """return all concepts""" path = _get_ddf_path(ddf_id) if os.path.exists(os.path.join(path, 'ddf--concepts.csv')): df = pd.read_csv(os.path.join(path, 'ddf--concepts.csv')) return {'concepts...
Python
0.000279
@@ -2179,9 +2179,16 @@ se:%0A -%09 + from
291699ad5637534ff17e074831ae40eef1167977
Fix wrong datatype
clitimer.py
clitimer.py
#!/usr/bin/env python3 #MIT License # #Copyright (c) 2016 Paul Kramme # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, cop...
Python
0.999999
@@ -2523,24 +2523,28 @@ timeinput = +int( input(%22Time @@ -2554,24 +2554,25 @@ count to: %22) +) %0A unit =
c382b43b5e5c442d9d3c6bc6af398b829e07f1b5
Fix chunk
node/floor_divide.py
node/floor_divide.py
#!/usr/bin/env python from nodes import Node class FloorDiv(Node): char = "f" args = 2 results = 1 @Node.test_func([3,2], [1]) @Node.test_func([6,-3], [-2]) def func(self, a:Node.number,b:Node.number): """a/b. Rounds down, returns an int.""" return a//b @Node.test...
Python
0.000009
@@ -38,16 +38,28 @@ ort Node +%0Aimport math %0A%0Aclass @@ -1089,25 +1089,8 @@ %5B%5D%0A - last = 0%0A @@ -1141,22 +1141,19 @@ nge( -size, len(inp) +0, num*size , si @@ -1188,37 +1188,18 @@ inp%5B -last:i%5D)%0A last = i +i:i+size%5D) %0A @@ -1250,20 +1250,22 @@ end(inp%5B -last +i...
f0962f53e517cb24fdab5253ae60ee7fd7be0cfe
Remove unnecessry print in tests
tests/interface/cli/exec_task_from_cli_test.py
tests/interface/cli/exec_task_from_cli_test.py
from __future__ import absolute_import, division, print_function, unicode_literals from builtins import * from unittest.case import TestCase from click.testing import CliRunner from zsl import inject from zsl.application.containers.core_container import CoreContainer from zsl.application.modules.cli_module import Zs...
Python
0.000023
@@ -1537,30 +1537,8 @@ '%5D)%0A - print(result)%0A
f2524ea01cc24c4de5a135980a016030f222feac
condense text to max 79 cols
horoscope.py
horoscope.py
""" Horoscope module for x/84 bbs. Lets a user choose their astrological sign and retrieves their daily horoscope from the littleastro.com web API. """ __author__ = u'haliphax <https://github.com/haliphax>' # stdlib import json from datetime import date # 3rd party import requests # local from x84.bbs import getter...
Python
0.999999
@@ -4329,16 +4329,104 @@ %5Cn%5Cr%5Cn', +%0A term.move_x(max(term.width / 2 - 40, 0)),%0A term.br @@ -5719,16 +5719,47 @@ t=False, + width=min(term.width - 1, 80), %0A
31d0291aad736bfa1ff78914c8d261130031d233
use HyperlinkedMultiIdentityField for ProjectSerializer
api/serializers.py
api/serializers.py
import copy from django.forms import widgets from django.contrib.auth.models import User from rest_framework import serializers from main.models import UserProfile from main.forms import UserProfileForm, RegistrationFormUserProfile from odk_logger.models import XForm from api.models import Project class UserSeri...
Python
0
@@ -297,16 +297,69 @@ Project%0A +from api.fields import HyperlinkedMultiIdentityField%0A %0A%0Aclass @@ -4595,24 +4595,166 @@ erializer):%0A + url = HyperlinkedMultiIdentityField(%0A view_name='project-detail',%0A lookup_fields=(('pk', 'pk'), ('owner', 'organization')))%0A owner = @@ -4805,3...
a8a0dd55a5289825aae34aa45765ea328811523e
Exclude Fast test for Python 2
spotpy/unittests/test_fast.py
spotpy/unittests/test_fast.py
import unittest try: import spotpy except ImportError: import sys sys.path.append(".") import spotpy from spotpy.examples.spot_setup_hymod_python import spot_setup class TestFast(unittest.TestCase): def setUp(self): self.spot_setup = spot_setup() self.rep = 200 # REP must be a...
Python
0.000023
@@ -177,18 +177,129 @@ _setup%0A%0A -%0A%0A +# Test only untder Python 3 as Python %3E2.7.10 results in a strange fft error%0Aif sys.version_info %3E= (3, 5):%0A%0A class Te @@ -325,16 +325,20 @@ tCase):%0A + def @@ -350,25 +350,31 @@ (self):%0A -%0A + %0A self.spo @@ -361,24 +361,26 @...
8c7f61bf9a200db6da2b1e43b5a7f43671e32d11
Fix reward is per epoch.
x/agent.py
x/agent.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division import numpy as np from keras.utils.generic_utils import Progbar from agnez.video import make_gif class Agent(object): """Base Agent class Parameters ---------- model : :obj:`Model` A learning mod...
Python
0.000001
@@ -159,41 +159,8 @@ bar%0A -from agnez.video import make_gif%0A %0A%0Acl @@ -4211,36 +4211,17 @@ (epoch)%0A - rewards = 0 %0A + @@ -4270,20 +4270,35 @@ t enviro +n ment + on each epoch %0A @@ -4364,16 +4364,40 @@ loss = 0 +%0A rewards = 0 %0A%0A @@ -5416,36 +5416,16 @@...
100a77490b466bbaeccba20803ff9ca5f2754ce4
Set the time-zone based on user's requirement
store/order/models.py
store/order/models.py
from django.db import models, transaction from django.contrib.auth.models import User from django.utils import timezone from django.core.validators import MinValueValidator from store.settings import __init__ from product.models import Product, Photo from cart.models import ProductItemInfo class InvalidOrderStatusCh...
Python
0.000121
@@ -169,44 +169,8 @@ ator -%0Afrom store.settings import __init__ %0A%0Afr @@ -6429,43 +6429,8 @@ ate. -replace(tzinfo=__init__.TIME_ZONE). strf
f3e6a8099c7eb8104371a936fba05804e0e76572
Fix hostnames with a dash getting rejected
webuntis/utils/userinput.py
webuntis/utils/userinput.py
''' This file is part of python-webuntis :copyright: (c) 2013 by Markus Unterwaditzer. :license: BSD, see LICENSE for more details. ''' import re from .logger import log from .third_party import urlparse def server(url): if not re.match(r'^http(s?)\:\/\/', url): # if we just have the hostname ...
Python
0.000015
@@ -724,16 +724,17 @@ Z0-9%5C.%5C: +%5C -_%5D+$',
85aec52251a67992c7792313e16cc1433320bba8
check if the journal exist on the account.bank.statement
addons/account/wizard/pos_box.py
addons/account/wizard/pos_box.py
#!/usr/bin/env python from osv import osv, fields import decimal_precision as dp from tools.translate import _ class CashBox(osv.osv_memory): _register = False _columns = { 'name' : fields.char('Reason', size=64, required=True), # Attention, we don't set a domain, because there is a journal_typ...
Python
0.000019
@@ -1070,16 +1070,248 @@ ecords:%0A + if not record.journal_id:%0A raise osv.except_osv(_('Error !'),%0A _(%22Please check that the field 'Journal' is set on the Bank Statement%22))%0A %0A
1a40d649d552c7e24fc56c0bc3dd4f117f3c8347
Add .get_documentcloud_dics() method
calaccess_raw/models/base.py
calaccess_raw/models/base.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import textwrap from django.db import models from calaccess_raw import managers class CalAccessBaseModel(models.Model): """ An abstract model with some tricks we'll reuse. """ # The UNIQUE_KEY is one or more fields t...
Python
0.000002
@@ -4255,16 +4255,899 @@ e_list%0A%0A + def get_documentcloud_dicts(self):%0A %22%22%22%0A Return distinct DocumentCloud documents as a list of dicts.%0A%0A Each dict has a pages key that is a list of start_page, end_page tuples.%0A %22%22%22%0A from calaccess_raw.annotations impo...
aa6fea3e1b8b8dedf89e5972e952fdb1e8542a90
Implement InMaintenance permissions class.
api/permissions.py
api/permissions.py
""" Atmosphere API's extension of DRF permissions. """ from core.models.cloud_admin import CloudAdministrator from rest_framework import permissions from threepio import logger # NOTE: It would be better to use Object-level permissions here. class ProjectOwnerRequired(permissions.BasePermission): def has_permis...
Python
0
@@ -51,63 +51,8 @@ %0A%22%22%22 -%0Afrom core.models.cloud_admin import CloudAdministrator %0A%0Afr @@ -122,73 +122,142 @@ er%0A%0A -%0A# NOTE: It would be better to use Object-level permissions here. +from core.models.cloud_admin import CloudAdministrator%0Afrom core.models import MaintenanceRecord%0A%0Afrom api im...
e1855bb410275c6ba5b0f04934ea21c615de38dc
fix for last commit
committees/api.py
committees/api.py
''' Api for the committees app ''' from tastypie.api import Api from tastypie.constants import ALL from tastypie.bundle import Bundle import tastypie.fields as fields from apis.resources.base import BaseResource from models import Committee, CommitteeMeeting, ProtocolPart from mks.api import MemberResource class Com...
Python
0
@@ -381,9 +381,8 @@ -# rece @@ -460,98 +460,8 @@ ()%0A%0A - meetings = fields.ToManyField('committees.api.CommitteeMeetingResource', 'meetings')%0A%0A
e736482bec7be7871bd4edd270f8c064961c20fc
Update minimum support boto version.
setup.py
setup.py
#!/usr/bin/env python from __future__ import unicode_literals from setuptools import setup, find_packages install_requires = [ "Jinja2", "boto", "flask", "httpretty>=0.6.1", "requests", "xmltodict", "six", "werkzeug", ] import sys if sys.version_info < (2, 7): # No buildint Ordere...
Python
0
@@ -144,16 +144,24 @@ %22boto +%3E=2.20.0 %22,%0A %22
fa117975b9d17aa074c61c8e795546be932704fc
Need to use 'host', not 'hostname'.
kestrel/manager.py
kestrel/manager.py
""" Kestrel: An XMPP-based Job Scheduler Copyright (C) 2011 Lance Stout This file is part of Kestrel. See the file LICENSE for copying permission. """ import logging import random import sleekxmpp from sleekxmpp.xmlstream import JID class Manager(sleekxmpp.ComponentXMPP): def __init__(self, ji...
Python
0.998468
@@ -503,20 +503,16 @@ 'host -name ': self. @@ -532,20 +532,16 @@ '%5D%5B'host -name '%5D,%0A
6d0240fbb329e649210578e7c194a79e1f495267
copy unprocessed files to key folders
koda/main.py
koda/main.py
import os import sys from mutagen.easyid3 import EasyID3 def listDirectory(directory): "get list of file info objects for files of particular extensions" workdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), directory) fileList = [os.path.normcase(f) for f in os.listdir(workdir)] return ...
Python
0
@@ -14,16 +14,38 @@ ort sys%0A +from glob import glob%0A from mut @@ -76,26 +76,472 @@ ID3%0A -%0Adef listDirectory +import shutil%0A%0ACAMELOT_FOLDERS = %5B%221A - 1B%22, %222A - 2B%22, %223A - 3B%22, %224A - 4B%22, %225A - 5B%22, %226A - 6B%22, %227A - 7B%22, %228A - 8B%22, %229A - 9B%22, %2210A - 10B%22, %2211A -...