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
c1b4216e610a46260f52d5ed71267a2ed5fcdd25
update debug url to account for downloads
hs_core/debug_urls.py
hs_core/debug_urls.py
"""Extra URLs that add debugging capabilities to resources.""" from django.conf.urls import url from hs_core import views urlpatterns = [ # Resource Debugging: print consistency problems in a resource url(r'^resource/(?P<shortkey>[0-9a-f-]+)/debug/$', views.debug_resource_view.debug_resource, ...
Python
0
@@ -203,32 +203,38 @@ urce%0A url(r'%5E +debug/ resource/(?P%3Csho @@ -251,22 +251,16 @@ a-f-%5D+)/ -debug/ $',%0A @@ -348,16 +348,22 @@ url(r'%5E +debug/ resource @@ -388,22 +388,16 @@ a-f-%5D+)/ -debug/ irods-is
2c06c20b8d96274f0dd1da1bcbd33b8b73e5d786
clean up logging handlers.
reservoir/settings.py
reservoir/settings.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -4355,76 +4355,8 @@ ing%0A -DEFAULT_LOG_LEVEL = os.environ.get('RESERVOIR_LOG_LEVEL', 'DEBUG')%0A%0A LOGG @@ -4484,20 +4484,24 @@ mat': '%5B -H3DM +RESERVOI R %7Blevel @@ -5069,12 +5069,16 @@ et(' -H3DM +RESERVOI R_LO @@ -5091,25 +5091,15 @@ L', +' DE -FAULT_LOG_LEVEL +BUG' ),%0A
e68307e10e1aebe8a6c527a15bfc34b1158bf0eb
Use labels in API for #
judge/views/api.py
judge/views/api.py
from django.core.exceptions import ObjectDoesNotExist from django.http import JsonResponse, Http404 from judge.models import Contest, Problem, Profile, Submission def sane_time_repr(delta): days = delta.days hours = delta.seconds / 3600 minutes = (delta.seconds % 3600) / 60 return '%02d:%02d:%02d' % ...
Python
0
@@ -700,16 +700,27 @@ +'labels': %5B 'externa @@ -721,17 +721,20 @@ xternal' -: +%5D if c.is_ex @@ -739,16 +739,24 @@ external + else %5B%5D ,%0A
9a92f1e214a9bf9bfa33a47eae31c3a626c4377c
improve backend id for vcloud
src/mist/io/model.py
src/mist/io/model.py
"""Mist Io Model Here we define the schema of our data structure in an object oriented way. Simple, low level, helper functions can also be added to the following classes. (eg user.get_num_mon_machines(), user.keys.unused()). It is recommended that only pure functions (no side-effects) are used as class methods. How...
Python
0.000001
@@ -4156,32 +4156,187 @@ r, self.apiurl)%0A + elif self.provider in %5B'vcloud', 'indonesian_vcloud'%5D:%0A concat = %22%25s%25s%25s%25s%22 %25 (self.provider, self.apikey, self.apisecret, self.apiurl)%0A else:%0A
600a19b8a3f6d320b00d1d2b25e5c0f341f821d1
bump version
kaggle_cli/main.py
kaggle_cli/main.py
import sys from cliff.app import App from cliff.commandmanager import CommandManager VERSION = '0.6.0' class KaggleCLI(App): def __init__(self): super(KaggleCLI, self).__init__( description='An unofficial Kaggle command line tool.', version=VERSION, command_manager=C...
Python
0
@@ -95,17 +95,17 @@ = '0.6. -0 +1 '%0A%0A%0Aclas
5a87dbbb0ea4faa44d743a21a2f7d7aca46242f9
Document internet gateway properties:
heat/engine/resources/internet_gateway.py
heat/engine/resources/internet_gateway.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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
@@ -2042,32 +2042,102 @@ 'Required': True +,%0A 'Description': _('VPC ID for this gateway association.') %7D,%0A 'Inte @@ -2149,24 +2149,37 @@ atewayId': %7B +%0A 'Type': 'Str @@ -2182,16 +2182,76 @@ 'String' +,%0A 'Description': _('ID of the InternetGateway.') %7D,%0A ...
77503c0e09c0a520ffdc3b4f936c579148acd915
Clean up the code a bit
piwik_tracking/piwiktracker.py
piwik_tracking/piwiktracker.py
import datetime import httplib import random import urllib import urlparse class PiwikTracker: VERSION = 1 def __init__(self, id_site, api_url, request, token_auth): random.seed() self.id_site = id_site self.api_url = api_url self.request = request self.token_auth = to...
Python
0
@@ -790,16 +790,28 @@ NGUAGE', +%0A '')%0A%0A @@ -1537,17 +1537,16 @@ url - = self.g @@ -1858,87 +1858,22 @@ -url = %22?idsite=%25d&rec=1&apiv=%25s&r=%25s&url=%25s&urlref=%25s&cip=%25s&token_auth=%25s%22 %25 ( +parameters = %7B %0A @@ -1876,24 +1876,34 @@ %0A + 'idsite': ...
b1e2275b47e70949c018ab276279c9e6b8f6d3cf
Add debug (#10828)
homeassistant/components/sensor/serial.py
homeassistant/components/sensor/serial.py
""" Support for reading data from a serial port. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.serial/ """ import asyncio import logging import json import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistan...
Python
0.000001
@@ -2952,24 +2952,72 @@ line)%0A%0A + _LOGGER.debug(%22Received: %25s%22, line)%0A
ad6b055b53d621addc3565209c7af095b6d6d0e7
Add .delete() and the start of Room
hypchat/jsonobject.py
hypchat/jsonobject.py
from __future__ import absolute_import, division import json from . import requests class Linker(object): """ Responsible for on-demand loading of JSON objects. """ def __init__(self, url, parent=None, _requests=None): self.url = url self.__parent = parent self._requests = _requests or __import__('requests')...
Python
0.000001
@@ -54,16 +54,26 @@ rt json%0A +import re%0A from . i @@ -88,16 +88,39 @@ quests%0A%0A +_urls_to_objects = %7B%7D%0A%0A class Li @@ -1230,8 +1230,590 @@ .json()%0A +%0A%09def delete(self):%0A%09%09return requests.delete(self%5B'links'%5D%5B'self'%5D).json()%0A%0Aclass Room(JsonObject):%0A%09def message(self, *p, *...
52dfb3b81b0d7fa27db9acf8033f28f31f8290ad
scale large icons to avoid out of memory
hypergan/tk_viewer.py
hypergan/tk_viewer.py
""" Opens a window that displays an image. Usage: from viewer import GlobalViewer GlobalViewer.update(image) """ import numpy as np import os import contextlib class TkViewer: def __init__(self, title="HyperGAN", viewer_size=1, enabled=True): self.screen = None self.title = title ...
Python
0
@@ -1928,16 +1928,345 @@ (event)%0A + surface = self.tkviewer.pg.Surface(%5Bimage.shape%5B0%5D,image.shape%5B1%5D%5D)%0A self.tkviewer.pg.surfarray.blit_array(surface, image)%0A self.tkviewer.screen.blit(self.tkviewer.pg.transform.scale(surface,self.tkviewer.siz...
1ae34b1a9035ec8813c40477a6f83bfdf10413f3
Add chkdown in the list of server metrics
haproxystats/metrics.py
haproxystats/metrics.py
"""Provide constants for grouping metric names. There are seperated groups for frontend, backend, servers and haproxy daemon. Metric names are the field names contained in the HAProxy statistics. """ from collections import namedtuple DAEMON_METRICS = [ 'CompressBpsIn', 'CompressBpsOut', 'CompressBpsRateL...
Python
0
@@ -1291,16 +1291,31 @@ kfail',%0A + 'chkdown',%0A 'cli
fe9226898772c4ff909f9c3f0cb05c271333b73a
Make auth_url lookup dynamic
heat/common/auth_url.py
heat/common/auth_url.py
# # Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Python
0.000009
@@ -890,24 +890,129 @@ self. +_auth_url = None%0A%0A @property%0A def auth_url(self):%0A if not self._auth_url:%0A self._ auth_url = s @@ -1030,16 +1030,46 @@ th_url() +%0A return self._auth_url %0A%0A de
a79db7cf85dac6d74d7929137f640a0ac10ddf7d
return from sys.exit for easier testing
p7doi/__init__.py
p7doi/__init__.py
# -*- coding: UTF-8 -*- from __future__ import print_function import webbrowser import sys __version__ = '0.0.1' DOI_URL = 'http://rproxy.sc.univ-paris-diderot.fr/login' + \ '?url=http://dx.doi.org/%s' def make_doi_url(doi): """ Return an URL for the given DOI """ return DOI_URL % doi def ope...
Python
0.000001
@@ -685,32 +685,39 @@ rgv%5B0%5D)%0A +return sys.exit(1)%0A%0A @@ -931,32 +931,39 @@ oi)%0A +return sys.exit(1)%0A @@ -966,16 +966,23 @@ +return sys.exit
7ed627991632cf761dfccb553f830a6e9e3c37e9
fix bitonality test for solid color images
kraken/lib/util.py
kraken/lib/util.py
""" Ocropus's magic PIL-numpy array conversion routines. They express slightly different behavior from PIL.Image.toarray(). """ import unicodedata import numpy as np from PIL import Image __all__ = ['pil2array', 'array2pil'] def pil2array(im: Image, alpha: int = 0) -> np.array: if im.mode == '1': return...
Python
0.000001
@@ -1236,16 +1236,46 @@ not None + and len(im.getcolors(2)) == 2 %0A%0A%0Adef g
4d5889e87399e940ebb08c7513f24466c0a93eaf
Remove useless space.
plugins/ChannelStats/config.py
plugins/ChannelStats/config.py
### # Copyright (c) 2005, Jeremiah Fincher # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
Python
0
@@ -3209,17 +3209,16 @@ in them - ) are co
8d7bde02f376acfdb4a06335c541133a31f76abe
Fix unslicable ("striped") model rendering and add overhang color theming
plugins/SolidView/SolidView.py
plugins/SolidView/SolidView.py
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.View.View import View from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Scene.Selection import Selection from UM.Resources import Resources from UM.Application import Application from UM.Pr...
Python
0
@@ -429,16 +429,47 @@ orState%0A +from UM.Math.Color import Color %0Afrom UM @@ -1202,16 +1202,192 @@ hader%22)) +%0A theme = Application.getInstance().getTheme()%0A self._enabled_shader.setUniformValue(%22u_overhangColor%22, Color(*theme.getColor(%22model_overhang%22).getRgb())) %0A%0A ...
eaac4e45928b7008e6c561e28e9b5ed5dc427587
fix redis storage
labDNS/storages.py
labDNS/storages.py
try: import redis except ImportError: redis = None class BaseStorage: DEFAULT_CONFIG = dict() def __init__(self, config): self.config = self.DEFAULT_CONFIG self._configure(config) def get(self, key): raise NotImplementedError def _configure(self, config): sel...
Python
0
@@ -698,32 +698,83 @@ nit__(self, -config): +*args, **kwargs):%0A super().__init__(*args, **kwargs) %0A sel @@ -880,27 +880,46 @@ lf.redis.get(key -, +).decode(%22utf-8%22) or default )%0A @@ -908,18 +908,17 @@ f-8%22) or default -) %0A
36cd155bb317872a43a0e455a012a06cd5b6ffff
store callbacks in OrderedSets
hotdoc/utils/signals.py
hotdoc/utils/signals.py
# -*- coding: utf-8 -*- # A signal/slot implementation # # Author: Thiago Marcos P. Santos # Author: Christopher S. Case # Author: David H. Bronke # Author: Mathieu Duponchelle # Author: Thibault Saunier # Created: August 28, 2008 # Updated: January 29, 2016 # License: MIT # http://code.activestate.com/recipes/57...
Python
0
@@ -433,16 +433,58 @@ nspect%0A%0A +from hotdoc.utils.utils import OrderedSet%0A %0Aclass S @@ -1437,33 +1437,40 @@ lf._functions = -s +OrderedS et()%0A sel @@ -1490,17 +1490,24 @@ tions = -s +OrderedS et()%0A
e4ac571eb44954254b15857d88bde145e66d297b
Remove typo
labellines/core.py
labellines/core.py
from math import atan2, degrees import warnings import numpy as np import matplotlib.pyplot as plt from matplotlib.dates import date2num, DateConverter, num2date from matplotlib.container import ErrorbarContainer from datetime import datetime # Label line with line2D label data def labelLine(line, x, label=None, ali...
Python
0.999292
@@ -1554,17 +1554,16 @@ ats.%22%22%22%0A -v
13ffa4113341c13e635896f94a29df5cff5c0348
Build objects in JSON generator tool
test/generate-json.py
test/generate-json.py
#!/usr/bin/env python import argparse import random def random_array_element(): return random.choice(['123', 'true', 'false', 'null', '3.1415', '"foo"']) def main(): parser = argparse.ArgumentParser(description="Generate a large JSON document.") parser.add_argument('--array-size', nargs=1, type=int, defa...
Python
0.000002
@@ -505,36 +505,333 @@ -args = parser.parse_args()%0A%0A +parser.add_argument('--object-size', nargs=1, type=int, default=None)%0A args = parser.parse_args()%0A%0A if args.object_size:%0A print('%7B')%0A for i in range(args.object_size%5B0%5D - 1):%0A print(' %22x%25d%22: %25s,' %2...
8ec6662a903aeea9613a53016d4f684a833605e5
clean up impors
porkchop/commandline.py
porkchop/commandline.py
import logging from optparse import OptionParser from server import GetHandler import sys from porkchop.plugin import PorkchopPluginHandler from porkchop.server import GetHandler, ThreadedHTTPServer def coerce_number(s): try: return int(s) except: return float(s) def get_logger(level = logging.INFO): l...
Python
0.000001
@@ -45,49 +45,8 @@ rser -%0Afrom server import GetHandler%0Aimport sys %0A%0Afr @@ -96,67 +96,8 @@ dler -%0Afrom porkchop.server import GetHandler, ThreadedHTTPServer %0A%0Ade @@ -507,16 +507,109 @@ main():%0A + from server import GetHandler%0A from porkchop.server import GetHandler, ThreadedHTTPServer%0A plu...
02e4d3664b4436724ad11f045bbfb631014eeadb
Handle unload errors
hubbot/modulehandler.py
hubbot/modulehandler.py
import operator import sys from twisted.internet import threads from hubbot.response import IRCResponse, ResponseType from hubbot.moduleinterface import ModuleAccessLevel class ModuleHandler(object): def __init__(self, bot): """ @type bot: hubbot.bot.Hubbot """ self.bot = bot ...
Python
0
@@ -4955,17 +4955,37 @@ ower()%5D%0A -%0A + try:%0A @@ -5004,32 +5004,36 @@ module triggers%0A + for @@ -5086,32 +5086,36 @@ + del self.mappedT @@ -5131,17 +5131,20 @@ rigger%5D%0A -%0A + @@ -5180,25 +5180,168 @@ onDisable()%0A -%0A + ...
c48b0ae4331d1d039cb6bc29ef25fc7c4a5df8da
Bump version to 0.2.7
approvaltests/version.py
approvaltests/version.py
version_number = "0.2.6"
Python
0.000001
@@ -19,7 +19,7 @@ 0.2. -6 +7 %22%0A
903d9b000c4d7b333b5d3000aeb38b7e4d818c27
add "Partly Cloudy" to color_icons
i3pystatus/weather.py
i3pystatus/weather.py
from i3pystatus import IntervalModule import pywapi from i3pystatus.core.util import internet, require class Weather(IntervalModule): """ This module gets the weather from weather.com using pywapi module First, you need to get the code for the location from the www.weather.com Available formatters: ...
Python
0.999821
@@ -819,24 +819,114 @@ '#F8F8FF'),%0A + 'Partly Cloudy': (u'%5Cu2601', '#F8F8FF'), # %5Cu26c5 is not in many fonts%0A
f4a39adc6513f41dc33c4ecf597f4a80dd846dd9
rename LdapConnection to DatabaseWrapper and accept configuration as a dict
ldapdb/__init__.py
ldapdb/__init__.py
# -*- coding: utf-8 -*- # # django-ldapdb # Copyright (c) 2009-2010, Bolloré telecom # All rights reserved. # # See AUTHORS file for a full list of contributors. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # ...
Python
0.000002
@@ -2411,30 +2411,31 @@ %0A%0Aclass -LdapConnection +DatabaseWrapper (object) @@ -2453,26 +2453,101 @@ _init__(self -): +, settings_dict=%7B%7D, alias='ldap'):%0A self.settings_dict = settings_dict %0A sel @@ -2685,16 +2685,51 @@ ions()%0A%0A + def close(self):%0A pass%0A%0A def @@ -...
9729d98b470c62bb0e9f63e086d576b773b68047
Disable some web content related tasks depending on the config file.
ichnaea/data/tasks.py
ichnaea/data/tasks.py
""" Contains all celery tasks. The task function names and this module's import path is used in generating automatic statsd timer metrics to track the runtime of each task. """ from datetime import timedelta from celery.schedules import crontab from ichnaea.async.app import celery_app from ichnaea.async.task import...
Python
0
@@ -826,24 +826,235 @@ ections()%0A%0A%0A +def _web_content_enabled(app_config):%0A if ('web' in app_config.sections() and%0A app_config.get('web', 'enabled', True) in ('false', '0')):%0A return False # pragma: no cover%0A return True%0A%0A%0A @celery_app. @@ -4267,18 +4267,66 @@ onds=45) +,...
faebe4928b4bef33efd6183f97f1ff1396a701ee
fix missing urls.
blackgate/cli.py
blackgate/cli.py
# -*- coding: utf-8 -*- import click from blackgate.core import component from blackgate.config import parse_yaml_config from blackgate.config import read_yaml_config from blackgate.config import read_default_config from blackgate.server import run @click.group() @click.option('-c', '--config', default='') @click.p...
Python
0.00013
@@ -635,24 +635,41 @@ id yaml.')%0A%0A + ctx.obj = %7B%7D%0A ctx.obj%5B
66b95e2e0b89470993c52998eeb179d9e4926713
test public list
project/test_project.py
project/test_project.py
#from django.contrib.auth.models import User from .models import * from django.test import TestCase from django.db import transaction import reversion #from reversion.models import Version TEST_USER_NAME_CREATOR = 'test project creator' TEST_USER_NAME_NOT_MEMBER = 'user is not a member' TEST_PROJECT_PUBLIC_NAME = 't...
Python
0.000001
@@ -3148,8 +3148,198 @@ _NONE )%0A + %0A def test_public_project_list(self):%0A pl = GetAllPublicProjectList()%0A self.assertEqual( get_public_project() in pl, True )%0A self.assertEqual( pl.count(), 1 )
1408f2a7e782c0ca059b04cab2526cef558312b6
add comment to explain not extending BaseGoAccountCommand
go/base/management/commands/go_generate_export_conversations_urls.py
go/base/management/commands/go_generate_export_conversations_urls.py
""" Dump URLs that can be used by cURL for downloading conversation data """ from optparse import make_option from django.core.management.base import CommandError from django.utils.text import slugify from go.base.command_utils import BaseGoCommand class Command(BaseGoCommand): help = "Dump URLs for use with ...
Python
0
@@ -247,16 +247,121 @@ mmand%0A%0A%0A +# We don't extend BaseGoAccountCommand since the '--email' option is used%0A# instead of '--email-address'%0A class Co
bdef12745f5d91bf196139b444b34810b529c38d
Fix #37: Make subclassing of btuple work for __add__ and __radd__.
blist/_btuple.py
blist/_btuple.py
from blist._blist import blist from ctypes import c_int import collections class btuple(collections.Sequence): def __init__(self, seq=None): if isinstance(seq, btuple): self._blist = seq._blist elif seq is not None: self._blist = blist(seq) else: self._bli...
Python
0
@@ -1227,35 +1227,37 @@ ther):%0A r -v = +eturn self._btuple_or @@ -1289,87 +1289,8 @@ __)%0A - if rv is NotImplemented:%0A raise TypeError%0A return rv%0A @@ -1325,19 +1325,21 @@ r -v = +eturn self._b @@ -1380,87 +1380,8 @@ __)%0A - if rv is NotImplemented:%0...
8abcd25ccd36d614ad650e0983385fbeb5a1777c
Add more search engines ping
blog/__init__.py
blog/__init__.py
# -*- coding: UTF-8 -*- # YaBlog # (c) Regis FLORET # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the fol...
Python
0
@@ -1969,32 +1969,212 @@ s/tools/ping'),%0A + ('technorati', 'http://rpc.technorati.com/rpc/ping'),%0A ('pigomatic', 'http://rpc.pingomatic.com'),%0A ('googleblog', 'http://blogsearch.google.com/ping/RPC2'),%0A ('yahoo'
3154f0098f9696cd48536599413659e47747491f
Add api [2]
blue/__init__.py
blue/__init__.py
from flask import Flask app = Flask(__name__) from blue.site.routes import mod from blue.api.routes import mod app.register_blueprint(site.routes.mod) app.register_blueprint(api.routes.mod)
Python
0
@@ -176,17 +176,36 @@ t(api.routes.mod +, url_prefix='/api' )
20d47877bf426bc2ec9ac1b8a99ec887faec31c5
Fix minor problems with mux function
boolexpr/misc.py
boolexpr/misc.py
# Copyright 2016 Chris Drake # # 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.000018
@@ -2245,18 +2245,17 @@ def mux( -xs +a , sel):%0A @@ -2309,76 +2309,41 @@ es a - sequence of input functions over a%0A sequence of select functions +n input array over a select array .%0A @@ -2352,18 +2352,17 @@ %22%22%22%0A -xs +a = _expe @@ -2370,18 +2370,17 @@ t_array( -xs +a )%0A se @@ -2422,2...
8da750eddfecb2c7162e1a33c7c830fd083944bd
Change allowed exception raising
intelmq/bots/parsers/abusech/parser_ip.py
intelmq/bots/parsers/abusech/parser_ip.py
# -*- coding: utf-8 -*- """ Parses simple newline separated list of IPs. Docs: - https://feodotracker.abuse.ch/blocklist/ - https://zeustracker.abuse.ch/blocklist.php """ import re import dateutil from intelmq.lib.bot import ParserBot from intelmq.lib import utils from intelmq.lib.exceptions import PipelineError ...
Python
0
@@ -1760,23 +1760,20 @@ raise -Pipelin +Valu eError(%22
7c3faea0dde53163628462db4fe688fa47cc63ab
comment fixed
sanic/sanic.py
sanic/sanic.py
from asyncio import get_event_loop from inspect import isawaitable from multiprocessing import Process, Event from signal import signal, SIGTERM, SIGINT from time import sleep from traceback import format_exc from .config import Config from .exceptions import Handler from .log import log, logging from .response import...
Python
0
@@ -1508,106 +1508,69 @@ s a -route%0A :param uri: path of the URL%0A :param methods: list or tuple of methods allowed +handler for exceptions%0A :param *exceptions: exceptions %0A
ff9e3e99e7a5bda1eefdd925960b6b6153a9e10d
Update messenger.py
bot/messenger.py
bot/messenger.py
import logging import random logger = logging.getLogger(__name__) class Messenger(object): def __init__(self, slack_clients): self.clients = slack_clients def send_message(self, channel_id, msg): # in the case of Group and Private channels, RTM channel payload is a complex dictionary ...
Python
0.000001
@@ -2952,26 +2952,68 @@ -txt = %22task # %22 + +fs_url = os.getenv(%22FLYSPRAY_URL%22, %22%22)%0A txt = fs_url+ task
1e930adbfb1714670ad04717401b36b59bf12558
Bump version to 0.0.2
bqdm/__init__.py
bqdm/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import __version__ = '0.0.1' CONTEXT_SETTINGS = dict( help_option_names=['-h', '--help'], max_content_width=120, )
Python
0.000001
@@ -77,17 +77,17 @@ = '0.0. -1 +2 '%0A%0A%0ACONT
24f1c94817bbeeca18d9dd307c1086ad76f9f167
add missing curly braces for string formatting (#1148)
appengine/standard/storage/appengine-client/main.py
appengine/standard/storage/appengine-client/main.py
#!/usr/bin/env python # 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...
Python
0
@@ -1510,16 +1510,18 @@ t name: +%7B%7D %5Cn%5Cn'.fo
649e34402477d1d93efc9be11394d69cf676af1d
fix indent
script/iris.py
script/iris.py
# coding: UTF-8 # # --- Iris.py --- # Irisのデータを用いてtsaliisエントロピー正則化FCM法を試す # import numpy as np import matplotlib.pyplot as plt from sklearn import datasets as ds from sklearn.metrics import accuracy_score import random import math import sys import copy def main(): # Irisのデータを読み込む iris = ds.load_iris() # Iri...
Python
0.00006
@@ -1174,9 +1174,9 @@ max -%3E +%3C sco
e01a06c735d0ac59f7b0827839a5e1bcfd7200bc
Allow non-integer parts of GNOME version number
gsetting.py
gsetting.py
#!/usr/bin/python from os import environ import re import subprocess from ansible.module_utils.basic import * def _check_output_strip(command): return subprocess.check_output(command).decode('utf-8').strip() def _escape_single_quotes(string): return re.sub("'", r"'\''", string) def _split_key(full_key): ...
Python
0.000007
@@ -450,16 +450,111 @@ e_key)%0A%0A +def _maybe_int(val):%0A try:%0A return int(val)%0A except ValueError:%0A return 0%0A%0A def _get @@ -605,16 +605,23 @@ ple(map( +_maybe_ int, (_c
6c556f6c5e4aa70173a84f6e6854390241231021
Update the Jinja2Templates() constructor to allow PathLike (#1292)
starlette/templating.py
starlette/templating.py
import typing from starlette.background import BackgroundTask from starlette.responses import Response from starlette.types import Receive, Scope, Send try: import jinja2 # @contextfunction renamed to @pass_context in Jinja 3.0, to be removed in 3.1 if hasattr(jinja2, "pass_context"): pass_contex...
Python
0
@@ -6,16 +6,40 @@ t typing +%0Afrom os import PathLike %0A%0Afrom s @@ -1692,27 +1692,51 @@ directory: -str +typing.Union%5Bstr, PathLike%5D ) -%3E None:%0A @@ -1887,16 +1887,25 @@ ate_env( +%0A self, di @@ -1913,19 +1913,48 @@ ectory: -str +typing.Union%5Bstr, PathLike%5D%0A ) -%3E %22ji
a0dfb1ce1a72880da34ad817c8021e54e2ce0e5d
add fields.
lib/acli/output.py
lib/acli/output.py
# from tabulate import tabulate from terminaltables import AsciiTable def output_ec2(output_type=None, instances=None): if output_type == 'console': heading = ['id', 'state'] table_data = [heading] for instance in instances: instance_id = instance[0].id instance_st...
Python
0
@@ -180,18 +180,62 @@ 'state' +, 'type', 'image', 'public ip', 'private ip' %5D%0A - @@ -397,57 +397,508 @@ -table_data.append(%5Binstance_id, instance_state +instance_type = instance%5B0%5D.instance_type%0A image_id = instance%5B0%5D.image_id%0A public_ip = instance%5B0%5D.ip_a...
2d7b3afaca97a3e6a115c077586d0a9fb9daf8b2
Fix imap connection lost (#380)
i3pystatus/mail/imap.py
i3pystatus/mail/imap.py
import sys import imaplib from i3pystatus.mail import Backend from i3pystatus.core.util import internet class IMAP(Backend): """ Checks for mail on a IMAP server """ settings = ( "host", "port", "username", "password", ('keyring_backend', 'alternative keyring backend for retr...
Python
0.000001
@@ -4,19 +4,23 @@ ort -sys +imaplib %0Aimport imap @@ -15,23 +15,22 @@ %0Aimport -imaplib +socket %0A%0Afrom i @@ -63,50 +63,8 @@ end%0A -from i3pystatus.core.util import internet%0A %0A%0Acl @@ -644,32 +644,535 @@ nnection(self):%0A + if self.connection:%0A try:%0A self.conn...
c0f959446731b8ce2677c56afd5456c2e047cabb
Change the webapp tests to not interfere with instance level connections.
ichnaea/webapp/tests.py
ichnaea/webapp/tests.py
from ichnaea.config import DummyConfig from ichnaea.tests.base import ( _make_app, _make_db, DBTestCase, RedisIsolation, REDIS_URI, SQLURI, ) class TestApp(RedisIsolation, DBTestCase): def test_db_hooks(self): app_config = DummyConfig({'ichnaea': { 'db_master': SQLURI,...
Python
0
@@ -225,13 +225,14 @@ _db_ -hooks +config (sel @@ -603,37 +603,32 @@ )%0A -self. db_rw = app.app. @@ -642,37 +642,32 @@ y.db_rw%0A -self. db_ro = app.app. @@ -693,46 +693,300 @@ -app.get('/stats_wifi.json', status=200 +# the configured databases are working%0A try:%0A ...
aa096411780cb2c02e123e1f4e456d6fb4b3d551
make it guess etc directory for ease of use
src/server/rz_cli.py
src/server/rz_cli.py
#!/usr/bin/python import argparse # TODO - use the newer / shorter argument parser. y? from collections import namedtuple import json import uuid from neo4j_util import generate_random_id__uuid from rz_server import init_config from rz_kernel import RZ_Kernel from model.graph import Topo_Diff import db_controller as ...
Python
0
@@ -12,16 +12,26 @@ python%0A%0A +import os%0A import a @@ -3496,17 +3496,12 @@ ult= -'res/etc' +None )%0A @@ -4009,16 +4009,184 @@ ()%0A %0A + if args.config_dir is None:%0A for d in %5B'res/etc', '/etc/rhizi'%5D:%0A if os.path.exists(d):%0A args.config_dir = d%0A ...
17f1c210c9c8b410cb6888a51ea1d863b74c14be
Use has_module check in _can_read
imageio/plugins/gdal.py
imageio/plugins/gdal.py
# -*- coding: utf-8 -*- # Copyright (c) 2015, imageio contributors # imageio is distributed under the terms of the (new) BSD License. """ Plugin for reading gdal files. """ from __future__ import absolute_import, print_function, division from .. import formats from ..core import Format _gdal = None # lazily loaded ...
Python
0
@@ -281,16 +281,28 @@ t Format +, has_module %0A%0A_gdal @@ -857,32 +857,151 @@ self, request):%0A + if request.filename.lower().endswith('.ecw'):%0A return True%0A if has_module('osgeo.gdal'):%0A return r @@ -1033,28 +1033,31 @@ ndswith( -GDAL_FORMATS +self.extensions )%0A%0...
70f1838951460c16b7eb4b8220621c198d4634a5
remove pdb
inferelator_ng/tfa.py
inferelator_ng/tfa.py
import numpy as np import pandas as pd from scipy import linalg class TFA: """ TFA calculates transcription factor activity using matrix pseudoinverse Parameters -------- prior: pd.dataframe binary or numeric g by t matrix stating existence of gene-TF interactions. g--gene, t...
Python
0.000024
@@ -956,44 +956,8 @@ e):%0A - import pdb; pdb.set_trace()%0A
ebfc7969fc2559d7f67eae628f00e0465b85e0c5
Add blur filter to supported URLs
imboclient/url/image.py
imboclient/url/image.py
from imboclient.url import accesstoken from imboclient.url import url class UrlImage (url.Url): def __init__(self, base_url, public_key, private_key, image_identifier): url.Url.__init__(self, base_url, public_key, private_key) self._image_identifier = image_identifier def resource_url(self): ...
Python
0
@@ -3045,32 +3045,208 @@ return self%0A%0A + def blur(self, type='gaussian', radius=5, sigma=2):%0A self.add_query_param('t%5B%5D', %22blur:type=%7B%7D,radius=%7B%7D,sigma=%7B%7D%22.format(type, radius, sigma))%0A return self%0A%0A def reset(se
f1d76611b6b7c2f1b1a15c72976e5c1029f3b4a8
Use the executable bit on AWS callback.
scripts/aws.py
scripts/aws.py
import logging import requests from requests.exceptions import RequestException import sys import boto.ec2 logger = logging.getLogger(__name__) class AWSConnection: def __init__(self, config): self.available = False self.config = config if 'cluster_name' in config: self.clust...
Python
0
195925232b47e2c607b95dfaabb46f884f1a1a5e
remove extra newlines in usage string.
lib/bup/options.py
lib/bup/options.py
"""Command-line options parser. With the help of an options spec string, easily parse command-line options. """ import sys import textwrap import getopt import re class OptDict: def __init__(self): self._opts = {} def __setitem__(self, k, v): if k.startswith('no-') or k.startswith('no_'): ...
Python
0.000013
@@ -2363,32 +2363,64 @@ ut.append('%5Cn')%0A + last_was_option = False%0A while li @@ -2416,32 +2416,32 @@ while lines:%0A - l = @@ -2518,29 +2518,142 @@ nd(' -%5Cn%25s%5Cn' %25 l.lstrip()) +%25s%25s%5Cn' %25 (last_was_option and '%5Cn' or '',%0A ...
00cd014118c4af028579143db73f089a169a0e2d
Fix error when you provide the wrong arguments
lib/circonusapi.py
lib/circonusapi.py
import json import urllib import urllib2 class CirconusAPI(object): def __init__(self, token): self.hostname = 'circonus.com' self.token = token # List valid api methods and their parameters here # The two lists are required and optional parameters self.methods = { ...
Python
0.000006
@@ -6334,16 +6334,57 @@ '.join( +%0A self.met @@ -6394,17 +6394,26 @@ s%5Bname%5D%5B -0 +'required' %5D)))%0A
c8bdf3b95b2ff8e4049a109f65728619a55a927c
Add parallelism to generate_departures (that was easy)
busstops/management/commands/generate_departures.py
busstops/management/commands/generate_departures.py
from datetime import date, timedelta from django.core.management.base import BaseCommand from django.db import transaction from txc import txc from ...models import Region, Service, Journey, StopUsageUsage, StopPoint from ...utils import get_files_from_zipfile ONE_DAY = timedelta(days=1) def handle_timetable(servic...
Python
0.000002
@@ -1,12 +1,45 @@ +from multiprocessing import Pool%0A from datetim @@ -2022,16 +2022,34 @@ egion):%0A + print(region)%0A toda @@ -3054,21 +3054,64 @@ -for +pool = Pool(processes=4)%0A pool.map(handle_ region - in +, Reg @@ -3164,66 +3164,6 @@ I')) -:%0A print(region)%0A ...
eaa062840c0b56bbd7c47986b77f08528bb39eb7
Fix typo leading to misinterpretation of the doc in the implementation.
ppp_datamodel/communication.py
ppp_datamodel/communication.py
"""Contains the classes representing a request to and a response of a module.""" import json from .abstractnode import register, AbstractNode class Request: """Represents a request. https://github.com/ProjetPP/Documentation/blob/master/module-communication.md#request """ __slots__ = ('language', 'per...
Python
0
@@ -302,38 +302,36 @@ = ('language', ' -pertin +sent ence', 'tree')%0A%0A @@ -363,27 +363,181 @@ nguage, tree -):%0A +_or_sentence, is_sentence=False):%0A if is_sentence:%0A self.sentence = tree_or_sentence%0A else:%0A tree = tree_or_sentence%0A if i @@ -588,32 +588,3...
749471d32e18eb14a0d4094ef265dede80cb58c1
modify name
automation_calculator.py
automation_calculator.py
#!python3 # -*- coding: utf-8 -*- # test only on windows XP, 7, 10 import time import subprocess import uiautomation as automation def Calc(window, btns, expression): expression = ''.join(expression.split()) if not expression.endswith('='): expression += '=' for char in expression: automati...
Python
0.000894
@@ -33,17 +33,13 @@ -%0A# -test only +works on @@ -52,16 +52,22 @@ s XP, 7, + 8 and 10%0Aimpo @@ -1191,16 +1191,20 @@ Windows7 +And8 ():%0A @@ -3676,16 +3676,20 @@ Windows7 +And8 ()%0A e
c2d543a3de566443a2c61761f9a190e915426fec
Return stream_client instead of binding it inside method (tests now passing)
stream_django/client.py
stream_django/client.py
from stream_django import conf import os import stream from stream_django.conf import DJANGO_MAJOR_VERSION from django.core.exceptions import ImproperlyConfigured def init_client(mayRaise=False): if conf.API_KEY and conf.API_SECRET: stream_client = stream.connect( conf.API_KEY, conf.API_SECRET, locat...
Python
0
@@ -173,24 +173,34 @@ _client( -mayRaise +raise_config_error =False): @@ -241,39 +241,30 @@ CRET:%0A -stream_client = +return stream.conn @@ -271,19 +271,8 @@ ect( -%0A conf @@ -399,31 +399,22 @@ :%0A -stream_client = +return stream. @@ -431,60 +431,31 @@ el -se:%0A stream_client...
c895a8b62754f5df32aba06cd2231ba43acc9576
Update algo.py
server/algo.py
server/algo.py
from __future__ import division import math import itertools SPACING = 15 def iter_to_runs(visibles, pixels): cur_val = 6666666 start_idx = None out = [] for i, val in enumerate(itertools.chain(visibles, [None])): if cur_val != val: if cur_val is True: # we just e...
Python
0.000007
@@ -66,17 +66,16 @@ ACING = -1 5%0A%0Adef i
315a8ea99240d0eebe2335f25269154475dda679
Fix broken svn_export test
py/desimodel/install.py
py/desimodel/install.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ desimodel.install ================= Install data files not handled by pip install. """ def default_install_dir(): """Return the default install directory. Assumes this file lives in a 'site-packages' directory. ...
Python
0.000007
@@ -1115,16 +1115,48 @@ elif +desimodel_version is 'truck' or 'branche
a22174dcd9fa8540329f0e69a17f021ccb59b678
load only first 1000 data
server/init.py
server/init.py
# -*- coding: utf-8 -*- from werkzeug.contrib.profiler import ProfilerMiddleware from flask import Flask, request, g, render_template from flask.ext.triangle import Triangle from scipy import sparse, io from sklearn.metrics.pairwise import pairwise_distances import numpy as np from matlab import engine import os, json...
Python
0
@@ -342,19 +342,27 @@ import C -ORS +onfigParser %0Afrom ji @@ -447,16 +447,17 @@ static') +%09 %0ATriangl @@ -1406,18 +1406,8 @@ DD'%5D -#.tolist() %0A%0A%09W @@ -1645,25 +1645,17 @@ imals=4) -.tolist() +%0A %0A%09cl_idx @@ -1663,17 +1663,115 @@ = cl_idx -%0A +%5B0:1000%5D%0A%09distanceMatrix = distanceMatrix...
7af40645756fbe2f1b7d44f0ea357a710d10fd3c
Use list2cmdline to rebuild the shell cmdline
substance/subenv/api.py
substance/subenv/api.py
import os from substance.monads import * from substance.constants import * from substance.logs import dinfo from substance import Shell from substance.subenv import SubenvSpec from substance.exceptions import (InvalidEnvError, InvalidOptionError) from substance.utils import makeSymlink, readSymlink logger = logging.ge...
Python
0
@@ -3,16 +3,34 @@ port os%0A +import subprocess%0A from sub @@ -2600,24 +2600,69 @@ vSpec.name%0A%0A + cmd = subprocess.list2cmdline(args)%0A %0A return O @@ -2774,20 +2774,19 @@ ll.call( -args +cmd , cwd=p, @@ -2792,20 +2792,19 @@ , shell= -Fals +Tru e))%0A
066e60897aa931b22ce92776b896912dbec3ccf6
bump dev version
py/desispec/_version.py
py/desispec/_version.py
__version__ = '0.47.1.dev6104'
Python
0
@@ -24,8 +24,8 @@ ev61 -04 +82 '%0A
339fdf6a588fdcd9613015814d3f242d9a0f4118
Fix minor bug
lib/models/vgg.py
lib/models/vgg.py
import cupy import chainer import chainer.links as L import chainer.functions as F from chainer import Variable class VGG(chainer.Chain): """Input dimensions are (224, 224).""" def __init__(self): super().__init__( conv1_1=L.Convolution2D(3, 64, 3, stride=1, pad=1), conv1_2=L...
Python
0.000001
@@ -2593,37 +2593,32 @@ hs.append(h -.data )%0A%0A retur @@ -3153,16 +3153,50 @@ tions(x) +%0A hs = %5Bh.data for h in hs%5D %0A%0A
8b6e7fab7b81ee1488687ab4a2b00ea6f4914e64
fix iam access json schema (#244)
c7n/iamaccess.py
c7n/iamaccess.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
@@ -1409,16 +1409,25 @@ 'items': + %7B'type': 'string @@ -1428,16 +1428,17 @@ string'%7D +%7D )%0A%0A p
54c48073dfb8ffd418efe234c0c107f7a5c303a9
Fix failing imports in Python 2
svg/templatetags/svg.py
svg/templatetags/svg.py
import logging import os from django import template from django.conf import settings from django.contrib.staticfiles import finders from django.utils.safestring import mark_safe from svg.exceptions import SVGNotFound logger = logging.getLogger(__name__) register = template.Library() @register.simple_tag def svg(f...
Python
0.000196
@@ -1,12 +1,51 @@ +from __future__ import absolute_import%0A import loggi
b71ef8c05a9afa9eb3614c863650c12df0967fae
document methods
svtools/vcf/genotype.py
svtools/vcf/genotype.py
import sys class Genotype(object): def __init__(self, variant, gt): self.format = dict() self.variant = variant self.set_format('GT', gt) def set_formats(self, fields, values): format_set = self.variant.format_set add_to_active = self.variant.active_formats.add ...
Python
0.000002
@@ -37,40 +37,194 @@ -def __init__(self, variant, gt): +'''%0A This class stores information about each sample.%0A '''%0A def __init__(self, variant, gt):%0A '''%0A Initialize the class. All instances have a GT field.%0A ''' %0A @@ -354,32 +354,170 @@ ields, values):%0A + ...
e2a0fb602c9de9f988d733a30b466dc400cd9503
update issue 84
test/test_issue084.py
test/test_issue084.py
from rdflib.term import URIRef from rdflib.graph import Graph rdf = u"""@prefix skos: <http://www.w3.org/2004/02/skos/core#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix : <http://www.test.org/#> . :world rdf:type skos:Concept; skos:prefLabel "World"@en. :africa rdf:type skos:Concept; ...
Python
0
@@ -1,20 +1,80 @@ +from codecs import getreader%0Afrom StringIO import StringIO%0A%0A from rdflib.term imp @@ -116,17 +116,16 @@ Graph%0A%0A -%0A rdf = u%22 @@ -552,16 +552,32 @@ %0A%22%22%22 +%0A%0Ardf_utf8 = rdf .encode( @@ -584,16 +584,82 @@ 'utf-8') +%0A%0Ardf_reader = getreader('utf-8')(StringIO(rdf.enc...
f486280a264c195c989d59f0b3fa631d9e165a18
Fix comment
servo_write.py
servo_write.py
from tamproxy import Sketch, SyncedSketch, Timer from tamproxy.devices import Servo # Cycles a motor back and forth between -255 and 255 PWM every ~5 seconds class ServoWrite(Sketch): def setup(self): self.servo = Servo(self.tamp, 9) self.servo.write(1050) self.timer = Timer() sel...
Python
0
@@ -82,10 +82,42 @@ vo%0A%0A -# +%0Aclass ServoWrite(Sketch):%0A %22%22%22 Cycl @@ -125,13 +125,13 @@ s a -motor +servo bac @@ -154,68 +154,69 @@ een --255 and 255 PWM every ~5 seconds%0A%0Aclass ServoWrite(Sketch): +1050us and 1950us pulse widths (most servos are 1000-2000)%22%22%22 %0A%0A @@ -656,8 +65...
a0a2810e52ba27bb2b6eba5d13d8a3bc88bca266
Complete overhaul because I hated the ConfigParser module.
camoco/Config.py
camoco/Config.py
#!/usr/env/python3 import os import configparser global cf cf = configparser.ConfigParser() cf._interpolation = configparser.ExtendedInterpolation() cf_file = os.path.expanduser('~/.camoco.conf') default_config = ''' [options] basedir = ~/.camoco/ testdir = ~/.camoco/tests/ [logging] log_level = verbose [test]...
Python
0
@@ -47,201 +47,125 @@ ser%0A -%0A%0Aglobal cf%0A%0A%0Acf = configparser.ConfigParser()%0Acf._interpolation = configparser.ExtendedInterpolation()%0A%0Acf_file = os.path.expanduser('~/.camoco.conf')%0A%0Adefault_config = '''%0A%5B +import yaml%0Aimport pprint%0A%0A%0Aglobal cf%0A%0Adefault_config = '''--- # YAML Camoco...
f32c834ea5c3ac937ba608985dbe0a4f72b6a21a
move dangling return
pybossa/view/twitter.py
pybossa/view/twitter.py
# This file is part of PyBOSSA. # # PyBOSSA is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # PyBOSSA is distributed in the ho...
Python
0.000002
@@ -2134,35 +2134,69 @@ %0A if user is -Non +not None:%0A return user%0A els e:%0A twitt @@ -2975,38 +2975,8 @@ one%0A - else:%0A return user%0A %0A%0A@b
648de375f5e9ae1620bc836e5d647688b541690c
Add atom package
test/test_packages.py
test/test_packages.py
import pytest @pytest.mark.parametrize("name", [ ("apt-file"), ("apt-transport-https"), ("blktrace"), ("ca-certificates"), ("chromium-browser"), ("cron"), ("curl"), ("diod"), ("docker-ce"), ("fonts-font-awesome"), ("git"), ("gnupg"), ("handbrake"), ("handbrake-cli"), ("haveged"), ("htop...
Python
0.000002
@@ -82,24 +82,36 @@ rt-https%22),%0A + (%22atom%22),%0A (%22blktrace
89664ec37036553534c07d65f2df2b9fa07bfe80
Check total weights remain correct.
test/test_priority.py
test/test_priority.py
# -*- coding: utf-8 -*- """ test_priority ~~~~~~~~~~~~~ Tests for the Priority trees """ from hypothesis import given from hypothesis.strategies import integers, lists, tuples import priority STREAMS_AND_WEIGHTS = lists( elements=tuples( integers(min_value=1), integers(min_value=1, max_value=255) ),...
Python
0
@@ -2155,16 +2155,61 @@ pendents +%0A assert dependents.total_weight == 16 %0A%0A @@ -2336,16 +2336,73 @@ evel_dependents%0A + assert second_level_dependents.total_weight == 8%0A
4530eea92e37c087b6f25fe3a0e48e54b949b68b
allow setup.py to work without django
cart/__init__.py
cart/__init__.py
from django.utils.importlib import import_module from django.core.exceptions import ImproperlyConfigured __version__ = '1.1' VERSION = tuple(map(int, __version__.split('.'))) + ('dev',) def get_helper_module(): '''Get the helper module as defined in the settings.''' import settings as cart_settings if car...
Python
0.000001
@@ -1,110 +1,4 @@ -from django.utils.importlib import import_module%0Afrom django.core.exceptions import ImproperlyConfigured%0A%0A __ve @@ -160,16 +160,232 @@ ngs.'''%0A + %0A # need to be able to import file without importing django, so these can't go%0A # at the top%0A from django.utils.importlib impor...
a3b6306b2288b6dc4a9ec6e04a5962c7fb94699e
Update addition.py: s/stop/N
pyeda/logic/addition.py
pyeda/logic/addition.py
""" Logic functions for addition Interface Functions: ripple_carry_add kogge_stone_add brent_kung_add """ # Disable "invalid variable name" # pylint: disable=C0103 from math import floor, log from pyeda.boolalg.expr import Xor, Majority from pyeda.boolalg.vexpr import BitVector from pyeda.util import cl...
Python
0.000001
@@ -808,20 +808,17 @@ (B)%0A -stop +N = len(A @@ -882,28 +882,25 @@ i in range( -stop +N )%5D%0A p = %5B @@ -926,28 +926,25 @@ i in range( -stop +N )%5D%0A for i @@ -959,20 +959,17 @@ e(clog2( -stop +N )):%0A @@ -1017,20 +1017,17 @@ (start, -stop +N ):%0A @@ -1191,12 +1191,9 @@ nge( -s...
99d76458256da781fc4b25a75d68a7a6d8c9379d
Correcting a typo in entries URLConf
urls/entries.py
urls/entries.py
""" URLs for entries in a weblog. """ from django.conf.urls.defaults import * from django.views.generic import date_based from coltrane.models import Entry entry_info_dict = { 'queryset': Entry.live.all(), 'date_field': 'pub_date', } urlpatterns = patterns('', url(r'^$', ...
Python
0.998607
@@ -1126,17 +1126,17 @@ coltrane -. +_ entry_ar
5295cf039960e239d509cdc9e5b5f23c88cb1fb1
use the category type for performance wins http://pandas.pydata.org/pandas-docs/stable/categorical.html
synthpop/categorizer.py
synthpop/categorizer.py
import itertools import numpy as np import pandas as pd # TODO DOCSTRINGS!! def categorize(df, eval_d, index_cols=None): cat_df = pd.DataFrame(index=df.index) for index, expr in eval_d.iteritems(): cat_df[index] = df.eval(expr) if index_cols is not None: cat_df[index_cols] = df[index_co...
Python
0
@@ -2314,24 +2314,43 @@ me%5D, axis=1) +.astype('category') %0A%0A catego
f89bc55aebeba0cbf3c8423c97599aa0d334d9c9
Fix lint error (#113)
synthtool/gcp/common.py
synthtool/gcp/common.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000001
@@ -937,16 +937,21 @@ lemented +Error ()%0A%0A
541822e07634a6dce374fed5b47b34212afd657f
Fix python 2.4 compatibility
lib/serializer.py
lib/serializer.py
# # # Copyright (C) 2007, 2008 Google Inc. # # This program 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 later version. # # This program is distri...
Python
0.000002
@@ -924,23 +924,8 @@ mac%0A -import hashlib%0A %0Afro @@ -947,16 +947,89 @@ errors%0A +%0Atry:%0A from hashlib import sha1%0Aexcept ImportError:%0A import sha as sha1 %0A%0A# Chec @@ -2253,30 +2253,20 @@ + txt, -hashlib.sha256 +sha1 ).hexdig @@ -3310,22 +3310,12 @@ sg, -hashlib.sha256 +sha1 ).he
7b4531ec867982ba2f660a2a08e85dbae457083e
Fix new line stripping in admin site
users/models.py
users/models.py
import hashlib import urllib.parse as urllib from django.contrib.auth.models import User from django.db import models # extension to django's User class which has authentication details # as well as some basic info such as name class Member(models.Model): def gravatar(self, size=128): default = "https://...
Python
0
@@ -799,36 +799,36 @@ bio = models. -Char +Text Field(max_length @@ -861,36 +861,36 @@ nature = models. -Char +Text Field(max_length
1116d028071f542c3452a61b3f64a2b9f81f94ff
Fix facts broken by default change.
pyinfra/facts/server.py
pyinfra/facts/server.py
# pyinfra # File: pyinfra/facts/server.py # Desc: server/os related facts from __future__ import unicode_literals import re from datetime import datetime from dateutil.parser import parse as parse_date from pyinfra.api import FactBase class Home(FactBase): command = 'echo $HOME' class Hostname(FactBase): ...
Python
0
@@ -1468,16 +1468,35 @@ c/group' +%0A default = list %0A%0A de @@ -4391,99 +4391,8 @@ e'%0A%0A - default = %7B%0A 'name': None,%0A 'major': None,%0A 'minor': None,%0A %7D%0A%0A @@ -4794,16 +4794,161 @@ %0A %5D%0A%0A + @staticmethod%0A def default():%0A return %...
3fe1eab593d2f2ef5125570c297e14b96ad7d709
Reword get_installation_order docstring
src/pip/_internal/resolution/resolvelib/resolver.py
src/pip/_internal/resolution/resolvelib/resolver.py
import functools import logging from pip._vendor import six from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.resolvelib import BaseReporter, ResolutionImpossible from pip._vendor.resolvelib import Resolver as RLResolver from pip._internal.exceptions import InstallationError from pip._interna...
Python
0
@@ -4362,41 +4362,55 @@ %22%22%22 -Create a list that orders given r +Get order for installation of requirements in R equi @@ -4415,34 +4415,19 @@ uirement -s for installation +Set .%0A%0A @@ -4451,26 +4451,18 @@ ist -should contain +s a -ll req @@ -4473,135 +4473,150 @@ ment -s in %60%60req_set%60%6...
0b7ab77ef7d290ef4c9708d0564c474fa51dcc2d
rename flipoutput method to flip_output
psv/core/objects/selections.py
psv/core/objects/selections.py
from ..utils import cleanup_name, multiple_index, limit_text from ..utils import _index_function_gen, generate_func, asciireplace from ..exceptions.messages import ApiObjectMsg as msg from types import FunctionType from tabulate import tabulate class Selection(object): __slots__ = ["__rows__", "__apimother__"] ...
Python
0.000036
@@ -1930,16 +1930,17 @@ def flip +_ output(s
2af91316f3ee5174d6183fd376d527e072bebdd2
Make deleting from form skip validation, because we really don't actually care.
sleep/forms.py
sleep/forms.py
from django import forms from sleep.models import * from django.core.exceptions import * import pytz import datetime class GroupForm(forms.ModelForm): class Meta: model=SleeperGroup fields = ['name'] class SleeperProfileForm(forms.ModelForm): idealWakeupWeekend = forms.CharField(max_length=30...
Python
0
@@ -2605,32 +2605,178 @@ ef clean(self):%0A + if 'delete' in self.data and self.data%5B'delete'%5D =='on': return %7B'delete': 'on' %7D #Skip validation, I don't actually care if I'm deleting%0A cleaned_
57cec2b03eaa6857bcb1b3780c4de00c3165b281
Return early if owner
utils/checks.py
utils/checks.py
from discord.ext import commands def is_owner_or(**perms): async def predicate(ctx): owner = await ctx.bot.is_owner(ctx.author) permissions = ctx.channel.permissions_for(ctx.author) return all(getattr(permissions, perm, None) == value for perm, value in perms.ite...
Python
0.000006
@@ -101,15 +101,10 @@ -owner = +if awa @@ -126,32 +126,58 @@ wner(ctx.author) +:%0D%0A return True %0D%0A permis @@ -343,17 +343,8 @@ s()) - or owner %0D%0A
42cec96f1e3465d5c2ce0e47d66c4ffa17f6548b
Fix log method if iotdb_log cannot be imported.
smartthings.py
smartthings.py
# # smartthings.py # # David Janes # IOTDB.org # 2014-01-31 # # Demonstrate how to use the SmartThings API from Python. # # See also: # Example App explanation: # http://build.smartthings.com/blog/tutorial-creating-a-custom-rest-smartapp-endpoint/ # # Example PHP code: # https://www.dropbox.com/s/7m...
Python
0
@@ -689,24 +689,46 @@ og(object):%0A + @staticmethod%0A def @@ -731,22 +731,16 @@ def log( -self, **ad):%0A
28c314e98ec88586b8c423b0941d8f029e4946e9
fix function which has obviously never been tested
lib/xdg_secret.py
lib/xdg_secret.py
import subprocess def xdg_secret_store(label, secret, attrs): with subprocess.Popen(["secret-tool", "store", "--label", label] + attrs, stdin=subprocess.PIPE) as proc: proc.communicate(secret.encode("utf-8")) return proc.wait() == 0 def xdg_secret_lookup_secret(attrs): ...
Python
0.000001
@@ -474,16 +474,17 @@ .rstrip( +b %22%5Cn%22)%0A%0Ad
2d3016ce69e9a40dc5e428a0aa6ea75775c7d84a
Fix subscribe merge_vars.
pybossa/newsletter/__init__.py
pybossa/newsletter/__init__.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2014 SF Isle of Man Limited # # PyBossa 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...
Python
0
@@ -2502,62 +2502,8 @@ ddr%7D -%0A merge_vars%5B'email'%5D = user.email_addr %0A%0A
e1a4b0d7f7d9e860dce794e07aadedea193d470e
Set version to v2.0.18.dev1
spacy/about.py
spacy/about.py
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __title__ = 'spacy' __version__ = '2.0.18' __summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython' __uri__ ...
Python
0.000011
@@ -210,16 +210,21 @@ '2.0.18 +.dev1 '%0A__summ @@ -440,11 +440,12 @@ _ = -Tru +Fals e%0A%0A_
e08ab1b77f72336f868fafc4d87b0ef36d703ac4
Support alternative lib file name on Mac OS
pymediainfo/__init__.py
pymediainfo/__init__.py
import json import os import sys from pkg_resources import get_distribution import xml.etree.ElementTree as ET from ctypes import * __version__ = get_distribution("pymediainfo").version class Track(object): def __getattribute__(self, name): try: return object.__getattribute__(self, name) ...
Python
0
@@ -2418,16 +2418,37 @@ arwin%22:%0A + try:%0A @@ -2486,16 +2486,93 @@ dylib%22)%0A + except OSError:%0A lib = CDLL(%22libmediainfo.dylib%22)%0A
d5c8d2f5fd4177b6f4980689ae972352563c28e5
Update about.py and increment version
spacy/about.py
spacy/about.py
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __title__ = 'spacy' __version__ = '1.8.2' __summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython' __uri__ =...
Python
0
@@ -208,13 +208,13 @@ = ' -1.8.2 +2.0.0 '%0A__ @@ -351,24 +351,20 @@ = ' -Matthew Honnibal +Explosion AI '%0A__ @@ -378,11 +378,14 @@ = ' -mat +contac t@ex
845be624ed0dfb8d942b240034af8b58f7a32e13
Fix the benchmark warm up code to make sure op that graph is not re-optimized during the timed run.
tensorflow/python/data/benchmarks/benchmark_base.py
tensorflow/python/data/benchmarks/benchmark_base.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 applica...
Python
0.000087
@@ -3121,16 +3121,19 @@ _element +.op )%0A%0A
0aa167d5959eefdb3509b1b74796741793df227a
add test cases
pyfluka/reader/UsrbinReader.py
pyfluka/reader/UsrbinReader.py
import operator from functools import partial from itertools import chain import numpy as np from BaseReader import BaseReader from pyfluka.base import InvalidInputError class UsrbinReader(BaseReader): def __init__(self, quantity="Activity", dim=None, weights=None): super(self.__class__, self).__init__(...
Python
0.000011
@@ -4010,25 +4010,24 @@ Binning%22%5D))%0A -%0A for @@ -4672,16 +4672,20 @@ ype %22 + +str( type(dat @@ -4681,25 +4681,26 @@ tr(type(data%5Bdet%5D%5Bkey%5D)) +) %0A
4e2f5c79b67a86fce622c486a0ea28fca0130015
clean up default arguments in strip_training_tags()
taggertester/testing.py
taggertester/testing.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from nltk.tag.stanford import StanfordPOSTagger from .config import DATA_DIR_NAME, PATH_TO_DATA_DIR from .files import TrainingFile, write_to_directory from .tag import FilePair class TaggerTester(object): """Collection of files for training/testing part-of-speech ta...
Python
0
@@ -1505,35 +1505,38 @@ s(self, -hand_tagged_sentenc +sentence=None, sep=Non e):%0A @@ -1594,24 +1594,144 @@ entence.%22%22%22%0A + if sentence == None:%0A sentence = self.hand_tagged%0A if sep == None:%0A sep = self.sep%0A retu @@ -1742,21 +1742,16 @@ w.split( -sel...
b82996ce03989c38e076679df35b378acdce753e
fix bug: random shuffle
spider/task.py
spider/task.py
# -*- coding: utf-8 -*- import logging import re import json import uuid import random from urllib.parse import urlparse from requests.exceptions import ConnectionError import requests import redis import pika from lxml import etree from twisted.internet import reactor, defer from scrapy.utils.project import get_p...
Python
0.000002
@@ -6103,34 +6103,24 @@ False%0A%0A -for __ in random.shuff @@ -6122,32 +6122,55 @@ shuffle(spiders) + %0A for __ in spiders :%0A runner @@ -6904,24 +6904,52 @@ turn False%0A%0A + random.shuffle(spiders)%0A @defer.i @@ -7001,39 +7001,23 @@ r __ in -random.shuffle( spiders -) :%0A
e0ff861e26c0f3c73c8f8c55ee5be0ad5a9cd68e
Fix issues on linux (due to previous commits on windows)
pyqode/core/__init__.py
pyqode/core/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyQode - Python/Qt Code Editor widget # Copyright 2013, Colin Duquesnoy <colin.duquesnoy@gmail.com> # # This software is released under the LGPLv3 license. # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see ...
Python
0
@@ -2913,9 +2913,8 @@ PyQt -4 %22:%0A
e8a5a97ea18120915dba74b9a73fdca4eb381568
Fix indentation level
tail/tests/test_tail.py
tail/tests/test_tail.py
""" Tests for the tail implementation """ from tail import FileBasedTail def test_tail_from_file(): """Tests that tail works as advertised from a file""" from unittest.mock import mock_open, patch, Mock # The mock_data we are using for our test mock_data = """A B C D E F """ mocked_open = mock_o...
Python
0.035546
@@ -792,32 +792,28 @@ with patch(' -builtins +tail .open', mock @@ -1350,20 +1350,16 @@ %22F%22%5D%0A%0A%0A - def test @@ -1377,20 +1377,16 @@ file():%0A - %22%22%22T @@ -1436,20 +1436,16 @@ ile%22%22%22%0A%0A - from @@ -1490,20 +1490,16 @@ , Mock%0A%0A - # Th @@ -1532,28 +1532,24...
17951915f22d12223373bec5e8003b4de666b843
__main__ compatible with python 3.5
pyqualtrics/__main__.py
pyqualtrics/__main__.py
# -*- coding: utf-8 -*- # # This file is part of the pyqualtrics package. # For copyright and licensing information about this package, see the # NOTICE.txt and LICENSE.txt files in its top-level directory; they are # available at https://github.com/Baguage/pyqualtrics # # Licensed under the Apache License, Version 2.0...
Python
0.999665
@@ -867,16 +867,106 @@ trics%0A%0A%0A +try:%0A # Python 2.7%0A input = raw_input%0Aexcept NameError:%0A # Python 3.5%0A pass%0A%0A%0A def main @@ -1300,20 +1300,16 @@ user = -raw_ input(%22E @@ -1414,20 +1414,16 @@ token = -raw_ input(%22E
f76c6376d8fe2b7fb8c1b9a9ad2566cc22b109fb
Change dict to kwarg format in test_monomerpattern
pysb/tests/test_core.py
pysb/tests/test_core.py
from pysb.testing import * from pysb.core import * from functools import partial def test_component_names_valid(): for name in 'a', 'B', 'AbC', 'dEf', '_', '_7', '__a01b__999x_x___': c = Component(name, _export=False) eq_(c.name, name) def test_component_names_invalid(): for name in 'a!', '!B'...
Python
0.00001
@@ -2685,23 +2685,20 @@ = A( -%7B'a': +a= ('u', + ANY) -%7D )%0A%0A@
33efe92104ad139f9313d91ae7b2eea8a76da9d7
fix flake8
pyscalambda/__init__.py
pyscalambda/__init__.py
from pyscalambda.operands import Underscore from pyscalambda.operators import UnaryOperator from pyscalambda.quote import quote from pyscalambda.scalambdable import scalambdable_const, scalambdable_func, scalambdable_iterator from pyscalambda.utility import convert_operand _ = Underscore(0) _1 = Underscore(1) _2 =...
Python
0
@@ -622,16 +622,17 @@ alue))%0A%0A +%0A __all__
4b6117fd4835cbde52e8d3fba79e46c2ec63a637
Add explanatory comments about the parent-child relationships
mapit/management/commands/find_parents.py
mapit/management/commands/find_parents.py
# This script is used after Boundary-Line has been imported to # associate shapes with their parents. With the new coding # system coming in, this could be done from a BIG lookup table; however, # I reckon P-in-P tests might be quick enough... from django.core.management.base import NoArgsCommand from mapit.models imp...
Python
0
@@ -635,229 +635,1140 @@ -'DIW': 'DIS',%0A 'CED': 'CTY',%0A 'LBW': 'LBO',%0A 'LAC': 'GLA',%0A 'MTW': 'MTD',%0A 'UTE': 'UTA',%0A 'UTW': 'UTA',%0A 'SPC': 'SPE',%0A 'WAC': 'WAE', +# A District council ward's parent is a District ...
5d94f90126260f147822ba8d3afe9c1c0a85e943
Discard FASTA headers by default.
pypeline/common/formats/msa.py
pypeline/common/formats/msa.py
#!/usr/bin/python # # Copyright (c) 2012 Mikkel Schubert <MSchubert@snm.ku.dk> # # 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 #...
Python
0
@@ -2088,24 +2088,45 @@ se_msa(lines +, read_header = False ):%0A msa = @@ -2123,18 +2123,31 @@ %0A msa +, headers = + %7B%7D, %7B%7D%0A @@ -2143,36 +2143,38 @@ %7B%7D, %7B%7D%0A for ( -name +header , sequence) in p @@ -2188,24 +2188,64 @@ sta(lines):%0A + name = header.split(None, 1)%5B0%...
c0824d3cb9cba811ba36c2f8937e91716f5a50df
Fix lint
ci/run_script.py
ci/run_script.py
""" Run tests and linters on Travis CI. """ import os import subprocess import sys from pathlib import Path import pytest def run_test(test_filename: str) -> None: """ Run pytest with a given filename. """ path = Path('tests') / 'mock_vws' / test_filename result = pytest.main([ '-vvv', ...
Python
0.000032
@@ -294,16 +294,25 @@ st.main( +%0A %5B%0A @@ -317,16 +317,20 @@ + + '-vvv',%0A @@ -325,16 +325,20 @@ '-vvv',%0A + @@ -360,16 +360,20 @@ + + str(path @@ -375,16 +375,20 @@ (path),%0A + @@ -400,16 +400,20 @@ v=src',%0A + @@ -431...