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
be792fccdfd02d564aae008ab459ddf266f01796
Fix assertion error
flask_github.py
flask_github.py
# -*- coding: utf-8 -*- """ GitHub-Flask ============ Authenticate users in your Flask app with GitHub. """ import logging try: from urllib.parse import urlencode, parse_qs except ImportError: from urllib import urlencode from urlparse import parse_qs from functools import wraps import reques...
Python
0.000002
@@ -5124,16 +5124,20 @@ if +not status_c @@ -5152,17 +5152,17 @@ tswith(' -4 +2 '):%0A @@ -5202,52 +5202,8 @@ e)%0A%0A - assert status_code.startswith('2')%0A%0A
4bc50fc3552ce537727895c7dc60bf3559249457
Tag new release: 2.2.11
floo/version.py
floo/version.py
PLUGIN_VERSION = '2.2.10' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.03' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
Python
0
@@ -16,17 +16,17 @@ = '2.2.1 -0 +1 '%0A# The
899c559f70a28a8d56ab02541009092c52b96507
allow passing preload_docs through
fluff/pillow.py
fluff/pillow.py
from couchdbkit import ResourceNotFound from dimagi.utils.read_only import ReadOnlyObject from pillowtop.checkpoints.manager import get_default_django_checkpoint_for_legacy_pillow_class from pillowtop.listener import PythonPillow, PYTHONPILLOW_CHUNK_SIZE from .indicators import IndicatorDocument from .signals import BA...
Python
0
@@ -782,16 +782,35 @@ eed=None +, preload_docs=True ):%0A @@ -1287,16 +1287,55 @@ e_feed,%0A + preload_docs=preload_docs,%0A
855b011c30db46d74b95d126e1953e5a5161d732
fix bug
src/python/convert_to_text.py
src/python/convert_to_text.py
# -*- coding: utf-8 -*- """ 1. Pre-process the English corpus: read the ".conll" format mixed pipeline source file (the english version) create two files: a) Original raw english corpus line by line b) POS-tagged and lemmatized english 2. Pre-process the Swedish: 3. Create the final parallel file read lines of both ...
Python
0.000001
@@ -5195,16 +5195,24 @@ V_TOKEN%5D +.strip() %5B-4:%5D ==
428e7cfcec6ab3861a2761f1bc124089409f64ac
Make namespace required and improve the documentation: #125
forge/config.py
forge/config.py
# Copyright 2017 datawire. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
Python
0.000005
@@ -1328,27 +1328,221 @@ ing(), d -efault=None +ocs=%22The namespace for the docker registry. For docker hub this is a user or an organization. This is used as the first path component of the registry URL, for example: registry.hub.docker.com/%3Cnamespace%3E%22 )%0A)%0A%0Acla
127f26069622d78c3255079808211a00dec3af64
Fix for issue #508 MenuBarPopupPanel should not be modal
library/pyjamas/ui/MenuBarPopupPanel.py
library/pyjamas/ui/MenuBarPopupPanel.py
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # 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/...
Python
0
@@ -926,16 +926,23 @@ f, True, + False, **kwarg
0d33c44197ef4c756665d33922aa79b644fbe205
Fix vlnv parsing for cores with names containing - (dash)
fusesoc/vlnv.py
fusesoc/vlnv.py
class Vlnv(object): def __init__(self, s, default_relation = ">="): def _is_rev(s): return s.startswith('r') and s[1:].isdigit() def _is_version(s): return s[0].isdigit() if s.startswith('!'): self.conflict = True _s = s[1:] else: ...
Python
0
@@ -1461,17 +1461,16 @@ sion = %22 -0 %22%0A%0A @@ -2211,32 +2211,100 @@ relation = %22==%22%0A + if not self.version:%0A self.version = %220%22%0A else:%0A
4db4adc0e154ee1e8ad7f0971fe90dc11349b9c0
Build libjpeg from source for all platforms
gyp/libjpeg.gyp
gyp/libjpeg.gyp
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This is a copy of ../third_party/externals/libjpeg/libjpeg.gyp , modified # such that all source paths point into that directory. # See http://code.google....
Python
0.000005
@@ -487,217 +487,8 @@ : %7B%0A - 'conditions': %5B%0A %5B 'os_posix == 1 and OS != %22mac%22', %7B%0A # Link to system .so since we already use it due to GTK.%0A 'use_system_libjpeg%25': 1,%0A %7D, %7B # os_posix != 1 or OS == %22mac%22%0A @@ -517,25 +517,8 @@ 0,%0A - %7D%5...
b95694b88a8b18a6d7ef932fd365949a2aa97322
Add test vectors with decryption
test-totp.py
test-totp.py
#!/usr/bin/env python # Copyright (c) 2015, Jan Varho # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AU...
Python
0.000009
@@ -944,16 +944,26 @@ , token, + pwd=None, **kwarg @@ -1006,16 +1006,71 @@ kwargs)%0A + if pwd is not None:%0A t.dec_key(pwd)%0A @@ -2132,16 +2132,334 @@ ut=60)%0A%0A + def test_vector_p1(self):%0A self._test_vector('asdf', 10, '036575', pwd='qwerty', salt='1234')%0A%0A def...
e8517aeda59df4dae4e91272bab3a8963e8f7577
Make loaders more explicit (should go away entirely).
aleph/logic/notifications.py
aleph/logic/notifications.py
import logging from banal import ensure_list, is_mapping from datetime import datetime, timedelta from aleph.core import db from aleph.model import Role, Alert, Event, Notification from aleph.model import Collection, Document, Entity from aleph.index.entities import get_entity from aleph.logic.util import collection_u...
Python
0
@@ -232,52 +232,8 @@ ity%0A -from aleph.index.entities import get_entity%0A from @@ -845,24 +845,215 @@ on.%0A %22%22%22%0A + from aleph.logic.entities import get_entity%0A from aleph.logic.roles import get_role%0A from aleph.logic.alerts import get_alert%0A from aleph.logic.collections import get_col...
9bfe2dbd37fa18ed7915e82dc8dc8515d7fe9a76
Terminate child processes on SIGTERM signal
alfred_collector/__main__.py
alfred_collector/__main__.py
import argparse import yaml from .process import CollectorProcess def get_config(path): with open(path) as file: return yaml.load(file) def main(): parser = argparse.ArgumentParser() parser.add_argument('config') args = parser.parse_args() config = get_config(args.config) processes...
Python
0
@@ -16,19 +16,63 @@ %0Aimport -yam +signal%0Aimport yaml%0Afrom functools import partia l%0Afrom . @@ -189,16 +189,213 @@ file)%0A%0A%0A +def terminate_processes(processes, signum, frame):%0A for process in processes:%0A if process is not None and process.is_alive():%0A process.terminate()%0A ...
816bec01d51a93567db6838f5afa57913ecc538c
Fix collections.iterable warning (#553)
algorithms/arrays/flatten.py
algorithms/arrays/flatten.py
""" Implement Flatten Arrays. Given an array that may contain nested arrays, produce a single resultant array. """ from collections import Iterable # return list def flatten(input_arr, output_arr=None): if output_arr is None: output_arr = [] for ele in input_arr: if isinstance(ele, Iterable): ...
Python
0
@@ -124,16 +124,20 @@ lections +.abc import
d590178fd99904d96f57cd297e84dac8998e3b48
add wtforms required validator
amgut/handlers/add_sample.py
amgut/handlers/add_sample.py
from wtforms import Form, SelectField, DateField, DateTimeField, TextField from tornado.web import authenticated from future.utils import viewitems from amgut.connections import ag_data from amgut.handlers.base_handlers import BaseHandler from amgut import media_locale class LogSample(Form): barcode = SelectFiel...
Python
0.000001
@@ -13,16 +13,17 @@ import +( Form, Se @@ -68,16 +68,50 @@ extField +,%0A validators) %0Afrom to @@ -354,121 +354,385 @@ eld( -)%0A sample_site = SelectField()%0A sample_date = DateField(format='%25m/%25d/%25Y')%0A sample_time = DateTimeField( +validators=%5Bvalidators.required(%22Re...
a2c97e53425ce1f12859daacd845778740d70fc7
Add master and foreground opts to swarm
tests/minionswarm.py
tests/minionswarm.py
#/usr/bin/env python ''' The minionswarm script will start a group of salt minions with different ids on a single system to test scale capabilities ''' # Import Python Libs import os import optparse import subprocess import tempfile # Import third party libs import yaml def parse(): ''' Parse the cli options...
Python
0
@@ -226,16 +226,30 @@ tempfile +%0Aimport shutil %0A%0A# Impo @@ -550,16 +550,443 @@ o make') +%0A parser.add_option('--master',%0A dest='master',%0A default='salt',%0A help='The location of the salt master that this swarm will serve')%0A parser.add_option('-f',%0A '...
a506a4274e2d97fc58341ad3b9cf8400a42b68d2
Fix a wrong docstring.
alphafold_casp13/two_dim_convnet.py
alphafold_casp13/two_dim_convnet.py
# Lint as: python3. # Copyright 2019 DeepMind Technologies Limited # # 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 a...
Python
0.999999
@@ -614,45 +614,55 @@ %0A%22%22%22 -One +Two dim - convnet for angles prediction +ensional convolutional neural net layers .%22%22%22
6cbea7aeca0a8ed9479aa7dbfb89bf6dc2d2c3ac
Remove debug statement.
butterfly/AccessLayer/API.py
butterfly/AccessLayer/API.py
from RequestHandler import RequestHandler from QueryLayer import InfoQuery from QueryLayer import DataQuery from urllib2 import HTTPError import numpy as np class API(RequestHandler): def parse(self, *args): meth = str(args[0]) meths = self.INPUT.METHODS.LIST command = self._match_list('me...
Python
0.000001
@@ -2752,39 +2752,8 @@ %5B%5D)%0A - print valid_groups%0A
93014d525861f278aa60acace5ec15cae106ef25
fix typo and missing argument
invenio/modules/access/mailcookie.py
invenio/modules/access/mailcookie.py
# This file is part of Invenio. # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2013 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any l...
Python
0
@@ -75,16 +75,22 @@ 11, 2013 +, 2015 CERN.%0A# @@ -1116,20 +1116,8 @@ %22%22%0A%0A -import sys%0A%0A from @@ -1213,22 +1213,16 @@ import -(%0A InvenioW @@ -1248,49 +1248,8 @@ rror -, InvenioWebAccessMailCookieDeletedError) %0Afro @@ -1758,18 +1758,17 @@ me: whet -ev +h er to re @@ -4166,16 +4166,18 @@ ...
62e928992acf943b42dec761ee75bf1609e9c591
Update inputs.py
haystack/inputs.py
haystack/inputs.py
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import re import warnings from django.utils.encoding import force_text, python_2_unicode_compatible @python_2_unicode_compatible class BaseInput(object): """ The base input type. Doesn't do much. You want `...
Python
0.000002
@@ -598,18 +598,8 @@ self -.__str__() )%0A%0A
8a0ef4134b6aefbaf9b6e49fc0a3e88dcf426558
Add automate build fonts engine
common/libfont/wasm/build/make.py
common/libfont/wasm/build/make.py
#!/usr/bin/env python import sys sys.path.append('../../../../../build_tools/scripts') import base import os base.configure_common_apps() freetype_version = "2.10.1" freetype_name = "freetype-" + freetype_version # fetch emsdk if not base.is_dir("emsdk"): base.cmd("git", ["clone", "https://github.com/emscripten-c...
Python
0.000001
@@ -4445,17 +4445,16 @@ =%5B%5D;%22, %22 -' __ATPOST
917b84f4d985e211168967c2fda6ea0b0b2ffe61
Add explicit branching in AirVisual diagnostics (#64493)
homeassistant/components/airvisual/diagnostics.py
homeassistant/components/airvisual/diagnostics.py
"""Diagnostics support for AirVisual.""" from __future__ import annotations from types import MappingProxyType from typing import Any from homeassistant.components.diagnostics import REDACTED from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITU...
Python
0
@@ -997,16 +997,18 @@ +el if isins
50b0f2e7f271fa4db2e507d0eaa559c31aecc1ee
Fix atom feed
indico/web/http_api/metadata/atom.py
indico/web/http_api/metadata/atom.py
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
Python
0.000001
@@ -725,77 +725,121 @@ %3E.%0A%0A -# python stdlib imports%0Afrom pyatom import AtomFeed%0A%0A# indico imports +from datetime import datetime%0A%0Aimport dateutil.parser%0Afrom pyatom import AtomFeed%0Afrom pytz import timezone, utc%0A %0Afro @@ -883,26 +883,8 @@ None -%0A%0A# module imports %0Afro @@ -945,16 +945,...
b11af5e6f8e8bd7fcf7a6687248f672cc7c992ea
Fix Garmin Connect sensor dependency import (#52306)
homeassistant/components/garmin_connect/sensor.py
homeassistant/components/garmin_connect/sensor.py
"""Platform for Garmin Connect integration.""" from __future__ import annotations import logging from garminconnect_aio import ( GarminConnectAuthenticationError, GarminConnectConnectionError, GarminConnectTooManyRequestsError, ) from homeassistant.components.sensor import SensorEntity from homeassistant...
Python
0
@@ -115,11 +115,10 @@ ect_ +h a -io imp
75ceaa5fa01291eea0e01281c3d1ecda77200099
Fix AppELB unit tests.
tests/test_appelb.py
tests/test_appelb.py
# Copyright 2016 Capital One Services, 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 agreed to in...
Python
0
@@ -674,21 +674,22 @@ ces. +app elb -v2 import ELBV @@ -684,21 +684,22 @@ import +App ELB -V2 %0A%0Aclass @@ -766,37 +766,38 @@ self.patch( +App ELB -V2 , 'executor_fact @@ -1168,37 +1168,38 @@ self.patch( +App ELB -V2 , 'executor_fact @@ -1715,37 +1715,38 @@ self.patch( +App ELB -V2 ...
beb78f4bc5e6b94666e0beb0488ee03b7054cdf1
Remove redundant function
cartodbsync/synchronizers.py
cartodbsync/synchronizers.py
import traceback from django.conf import settings from django.contrib.gis.geos import GEOSGeometry from cartodb import CartoDBAPIKey, CartoDBException from .models import SyncEntry class BaseSynchronizer(object): """ The base class for synchronizing a model with a CartoDB table. The general outline fo...
Python
0.999981
@@ -897,36 +897,39 @@ es)%0A -self +entries .mark_as_success @@ -929,23 +929,16 @@ success( -entries )%0A @@ -1109,20 +1109,23 @@ -self +entries .mark_as @@ -1132,23 +1132,16 @@ _failed( -entries )%0A%0A d @@ -4853,152 +4853,4 @@ sql%0A -%0A def mark_as_success(self, entries):%...
d70dd64604ff587bdd3821b6f15228a9537aa5ac
Extend User class to include email and photo_url
hangups/user.py
hangups/user.py
"""User objects.""" import logging from collections import namedtuple logger = logging.getLogger(__name__) DEFAULT_NAME = 'Unknown' UserID = namedtuple('UserID', ['chat_id', 'gaia_id']) class User(object): """A chat user. Handles full_name or first_name being None by creating an approximate first_nam...
Python
0
@@ -431,16 +431,34 @@ st_name, + photo_url, email, is_self @@ -460,16 +460,16 @@ _self):%0A - @@ -721,16 +721,78 @@ t()%5B0%5D)%0A + self.photo_url = photo_url%0A self.email = email%0A @@ -1208,24 +1208,118 @@ first_name,%0A + entity.properties.photo_url,%0A ...
59dc8335672744db64afd334c2483f576cecea78
update tomcat war_deployed state tests
tests/unit/states/tomcat_test.py
tests/unit/states/tomcat_test.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>` ''' # Import Python Libs from __future__ import absolute_import # Import Salt Testing Libs from salttesting import TestCase, skipIf from salttesting.helpers import ensure_in_syspath from salttesting.mock import ( MagicMock,...
Python
0
@@ -1168,37 +1168,38 @@ n': 'jenkins-1.2 +0 .4',%0A - @@ -1302,33 +1302,35 @@ t': %7B'version': -1 +'1' %7D%7D,%0A @@ -1509,33 +1509,35 @@ t': %7B'version': -1 +'1' %7D%7D,%0A @@ -1575,33 +1575,35 @@ t': %7B'version': -1 +'1' %7D%7D%5D)%0A wit @@ -1909,27 +190...
0e2717703e3e72b8e9a5660ccfa0ff847c1df139
support initial config loading prior to reactor execution loop so that port config may be read early
server/config.py
server/config.py
''' See LICENSE for license information. This file contains the server's loop control. It is decoupled from the code run within the main loop. This allows the main loop to be reloaded and updated at runtime. ''' ## # Built-in modules ## import platform.python_version as py_version if py_version.startswith('2.'): ...
Python
0
@@ -1670,32 +1670,147 @@ e.%0A '''%0A%0A + # Placeholder encryption key for use when writing secure data to disk.%0A self.encryption_key = None%0A%0A # Ensure @@ -1960,123 +1960,8 @@ ()%0A%0A - # Placeholder encryption key for use when writing secure data to disk.%0A self.e...
7499703380a2b02149efa5845fcceb1f98b119bc
save with another name function aded
lokingyql/contrib/opentable/yqltable.py
lokingyql/contrib/opentable/yqltable.py
from xml.dom import minidom from xml.etree import cElementTree as xtree class YqlTable(object): """Class representating a YQL Table """ _TAB_ATTR = {'xmlns':'', 'securityLevel':'any', 'https':'false'} def __init__(self, name, author, apiKeyURL, documentationURL, sampleQuery, description=None, table_a...
Python
0.000001
@@ -1123,32 +1123,44 @@ _file(self, data +, fname=None ):%0A %22%22%22Cr @@ -1248,16 +1248,76 @@ t(data)%0A + %0A if not fname:%0A fname = self.name %0A @@ -1327,21 +1327,17 @@ th open( -self. +f name+%22.x @@ -2720,16 +2720,27 @@ ave(self +, name=None ):%0A @@ -2827,...
8f63bad91d956d27279a1c2c5cd3de9b704f6856
fix BasicObject#!
rupypy/objects/objectobject.py
rupypy/objects/objectobject.py
from pypy.rlib import jit from pypy.rlib.objectmodel import compute_unique_id, compute_identity_hash from rupypy.mapdict import MapTransitionCache from rupypy.module import ClassDef class ObjectMetaclass(type): def __new__(cls, name, bases, attrs): new_cls = super(ObjectMetaclass, cls).__new__(cls, name,...
Python
0
@@ -1810,217 +1810,52 @@ -equal = space.newsymbol(%22equal?%22)%0A return space.newbool(%0A space.is_true(space.send(self, equal, %5Bspace.w_false%5D)) or%0A space.is_true(space.send(self, equal, %5Bspace.w_nil%5D))%0A +return space.newbool(not space.is_true(self) )%0A%0A
6f6376711ed5ffeb4c3bf226eef8c4b72b94870e
Fix Amazon Digital source
sacad/sources/amazondigital.py
sacad/sources/amazondigital.py
import collections import logging import urllib.parse import lxml.cssselect import lxml.etree import requests from sacad.cover import CoverImageFormat, CoverSourceQuality, CoverSourceResult, USER_AGENT from .base import CoverSource class AmazonDigitalCoverSourceResult(CoverSourceResult): def __init__(self, *args...
Python
0.000615
@@ -1403,35 +1403,37 @@ results_selector +s = +( lxml.cssselect.C @@ -1452,19 +1452,19 @@ div# -mp3AlbumsBa +dm_mp3Playe r di @@ -1474,16 +1474,118 @@ p3Cell%22) +,%0A lxml.cssselect.CSSSelector(%22div#dm_mp3Player li.s-mp3-federated-bar-item%22)) %0A img @@ -1593,19 +1593,21 @@ sel...
3aadc8a8c469dcaad7217fea82b3ef92c7e9934d
remove unused Mixin
wampy/roles/publisher.py
wampy/roles/publisher.py
import logging from wampy.errors import WampyError from wampy.messages.publish import Publish logger = logging.getLogger('wampy.publishing') class PublishProxy: def __init__(self, client): self.client = client def __call__(self, *unsupported_args, **kwargs): if len(unsupported_args) != 0:...
Python
0.000001
@@ -802,107 +802,4 @@ ge)%0A -%0A%0Aclass PublisherMixin:%0A%0A @property%0A def publish(self):%0A return PublishProxy(client=self)%0A
5d4f3bace422cbed32195ea8e6d4caa6473599b9
use mongodb as cache
waskr/engines/mongodb.py
waskr/engines/mongodb.py
# Implementation Engine for MongoDB from pymongo import Connection, DESCENDING from time import time, strftime, gmtime from waskr.config import options from waskr import log class Stats(object): def __init__(self, config=None, test=False): config = options(config) try: self.connectio...
Python
0.000003
@@ -643,32 +643,73 @@ f.waskr%5B'user'%5D%0A + self.cache = self.waskr%5B'cache'%5D%0A log.data @@ -918,91 +918,8 @@ er'%5D -%0A self.cache = %7B%7D%0A self.cache_size = 100%0A self.cache_keys = %5B%5D %0A%0A @@ -3733,32 +3733,82 @@ $lt%22: time()%7D%7D)%0A + total = re...
6f7f0ee8f143c97d36aa262ff0bf7a6613bec1b7
Remove execute permission on durationfield's __init__.py
thecut/durationfield/__init__.py
thecut/durationfield/__init__.py
# -*- coding: utf-8 -*- """Create new django model field (extended CharField) to accept ISO 8601 defined representation. http://en.wikipedia.org/wiki/ISO_8601#Durations P is the duration designator (historically called "period") placed at the start of the duration representation. --- Y is the year designator that fol...
Python
0.000005
547f5c7de0803bbec9873db7e613d3ff7cad24ed
Add server logging to contrib operations
indico/modules/events/contributions/operations.py
indico/modules/events/contributions/operations.py
# This file is part of Indico.# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at...
Python
0.000001
@@ -818,16 +818,71 @@ port db%0A +from indico.modules.events.contributions import logger%0A from ind @@ -955,16 +955,16 @@ ibution%0A - from ind @@ -1185,21 +1185,112 @@ h()%0A +logger.info('Contribution %7B%7D created by %7B%7D'.format(contrib, session.user))%0A contrib. event +_new .log(Eve @@ -1344,32 ...
e6f05a4e9e6fa969f636a3491c3f36f1a7b4fc36
Update name field help text
helios/forms.py
helios/forms.py
""" Forms for Helios """ from django import forms from models import Election from widgets import * from fields import * from django.conf import settings from django.utils.translation import ugettext as _ class ElectionForm(forms.Form): short_name = forms.SlugField(max_length=25, label=_("Short name"), help_te...
Python
0.000001
@@ -574,16 +574,44 @@ Election +. Maximum of 250 characters. '))%0A de
c24b1eb0e269c9cd59b7ae0d9a4388fc8264b188
Add a failing test for the linebreak presence
tests/test_merger.py
tests/test_merger.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_igenstrings ---------------------------------- Tests for `igenstrings` module. """ import os import unittest from codecs import open from py import path import pytest from igenstrings.merger import Merger @pytest.fixture(autouse=True) def initdir(tmpdir): ...
Python
0.000004
@@ -1796,20 +1796,497 @@ u doing' in content%0A +%0A%0Adef test_linebreak_between_strings():%0A merger = Merger('tests/objc/existing', None)%0A merger.merge_localized_strings()%0A content = None%0A with open('tests/objc/existing/en.lproj/Localizable.strings', encoding='utf16', mode='r') as en_locale_file:%...
692fe65ca9d24286d10e542c5028924a22036362
Add encoding and unicode literals import
tests/test_models.py
tests/test_models.py
import pytest import turbasen @pytest.fixture def configure_dev(): turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/') @pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason="API key not set") def test_get(configure_dev): sted = turbasen.Sted.get('52407fb375049e561500004e') ...
Python
0.000008
@@ -1,12 +1,71 @@ +# encoding: utf-8%0Afrom __future__ import unicode_literals%0A%0A import pytes
50bb03002c04512c858e97f29ad1c8ea15fef701
Edit staff and fellow ids
tests/test_people.py
tests/test_people.py
from models.people import Person, Fellow, Staff from unittest import TestCase class PersonTestCases(TestCase): """Tests the functionality of the person parent class """ def setUp(self): """Passes an instance of class Person to all the methods in this class """ self.person = Person(...
Python
0
@@ -906,10 +906,10 @@ 'fel +4 3 -6 ')%0A%0A @@ -1329,8 +1329,8 @@ stf4 -1 +8 ')%0A
76345d06e3b2a99c90d9e66d96ede165c69d8d9e
Clean up
scripts-test/Audio/DrawbotAIFFVisualize.py
scripts-test/Audio/DrawbotAIFFVisualize.py
from math import sin, pi, sqrt from robofab.pens.filterPen import flattenGlyph def distance(p0, p1, doRound=False): # Calculate the distance between two points d = sqrt((p0[0] - p1[0]) ** 2 + (p0[1] - p1[1]) ** 2) if doRound: return int(round(d)) else: return d class AIFFVisualize(obj...
Python
0.000002
@@ -1,12 +1,64 @@ +# Run this script in the RoboFont Drawbot extension%0A from math im @@ -342,16 +342,17 @@ turn d%0A%0A +%0A class AI @@ -494,39 +494,8 @@ 280%0A - self.mark_fill = False%0A @@ -1641,499 +1641,8 @@ %0A - def _drawMetrics(self, glyph):%0A save()%0A stroke(0.7)%0A ...
dbc36d61137521178321f7e69a601f05a88a4db8
Remove old structure test
tests/test_schema.py
tests/test_schema.py
from common import * class TestSchema(TestCase): def setUp(self): sg = Shotgun() self.sg = self.fix = fix = Fixture(sg) proj = fix.Project('Test Project ' + mini_uuid()) seqs = [proj.Sequence(code, project=proj) for code in ('AA', 'BB')] shots...
Python
0.000005
@@ -1935,797 +1935,8 @@ 0)%0A - %0A def test_structure(self):%0A %0A entities = %5Bself.sgfs.session.merge(x) for x in self.tasks%5B:%5D%5D%0A self.sgfs.session.fetch_heirarchy(entities)%0A %0A print 'ENTITIES'%0A entities%5B0%5D.project().pprint(backrefs=3)%0A ...
abd53f3dba7b2cca7dbe50cf83b3622048771a99
add test_report() test
tests/test_script.py
tests/test_script.py
import os.path import subprocess import sys DIR = os.path.dirname(os.path.abspath(__file__)) REPO = os.path.dirname(DIR) def call_vulture(args, **kwargs): return subprocess.call( [sys.executable, 'vulture.py'] + args, cwd=REPO, **kwargs) def test_script(): assert call_vulture(['whitelist.py', 'vul...
Python
0.000004
@@ -376,16 +376,30 @@ ulture(%5B +'vulture.py', '--exclu @@ -545,16 +545,82 @@ %5B'tests'%5D) == 0%0A +%0A%0Adef test_report():%0A assert call_vulture(%5B'vulture.py'%5D) == 1%0A
ad2ca3753ac73feccb68472c1c18f1f9201d958f
Remove now pointless test
tests/test_simple.py
tests/test_simple.py
#!/usr/bin/env python3 from nose.tools import eq_ from resumable import rebuild, value def test_simple(): @rebuild def function(original): return value(original.upper()) original = 'hello' original = function['function'](original) eq_(original, 'HELLO') def test_value(): @rebuild...
Python
0
@@ -287,216 +287,8 @@ )%0A%0A%0A -def test_value():%0A @rebuild%0A def function(original):%0A return value(original + ' world')%0A%0A original = 'hello'%0A%0A original = function%5B'function'%5D(original)%0A%0A eq_(original, 'hello world')%0A%0A%0A def
b82cf905280a3be91dcd3ac536495643f435f7b1
fix thing
helpmio/chat.py
helpmio/chat.py
import uuid import helpmio.event class ChatRoom: def __init__(self, asker_name): self._connected_users = dict() self._all_users = dict() self._chat_history = [] self.on_connect = helpmio.event.EventDispatcher() self.on_disconnect = helpmio.event.EventDispatcher() s...
Python
0.000006
@@ -982,45 +982,132 @@ -return self._all_users%5Bconnection_id%5D +if connection_id in self._all_users:%0A return self._all_users%5Bconnection_id%5D%0A else:%0A return None %0A%0A
1fdd2c838f0a947ff34770ba4660c4662adfeb32
Allow deciseconds
graphenecommon/utils.py
graphenecommon/utils.py
import re import time from datetime import datetime, timezone timeFormat = "%Y-%m-%dT%H:%M:%S" def formatTime(t): """ Properly Format Time for permlinks """ if isinstance(t, float): return datetime.utcfromtimestamp(t).strftime(timeFormat) if isinstance(t, datetime): return t.strftime...
Python
0.000564
@@ -1,12 +1,36 @@ +# -*- coding: utf-8 -*-%0A import re%0Aim @@ -420,32 +420,45 @@ rmlinks%0A %22%22%22%0A + try:%0A return datet @@ -477,32 +477,143 @@ (t, timeFormat)%0A + except Exception:%0A # Allow deci seconds%0A return datetime.strptime(t, %22%25Y-%25m-%25dT%25H:%25M:%25S.%25f%...
0336e25fd8d933ecd37eaa74370e32fefbfa5893
Define simulation setup variable before init
thermof/simulation/simulation.py
thermof/simulation/simulation.py
# Date: August 2017 # Author: Kutay B. Sezginel """ Simulation class for reading and initializing Lammps simulations """ import os import yaml import shutil from thermof.parameters import Parameters from thermof.read import read_run, read_trial, read_trial_set from thermof.initialize.lammps import write_lammps_files, w...
Python
0.000001
@@ -665,32 +665,59 @@ ct.%0A %22%22%22%0A + self.setup = '---'%0A if param @@ -2521,32 +2521,97 @@ on.%0A %22%22%22%0A + self.setup = '%7C'.join(self.parameters%5B'thermof'%5D%5B'fix'%5D)%0A self.set
2a38fd96cba20048264a67980b552489c8c2762f
Support for direct assignment of values of function calls
thinglang/parser/symbols/base.py
thinglang/parser/symbols/base.py
import struct from thinglang.compiler import CompilationContext, BytecodeSymbols from thinglang.lexer.tokens import LexicalToken from thinglang.lexer.tokens.base import LexicalIdentifier from thinglang.parser.symbols import BaseSymbol from thinglang.utils.type_descriptors import ValueType class AssignmentOperation(B...
Python
0
@@ -229,16 +229,74 @@ eSymbol%0A +from thinglang.parser.symbols.functions import MethodCall%0A from thi @@ -1583,16 +1583,213 @@ ntext):%0A + if self.value.implements(MethodCall):%0A self.value.compile(context, returns=True)%0A context.append(BytecodeSymbols.set(self.target))%0A e...
2b6f48110050443424469ad1c78e9e847de4650f
Update core.py
graphite_beacon/core.py
graphite_beacon/core.py
import os from re import compile as re, M import json import logging from tornado import ioloop, log, web from .alerts import BaseAlert from .utils import parse_interval from .handlers import registry LOGGER = log.gen_log COMMENT_RE = re('//\s+.*$', M) class Reactor(object): class UpdateHandler(web.RequestH...
Python
0.000001
@@ -391,16 +391,25 @@ = react +%5B'react'%5D %0A @@ -3707,21 +3707,35 @@ andler, +dict('react'= self) +) %0A
fab3a21e70b9ee83b948c0698b25639f374d5851
fix bug - deduplicator
intelmq/bots/experts/deduplicator/deduplicator.py
intelmq/bots/experts/deduplicator/deduplicator.py
from copy import copy from intelmq.lib.bot import Bot, sys from intelmq.lib.cache import Cache from intelmq.lib.message import Event class DeduplicatorBot(Bot): def init(self): self.cache = Cache( self.parameters.redis_cache_host, self.parameter...
Python
0.000002
@@ -10,16 +10,20 @@ import +deep copy%0Afro @@ -686,16 +686,20 @@ event = +deep copy(mes @@ -1009,81 +1009,81 @@ elf. -send_message(message)%0A self.cache.set(message_hash, 'hash' +cache.set(message_hash, 'hash')%0A self.send_message(message )%0A%0A
04319b38278269d34d253c4be973c1309edc579c
Add missing no cover to util
thinc/neural/util.py
thinc/neural/util.py
from __future__ import print_function, unicode_literals import numpy from .ops import NumpyOps, CupyOps def get_ops(ops): if ops in ('numpy', 'cpu'): return NumpyOps() elif ops in ('cupy', 'gpu'): return CupyOps() else: raise ValueError("TODO error %s" % ops) def mark_sentence_bo...
Python
0.000001
@@ -653,16 +653,35 @@ rop=0.): + # pragma: no cover %0A ops
48bd2c193d45d3629de623e220508ab6b23f9a3b
Use default font (#1865)
vision/cloud-client/face_detection/faces.py
vision/cloud-client/face_detection/faces.py
#!/usr/bin/env python # Copyright 2015 Google, 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...
Python
0
@@ -827,19 +827,8 @@ Draw -, ImageFont %0A# %5B @@ -2147,55 +2147,8 @@ ize%0A - font = ImageFont.truetype(%22arial.ttf%22, 25)%0A @@ -2646,19 +2646,8 @@ - font=font, fil
d06f526923a730d20c608c94a815fd604e4e62ee
Tidy sandbox view for readability
sandbox/apps/checkout/views.py
sandbox/apps/checkout/views.py
from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib import messages from django.conf import settings from oscar.apps.checkout.views import PaymentDetailsView as OscarPaymentDetailsView from oscar.apps.payment.forms import BankcardForm from oscar.apps.payment.mo...
Python
0
@@ -437,13 +437,9 @@ w):%0A - %0A + @@ -700,543 +700,8 @@ tx%0A%0A - def do_place_order(self, request):%0A bankcard_form = BankcardForm(request.POST)%0A if not bankcard_form.is_valid():%0A messages.error(request, %22Invalid submission%22)%0A return HttpResponseRedirec...
acd374e2515ed3eec5a5b2b8d09b24155b312d94
fix User-Agent
DDDProxy/webHandler.py
DDDProxy/webHandler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2015年1月11日 @author: dxw ''' from gittornado import BaseHandler import tornado import DDDProxyConfig from DDDProxy import domainConfig from DDDProxy.hostParser import parserUrlAddrPort, getDomainName import json from DDDProxy.server import baseServer class D...
Python
0.999733
@@ -649,16 +649,21 @@ est.uri, +%0A%09%09%09%09 self.req @@ -688,16 +688,64 @@ -Agent%22%5D + if %22User-Agent%22 in self.request.headers else %22%22 ),%0A%09%09%09%09%09
ad56a9cac7f0e62ef901a52589a62be3a2c81c46
Add secret key to testing settings
api/settings/testing.py
api/settings/testing.py
from .base import * ADMINS = ( ('Lyndon Garvey', 'lyndon.garvey@digital.justice.gov.uk'), )
Python
0
@@ -89,8 +89,59 @@ .uk'),%0A) +%0A%0ASECRET_KEY = %22Trdfgjgfghfdgjlfdtr_+@3gvuedrs873w%22
7c91cfa7e68d4f9b54a4380915235d5a443e0dc3
Remove benchmark in create_record
src/ggrc/fulltext/sql.py
src/ggrc/fulltext/sql.py
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """SQL routines for full-text indexing.""" from ggrc import db from ggrc.fulltext import Indexer from ggrc.utils import benchmark class SqlIndexer(Indexer): def create_record(self, record, commit=True):...
Python
0
@@ -208,41 +208,8 @@ xer%0A -from ggrc.utils import benchmark%0A %0A%0Acl @@ -285,85 +285,8 @@ e):%0A - with benchmark(%22Add fulltext records: create_record -%3E submit to db%22):%0A @@ -327,26 +327,24 @@ es.items():%0A - for su @@ -376,26 +376,24 @@ ue.items():%0A - if c @@ -406,26...
2f079a638b5af53f5e1548d44e439591d299be0a
provide urls for bug reports. refs #20
h1ds_summary/version.py
h1ds_summary/version.py
""" Current h1ds_summary version constant plus version pretty-print method. Code copied from Fabric: https://github.com/bitprophet/fabric/raw/master/fabric/version.py This functionality is contained in its own module to prevent circular import problems with ``__init__.py`` (which is loaded by setup.py during insta...
Python
0.999556
@@ -727,16 +727,176 @@ l', 0)%0A%0A +def get_module_urls():%0A return (%22https://code.h1svr.anu.edu.au/projects/h1ds-summary%22, %22https://code.h1svr.anu.edu.au/projects/h1ds-summary/issues/new%22, )%0A%0A%0A def get_
b1b2a3db2bc2e764e895dacf1c44ed1e674c7270
Update validate.py
hug/validate.py
hug/validate.py
"""hug/validate.py Defines hugs built-in validation methods Copyright (C) 2016 Timothy Edmund Crosley 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 limi...
Python
0.000001
@@ -2253,18 +2253,8 @@ elds -, **kwargs ):%0A
70593ae9b29577cc9b038209c8fa173cf3883e47
Update tweetimporter.py
libraries/tweetimporter.py
libraries/tweetimporter.py
import unicodedata class TweetImporter(object): def __init__(self, twitter_client, database): self.twitter_client = twitter_client self.database = database def importData(self, user, tweets_number=10): followers = self.twitter_client.followers_list(screen_name=user, count=1) f...
Python
0
@@ -934,37 +934,8 @@ -id_string = str(i)+%22_%22+str(j) %0A @@ -1222,18 +1222,8 @@ ble( -id_string, %0A @@ -1352,8 +1352,9 @@ _string) +%0A
a90554993c47987f9b253330a8858dad254766ec
Fix variable.
Demo/scripts/script.py
Demo/scripts/script.py
#! /usr/bin/env python # script.py -- Make typescript of terminal session. # Usage: # -a Append to typescript. # -p Use Python as shell. # Author: Steen Lumholt. import os, time, sys, getopt import pty def read(fd): data = os.read(fd, 1024) file.write(data) return data shell = 'sh...
Python
0.000003
@@ -268,20 +268,22 @@ 24)%0A -file +script .write(d
ec0ec8a36e45f68676aa88ba5dbf7889cf1aab79
Improve logging
src/sentry/tasks/sync_docs.py
src/sentry/tasks/sync_docs.py
from __future__ import absolute_import, print_function import logging from sentry.tasks.base import instrumented_task BASE_URL = 'https://docs.getsentry.com/hosted/_platforms/{}' logger = logging.getLogger('sentry') def get_integration_id(platform_id, integration_id): if integration_id == '_self': ret...
Python
0.00001
@@ -1603,16 +1603,19 @@ n for %25s +.%25s integra @@ -1620,16 +1620,53 @@ ration', +%0A platform_id, integra
df4efce256939a25fac097b521df0d97b9abdb33
update cnvnator_to_bedpes.py to take cnvkit input
scripts/cnvanator_to_bedpes.py
scripts/cnvanator_to_bedpes.py
#!/usr/bin/env python import sys import numpy as np from optparse import OptionParser def interval_to_bedpe(size, call, sv_type, i): half = size/2 chrom,interval = call.split(':') start,end = [int(x) for x in interval.split('-')] length = end-start bedpe = '\t'.join([chrom, s...
Python
0
@@ -795,24 +795,154 @@ NVanator%22)%0A%0A +parser.add_option(%22--cnvkit%22,%0A action=%22store_true%22,%0A default=False,%0A help=%22input is .cns file from cnvkit%22)%0A%0A parser.add_o @@ -1762,16 +1762,41 @@ o,'w')%0A%0A +cnvkit = options.cnvkit%0A%0A i = 1%0Afo @@ -1848,287 +1848,588 @@ ...
178706a02264388369d715b7dae6b7059bfdce88
Set declaration_made flag on dashboard
app/main/views/frameworks.py
app/main/views/frameworks.py
from flask import render_template, request, abort, flash, redirect, url_for, escape, current_app from flask_login import login_required, current_user from dmutils.apiclient import APIError from dmutils import flask_featureflags from dmutils.email import send_email, MandrillException from ...main import main, declarat...
Python
0
@@ -881,32 +881,308 @@ e.status_code)%0A%0A + try:%0A declaration_made = bool(data_api_client.get_selection_answers(%0A current_user.supplier_id, 'g-cloud-7'))%0A except APIError as e:%0A if e.status_code == 404:%0A declaration_made = False%0A else:%0A abort(...
75080e6f0da4f699ef1eb89310847befeccfab40
Check for deprecation on import is problematic. Rather just check that filter can be imported normally.
skimage/filter/tests/test_filter_import.py
skimage/filter/tests/test_filter_import.py
from skimage._shared.utils import all_warnings, skimage_deprecation from numpy.testing import assert_warns def import_filter(): from skimage import filter as F assert('sobel' in dir(F)) def test_filter_import(): with all_warnings(): assert_warns(skimage_deprecation, import_filter)
Python
0
@@ -2,28 +2,54 @@ rom -skimage._shared.util +numpy.testing import assert_warns%0Afrom warning s im @@ -53,19 +53,21 @@ import -all +catch _warning @@ -74,92 +74,113 @@ s, s -k im -age_deprecation%0Afrom numpy.testing import assert_warns%0A%0Adef import_filter():%0A +plefilter%0A%0Adef test_import_filter():%0A ...
3778014fb18f5a34a214d0fae3f7b57ab866284a
Exclude MPs who are no longer members of a fraction.
manoseimas/mps_v2/views.py
manoseimas/mps_v2/views.py
from django.shortcuts import render from django.utils.safestring import mark_safe from couchdbkit.exceptions import ResourceNotFound from sboard.models import couch from manoseimas.mps.nodes import prepare_position_list from .models import ParliamentMember, GroupMembership, Group def mp_list(request, fraction_slu...
Python
0
@@ -766,32 +766,57 @@ mps = map( -extract, +%0A extract,%0A ParliamentM @@ -851,17 +851,99 @@ fraction -) +,%0A groupmembership__until=None)%0A )%0A el
357f0f037b77e51e25a3d89ac7e9feac8ae8d472
make legacy merge MRMS more forgiving
scripts/iemre/merge_mrms_q2.py
scripts/iemre/merge_mrms_q2.py
''' Merge the 1km Q2 24 hour precip data estimates ''' import datetime import sys import pytz import numpy as np from PIL import Image import pyiem.mrms as mrms from pyiem import iemre from pyiem.util import ncopen def run(ts): """Actually do the work, please""" nc = ncopen(iemre.get_daily_mrms_ncname(ts.yea...
Python
0.000001
@@ -1,12 +1,11 @@ -'''%0A +%22%22%22 Merge th @@ -46,12 +46,11 @@ ates -%0A''' +%22%22%22 %0Aimp @@ -72,16 +72,26 @@ port sys +%0Aimport os %0A%0Aimport @@ -219,16 +219,339 @@ copen%0A%0A%0A +def findfile(ts):%0A %22%22%22See if we can find a file to use%22%22%22%0A for hr in %5B0, -1, 1, -2, 2, -3, 3%5D:%0...
d2328c28c89c1700906244610e92854c578e1262
test now a package
test/test.py
test/test.py
""" Run all the myhdl unit tests. """ import unittest from myhdl import test_all unittest.main(defaultTest='test_all.suite', testRunner=unittest.TextTestRunner(verbosity=2))
Python
0
@@ -59,16 +59,21 @@ om myhdl +.test import
3b4dc1aefe17d14ad74edbdfa133b26247880f73
Update run_init_temp.py
scripts/tests/run_init_temp.py
scripts/tests/run_init_temp.py
import os import sys pwd =os.getcwd() tpath = 'vtr_flow_holder' design = 'diffeq1' wrksp = 'workspace_holder' proc_num = 1 datpath = sys.path[0] srcFile = datpath+"/run_DATuner_arg.py" rep_cmd = "sed -e \"s:TOOL_PATH_HOLD:"+tpath+":g\" -e \"s:DESIGN_NAME_HOLD:"+design+":g\" -e \"s:WORK_SPACE_HOLD:"+wrksp+":g\" -e \"...
Python
0.000003
@@ -175,12 +175,8 @@ uner -_arg .py%22
2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9
Update Clock.py
service/Clock.py
service/Clock.py
# start the services python = Runtime.start("python","Python") clock = Runtime.start("clock","Clock") log = Runtime.start("log","Log") audio = Runtime.start("audio","AudioFile") # define a ticktock method def ticktock(timedata): print timedata audio.playResource("resource/Clock/tick.mp3") #create a message ...
Python
0.000001
@@ -551,8 +551,10 @@ lock(1)%0A +#%0A
b9f9068a688ab5b6154b86a02e37c7812f1f9afb
Make sure it's an iterable
hgtools/managers/cmd.py
hgtools/managers/cmd.py
import os import re import operator import itertools import collections TaggedRevision = collections.namedtuple('TaggedRevision', 'tag revision') class Command(object): def is_valid(self): try: # Check if both command and repo are valid self._invoke('status') except Exception: return False return su...
Python
0.000077
@@ -4570,22 +4570,20 @@ %22%0A%09%09 -version = next +lines = iter (sel @@ -4618,16 +4618,40 @@ lines()) +%0A%09%09version = next(lines) .strip()
65b397e3911d64e047cbb66f90cf15598f626bae
Remove unused code
seq2seq/inference/inference.py
seq2seq/inference/inference.py
# Copyright 2017 Google 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.000006
@@ -801,973 +801,8 @@ s%0A%0A%0A -def create_predictions_iter(predictions_dict, sess):%0A %22%22%22Runs prediciton fetches in a sessions and flattens batches as needed to%0A return an iterator of predictions. Yield elements until an%0A OutOfRangeError for the feeder queues occurs.%0A%0A Args:%0A predictions_dic...
7e0f53a17780cabed95082ea582f9082ec2952c4
Fix python-3.6-only syntax
marge/bot.py
marge/bot.py
import logging as log import time from datetime import datetime from tempfile import TemporaryDirectory from . import git from . import merge_request as merge_request_module from . import store from .job import MergeJob, MergeJobOptions from .project import AccessLevel, Project MergeRequest = merge_request_module.Mer...
Python
0.999147
@@ -568,17 +568,16 @@ t_regexp -, %0A ):%0A
d8c873b2c135bce14cf909086c4a7b749e013a10
Check for _type
tools/scruffy/checkers/common.py
tools/scruffy/checkers/common.py
from .. import Check from ..core import db def common_checks(obj, singular, plural): if obj.get('jurisdiction_id'): org = db.metadata.find_one({ "_id": obj['jurisdiction_id'] }) if org is None: yield Check(collection=plural, id=obj['_id'], ...
Python
0.000001
@@ -442,24 +442,239 @@ t')%0A%0A if +obj.get(%22_type%22) is None:%0A yield Check(collection=plural,%0A id=obj%5B'_id'%5D,%0A tagname='%25s-is-missing-_type' %25 (singular),%0A severity='critical')%0A%0A elif obj%5B'_type'%5D
ad79dea7e0cd0af94cc17635a9ed72995af3bbd3
Bump version to 0.0.2
setec/version.py
setec/version.py
"""Package version.""" __version__ = '0.0.1' """Current version."""
Python
0.000022
@@ -40,9 +40,9 @@ 0.0. -1 +2 '%0A%22%22
9cbc286e9e9ddeda8751250ad880b513bd28619e
Add the Twitter and Facebook IDs for testing. Refs #251
settings_test.py
settings_test.py
SQLALCHEMY_DATABASE_TEST_URI = 'postgresql://postgres:@localhost/pybossa' GOOGLE_CLIENT_ID = '' GOOGLE_CLIENT_SECRET = '' TERMSOFUSE = 'http://okfn.org/terms-of-use/' DATAUSE = 'http://opendatacommons.org/licenses/by/' ITSDANGEORUSKEY = 'its-dangerous-key' LOGO = 'logo.png' MAIL_SERVER = 'localhost' MAIL_USERNAME = Non...
Python
0.000003
@@ -115,16 +115,109 @@ ET = ''%0A +TWITTER_CONSUMER_KEY=''%0ATWITTER_CONSUMER_SECRET=''%0AFACEBOOK_APP_ID=''%0AFACEBOOK_APP_SECRET=''%0A TERMSOFU
33a7e5c9ea17111e424a312431dc8b3193162bb7
fix problem https://github.com/spesmilo/electrum/issues/454
setup-release.py
setup-release.py
""" py2app/py2exe build script for Electrum Litecoin Usage (Mac OS X): python setup.py py2app Usage (Windows): python setup.py py2exe """ from setuptools import setup import os import re import shutil import sys from lib.util import print_error from lib.version import ELECTRUM_VERSION as version name = ...
Python
0
@@ -848,12 +848,11 @@ ion= -Fals +Tru e,%0A
063425c7023811fe58ff0f38e8f978cbb1555f1b
Fix collection edit saving #1701
server/views/sources/search.py
server/views/sources/search.py
import logging from flask import jsonify, request import flask_login from server.views.media_search import media_search, collection_search from server import app from server.util.request import api_error_handler, arguments_required from server.util.tags import VALID_COLLECTION_TAG_SETS_IDS from server.auth import user...
Python
0
@@ -3020,42 +3020,8 @@ %22%22%22%0A - mc = user_mediacloud_client()%0A @@ -3162,39 +3162,74 @@ s = -mc.tagList(name_like=search_str +collection_search(search_str, False, VALID_COLLECTION_TAG_SETS_IDS )%5B:M @@ -3239,32 +3239,37 @@ SOURCES%5D%0A if +tags_ id:%0A matc
9eb97ccd871afba7f2fbd0f59771bb840a32f939
fix copy and paste leftovers
totalimpact/providers/bibjson.py
totalimpact/providers/bibjson.py
from StringIO import StringIO import json, re from totalimpact.providers import provider from totalimpact.providers.provider import Provider, ProviderContentMalformedError, ProviderTimeout, ProviderServerError from totalimpact import unicode_helpers import logging logger = logging.getLogger('ti.providers.bibjson') ...
Python
0
@@ -1495,19 +1495,20 @@ elf, bib -tex +json _content @@ -1587,19 +1587,20 @@ for bib -tex +json %22 %25 (sel @@ -1636,19 +1636,20 @@ rsed_bib -tex +json = self. @@ -1657,19 +1657,20 @@ arse(bib -tex +json _content @@ -1733,19 +1733,20 @@ rsed_bib -tex +json %5D%0A%0A
470a59a58bcfcdc8b8bae91b527e72f84ce121c8
Make update_config.py work on Ubuntu 20.04
setup_scripts/update_config.py
setup_scripts/update_config.py
#!/usr/bin/env python # Copyright 2011 Marc-Antoine Ruel. All Rights Reserved. Use of this # source code is governed by a BSD-style license that can be found in the # LICENSE file. """Updates the config files without destroying anything.""" import difflib import optparse import os import shutil import subprocess impo...
Python
0.000002
@@ -14,16 +14,17 @@ v python +3 %0A# Copyr
59c292ee1ac264985e96dc1b8a5e2e3a0d69a3b0
Make the diff line-number regex only match complete lines.
trac/Diff.py
trac/Diff.py
# -*- coding: iso8859-1 -*- # # Copyright (C) 2003, 2004 Edgewall Software # Copyright (C) 2003, 2004 Jonas Borgstrm <jonas@edgewall.com> # # Trac is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version...
Python
0.000005
@@ -919,16 +919,17 @@ ompile(' +%5E @@ %5B+-%5D( @@ -969,16 +969,17 @@ -9%5D+) @@ +$ ')%0Aspace
d0098133e3d2e7fc790d0c8714b521b00b89317f
make `ExtensionPoint` automatic documentation more useful when processed by Sphinx.
trac/core.py
trac/core.py
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2011 Edgewall Software # Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com> # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part ...
Python
0
@@ -2371,16 +2371,20 @@ lement %60 +~%25s. %25s%60%22 %25%0A @@ -2401,24 +2401,52 @@ + (self.interface.__module__, self.interf @@ -2458,16 +2458,17 @@ _name__) +) %0A%0A de
abf2d338762d0d48a3a334c607cef65fa025ac7d
Update extract_strings_qt.py
share/qt/extract_strings_qt.py
share/qt/extract_strings_qt.py
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
Python
0
@@ -182,16 +182,32 @@ ort glob +%0Aimport operator %0A%0AOUT_CP @@ -741,21 +741,9 @@ rue%0A - %0A + @@ -1192,17 +1192,16 @@ rc/*.h') - %0A%0A# xget @@ -1366,17 +1366,16 @@ _po(out) - %0A%0Af = op @@ -1615,17 +1615,61 @@ gs%5B%5D = %7B -' +%5Cn')%0Amessages.sort(key=operator.itemgetter(0) )...
356cd6568411579fa85c54c810d61ae02efbb039
Use parse_and_run in multi_command_cli
traitscli.py
traitscli.py
""" Type-safe CLI generator based on class traits. """ from traits.api import ( HasTraits, Bool, CBool, Complex, CComplex, Float, CFloat, Int, CInt, Long, CLong, Str, CStr, Unicode, CUnicode, Enum, ) _trait_simple_type_map = { Complex: complex, CComplex: complex, Float: float, CFloat: floa...
Python
0
@@ -1992,16 +1992,78 @@ gv%5B1:%5D%0A%0A + def applyargs(func, **kwds):%0A return func(**kwds)%0A%0A (dop @@ -6242,63 +6242,8 @@ %22%0A%0A%0A -def applyargs(func, **kwds):%0A return func(**kwds)%0A%0A%0A def @@ -6690,66 +6690,33 @@ -args = parser.parse_args()%0A return applyargs(**vars(ar...
f9269fe894915e0c81d4313032541085c9982533
Update interface.py
src/interface.py
src/interface.py
import socket import logger from src.logging import sys import time class interface(object): """docstring for interface""" def __init__(self, arg): super(interface, self).__init__() self.arg = arg def connection(ip = "0.0.0.0", port = 19132): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) bind = s...
Python
0.000001
@@ -198,18 +198,24 @@ = arg%0A%0A -%09%09 + def conn @@ -253,17 +253,19 @@ 9132):%0A%09 -%09 + %09s = soc @@ -312,17 +312,16 @@ GRAM)%0A%09%09 -%09 bind = s @@ -338,17 +338,16 @@ port)%0A%09%09 -%09 if not b @@ -353,18 +353,16 @@ bind:%0A%09%09 -%09 -%09 logging. @@ -404,18 +404,16 @@ %22+port)%0...
8bd9d8fbdbfd2c5ac430ef64af932c67e58b887e
Add topic-command
tsversion.py
tsversion.py
import irc3 from irc3.plugins.command import command from irc3.plugins.cron import cron from teamspeak_web_utils import latest_version @irc3.plugin class TSVersion(object): def __init__(self, bot): self.bot = bot self.client_version = None self.server_version = None config = bot.co...
Python
0
@@ -383,16 +383,137 @@ hannel') +%0A self.topic_template = config.get(%0A 'topic',%0A 'Client: %7Bclient%7D Server: %7Bserver%7D'%0A ) %0A%0A @c @@ -1581,8 +1581,417 @@ ersion)%0A +%0A @command(permission='admin')%0A def topic(self, mask, target, args):%0A '''Set t...
f22eae158e337f4438aa367c13b93bf40085f242
add def unicode in class Achievement
achievements/models.py
achievements/models.py
from django.db import models from django.contrib.auth.models import User from filebrowser.fields import FileBrowseField from django.utils.translation import ugettext_lazy as _ import validate class Category(models.Model): name = models.CharField(_("Name"), max_length=255) parent_category = models.ForeignKey('s...
Python
0.999826
@@ -912,16 +912,73 @@ ategory) +%0A %0A def __unicode__(self):%0A return self.name %0A%0Aclass
be0a878a0b8cb87491967bce30e503b62547a5c7
add class Progress
achievements/models.py
achievements/models.py
from django.db import models from django.contrib.auth.models import User from filebrowser.fields import FileBrowseField from django.utils.translation import ugettext_lazy as _ class Category(models.Model): name = models.CharField(_("Name"), max_length=255) parent_category = models.ForeignKey('self', blank=Tru...
Python
0
@@ -1003,8 +1003,192 @@ ogress%22) +%0A%0Aclass Progress(models.Model):%0A user = models.ForeignKey(User)%0A progress_achievement = models.ForeignKey(ProgressAchievement)%0A achieved_amount = models.PositiveIntegerField()
b58a856d8ec99dd5b55037859959057bbfc3b87c
bump benchmark version
shap/__init__.py
shap/__init__.py
# flake8: noqa __version__ = '0.27.3' from .explainers.kernel import KernelExplainer, kmeans from .explainers.sampling import SamplingExplainer from .explainers.tree import TreeExplainer, Tree from .explainers.deep import DeepExplainer from .explainers.gradient import GradientExplainer from .explainers.linear import ...
Python
0
@@ -30,16 +30,17 @@ '0.27.3 +a '%0A%0Afrom
8154d0ee337a5104ccb6b4152ae5bbac977d9345
Check that cc info is in the request before removing it
sharpy/client.py
sharpy/client.py
import base64 import logging from urllib import urlencode from dateutil.tz import tzutc import httplib2 from sharpy.exceptions import AccessDenied from sharpy.exceptions import BadRequest from sharpy.exceptions import CheddarError from sharpy.exceptions import CheddarFailure from sharpy.exceptions import NaughtyGatewa...
Python
0
@@ -3397,11 +3397,53 @@ -try +if 'subscription%5BccCardCode%5D' in cleaned_data :%0A @@ -3497,24 +3497,81 @@ CardCode%5D'%5D%0A + if 'subscription%5BccNumber%5D' in cleaned_data:%0A @@ -3617,24 +3617,24 @@ ccNumber%5D'%5D%0A + @@ -3692,99 +3692,8 @@ -4:%5D -%0A ...
d54b1a1b2faf8ded624385dc8e4b0e8ec5adb869
Update version.
shop/__init__.py
shop/__init__.py
__version__ = '2.11'
Python
0
@@ -12,11 +12,11 @@ _ = '2.1 -1 +2 '%0A
b8ecb1e86fcbbda0f92314c90fb319c2c50fcf94
Set DEBUG = False in production
uchicagohvz/production_settings.py
uchicagohvz/production_settings.py
from local_settings import * settings.DEBUG = False ALLOWED_HOSTS = ['uchicagohvz.org'] # Database DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'uchicagohvz', ...
Python
0.032108
@@ -27,17 +27,8 @@ *%0A%0A -settings. DEBU
5ab4f1bc233a74247059dbd5254576dc2eeb1ea4
Use inner join where appropriate
skylines/model/notification.py
skylines/model/notification.py
from datetime import datetime from collections import OrderedDict from sqlalchemy import ForeignKey, Column from sqlalchemy.orm import relation, contains_eager from sqlalchemy.types import Integer, DateTime from .base import DeclarativeBase from .session import DBSession from .auth import User from .flight import Fli...
Python
0
@@ -916,32 +916,48 @@ relation('User' +, innerjoin=True )%0A%0A # A fligh @@ -1787,24 +1787,40 @@ tion('Event' +, innerjoin=True )%0A%0A # The @@ -1989,16 +1989,32 @@ n('User' +, innerjoin=True )%0A%0A #
e62bab8106e96df4e9a248e125c6b18e3700f602
add unit test for utils
smart_open/tests/test_utils.py
smart_open/tests/test_utils.py
# -*- coding: utf-8 -*- # # Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com> # # This code is distributed under the terms and conditions # from the MIT License (MIT). # import unittest import smart_open.utils class ClampTest(unittest.TestCase): def test_low(self): self.assertEqual(smart_open.utils...
Python
0
@@ -521,8 +521,303 @@ 10), 0)%0A +%0A%0Adef test_check_kwargs():%0A import smart_open.s3%0A kallable = smart_open.s3.open%0A kwargs = %7B'client': 'foo', 'unsupported': 'bar', 'client_kwargs': 'boaz'%7D%0A supported = smart_open.utils.check_kwargs(kallable, kwargs)%0A assert supported == %7B'client': 'f...
31cb592d5e4525dc61174af922fcf7f24bb1a824
Update comments to more accurately reflect the real design
socorro/lib/JsonDumpStorage.py
socorro/lib/JsonDumpStorage.py
import datetime as dt import os #----------------------------------------------------------------------------------------------------------------- class JsonDumpStorage(object): """ This class implements a file system storage scheme for the JSON and dump files of the Socorro project. It create a tree with two bra...
Python
0
@@ -1204,17 +1204,18 @@ 83d.json +%22 %0A - %22%22%22%0A @@ -2243,16 +2243,22 @@ id.dump%22 +%0A %22 %22%22%0A r @@ -2779,36 +2779,36 @@ athname for the -json +dump file for given @@ -3893,31 +3893,8 @@ the -both the%0A radix and date @@ -3892,35 +3892,37 @@ the date branch -es, +,%0A ...
d4047ab21b1330eab6ef3b03c9c3ed816bdd9ff1
Fix validation for new graph db (test_validation.py passes now)
solar/solar/core/validation.py
solar/solar/core/validation.py
""" Validation for meta.yaml files. Each input looks like this: ip: schema: int! value: 5000 or like this: ip: jsonschema: type: number value: 5000 For more complicated objects: mount_points: schema: [{src: str!, dst: str!}] value: or mount_points: jsonschema: type: array items: ...
Python
0
@@ -3709,15 +3709,8 @@ args -_dict() %0A%0A
b27d1d3baf9d7b7971b2353f6d57716f72a72dd9
Add SENDFILE_BACKEND parameter that is required by newer Django.
site/settings.py
site/settings.py
# Copyright 2015 Oleg Girko <ol@infoserver.lv> # # This file is part of ldbox.site Python package. # # ldbox.site Python package is free software: # you can redistribute it and/or modify # it under the terms of the GNU Affero Public License as published by # the Free Software Foundation, either version 3 of the Licens...
Python
0
@@ -3516,16 +3516,63 @@ atic/'%0A%0A +SENDFILE_BACKEND = 'sendfile.backends.simple'%0A%0A # Authen
2dad5140ceeb7635374203b55727eb19c3264875
fix template path in urls
src/main/urls.py
src/main/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic.base import TemplateView urlpatterns = [ # Examples: url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'...
Python
0.000001
@@ -285,24 +285,30 @@ plate_name=' +pages/ home.html'),
80e82ce7d5f2e4da2c5df3e912bec00d4f05be13
Add region tags
speech/api/speech_streaming.py
speech/api/speech_streaming.py
#!/usr/bin/python # Copyright (C) 2016 Google 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 ...
Python
0
@@ -2073,16 +2073,39 @@ nnel)%0A%0A%0A +# %5BSTART audio_stream%5D%0A @context @@ -2528,16 +2528,37 @@ inate()%0A +# %5BEND audio_stream%5D%0A %0A%0Adef re
551f7bf91a91420de6ac4c4b5767c7d926c9a500
Allow camera to be chosen by config
raspicam/main.py
raspicam/main.py
import logging from config_resolver import Config import cv2 from camera import USBCam from processing import detect from raspicam.webui import make_app LOG = logging.getLogger(__name__) class Application: def __init__(self, config): self.config = config self.initialised = False self...
Python
0
@@ -81,16 +81,26 @@ t USBCam +, PiCamera %0Afrom pr @@ -420,32 +420,29 @@ s = -USBCam().frame_generator +self._get_framesource ()%0A @@ -539,16 +539,705 @@ sed.')%0A%0A + def _get_framesource(self):%0A kind = self.config.get('framesource', 'kind').lower()%0A raw_arguments = self.config.get('fram...
dfe7728c4dd118968809f7b34b0dd2e4178a322c
Add missing blank line to make flake8 pass.
kale/scripts/benchmark_queue_info.py
kale/scripts/benchmark_queue_info.py
"""Benchmarks queue_info implementations.""" from __future__ import absolute_import import argparse import logging import os import threading import time import six.moves.queue from six.moves import range # Set this environment variable before importing kale module os.environ['KALE_SETTINGS_MODULE'] = 'benchmark_set...
Python
0
@@ -3413,16 +3413,17 @@ .run()%0A%0A +%0A if __nam
562d84c69177b684a148e7818c1e47312a473c54
Add serializers for UserOrders API
apps/shop/serializers.py
apps/shop/serializers.py
# -*- coding: utf-8 -*- from rest_framework import serializers from apps.authentication.models import OnlineUser as User from apps.gallery.serializers import ResponsiveImageSerializer from apps.inventory.models import Item, ItemCategory from apps.payment.models import PaymentTransaction from apps.shop.models import O...
Python
0
@@ -1945,20 +1945,409 @@ category'%0A )%0A +%0A%0Aclass UserOrderSerializer(serializers.ModelSerializer):%0A content_object = ItemSerializer()%0A%0A class Meta:%0A model = Order%0A fields = ('price', 'quantity', 'content_object')%0A%0A%0Aclass UserOrderLineSerializer(serializers.ModelSeriali...
d5e790dcfcc185b49739285d4fb3975458e2760a
revert api point option to argument
catalog/harvest/harvester.py
catalog/harvest/harvester.py
#!/usr/bin/env python #-*- coding: utf-8 -*- """ EOSS catalog system Dataset harvester program Used to update the local database with existing datasets (from catalog queries, files and or SQS messages) """ __author__ = "Thilo Wehrmann, Steffen Gebhardt" __copyright__ = "Copyright 2016, EOSS GmbH" __credits__ = ["T...
Python
0.000001
@@ -2659,18 +2659,18 @@ ick. -option('-- +argument(' api_