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
199e09408c252c703cdc6668e0bd4593c3642b55
Allow to pass different codecs
cast/cast.py
cast/cast.py
# pip install -r requirements.txt from __future__ import print_function from ConfigParser import ConfigParser from os.path import expanduser import time import pychromecast import argparse parser = argparse.ArgumentParser(description='Chromecast toolset.') parser.add_argument('--url', help='url of the video') parser....
Python
0.000007
@@ -872,16 +872,77 @@ ning.')%0A +parser.add_argument('--codec', help='Codec, e.g. video/mp4')%0A args = p @@ -1435,16 +1435,100 @@ gs.url:%0A + if args.codec:%0A codec = args.codec%0A else:%0A codec = 'video/mp4'%0A mc.p @@ -1547,27 +1547,21 @@ gs.url, -'video/mp4' +codec )%0A%0Amc.bl
cd82fc3adab4d88de805a90bb20ec6207a28b310
Fix typo in docstrings (#12220)
airflow/api_connexion/schemas/task_instance_schema.py
airflow/api_connexion/schemas/task_instance_schema.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
0.000218
@@ -5751,17 +5751,16 @@ with me -a tadata a
310b49e39a511a57312c1560b09f1dd2449cd84b
add force git pull and fix path
github_backup_user_repos.py
github_backup_user_repos.py
#!/usr/bin/python # -*- coding: utf-8 -*- # author Oros # date 2020-06-07 # license CC0 # # This program clone and pull all repositories of one or more user for backup. # Work with python 2 and 3 # import os from json import loads as json_loads from sys import exit, argv from time import strftime, gmtime from optparse ...
Python
0
@@ -550,27 +550,34 @@ r, outputDir +, force ):%0A - if user @@ -1760,24 +1760,33 @@ if +force or item%5B%22update @@ -2021,20 +2021,17 @@ system(%22 -push +c d %7B%7D%7B%7D; @@ -2042,14 +2042,8 @@ pull -; popd %22.fo @@ -3091,16 +3091,113 @@ ctory%22)%0A + parser.add_option(%22-f%22, %22--...
737d069c57c3cb2d6305f8e5d1f7d88402ef1327
Add support for v2 endpoints in config.
go/apps/jsbox/definition.py
go/apps/jsbox/definition.py
import json from go.vumitools.conversation.definition import ( ConversationDefinitionBase, ConversationAction) class ViewLogsAction(ConversationAction): action_name = 'view_logs' action_display_name = 'View Sandbox Logs' redirect_to = 'jsbox_logs' class ConversationDefinition(ConversationDefinition...
Python
0
@@ -894,95 +894,339 @@ - pool, tag = js_config.get(%22sms_tag%22)%0A except Exception:%0A return %5B +except Exception:%0A return %5B%5D%0A%0A endpoints = set()%0A # vumi-jssandbox-toolkit v2 endpoints%0A try:%0A endpoints.update(js_config%5B%22endpo...
2d81c83545703359ab13652997bdffffc2b0f62b
Fix TOC
lite/tools/build_model_maker_api_docs.py
lite/tools/build_model_maker_api_docs.py
# Lint as: python3 # Copyright 2020 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 ...
Python
0.000001
@@ -1041,16 +1041,292 @@ _maker%0A%0A +import yaml%0A%0A%0Aclass OrderedDumper(yaml.dumper.Dumper):%0A pass%0A%0A%0Adef _dict_representer(dumper, data):%0A %22%22%22Force yaml to output dictionaries in order, not alphabetically.%22%22%22%0A return dumper.represent_dict(data.items())%0A%0A%0AOrderedDumper.add_repres...
b595f5c67cd9ed99233df3524b41f6ca972dc22d
change default
string_recorder/__init__.py
string_recorder/__init__.py
from string_recorder.string_recorder import StringRecorder
Python
0.000002
@@ -29,16 +29,20 @@ recorder +_pil import
a6efd2cc2bac611c237203e3e74b9fdcde661f6a
add comment
libndarray/tools/mk_config.py
libndarray/tools/mk_config.py
import re import sys DEFINE_MAP = { 'VERSION': 'DUMMY_VERSION', 'HAVE_LONG_LONG_INT': 'NPY_HAVE_LONGLONG', 'SIZEOF_LONG_DOUBLE': 'NPY_SIZEOF_LONGDOUBLE', 'SIZEOF_LONG_LONG': 'NPY_SIZEOF_LONGLONG', 'SIZEOF_VOID_P': 'NPY_SIZEOF_PTR', 'SI...
Python
0
@@ -2022,9 +2022,9 @@ orm -! += = 'd @@ -2031,16 +2031,192 @@ arwin':%0A + data += '''%0A/* long double representation is not added by tools/mk_config.py on OSX%0A because NPY_LDOUBLE_??? is definied in src/npy_fpmath.h for OSX%0A*/%0A'''%0A else:%0A
5b27973ef242ef949b292f03e8320c31ac1a62a1
Disable testing when dev scope isn't set.
conanfile.py
conanfile.py
from conans import ConanFile, CMake class ApriltagsConan(ConanFile): name = "apriltags" version = "master" settings = "os", "compiler", "build_type", "arch" generators = "cmake" options = {"opencv_dir": "ANY", "use_openmp": [True,False], "shared": [True,False]} default_options = "...
Python
0
@@ -967,16 +967,129 @@ lse %22%22%0A%0A + if not self.scope.dev:%0A cmake_opts += %22-DBUILD_PERF_TESTS:BOOL=FALSE -DBUILD_UNIT_TESTS:BOOL=FALSE %22%0A%0A self
bf5e60ec33e1eb3944cf51092bfa2b4574fc376c
Fix base URI for new API
cogs/news.py
cogs/news.py
import json import asyncio import discord from urllib.parse import quote from dateutil.parser import parse from utils import aiohttp_wrap as aw from discord.ext import commands class News(commands.Cog): def __init__(self, bot): self.bot = bot self.redis_client = bot.redis_client self.aio...
Python
0.000008
@@ -389,16 +389,20 @@ .com/v1/ +news %22%0A @@ -2371,20 +2371,16 @@ -(f%22%7B self.uri %7D/ev @@ -2379,64 +2379,8 @@ .uri -%7D/everything%22 if query else f%22%7Bself.uri%7D/top-headlines%22) ,%0A
50550564c09237b53b6abb8ab6ad1d4d50ef6eda
fix movie / show not found
cogs/tmdb.py
cogs/tmdb.py
#!/bin/env python import discord import json from discord.ext import commands import tmdbsimple as tmdb # TMDb key with open('data/apikeys.json') as f: tmdb.API_KEY = json.load(f)['tmdb'] class MyTMDb: def __init__(self, bot): self.bot = bot def sync_get_tmdb(query, type_search): """ N...
Python
0.000001
@@ -491,32 +491,40 @@ response = + None or search.tv(query @@ -604,16 +604,24 @@ sponse = + None or search.
72793a2fe309e296e37b39174178825db93f5641
Bump version: 0.0.3 -> 0.0.4
conanfile.py
conanfile.py
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.3" class CMakeUnitConan(ConanFile): name = "cmake-unit" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspillaz/cmake-include-guard...
Python
0
@@ -93,9 +93,9 @@ 0.0. -3 +4 %22%0A%0A%0A
e57aef65510e367fadd4776e2ed4cd247c43e8c1
update conanfile to export pakage
conanfile.py
conanfile.py
from conans import ConanFile, CMake class FMI4cppConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake", "virtualrunenv" requires = ( "boost/1.66.0@conan/stable", "libzip/1.5.1@bincrafters/stable", "spdlog/1.3.1@bincrafters/stable" ) opti...
Python
0
@@ -63,16 +63,320 @@ nFile):%0A + name = %22FMI4cpp%22%0A version = %220.5.4%22%0A license = %22MIT%22%0A author = %22Lars Ivar Hatledal %5Blarsivarhatledal@gmail.com%5D%22%0A url = %22https://github.com/NTNU-IHB/FMI4cpp%22%0A description = %22FMI 2.0 implementation written in modern C++.%22%0A to...
57278d72339be6032072d1bf58c5745199794995
Change the way multi line responses look like in a channel
core/main.py
core/main.py
import re import thread import traceback thread.stack_size(1024 * 512) # reduce vm size class Input(dict): def __init__(self, conn, raw, prefix, command, params, nick, user, host, paraml, msg): chan = paraml[0].lower() if chan == conn.nick.lower(): # is a PM chan...
Python
0.000001
@@ -2306,41 +2306,124 @@ -for line in out:%0A +input.say(input.nick + ': ')%0A for line in out:%0A input.say(unicode(line))%0A # inpu
676638ede872decf0d037a7edaf13b0b9bad047a
Fix ceilometer-test-event.py script
tools/ceilometer-test-event.py
tools/ceilometer-test-event.py
#!/usr/bin/env python # # Copyright 2013 Rackspace Hosting. # # 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.000033
@@ -1420,50 +1420,8 @@ ()%0A%0A -config_file = converter.get_config_file()%0A outp @@ -1753,20 +1753,44 @@ s%5Cn%22 %25 c -onfi +fg.CONF.event.definitions_cf g_file)%0A @@ -2247,19 +2247,19 @@ t.event_ -nam +typ e, event
e3eca0c9102fd29bce14badb69d7571a0b2ac07a
fix for unix socket memcache config (#1357)
elasticapm/instrumentation/packages/python_memcached.py
elasticapm/instrumentation/packages/python_memcached.py
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # 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, t...
Python
0
@@ -1583,16 +1583,30 @@ DAMAGE. +%0Aimport socket %0A%0Afrom e @@ -2664,29 +2664,28 @@ -address, port +first_server = insta @@ -2698,16 +2698,180 @@ rvers%5B0%5D +%0A if first_server.family == socket.AF_UNIX:%0A address = first_server.address%0A else:%0A ...
23f5ae5bb7c8deb98d08376f94100b19497c46cb
Fix plot_matching example
doc/examples/plot_matching.py
doc/examples/plot_matching.py
""" ============================ Robust matching using RANSAC ============================ In this simplified example we first generate two synthetic images as if they were taken from different view points. In the next step we find interest points in both images and find correspondences based on a weighted sum of squ...
Python
0.000037
@@ -4620,25 +4620,28 @@ ero(inliers) +%5B0%5D %0A - plot_matches @@ -4703,16 +4703,33 @@ +np.column_stack(( inlier_i @@ -4736,32 +4736,34 @@ dxs, inlier_idxs +)) , matches_color= @@ -4864,16 +4864,19 @@ utliers) +%5B0%5D %0Aplot_ma @@ -4943,16 +4943,33 @@ +np.column_stack(( outlier_ @@ -498...
cef1a4ff0da96741a560889de73f8c4529ad9404
remove empty line
doc/examples/reconst_shore.py
doc/examples/reconst_shore.py
""" ==================================================== Continuous and analytical diffusion signal modelling ==================================================== We show how to model the diffusion signal as a linear combination of continuous functions from the SHORE basis (Ozarslan et al. ISMRM 2009). We also compute...
Python
0.999999
@@ -2313,16 +2313,80 @@ show(r)%0A +fvtk.record(r, n_frames=1, out_path='odfs.png', size=(600, 600)) %0A%22%22%22%0A..
c97e5cf11fc21e2ef4ee04779a424e4d6a2b96ae
Add CustomizeBrowserOptions method to Metric base class
tools/perf/metrics/__init__.py
tools/perf/metrics/__init__.py
# Copyright 2013 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. class Metric(object): """Base class for all the metrics that are used by telemetry measurements. The Metric class represents a way of measuring somethin...
Python
0.000001
@@ -496,16 +496,385 @@ %0A %22%22%22%0A%0A + def CustomizeBrowserOptions(self, options):%0A %22%22%22Add browser options that are required by this metric.%0A%0A Some metrics do not have any special browser options that need%0A to be added, and they do not need to override this method; by%0A default, no b...
7ee0f8e4724b3f3e026c3fad1cd734ce513a3004
Remove now-obsolete testing helper
gratipay/testing/browser.py
gratipay/testing/browser.py
""" """ from __future__ import absolute_import, division, print_function, unicode_literals import atexit import os import time from splinter.browser import _DRIVERS from gratipay.security import user from . import P from .harness import Harness def get_browser(driver_name): # Override to clean up after oursel...
Python
0
@@ -112,20 +112,8 @@ t os -%0Aimport time %0A%0Afr @@ -2315,1062 +2315,8 @@ t)%0A%0A - def confirming(self, answer):%0A %22%22%22Return a context manager for working with confirm alerts cross-driver.%0A %22%22%22%0A%0A class Context(object):%0A%0A def __enter__(*a, **kw):%0A ...
97dfe37912d84baf7bb4724ac9b7717f750ffd54
correct damage_simulation() arguments in example
docs/source/code/output_paper.py
docs/source/code/output_paper.py
from ezclimate.tree import TreeModel t = TreeModel(decision_times=[0, 15, 45, 85, 185, 285, 385]) from ezclimate.bau import DLWBusinessAsUsual bau_default_model = DLWBusinessAsUsual() bau_default_model.bau_emissions_setup(tree=t) from ezclimate.cost import DLWCost c = DLWCost(tree=t, emit_at_0=bau_default_model.em...
Python
0.000001
@@ -749,35 +749,16 @@ xh=100.0 -, cons_growth=0.015 )%0A%0Afrom @@ -2977,16 +2977,17 @@ _%22:%0A%09base_case() +%0A
bafb9e91958a122ebd8ee623c8c623c72617f1aa
Fix scanning class.
apsuite/optimization/scanning.py
apsuite/optimization/scanning.py
"""Multidimensional Simple Scan method for Minimization.""" from threading import Thread as _Thread import numpy as _np class SimpleScan: """.""" def __init__(self): """.""" self._position = _np.array([]) self._delta = _np.array([]) self._curr_dim = 0 self._stop = Fa...
Python
0
@@ -58,270 +58,949 @@ %22%22%0A%0A -%0Afrom threading import Thread as _Thread%0Aimport numpy as _np%0A%0A%0Aclass SimpleScan:%0A %22%22%22.%22%22%22%0A%0A def __init__(self):%0A %22%22%22.%22%22%22%0A self._position = _np.array(%5B%5D)%0A self._delta = _np.array(%5B%5D)%0A self._curr...
610dba7c4b8a08dee1387dd1a5ffba81ce12b7fc
Fix for import of `modpython.version` that does not exist for versions older than 3.2.
trac/web/modpython_frontend.py
trac/web/modpython_frontend.py
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2007 Edgewall Software # Copyright (C) 2004-2007 Christopher Lenz <cmlenz@gmx.de> # Copyright (C) 2005 Matthew Good <trac@matt-good.net> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this ...
Python
0.000004
@@ -772,17 +772,90 @@ ache -, version +%0Atry:%0A from mod_python import version%0Aexcept ImportError:%0A version = %22%3C 3.2%22 %0A%0Afr
36024f0d81fa9962782735a7a571b87d8b85235f
Add workaround for Windows to avoid OpenGL crash, which is to set emulate_texture to True.
vispy_volume/vol_vispy_widget.py
vispy_volume/vol_vispy_widget.py
from __future__ import absolute_import, division, print_function import numpy as np from glue.external.qt import QtGui from vispy import scene, app from vispy.color import get_colormap __all__ = ['QtVispyWidget'] class QtVispyWidget(QtGui.QWidget): def __init__(self, parent=None): super(QtVispyWidget, ...
Python
0
@@ -58,16 +58,29 @@ unction%0A +%0Aimport sys%0A%0A import n @@ -757,16 +757,104 @@ texture +. This needs to be enabled%0A # as a workaround on Windows otherwise VisPy crashes. %0A @@ -877,21 +877,39 @@ xture = -False +sys.platform == 'win32' %0A%0A
186ffd328dbcfb6593f25dd31938d5449e299f4d
Clean up tests of bifurcationfunct
neurom/fst/tests/test_bifurcationfunc.py
neurom/fst/tests/test_bifurcationfunc.py
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
Python
0.00006
@@ -1801,18 +1801,9 @@ tion -, Neurite %0A + from @@ -1847,116 +1847,8 @@ s bf -%0Afrom neurom.core import Tree, iter_neurites, iter_sections%0Afrom neurom.fst._neuritefunc import map_sections %0A%0As0 @@ -2084,33 +2084,253 @@ ))%0A%0A -test_neurite = Neurite(s0 +a0 = Section(%5B0.0, 0.0, 0.0%5D)%0Aa1 = s0.add_ch...
896c1e252aaad5ac75ad485da3d19d2244260414
Make it possible to disable validation with validate_every_n=0
niftynet/application/base_application.py
niftynet/application/base_application.py
from six import with_metaclass from niftynet.utilities import util_common from niftynet.layer.base_layer import TrainableLayer import tensorflow as tf class SingletonApplication(type): _instances = None def __call__(cls, *args, **kwargs): if cls._instances is None: cls._instances...
Python
0.000283
@@ -4522,16 +4522,78 @@ if +param.validate_every_n %3E 0 and %5C%0D%0A iter_i %25
b200d02a74f5c643dbbc9de510aaf2c64e3ce947
add path to translations folder
hawkpost/settings/common.py
hawkpost/settings/common.py
""" Django settings for hawkpost project. Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ from django....
Python
0.000001
@@ -4924,8 +4924,146 @@ OMAIN%22)%0A +%0A# LOCALE_PATH for translations%0A# https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-LOCALE_PATHS%0ALOCALE_PATHS = %5B'locale'%5D%0A
0feff87d4ed72fe7d35f2b51ac5f67c7ea34a4c1
Remove obsolete comments
nipype-pbs-workflows/dcm2niiconverter.py
nipype-pbs-workflows/dcm2niiconverter.py
""" Copyright 2014 University of Florida. All rights reserved. Use of this source code is governed by the license found in the LICENSE file. For instructions on how to use this script please refer to doc/README_dcm2niiconverter.md """ import os # system functions import nipype.inte...
Python
0
@@ -2201,17 +2201,16 @@ ource%22)%0A -%0A infosour @@ -2266,415 +2266,8 @@ )%5D%0A%0A -# #Node: Infosource - we use IdentityInterface to create our own node, to specify%0A# # the list of subjects the pipeline should be executed on%0A# subjectsource = pe.Node(interface=util.IdentityInterface(fields=...
4c5a22f908e25b7f9b9fd829eb7908effd8f7fb6
fix issue if no affected references
helpers/manipulator_base.py
helpers/manipulator_base.py
from google.appengine.ext import ndb from helpers.cache_clearer import CacheClearer class ManipulatorBase(object): """ Provides a basic framework for manipulating db models. Ideally, all db read/writes would go through manipulators. """ BATCH_SIZE = 500 @classmethod def delete_keys(cls, ...
Python
0.000001
@@ -591,32 +591,91 @@ istify(models):%0A + if hasattr(model, '_affected_references'):%0A self @@ -712,24 +712,28 @@ nces(model)%0A + @@ -2461,24 +2461,67 @@ if +hasattr(model, '_affected_references') and getattr(mode
d42829197e5a4cf285fb5bab6723c28189da96b8
Update history_message_download.py
history_message_download.py
history_message_download.py
#! /usr/bin/env python # coding=utf-8 import os import re import json import time import logging import random import datetime import hashlib import commands commands.getoutput('easy_install requests') import requests class ConnectionError(Exception): def __init__(self, response, content=None, message=None): ...
Python
0.000002
@@ -52,16 +52,58 @@ port re%0A +import ConfigParser%0Asys.path.append('./')%0A import j
8d15f88e8c1e400a5f28622aa16e18587aea8a3c
Handle absent email key
allauth/socialaccount/providers/amazon/provider.py
allauth/socialaccount/providers/amazon/provider.py
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class AmazonAccount(ProviderAccount): def to_str(self): return self.account.extra_data.get("name", super(AmazonAccount, self).to_str()) class AmazonProvider(OAuth2P...
Python
0.00005
@@ -851,17 +851,25 @@ data -%5B +.get( %22email%22 -%5D +, %22%22) , la
59a1047d4105b94181a75b1d496469f0efe2989f
add admin action test
InvenTree/plugin/test_api.py
InvenTree/plugin/test_api.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.urls import reverse from InvenTree.api_tester import InvenTreeAPITestCase class PluginDetailAPITest(InvenTreeAPITestCase): """ Tests the plugin AP I endpoints """ roles = [ 'admin.add', 'admin.view', ...
Python
0
@@ -1607,16 +1607,1247 @@ irmed'.upper())%0A +%0A def test_admin_action(self):%0A %22%22%22%0A Test the PluginConfig action commands%0A %22%22%22%0A from plugin.models import PluginConfig%0A from plugin import plugin_reg%0A%0A url = reverse('admin:plugin_pluginconfig_change...
f9c7a911411429972929bb4372b370192bd4cf8a
Update crossfilter to gray/blue scheme
altair/examples/interactive_layered_crossfilter.py
altair/examples/interactive_layered_crossfilter.py
""" Interactive Crossfilter ======================= This example shows a multi-panel view of the same data, where you can interactively select a portion of the data in any of the panels to highlight that portion in any of the other panels. """ # category: interactive charts import altair as alt from vega_datasets impor...
Python
0.000001
@@ -737,12 +737,12 @@ %0A%0A# -blue +gray bac @@ -782,16 +782,54 @@ = base. +encode(%0A color=alt.value('#ddd')%0A). add_sele @@ -848,14 +848,12 @@ %0A%0A# -yellow +blue hig @@ -905,51 +905,8 @@ ase. -encode(%0A color=alt.value('goldenrod')%0A). tran
e56a22d4146b3b251d2e4903280c3dea226e8eed
update Great Yarmouth
polling_stations/apps/data_collection/management/commands/import_great_yarmouth.py
polling_stations/apps/data_collection/management/commands/import_great_yarmouth.py
from django.contrib.gis.geos import Point from data_collection.management.commands import BaseHalaroseCsvImporter class Command(BaseHalaroseCsvImporter): council_id = "E07000145" addresses_name = "parl.2019-12-12/Version 1/polling_station_export-2019-11-12GY.csv" stations_name = "parl.2019-12-12/Version 1...
Python
0
@@ -804,16 +804,416 @@ =4326)%0A%0A + # Corrections from Council%0A if rec%5B%22internal_council_id%22%5D == %2211-the-priory-centre%22:%0A rec%5B%22postcode%22%5D = %22NR30 1NA%22%0A rec%5B%22address%22%5D = %22The Catalyst%5CnThe Conge%5CnGreat Yarmouth%22%0A if rec%5B%22in...
1a52a28c5864f82edd19febba14b861d5f3efef1
fix gibbs ensemble unit test
hoomd/hpmc/test-py/gibbs.py
hoomd/hpmc/test-py/gibbs.py
from __future__ import division from hoomd import * from hoomd import hpmc import unittest import math # this script needs to be run on two ranks # initialize with one rank per partitions context.initialize(args="--nrank=1") class gibbs_ensemble_test(unittest.TestCase): def setUp(self): p = comm.get_pa...
Python
0
@@ -593,22 +593,8 @@ 23+p -,implicit=True )%0A
973571f7f24ecd60caab6035515a881f80304b50
Fix missing response body in error response.
horizon_contrib/api/base.py
horizon_contrib/api/base.py
import json import logging import requests from horizon import messages from requests import exceptions from django.conf import settings from .response import DictResponse, ListResponse LOG = logging.getLogger("client.base") TOKEN_FORMAT = " Token {0}" class ClientBase(object): """Base Client Object with m...
Python
0.000027
@@ -2069,12 +2069,12 @@ est. -body +text )%0A
152417b5c754509d2b64c0ab1c1a74ac612f96ad
fix for python 3
html5validator/validator.py
html5validator/validator.py
"""The main validator class.""" import os import re import vnujar import fnmatch import subprocess class JavaNotFoundException(Exception): def __str__(self): return 'Missing Java Runtime Environment on this system. ' +\ 'The command "java" must be available.' class Validator(object): ...
Python
0.000052
@@ -2280,17 +2280,19 @@ essError -, + as e:%0A
d1911e9c545a88c5924d7d631d278e1c225edcf8
Add log message about unknown couch exception
openprocurement/auction/helpers/couch.py
openprocurement/auction/helpers/couch.py
import socket from random import sample from urlparse import urlparse from couchdb import Server, Session from time import sleep CONSTANT_IS_TRUE = True def couchdb_dns_query_settings(server_url, database_name): parsed_url = urlparse(server_url) all_ips = set([str(i[4][0]) for i in socket.getaddrinfo(urlpars...
Python
0
@@ -126,32 +126,95 @@ eep%0A -%0ACONSTANT_IS_TRUE = True +import sys%0Aimport logging%0A%0ACONSTANT_IS_TRUE = True%0ALOGGER = logging.getLogger(__name__) %0A%0A%0Ad @@ -2095,24 +2095,209 @@ continue%0A + except Exception:%0A err_type, value, traceback = sys.exc_info()%0A LOGGER.warnin...
3e312180c1d3a0df2a5ba193cb75961166e92cc6
Add SignedCertificateTimestamp namedtuple
ctutlz/sct/scrape/tls_extension_18.py
ctutlz/sct/scrape/tls_extension_18.py
import collections from utlz import flo from utlz import StructContext _SctListEntry = collections.namedtuple( typename='SctListEntry', field_names=[ 'sct_len', 'sct_der', ] ) _TlsExtension18 = collections.namedtuple( typename='TlsExtension18', field_names=[ 'tls_extens...
Python
0.000001
@@ -1055,8 +1055,705 @@ a_dict)%0A +%0A%0A_SignedCertificateTimestampList = collections.namedtuple(%0A typename='SignedCertificateTimestampList',%0A field_names=%5B%0A 'signed_certificate_timestamp_list_len',%0A 'sct_list',%0A %5D%0A)%0A%0A%0Adef SignedCertificateTimestampList(sctlist):%0A wi...
97e81e53ac068927f41e4045bc05002831d2c408
fix url patterns
CopyHaste/CopyHaste/urls.py
CopyHaste/CopyHaste/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from .views import home_view urlpatterns = patterns( '', url(r'^admin/', include(admin.site.urls)), url(r'^$', home_view, name='homepage'), url(r'^accounts/', include('registration.backends.default.urls')), url(r'^...
Python
0.999223
@@ -25,18 +25,8 @@ port - patterns, inc @@ -116,25 +116,9 @@ s = -patterns(%0A '', +%5B %0A @@ -328,10 +328,10 @@ rls')),%0A -) +%5D %0A
985f9042a9e4a27644db4248cf0ea34758c7bf29
fix test_worker to work with heartbeat registration
dask/distributed/tests/test_worker.py
dask/distributed/tests/test_worker.py
import pytest pytest.importorskip('zmq') pytest.importorskip('dill') from dask.distributed.worker import Worker from contextlib import contextmanager import multiprocessing import itertools import zmq from time import sleep import pickle context = zmq.Context() def inc(x): return x + 1 def add(x, y): return...
Python
0
@@ -473,25 +473,8 @@ data -, heartbeat=False )%0A%0A
d3430fccc442f461e22a4139ab5f60d06be73152
Fix endpoints_smoke_test on SDK 1.9.32.
appengine/components/tests/endpoints_smoke_test.py
appengine/components/tests/endpoints_smoke_test.py
#!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. """Smoke test for Cloud Endpoints support in auth component. It launches app via dev_appserver and queries a bunch of cloud endpoi...
Python
0.000003
@@ -2168,325 +2168,8 @@ ode) -%0A expected = %7B%0A u'error': %7B%0A u'code': 403,%0A u'errors': %5B%0A %7B%0A u'domain': u'global',%0A u'message': u'Forbidden',%0A u'reason': u'forbidden',%0A %7D%0A %5D,%0A u'message': u'Forbidden'...
4f3376d2803a4f158d44b59811e9f953895db0b3
Fix Line constructor
data/line.py
data/line.py
# This class will be used to generate random straight lines import random def generate_line(d_min, d_max): random.seed() d = random.randint(d_min, d_max) theta = random.randint(0, 359) return Line(d, theta) class Line: """Represents a straight line as distance 'd' from the origin and angle 'theta' from the x-ax...
Python
0.000003
@@ -324,60 +324,8 @@ %22%22%0A%0A -%09def __init__(self):%0A%09%09self.d = 0%0A%09%09self.theta = 0%0A%0A %09def @@ -341,23 +341,27 @@ (self, d +=0 , theta +=0 ):%0A%09%09sel
62da235cd5fe345ef1e2bc038193e1ddcedac1ce
remove unused line
dingo/grid/mv_grid/solvers/savings.py
dingo/grid/mv_grid/solvers/savings.py
""" Copyright 2016 openego development group Licensed under GNU General Public License 3.0. See the LICENSE file at the top-level directory of this distribution or obtain a copy of the license at http://www.gnu.org/licenses/gpl-3.0.txt Based on code by Romulo Oliveira copyright (C) 2015, ht...
Python
0.000163
@@ -6177,17 +6177,16 @@ -# savings_ @@ -6198,20 +6198,20 @@ remove(( -j, i +i, j ))%0A%0A @@ -6361,69 +6361,8 @@ ak%0A%0A - #solution._routes%5B0%5D.calc_circuit_breaker_position()%0A
c7f18a10b2d7be273d99a002d704a42661c98d23
Use the readthedocs theme.
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
Python
0
@@ -2394,16 +2394,17 @@ emes.%0A#%0A +# html_the @@ -2419,16 +2419,48 @@ abaster' +%0Ahtml_theme = %22sphinx_rtd_theme%22 %0A%0A# Them @@ -4851,28 +4851,29 @@ ---------------------------- +%0A
934879e3cbb1be519ee4b6936b8041cc5917d142
update docs
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # phpboot documentation build configuration file, created by # sphinx-quickstart on Fri Aug 11 10:12:02 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
Python
0.000001
@@ -863,17 +863,16 @@ ructify%0A -# from sph @@ -902,17 +902,16 @@ lexers%0A -# from pyg @@ -1021,17 +1021,16 @@ ------%0A%0A -# lexers%5B' @@ -1075,17 +1075,16 @@ enos=1)%0A -# lexers%5B' @@ -1141,17 +1141,16 @@ enos=1)%0A -# primary_
f2565db1e6467eb3546dc366f498ba4f8c4fe805
Fix link in docs
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # WeasyPrint documentation build configuration file. import codecs import os import re # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx...
Python
0
@@ -3185,34 +3185,32 @@ p:// -pythonhosted.org/cairocffi +cairocffi.readthedocs.io /',
d564a5402b4818b3d87639a0a6d245460df73e5a
Add sphinx.ext.autosectionlabel extension
docs/conf.py
docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
Python
0
@@ -1026,16 +1026,51 @@ ons = %5B%0A + 'sphinx.ext.autosectionlabel',%0A %5D%0A%0A# Add
c2abb41906a6e1fca8194175f7f59f120d868166
remove timezonefinder import
docs/conf.py
docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
Python
0
@@ -1224,16 +1224,18 @@ up(1)%0A%0A%0A +# import t @@ -1275,16 +1275,72 @@ document +, ATTENTION: must then be installed during online build! %0A%0A# -- P
c8a07e323c417b5617c1bad539aba2ae719cdad5
Add gaphas' path to sphinx config
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config from datetime import date from pathlib import Path from typing import Dict ...
Python
0
@@ -241,111 +241,8 @@ ig%0A%0A -from datetime import date%0Afrom pathlib import Path%0Afrom typing import Dict%0A%0Afrom tomlkit import parse%0A%0A # -- @@ -559,77 +559,120 @@ re.%0A -#%0A# import -os%0A# import sys%0A# sys.path.insert(0, os.path.abspath('.')) +sys%0Afrom datetime import date%0Afrom pathlib impor...
d1896b357d4840c3c2c46291df06ae223b97115e
Prepare official version bump
docs/conf.py
docs/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.abspath('../executor/')) # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx...
Python
0
@@ -506,16 +506,52 @@ Submit'%0A +version = '0.7.3'%0Arelease = '0.7.3'%0A copyrigh
e39642fc21e9de001ca435a62b66f4cd48bffadb
Allow POST methods
erply_api.py
erply_api.py
# -*- coding: utf-8 -*- """ erply ~~~~~ Simple Python wrapper for Erply API :copyright: (c) 2014 by Priit Laes :license: BSD, see LICENSE for details. """ from contextlib import closing from datetime import datetime import csv import requests class ErplyAuth(object): def __init__(self, code...
Python
0.000001
@@ -709,16 +709,50 @@ ckCSV',) +%0A ERPLY_POST = ('saveProduct',) %0A%0A de @@ -2490,24 +2490,299 @@ st, _page)%0A%0A + def handle_post(self, request, *args, **kwargs):%0A data = dict(request=request)%0A data.update(self.payload)%0A data.update(**kwargs)%0A r = requests.post(self...
f55b0b130923295ff01c80f38fe1ec4737735941
Fix these UnboundLocalError
esipy/app.py
esipy/app.py
# -*- encoding: utf-8 -*- """ App entry point. Uses Esi Meta Endpoint to work """ import time import requests from pyswagger import App from .utils import check_cache from .utils import get_cache_time_left class EsiApp(object): """ EsiApp is an app object that'll allows us to play with ESI Meta API, not to...
Python
0
@@ -2512,48 +2512,8 @@ iry%0A - if self.expire is None:%0A @@ -2578,22 +2578,73 @@ - if +cache_timeout = -1%0A if self.expire is None and expires @@ -2657,21 +2657,16 @@ t None:%0A -%0A @@ -2726,28 +2726,24 @@ - - cached_heade @@ -2764,36...
de8f7df034e5313d94e84ebc4951335eec0667c4
Complete version of exercise 2 and questions.
exercise2.py
exercise2.py
#!/usr/bin/env python """ Assignment 1, Exercise 2, INF1340, Fall, 2015. Name that shape. This module contains one function name_that_shape(). It prompts the user to input the number of sides in a shape and outputs the name of the shape. """ __author__ = 'Susan Sim' __email__ = "ses@drsusansim.org" __copyright__ = ...
Python
0
@@ -1218,43 +1218,916 @@ %22%22%22%0A -%0A print(%22Error%22)%0A%0A%0Aname_that_shape() +# Find shape name by number of sides input by user.%0A%0A side = int(input(%22Please enter the number of sides:%22))%0A%0A if side == 3:%0A print(%22This is a triangle.%22)%0A elif side == 4:%0A print(%22...
67c31a12c59e56f9cad7af84f9478fc026fe1816
add statspost cmd
ext/stats.py
ext/stats.py
import asyncio import logging import decimal import pymongo from datadog import statsd from discord.ext import commands from .common import Cog log = logging.getLogger(__name__) def empty_stats(c_name): return { 'name': c_name, 'uses': 0, } class Statistics(Cog): """Bot stats stuff."...
Python
0.000002
@@ -6264,16 +6264,159 @@ ses%60')%0A%0A + @commands.command()%0A @commands.is_owner()%0A async def statspost(self, ctx):%0A await self.single_stats()%0A await ctx.ok()%0A%0A %0Adef set
801f7103c860af740cafabeb84e9e594d32db11e
Update docstrings in fsictools module
fsictools.py
fsictools.py
# -*- coding: utf-8 -*- """ fsictools ========= Supporting tools for FSIC-based economic models. """ # Version number keeps track with the main `fsic` module from fsic import __version__ from typing import List from fsic import BaseModel, Symbol def symbols_to_dataframe(symbols: List[Symbol]) -> 'DataFrame': ""...
Python
0
@@ -89,17 +89,95 @@ models. + See the individual docstrings%0Afor dependencies additional to those of %60fsic%60. %0A - %22%22%22%0A%0A# V @@ -260,16 +260,26 @@ sion__%0A%0A +import re%0A from typ @@ -294,16 +294,17 @@ rt List%0A +%0A from fsi @@ -447,32 +447,55 @@ ndas%60 DataFrame. + **Requires %60pandas%60*...
10645b8d26f883312f0411f2b0bd79345556a5e2
correct syntax for hasattr
githubapp.py
githubapp.py
import os import base64 from flask import Flask , request, render_template import nbconvert.nbconvert as nbconvert import requests from nbformat import current as nbformat from flask import Flask, redirect, abort import re import github as gh from gist import render_content app = Flask(__name__) github = gh.Github() ...
Python
0.00019
@@ -1185,18 +1185,16 @@ if -e. hasattr( 'typ @@ -1189,16 +1189,18 @@ hasattr( +e, 'type')
1376e4f0c3af47716c5147bdf742a0373170a138
limit query output
bin/apocrypha_server.py
bin/apocrypha_server.py
#!/usr/bin/env python3 ''' Apocrypha Server TCP network server that listens for database requests ''' import apocrypha import os import socketserver import time db_server = None db_path = os.path.expanduser('~') + '/.db.json' class ApocryphaServer(apocrypha.Apocrypha): def __init__(self, path): '...
Python
0.999525
@@ -2793,16 +2793,21 @@ tr(args) +%5B:50%5D ))%0A%0A%0Acla
8f326164a1f8503b357eadcbba7a29c75caebf2e
Fix xml feed extraction.
WebMirror/processor/XmlProcessor.py
WebMirror/processor/XmlProcessor.py
from . import ProcessorBase import bs4 class XmlProcessor(ProcessorBase.PageProcessor): wanted_mimetypes = ['text/xml', 'application/xml'] want_priority = 50 loggerPath = "Main.Text.XmlProcessor" # def __init__(self, pageUrl, loggerPath, content, pbLut, **kwargs): def __init__(self, baseUrls, pageUrl...
Python
0
@@ -165,9 +165,9 @@ = -5 +4 0%0A%0A%09
b7e9f77284dc9cac22261ba5989747b844475762
Set default in uconf/cli.py
uconf/cli.py
uconf/cli.py
# coding: utf-8 # Copyright (c) 2010-2012 Raphaël Barrois from __future__ import unicode_literals """Parse command-line arguments. The CLI parsing is a three-step process: 1) Parse a minimal set of configuration options: - verbosity - config file - repository root 2) If a config fil...
Python
0
@@ -2230,38 +2230,47 @@ _true%22, default= +Default( False) +) %0A parser. @@ -2497,22 +2497,31 @@ default= +Default( False) +) %0A @@ -2597,16 +2597,49 @@ TARGET%22 +,%0A default=Default('') )%0A%0A #
c35fb7754ee62776bbea3baafb66d395d139f9ea
update scraper
scraper.py
scraper.py
import re from dateutil.parser import parse from xml.sax.saxutils import unescape import requests import bs4 from celery import Celery from app import app, db from models import Result base_scraper_url = app.config.get('SCRAPER_BASE_URL') base_url = app.config.get('BASE_URL') base_dict = {} celery = Celery(app.na...
Python
0
@@ -923,16 +923,21 @@ urn tree +.body %0A ret @@ -975,118 +975,137 @@ -bottom +h4 = -( file. -split('%3C!-- %5Cbfsc!7010%5Cb--%3E %3C!-- %5Cbcat:70%5Cb--%3E')).pop()%0A%0A return (bottom.split('%3C/div%3E'))%5B0%5D +find('h4')%0A data = str(h4)%0A for sibling in h4.find_next_siblings():%0A ...
de093f3046476da7c1540d983aac08408398fce6
Fix for Ebay Prices again!
scraper.py
scraper.py
# # Scraping Utilities # import urllib import logging # # Retrieves a URL to the card's image as represented by http://magiccards.info # def getCardImageURL(cardName, cardSet): magicInfoURL = "http://magiccards.info/query?q=" + urllib.quote(cardName) if cardSet: magicInfoURL += urllib.quote(" e:" ...
Python
0
@@ -1594,16 +1594,17 @@ d('span + class=%22g
3c776540b0774679af6a27bea1b9958a6769e48f
update worker.py
scraper.py
scraper.py
import re from dateutil.parser import parse from xml.sax.saxutils import unescape import requests import bs4 from app import app, db from models import Result base_scraper_url = app.config.get('SCRAPER_BASE_URL') base_url = app.config.get('BASE_URL') base_dict = {} def clean_html(html): return ' '.join(re.fin...
Python
0
@@ -102,16 +102,42 @@ port bs4 +%0Afrom celery import Celery %0A%0Afrom a @@ -291,16 +291,182 @@ = %7B%7D%0A%0A%0A +celery = Celery(app.name, broker=app.config%5B'CELERY_BROKER_URL'%5D)%0Acelery.conf.update(app.config)%0A%0A%0A@celery.task%0Adef test():%0A print('Hello world, sample tasks.')%0A%0A%0A def clea @...
778c8f2cf227da8c11e33ceb12b7058326254a96
improve connection error handling
cheertree.py
cheertree.py
import urllib2 import json import time import unicornhat as UH lastID = 0 #most recent entry_id refresh = 15 #refresh time in secs urlRoot = "http://api.thingspeak.com/channels/1417/" pixels = [] #list of pixels and their colours pattern = [[3,0], [2,1],[3,1],[4,1], [1,2],[2,2],[3,2],[4,...
Python
0.000001
@@ -478,15 +478,15 @@ 0%5D,%5B -1 +2 ,2%5D,%5B -5 +4 ,2%5D, @@ -496,15 +496,15 @@ 4%5D,%5B -0 +1 ,5%5D,%5B -6 +5 ,5%5D%5D @@ -1711,18 +1711,30 @@ t_exc()%0A +%0A%09return %5B%5D%09 %09%0A - %0A#use th @@ -2241,24 +2241,69 @@ (feedItem):%0A + if len(feedItem) == 0:%0A return -1%0A return i @@ -3...
0f147df0be5dc948405fe4a6deb83ff0f8109330
Add some debug logging to burst code
txircd/modules/server/burst.py
txircd/modules/server/burst.py
from twisted.plugin import IPlugin from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from txircd.utils import ModeType, timestampStringFromTime from zope.interface import implements class ServerBurst(ModuleData, Command): implements(IPlugin, IModuleData, ICommand) name = "ServerBurst" ...
Python
0.000001
@@ -1714,47 +1714,264 @@ %09%09%09%09 -continue%0A%09%09%09if not user.isRegistered(): +self.ircd.log.debug(%22Skipping bursting user %7Buser.nick%7D (%7Buser.uuid%7D) for being a local-only user%22, user=user)%0A%09%09%09%09continue%0A%09%09%09if not user.isRegistered():%0A%09%09%09%09self.ircd.log.debug(%22Skipping ...
f0f20089bc1c68c6547156f4f7b20116a5128dc7
Update RegisterHandler.py
Handlers/RegisterHandler.py
Handlers/RegisterHandler.py
# -*- coding: utf-8 -*- import logging from Handlers.BaseHandler import BaseHandler from Tools import PostgreSQL, VerifyFields logger = logging.getLogger(__name__) class RegisterHandler(BaseHandler): """handle / endpoint""" def get(self): """Serve Get and return main page""" self.render('re...
Python
0.000001
@@ -33,16 +33,43 @@ logging%0A +from tornado import escape%0A from Han @@ -105,16 +105,16 @@ Handler%0A - from Too @@ -455,24 +455,44 @@ prenom = +escape.xhtml_escape( self.get_bod @@ -507,24 +507,30 @@ nt('prenom') +)%5B:64%5D %0A nom @@ -532,16 +532,36 @@ nom = +escape.xhtml_escape( self.get @...
b2175715dcab0ab6360c513e5a455247afc25234
Update check_exec.py
src/check_exec.py
src/check_exec.py
#!/usr/bin/python3 ################################################################################ # Finds badwords in a file, particularly in exec* family of function calls, # and trys to determine what they are actually executing, to lower false positives from check_bad_words.py. # # calls to system() have high risk...
Python
0.000003
@@ -2931,24 +2931,29 @@ print (%22%5Ct +%5Ct%22,%22 error = %22 + @@ -3020,16 +3020,17 @@ %22, end=%22 + %22)%0A
730093369725dbc19112e01c909bde40620aa999
Fix %edit - editor attribute was missing
IPython/terminal/ptshell.py
IPython/terminal/ptshell.py
"""IPython terminal interface using prompt_toolkit in place of readline""" from __future__ import print_function import sys from IPython.core.interactiveshell import InteractiveShell from IPython.utils.py3compat import PY3 from traitlets import Bool, Unicode, Dict from prompt_toolkit.completion import Completer, Com...
Python
0
@@ -1126,16 +1126,65 @@ ok_func%0A +from .interactiveshell import get_default_editor%0A %0A%0Aclass @@ -2238,24 +2238,166 @@ ens%22%0A )%0A%0A + editor = Unicode(get_default_editor(), config=True,%0A help=%22Set the editor used by IPython (default to $EDITOR/vi/notepad).%22%0A )%0A%0A def get_
fac3a7e2f7c70bb46e8d4c5f3ad2b78001ce5769
change stat output
extension/views.py
extension/views.py
from django.views.decorators.clickjacking import xframe_options_exempt from annoying.decorators import render_to, ajax_request from django.contrib.auth.models import User from django.db.models import Q from common.view_helpers import JSONResponse from api.models import ChatMessage, EyeHistory from common.templatetags....
Python
0.000047
@@ -1655,16 +1655,381 @@ res%7D%0A%0A%0A +def get_stats(visits):%0A count = visits.count()%0A if count == 1:%0A count_text = '1 visit'%0A else:%0A count_text = '%25s visits' %25 (count)%0A if count == 0:%0A time = '0 seconds'%0A else:%0A time = humanize_time(datetime.timedel...
801765835e6e338dd4ffab17a46880bf8bc3a07e
use our own get_language_from_request instead of Django's
cms/views.py
cms/views.py
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.apphook_pool import apphook_pool from cms.appresolver import get_app_urls from cms.models import Title from cms.utils import get_template_from_request, get_language_from_request from cms.utils.i18n import get_fallback_languages, force_language, get_...
Python
0.000008
@@ -2668,20 +2668,8 @@ e = -translation. get_
8e230cf52bf4674deb98dbeb6e9e82bcb2d9a3c6
Fix relative import in core.py (for Python 3)
eyediagram/core.py
eyediagram/core.py
# Copyright (c) 2015, Warren Weckesser. All rights reserved. # This software is licensed according to the "BSD 2-clause" license. from __future__ import division as _division, print_function as _print_function import numpy as _np from scipy.interpolate import interp1d as _interp1d from _brescount import bres_curve_c...
Python
0
@@ -283,16 +283,17 @@ 1d%0Afrom +. _brescou
9f1ed873f235f618019107f2f2b81abcb6f9a477
Removing duplicates
update-affiliated/helpers_2.py
update-affiliated/helpers_2.py
# This set of repositories is a mixture of affiliated packages and packages # that use astropy_helpers and opted in receiving automated PRs to update # the helpers version. If your package requires Python 3.5+ consider adding # it to the list in the "helpers_3.py" file to recieve updates for the # Python 3.5+ releases ...
Python
0.999906
@@ -1605,40 +1605,8 @@ '),%0A - ('pyspeckit', 'pyspeckit'),%0A @@ -2051,32 +2051,8 @@ '),%0A - ('hipspy', 'hips'),%0A
49312e56b231b3bcc4d74f66e2d54b89a49bc677
Bah, fix typo
facebook_plugin.py
facebook_plugin.py
from app import * from flask.ext.login import login_required, current_user from flask import request, redirect, url_for import facebook @app.route('/admin/authorize_facebook') @login_required def authorize_facebook(): import urllib.parse, urllib.request, json params = {"client_id" : app.config.get('FACEB...
Python
0.999897
@@ -1424,16 +1424,52 @@ content, +%0A link=po @@ -1548,17 +1548,18 @@ link_url -%5D + %7D )%0A
e71c5a488106c3eecf7deb9099797e714e44b498
Change status detection
upol_search_engine/__main__.py
upol_search_engine/__main__.py
from time import sleep from upol_search_engine.upol_crawler import tasks def main(): crawler_settings = {'limit_domain': 'trnecka.inf.upol.cz', 'max_depth': 10, 'connect_max_timeout': 3.05, 'read_max_timeout': 10, 'frequency_per_server': 0.5, ...
Python
0.000001
@@ -559,16 +559,46 @@ RUNNING' + in feeder.status or 'PENDING' in feed
764913ba1b2e492eb1d966ab30c91229afab1893
Update config variable name
blockbuster/example_config_files/example_config.py
blockbuster/example_config_files/example_config.py
# General Settings timerestriction = False debug_mode = True log_directory = './logs' # Email Settings # emailtype = "Gmail" emailtype = "Console" # SMS Settings # outboundsmstype = "WebService" outboundsmstype = "Console" # Twilio Auth Keys account_sid = "twilio sid here" auth_token = "auth token here" # SMS Servi...
Python
0.000001
@@ -322,16 +322,22 @@ es Auth%0A +spsms_ basic_au
988f0e4be70e880d9d8ee2718ce57f9d7dffa4c6
Add file overwrite check for config file
accounts/tasks.py
accounts/tasks.py
import crypt import os from datetime import datetime from celery.decorators import task from django.conf import settings from django.contrib.auth.models import User from django.template.loader import get_template from ldap3 import Connection, Server, SYNC, SIMPLE, ALL_ATTRIBUTES from accounts.models import ShellAccou...
Python
0.000001
@@ -6746,24 +6746,273 @@ r.username)) +%0A%0A apache_conf_path = '%7Bapache%7D/member-%7Bnickname%7D.conf'.format(apache=settings.APACHE_SITES_AVAILABLE,%0A nickname=request.name)%0A if not os.path.exists(apache_conf_path): %0A ...
f5bd8b400e93e33666212a3558c05741ebef037d
Implement consume_token method
accounts/token.py
accounts/token.py
"""module containing generator for login tokens """ import base64 from django.core.signing import TimestampSigner class LoginTokenGenerator(object): """Generator for the timestamp signed tokens used for logging in. """ def __init__(self): self.signer = TimestampSigner( salt='aniauth...
Python
0.000015
@@ -574,8 +574,251 @@ code()%0A%0A + def consume_token(self, token, max_age=600):%0A %22%22%22Extract the email provided the token isn't older than max_age.%0A%0A %22%22%22%0A return self.signer.unsign(%0A base64.urlsafe_b64decode(token.encode()), max_age%0A )%0A
e3e54c8905e0c161531d41b24e7178242cb8a68d
Fix pep8; Remove redundancy
fastecdsa/ecdsa.py
fastecdsa/ecdsa.py
from binascii import hexlify from hashlib import sha256 # Python standard lib SHA2 is already in C from fastecdsa import _ecdsa from .curve import P256 from .point import Point from .util import RFC6979, msg_bytes class EcdsaError(Exception): def __init__(self, msg): self.msg = msg def sign_hash(hash, ...
Python
0.000023
@@ -297,101 +297,8 @@ sg%0A%0A -def sign_hash(hash, d, curve=P256, hashfunc=sha256):%0A return sign(hash, d, curve, hashfunc)%0A %0Adef @@ -1106,32 +1106,34 @@ rehashed:%0A + hashed = hashfun @@ -1172,16 +1172,18 @@ else:%0A + ha
6064db3000f2aeec66a775345d22b8a2b421497f
Fix gzip test for Python 2.6
astropy/utils/tests/test_gzip.py
astropy/utils/tests/test_gzip.py
import io import os from ...tests.helper import pytest from .. import gzip def test_gzip(tmpdir): fd = gzip.GzipFile(str(tmpdir.join("test.gz")), 'wb') fd = io.TextIOWrapper(fd, encoding='utf8')
Python
0.000111
@@ -70,16 +70,77 @@ t gzip%0A%0A +pytestmark = pytest.mark.skipif(%22sys.version_info %3C (3,0)%22)%0A%0A def test
1ec6da18d7906246380401c13496fdef3c80a27a
Address PR comments
afkak/protocol.py
afkak/protocol.py
# -*- coding: utf-8 -*- # Copyright (C) 2015 Cyan, Inc. from __future__ import absolute_import import logging from twisted.internet.error import ConnectionDone from twisted.protocols.basic import Int32StringReceiver from twisted.python.failure import Failure log = logging.getLogger(__name__) log.addHandler(logging....
Python
0
@@ -749,52 +749,8 @@ 1024 -%0A CLEAN_CLOSE = Failure(ConnectionDone()) %0A%0A @@ -870,19 +870,12 @@ son= -CLEAN_CLOSE +None ):%0A @@ -1170,16 +1170,34 @@ sing or +reason is None or reason.c
7869d1004dd58263926515ad196d5423b77ee251
Fix verify_gravatars after downgrade to Python 2.7
apps/profiles/management/commands/verify_gravatars.py
apps/profiles/management/commands/verify_gravatars.py
import datetime import urllib from django.core.management.base import BaseCommand from django.utils.timezone import now from apps.profiles.models import User class Command(BaseCommand): help = 'Tries to verify gravatar for recently joined users.' def handle(self, *args, **options): users_verified =...
Python
0.000001
@@ -22,16 +22,17 @@ t urllib +2 %0A%0Afrom d @@ -518,31 +518,34 @@ + request = urllib -.r +2.R equest -.urlopen (use @@ -560,16 +560,58 @@ ar_url)%0A + urllib2.urlopen(request)%0A%0A @@ -752,14 +752,9 @@ llib -.error +2 .HTT
680c8eaf87891825d99dbc05fe2343e08daa97f6
Add a comment
vt_config/NSLS-II/init.py
vt_config/NSLS-II/init.py
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in ...
Python
0
@@ -2771,16 +2771,45 @@ config%0A%0A +# unrelated so commented out%0A #from vt
f09a04158ecea7c0d4ef7f34319e3a94e1e01340
Fix seo description
wapps/templatetags/seo.py
wapps/templatetags/seo.py
import jinja2 from django_jinja import library from jinja2.ext import Extension from ..models import IdentitySettings class Metadata(object): ''' Extract metadata from a Page object ''' def __init__(self, context, **kwargs): self.context = context self.kwargs = kwargs self.p...
Python
0.999406
@@ -1138,17 +1138,20 @@ age, 'se -o +arch _descrip @@ -1195,17 +1195,20 @@ .page.se -o +arch _descrip
4f7cd1c6f48fec9be34af049f3b91f0e895a36f1
Bump version to 0.1.1
amqpy/__init__.py
amqpy/__init__.py
VERSION = (0, 1, 0) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'veegee' __maintainer__ = 'veegee' __contact__ = 'veegee@veegee.org' __homepage__ = 'http://github.com/veegee/amqpy' __docformat__ = 'restructuredtext' from .message import Message from .channel import Channel from ....
Python
0.000002
@@ -10,17 +10,17 @@ (0, 1, -0 +1 )%0A__vers
25bcf2c438232631bf5dd3c7c8c997a4edabc0f4
make git log call simpler
InvenTree/plugin/helpers.py
InvenTree/plugin/helpers.py
""" Helpers for plugin app """ import os import subprocess import pathlib import sysconfig import traceback import inspect import pkgutil from django.conf import settings from django.core.exceptions import AppRegistryNotReady # region logging / errors class IntegrationPluginError(Exception): """ Error that e...
Python
0.000009
@@ -2706,16 +2706,34 @@ , path%5D%0A + output = None%0A try: @@ -2910,88 +2910,97 @@ - else:%0A output = 7 * %5B''%5D%0A except subprocess.CalledProcessError +except subprocess.CalledProcessError: # pragma: no cover%0A pass%0A%0A if not output :%0A @@ -3022,16 +3022,36 @@ ...
a1fb04e1ba961149eaa5ced9e2017cd0c865373f
Bump version
amqpy/__init__.py
amqpy/__init__.py
from __future__ import absolute_import, division, print_function, unicode_literals __metaclass__ = type VERSION = (0, 12, 1) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'veegee' __maintainer__ = 'veegee' __contact__ = 'veegee@veegee.org' __homepage__ = 'http://github.com/veegee/...
Python
0
@@ -117,17 +117,17 @@ (0, 12, -1 +2 )%0A__vers
1c9c59406f549e231768adbcc8eb2ebd4ecc824d
Remove DOM stability check from chrome_utils.
chrome/test/functional/ispy/client/chrome_utils.py
chrome/test/functional/ispy/client/chrome_utils.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import logging import os import time from distutils.version import LooseVersion from PIL import Image from ..common import cloud_bucket from ..c...
Python
0.000049
@@ -6004,16 +6004,27 @@ %0A%0A def +GetScriptTo WaitForU @@ -6044,16 +6044,8 @@ self -, driver ):%0A @@ -6054,295 +6054,125 @@ %22%22%22 -Waits for the DOM to stop changing.%0A%0A Args:%0A driver: a chromedriver driver instance.%0A %22%22%22%0A try:%0A driver.execute_async_script(self._wait_...
313a1301778c14be43b4ed081cb48b1639c7c85d
Add RuntimeError to exceptions for gpg
figgypy/decrypt.py
figgypy/decrypt.py
"""Decrypt objects in Config.""" from __future__ import unicode_literals from future.utils import bytes_to_native_str as n import base64 import logging import os import boto3 from botocore.exceptions import ClientError, NoRegionError from figgypy.exceptions import FiggypyError from figgypy.utils import env_or_defaul...
Python
0
@@ -3340,18 +3340,16 @@ - 'binary' @@ -3372,18 +3372,16 @@ INARY',%0A - @@ -3640,15 +3640,31 @@ ept +( OSError +, RuntimeError) :%0A
c762009732f2e09a90982b1b429fad6a79a7ef40
Fix exception handling of default fields loader
backend/globaleaks/db/appdata.py
backend/globaleaks/db/appdata.py
# -*- coding: UTF-8 # datainit.py: database initialization # ****************** import json import os from globaleaks import models from globaleaks.orm import transact #from globaleaks.handlers.submission import db_assign_submission_sequence from globaleaks.handlers.admin.field import db_create_field from globaleak...
Python
0.000001
@@ -722,24 +722,37 @@ lds(store):%0A + try:%0A if os.pa @@ -778,32 +778,36 @@ s.fields_path):%0A + for fnam @@ -859,16 +859,20 @@ + + fpath = @@ -915,16 +915,20 @@ fname)%0A + @@ -967,32 +967,36 @@ + json_string = f. @@ -1018,16 +1018,20 ...
99b7db8defaa98feaa64cd3ba3d7f104ebcc43e5
Change repr(irNull) to output 'irNull' instead of the db-representation
IndexedRedis/fields/null.py
IndexedRedis/fields/null.py
# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # null - The irNull singleton and IRNullType # # vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : import sys __all__ = ('IR_NULL_STR', 'IR_NULL_BYTES', 'IR_NULL_UNICODE', 'IR_NULL_STRINGS', 'IRNul...
Python
0.000041
@@ -1992,27 +1992,24 @@ %09return -IR_NULL_STR +'irNull' %0A%0A%0A# For
6c5b2183479ff6d6f68ef6e2a71fba4bc4fb6f60
Move hard-coded panels into `fetch_panels`
config/preproc/preproc.py
config/preproc/preproc.py
#!/usr/bin/env python # Contributors: # Nicholas Rejack <nrejack@ufl.edu> # Kevin Hanson <hansonks@gmail.com> # Copyright (c) 2014-2015, University of Florida # All rights reserved. # # Distributed under the BSD 3-Clause License # For full text of the BSD 3-Clause License see http://opensource.org/licenses/BSD-3-Claus...
Python
0
@@ -728,18 +728,16 @@ ids)%0A - # panels @@ -789,333 +789,58 @@ ml', -'translationTable.xml')%0A panels = %7B%0A 'rna': %5B1230, 3774, 1914, 4189, 6912, 1561675, 6860%5D%0A 'cbc': %5B1534435, 918, 1534444, 1577116, 1009, 1558101, 1539315, 913, 999, 1577876%5D%0A 'chem': %5B1534098, 97...
d143f7b8282941bb4c592b8e2874ea359b0f43ba
Revert "Works with Django 2.0"
drf_autodocs/parser.py
drf_autodocs/parser.py
from django.conf import settings from importlib import import_module from django.utils.module_loading import import_string from django.urls.resolvers import RegexPattern, RoutePattern from addict import Dict from rest_framework.views import APIView from .endpoint import Endpoint from django.contrib.admindocs.views impo...
Python
0
@@ -116,16 +116,25 @@ _string%0A +try:%0A from dja @@ -141,17 +141,146 @@ ngo.urls -. + import URLPattern as RegexURLPattern%0A from django.urls import URLResolver as RegexURLResolver%0Aexcept:%0A from django.core.url resolver @@ -297,29 +297,41 @@ egex -Patt +URLResolv er -n , R -oute +egexURL Patter...
cd09540f41ee34b360248aa4637b063c82c23e35
add update_gemspec (#276)
synthtool/languages/ruby.py
synthtool/languages/ruby.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
@@ -1537,16 +1537,483 @@ n src%0A%0A%0A +def update_gemspec(src: PathOrStr):%0A %22%22%22Updates the required ruby version and google-style dependency.%0A%0A Args:%0A src: Source gemspec%0A %22%22%22%0A regex = 'required_ruby_version%5B%5C%5Cs=%5D*%22(%5B~%3E%3C=%5C%5Cs%5C%5Cd%5C%5C.%5D*)%22'%0A ...
fb0e719722184f7293819e9a25bdc84813957243
Fix some PEP8 warnings
mapbox_vector_tile/decoder.py
mapbox_vector_tile/decoder.py
from Mapbox import vector_tile_pb2 cmd_bits = 3 CMD_MOVE_TO = 1 CMD_LINE_TO = 2 CMD_SEG_END = 7 UNKNOWN = 0 POINT = 1 LINESTRING = 2 POLYGON = 3 class TileData: """ """ def __init__(self, extents=4096): self.tile = vector_tile_pb2.tile() self.extents = extents def getMessage(se...
Python
0.000277
@@ -110,18 +110,16 @@ 0%0APOINT - = 1%0ALINE @@ -142,16 +142,17 @@ ON = 3%0A%0A +%0A class Ti @@ -371,24 +371,16 @@ f_data)%0A - %0A @@ -996,32 +996,16 @@ = value%0A - %0A @@ -1107,16 +1107,37 @@ ture = %7B +%0A %22geometr @@ -1149,17 +1149,16 @@ e...
a1a9c0106b13d9fedfdacae6153c626c51cb2aba
Update typing for MutableList
keeper/utils.py
keeper/utils.py
"""Utilities for the Flask API and SQLAlchemy models. Copyright 2016 AURA/LSST. Copyright 2014 Miguel Grinberg. """ from __future__ import annotations import json import re from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union from dateutil import parser as datetime_parser from dateutil.tz impor...
Python
0
@@ -188,16 +188,22 @@ import +(%0A TYPE_CHE @@ -212,25 +212,41 @@ ING, +%0A Any, +%0A Dict, +%0A List, +%0A Opt @@ -255,21 +255,51 @@ nal, +%0A SupportsIndex,%0A Tuple, +%0A Union +,%0A) %0A%0Afr @@ -5885,19 +5885,29 @@ : Union%5B -int +SupportsIndex , slice%5D
ad54fc8030c47dbacfd80665a6ae3b7ad6a0270d
Fix docstring for is_pyinstaller().
angr/utils/env.py
angr/utils/env.py
import sys def is_pyinstaller() -> bool: """ Detect if we are currently running as a PyInstaller-packaged program. :return: True if we are running as a PyInstaller-packaged program. False if we are running in Python directly (e.g., development mode). """ return getattr(sys, 'froz...
Python
0.000002
@@ -117,16 +117,17 @@ rogram.%0A +%0A :ret
ef23e4780b654f5da2d7ce07c6daaaccc57c1710
Fix add_faculty email check
git-keeper-server/gkeepserver/event_handlers/faculty_add_handler.py
git-keeper-server/gkeepserver/event_handlers/faculty_add_handler.py
# Copyright 2016, 2017, 2018 Nathan Sommer and Ben Coleman # # 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 3 of the License, or # (at your option) any later version. # # This pr...
Python
0
@@ -1468,32 +1468,272 @@ e%0A%0A try:%0A + try:%0A _, _ = self._email_address.split('@')%0A except ValueError:%0A raise HandlerException('%7B%7D is not an email address'%0A .format(self._email_address))%0A%0A ...
ddf3ec8341ea01408531ef4d45686ebed0473ed1
Update Ridge_Kernel.py
KernelModel/Ridge_Kernel.py
KernelModel/Ridge_Kernel.py
import numpy as np from MachineLearning.KernelModel import KernelCalc class KerRidgeReg: ########################################################################################################################## # Kernel Ridge Regression/Gaussian process ...
Python
0
@@ -554,9 +554,14 @@ (201 -6 +3-2017 )
2d9b0b0280424e0e5fe852d026ec34010cdac806
Add retry error assert
tests/connector/dashboard_test.py
tests/connector/dashboard_test.py
import unittest import logging from umapi import UMAPI, Action import mock import time from umapi import UMAPI from umapi.error import UMAPIRetryError, UMAPIError, UMAPIRequestError import email.utils import aedash import tests.helper from aedash.sync.connector.dashboard import ApiDelegate class MockRetryResult: ...
Python
0.000001
@@ -4020,24 +4020,169 @@ ion_man. -execute( +logger.warn = mock.Mock()%0A self.action_man.execute()%0A self.action_man.logger.warn.assert_called_with('FAILURE NO MORE RETRIES, SKIPPING...' )%0A%0A @
6797c9b705b0cfd5c770f68695402baf044510ff
Change default value of checkpoint frequency
utils/training_utils/params.py
utils/training_utils/params.py
# Data set split TRAIN_FRACTION = 0.75 VALIDATE_FRACTION = 0.1 TEST_FRACTION = 0.15 TOTAL_NUM_EXAMPLES = 147052 # Total number of tracks assert(TRAIN_FRACTION + VALIDATE_FRACTION + TEST_FRACTION == 1.0) # Validation and check pointing EVALUATION_FREQ = 1000 # Number of mini-batch SGD steps after which an evaluat...
Python
0
@@ -243,34 +243,33 @@ ALUATION_FREQ = -10 +9 00 # Number of @@ -352,10 +352,9 @@ Q = -10 +9 00
3bb167fdbf4e4e3f41a7dda6dbdb2005f3be6d52
make assert python2.6 compatible
django_extensions/tests/json_field.py
django_extensions/tests/json_field.py
import unittest from django.db import connection from django.conf import settings from django.core.management import call_command from django.db.models import loading from django.db import models from django_extensions.db.fields.json import JSONField class TestModel(models.Model): a = models.IntegerField() j...
Python
0.000319
@@ -960,11 +960,16 @@ sert -IsI +True(isi nsta @@ -988,16 +988,17 @@ d, list) +) %0A