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
3c5d82ced00da284fc8dc48fea34462958a8883e
Fix cross-platform process communication.
tests/test_cli.py
tests/test_cli.py
""" Tests the Grip command-line interface. """ from __future__ import print_function, unicode_literals from subprocess import PIPE, STDOUT, CalledProcessError, Popen import pytest from grip.command import usage, version def run(*args, **kwargs): command = kwargs.pop('command', 'grip') stdin = kwargs.pop('s...
Python
0.00007
@@ -462,20 +462,62 @@ ue)%0A -out1 +# Sent input as STDIN then close it%0A output , _ = p. @@ -569,42 +569,151 @@ -returncode = p.wait()%0A out2, _ +# Wait for process to terminate%0A returncode = p.wait()%0A # Capture any more output that occurred during shutdown%0A try:%0A output + ...
8cf225cae6e3b57fa068ec56373905835f9bc64d
Add automatic selection of default value if not provided
csunplugged/resources/utils/resource_parameters.py
csunplugged/resources/utils/resource_parameters.py
from lxml import etree from django.utils.translation import ugettext as _ class ResourceParameter(object): def __init__(self, name="", description=""): self.name = name self.description = description def html_element(self): legend = etree.Element('legend') legend.text = self.de...
Python
0
@@ -688,36 +688,66 @@ -raise Exception(self. +self.default = list(values.keys())%5B0%5D # Select first value -s) %0A%0A
5db86f0ede5c95f8b08ebb8c5f536e8d431662cb
fix daiquiri_path script
daiquiri/core/management/commands/daiquiri_path.py
daiquiri/core/management/commands/daiquiri_path.py
import imp from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args, **options): print(imp.find_module('daiquiri')[1])
Python
0
@@ -88,16 +88,84 @@ mand):%0A%0A + requires_system_checks = False%0A can_import_settings = False%0A%0A def
fec05c23f03cc4b633c53cc1f2feeb9056679973
version up
module/plugins/hooks/XFileSharing.py
module/plugins/hooks/XFileSharing.py
# -*- coding: utf-8 -*- import inspect import re from module.plugins.internal.Addon import Addon class XFileSharing(Addon): __name__ = "XFileSharing" __type__ = "hook" __version__ = "0.51" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" ,...
Python
0
@@ -201,17 +201,17 @@ _ = %220.5 -1 +2 %22%0A __
8077fee55a105e4fab35fa507ebbaef106e98184
Add support for local_settings.py
openquake/server/settings.py
openquake/server/settings.py
import os from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS from openquake.engine import settings as oqe_settings OQSERVER_ROOT = os.path.dirname(__file__) DEBUG = True TEMPLATE_DEBUG = DEBUG PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( # ('Your Name', 'your_email@examp...
Python
0.000001
@@ -4334,12 +4334,92 @@ Y_SIZE = 1%0A%0A +try:%0A from local_settings import *%0Aexcept ImportError:%0A raise ImportError%0A
5f09835f9aa62abb5f891c4d3896206eedd9fe12
fix somewherein url
corpus_builder/spiders/public_blog/somewherein.py
corpus_builder/spiders/public_blog/somewherein.py
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import Rule from corpus_builder.templates.spider import CommonSpider class SomewhereInSpider(CommonSpider): name = 'somewherein' allowed_domains = ['www.somewhereinblog.net', 'somewhereinblog.net'] b...
Python
0.999374
@@ -846,19 +846,19 @@ _url + ' -pag +liv e/%7Bpage%7D
1f31020f0eef5f2c44d9f5d0ce644a90153e68f4
Fix csv_path derivation
cpgintegrate/airflow_plugin/cpg_airflow_plugin.py
cpgintegrate/airflow_plugin/cpg_airflow_plugin.py
from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults from airflow.hooks.base_hook import BaseHook from airflow.plugins_manager import AirflowPlugin import cpgintegrate import os import logging class CPGDatasetToCsv(BaseOperator): @apply_defaults def __init__(self, connec...
Python
0.001868
@@ -829,21 +829,16 @@ th.join( -self. csv_dir, @@ -2744,16 +2744,17 @@ cols))%0A%0A +%0A class Ai
5f31cc1d4031aaa1a416261bf456e0a1e6a93f58
Version bump. Deepcopy bumps it up to 0.4.0
addict/__init__.py
addict/__init__.py
from .addict import Dict __title__ = 'addict' __version__ = '0.3.2' __author__ = 'Mats Julian Olsen' __license__ = 'MIT' __copyright__ = 'Copyright 2014 Mats Julian Olsen' __all__ = ['Dict']
Python
0.000001
@@ -62,11 +62,11 @@ '0. -3.2 +4.0 '%0A__
2ab780c8527f27f666ed649eee3c26f8c86b4720
Add test for get_ncpus().
tests/test_dev.py
tests/test_dev.py
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import warnings from monty.dev import deprecated, requires class A: @property def repl_prop(self...
Python
0
@@ -221,16 +221,38 @@ arnings%0A +import multiprocessing %0Afrom mo @@ -286,16 +286,27 @@ requires +, get_ncpus %0A%0A%0Aclass @@ -3325,16 +3325,113 @@ cess%22)%0A%0A + def test_get_ncpus(self):%0A self.assertEqual(get_ncpus(), multiprocessing.cpu_count())%0A %0Aif __na
606d2717f8a2531c726fad0229d4355006ec7c2e
change size of commit queue to 2 so that more jobs are bunched together under pressure
updatebot/build/dispatcher.py
updatebot/build/dispatcher.py
# # Copyright (c) 2009 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.rpath.com/permanent/...
Python
0
@@ -1676,9 +1676,9 @@ s = -5 +2 %0A
38dba247fbc5855dd830a02e52531d8c98964693
Update ipc_lista1.4.py
lista1/ipc_lista1.4.py
lista1/ipc_lista1.4.py
#ipc_lista1.4 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um Programa que peça as 4 notas bimestrais e mostre a media nota1 = int(input("Digite a primeira nota do bimestre: ")) nota2 = int(input("Digite a segunda nota do bimestre: ")) nota3 = int(input("Digite a terceira nota do bismestr...
Python
0
@@ -320,16 +320,28 @@ re: %22))%0A +nota4 - int%0A %0A%0A%0Aprint
0311ff1b0d3bdb40a8840293aa1acc5667b5db43
Update ipc_lista1.5.py
lista1/ipc_lista1.5.py
lista1/ipc_lista1.5.py
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros.
Python
0
@@ -133,8 +133,9 @@ metros.%0A +%0A
6bc6487d2659b33a15e93b998058bde637e83993
Update ipc_lista1.5.py
lista1/ipc_lista1.5.py
lista1/ipc_lista1.5.py
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros. metros = input("Digite o valor em metros que
Python
0
@@ -178,9 +178,16 @@ tros que + deseja %0A
04ac05ce2a7987a464e817c411007813b89aef2f
FIX Bug - Error when profile name with space
ImportUser.py
ImportUser.py
#!/usr/bin/env python __author__ = "Xanio" __license__ = "CC0" __version__ = "1.1" __maintainer__ = "Xanio" __email__ = "xanio@nemesilabs.org" import csv # imports the csv module import argparse # imports the argparse module def set_easy_logger(name, verbosity, logfile=False): ''' Easy setup for a logg...
Python
0
@@ -2680,18 +2680,20 @@ profile= +%22 %25s +%22 '%0A
ccfeb68b76b69525f757dc54f01787cf26fe6e2a
Fix the merge diff3 wrapper to work around a python subprocess bug on windows TBR(ojan) Ojan wrote this with me and we tested it together Review URL: http://codereview.chromium.org/19023
webkit/tools/merge/diff3-wrapper.py
webkit/tools/merge/diff3-wrapper.py
#!/bin/env python # Copyright (c) 2006-2008 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. """Wrapper around BeyondCompare or kdiff3 so it can be used as svn's diff3-cmd tool. The basic idea here is based heavily off of ...
Python
0.00001
@@ -501,16 +501,33 @@ port sys +%0Aimport traceback %0A%0ACYGDRI @@ -2814,73 +2814,506 @@ e.%22%0A +%0A - %0A value = subprocess.call(cmd, stdout=subprocess.PIPE +try:%0A # Work around http://bugs.python.org/issue3905%0A # by passing stderr and stdin as well since beyondcompare is a GUI app%0A ...
e579e03f70bfbea3942647059ebd2a8a3e0043a3
update sphinx rendering to use built in jinja rendering for .js/.css files
doc/build/builder/builders.py
doc/build/builder/builders.py
from sphinx.application import TemplateBridge from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.highlighting import PygmentsBridge from pygments import highlight from pygments.lexer import RegexLexer, bygroups, using from pygments.token import * from pygments.filter import Filter, apply_filters from py...
Python
0
@@ -137,24 +137,76 @@ mentsBridge%0A +from sphinx.jinja2glue import BuiltinTemplateLoader%0A from pygment @@ -224,16 +224,16 @@ ghlight%0A - from pyg @@ -686,16 +686,128 @@ **kw):%0A + self.jinja2_fallback = BuiltinTemplateLoader()%0A self.jinja2_fallback.init(builder, *args, **kw)%0A%0A @...
480061783825f3a7e20a0bef94a519afa5b162fe
Fix tests skipped depending on version of django
csv_generator/tests/test_csv_generator_formset.py
csv_generator/tests/test_csv_generator_formset.py
# -*- coding: utf-8 -*- """ Tests the csv_generator CsvGenerator Formset """ from __future__ import unicode_literals from csv_generator.forms import CsvGeneratorColumnFormSet from csv_generator.forms import CsvGeneratorColumnForm from csv_generator.models import CsvGenerator, CsvGeneratorColumn from csv_generator.tests...
Python
0.000001
@@ -1173,25 +1173,25 @@ sion() %3E '1. -8 +9 ', 'Not impl @@ -1212,17 +1212,17 @@ ngo %3C 1. -8 +9 ')%0A d @@ -1562,33 +1562,33 @@ _version() %3C '1. -8 +9 ', 'Not implemen @@ -1597,33 +1597,33 @@ d in django %3E 1. -7 +8 ')%0A def test_ @@ -2070,17 +2070,17 @@ () %3C '1. -8 +9 ', 'Not @@ -2109,9 +2109...
13c7f99947cbb18988b22243b0d019ccbb985335
Fix default handling of zeros in excel sheet.
dwarfsquad/model/Threshold.py
dwarfsquad/model/Threshold.py
from dwarfsquad.model.BaseWebModel import BaseWebModel class Threshold(BaseWebModel): required_fields = { "absolute_area": "1", "relative_area": "0.01", "absolute_height": "100", "relative_height": "0.01", "signal_to_noise": "3", "min_merge_difference": "3", ...
Python
0
@@ -1,8 +1,51 @@ +from dwarfsquad.lib.utils import to_stderr%0A from dwa @@ -1459,16 +1459,112 @@ -raise e%0A +to_stderr(str(e))%0A to_stderr(%22Setting absolute_area to 0%22)%0A self.absolute_area = 0 %0A%0A @@ -1787,32 +1787,49 @@ solute_height):%0A + try:%0A asser...
6959a95e204599cb18db7211ac4cce005918142c
update utils
disaggregator/utils.py
disaggregator/utils.py
from ApplianceTrace import ApplianceTrace from ApplianceInstance import ApplianceInstance from ApplianceType import ApplianceType from ApplianceSet import ApplianceSet from pandas import concat def concatenate_traces(traces, metadata=None, how="strict"): ''' Given a list of appliance traces, returns a single c...
Python
0.000002
@@ -1,197 +1,34 @@ -from ApplianceTrace import ApplianceTrace%0Afrom ApplianceInstance import ApplianceInstance%0Afrom ApplianceType import ApplianceType%0Afrom ApplianceSet import ApplianceSet%0Afrom pandas import concat +import appliance%0Aimport pandas %0A%0Ade @@ -1539,20 +1539,16 @@ dError%0A%0A - def orde ...
03da52f9098e05f564ff7c258a6d60e84bd2cf56
Make sure the test runner use the local filesystem.
us_ignite/settings/testing.py
us_ignite/settings/testing.py
# Testing settings for us_ignite from us_ignite.settings import * SECRET_KEY = 'c!lizso+53#4dhm*o2qyh9t(n14p#wr5!+%1bfjtrqa#vsc$@h' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'us-ignite-test.db', 'USER': '', 'PASSWORD': '', 'HOST': '', ...
Python
0.000005
@@ -1082,8 +1082,180 @@ te.org'%0A +%0ADEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'%0ASTATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'%0ASTATIC_URL = '/static/'%0A
af76b7957c123c084eb75ef83a5bd67016055fba
Remove '/tools' from clone URL
indico/web/flask/blueprints/event/management/tools.py
indico/web/flask/blueprints/event/management/tools.py
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
Python
0.000001
@@ -1042,38 +1042,32 @@ .add_url_rule('/ -tools/ clone', 'confMod @@ -1137,22 +1137,16 @@ _rule('/ -tools/ clone',
4730eff514022ee6aed7092c0a93159550b23a62
Fix merge conflict with base
s3backup/clients/__init__.py
s3backup/clients/__init__.py
# -*- coding: utf-8 -*- import datetime class SyncState(object): UPDATED = 'UPDATED' DELETED = 'DELETED' CONFLICT = 'CONFLICT' NOCHANGES = 'NOCHANGES' DOESNOTEXIST = 'DOESNOTEXIST' def __init__(self, action, timestamp): self.action = action self.timestamp = timestamp def...
Python
0.000001
@@ -2765,33 +2765,35 @@ e NotImplemented +() %0A - %0A def get_all @@ -2843,32 +2843,34 @@ e NotImplemented +() %0A%0A def get_al @@ -2892,32 +2892,32 @@ mestamps(self):%0A - raise No @@ -2928,16 +2928,18 @@ lemented +() %0A%0A de
85aa0455d5accb392cf6bc3b5fc44bc8b8da4350
Add retry when tag reference was lost
service/test/functional/features/steps/tag_list.py
service/test/functional/features/steps/tag_list.py
# # Copyright (c) 2014 ThoughtWorks, Inc. # # Pixelated 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. # # Pixelated is distrib...
Python
0
@@ -761,16 +761,48 @@ xception +, StaleElementReferenceException %0A%0Afrom c @@ -852,32 +852,8 @@ me,%0A - find_element_by_id,%0A @@ -1296,17 +1296,8 @@ %0A - toggle = fin @@ -1361,19 +1361,8 @@ i') -%0A toggle .cli @@ -1400,36 +1400,42 @@ %5C'%7Btag%7D%5C'')%0Adef -impl +select_tag (context...
96078744448023dc01d4816085d63291fb7760a0
add test case for is_staging_clean
tests/test_git.py
tests/test_git.py
import inspect from typing import List, Optional import pytest from commitizen import cmd, git from tests.utils import FakeCommand, create_file_and_commit def test_git_object_eq(): git_commit = git.GitCommit( rev="sha1-code", title="this is title", body="this is body" ) git_tag = git.GitTag(rev=...
Python
0.000086
@@ -4888,12 +4888,317 @@ me == %221.0%22%0A +%0A%0Adef test_is_staging_clean(tmp_commitizen_project):%0A with tmp_commitizen_project.as_cwd():%0A assert git.is_staging_clean() is True%0A%0A cmd.run(%22touch test_file%22)%0A cmd.run(%22git add test_file%22)%0A cmd.run(%22echo 'test' %3E t...
895a40c9e92af1700cc174e32472c833e83140be
Use replace instead of strip
exec_proc.py
exec_proc.py
#!/usr/bin/env python # Copyright 2014 Boundary, 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 o...
Python
0.000005
@@ -654,16 +654,43 @@ logging +%0Afrom string import replace %0A%0Aclass @@ -1387,20 +1387,25 @@ o = -o.strip('%5Cr' +replace(o,%22%5Cr%22,%22%22 )%0A
d5293bc83495e1d9ddcf8918dd99f983c185f475
clean formatting
packages/dependencies/libsndfile.py
packages/dependencies/libsndfile.py
{ 'repo_type' : 'git', #'branch' : '81a71e08c09b20b0255aa66e40fce293008b9525', # 'd2ca7f4afc776d7c0c14c9a9a5ba94d9ae3affb8', 'url' : 'https://github.com/erikd/libsndfile.git', 'configure_options' : '--host={target_host} --prefix={target_prefix} --disable-shared --enable-static --enable-sqlite --disable-test-coverag...
Python
0
@@ -21,111 +21,8 @@ t',%0A -%09#'branch' : '81a71e08c09b20b0255aa66e40fce293008b9525', # 'd2ca7f4afc776d7c0c14c9a9a5ba94d9ae3affb8',%0A %09'ur @@ -69,16 +69,16 @@ e.git',%0A + %09'config @@ -263,447 +263,8 @@ l',%0A -%09#'patches' : %5B #patches courtesy of https://github.com/Alexpux/MINGW-packages/tree/master/min...
487a17b55aa25225cd942bdb2f8f7adc840d0a5e
refactor fix
sandbox_scripts/environment/teardown/teardown_VM.py
sandbox_scripts/environment/teardown/teardown_VM.py
from multiprocessing.pool import ThreadPool from threading import Lock from cloudshell.core.logger import qs_logger from sandbox_scripts.helpers.Networking.NetworkingSaveNRestore import * class EnvironmentTeardownVM: REMOVE_DEPLOYED_RESOURCE_ERROR = 153 def __init__(self): self.reservation_id = hel...
Python
0.000033
@@ -2,74 +2,79 @@ rom -multiprocessing.pool import ThreadPool%0Afrom threading import Lock%0A +cloudshell.helpers.scripts import cloudshell_scripts_helpers as helpers %0Afro @@ -115,17 +115,16 @@ _logger%0A -%0A from san @@ -159,39 +159,260 @@ ing. -NetworkingSaveNRestore import * +save_restore_mgr import SaveRes...
ea28e36439aaae24d7ae501a90688cb3b7a3d3e5
Add 'events' intermediate variable
app/event/api.py
app/event/api.py
from django.http import JsonResponse from event.models import Event DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S' def event_filter(request, event_kind, *args, **kwargs): """Event Filter. リクエストのあったイベントを新規イベントは作成日時順、 他は開始日時順の若い方から10件をjsonで返す。 """ if request.method == 'POST': def new_events(): ...
Python
0.008016
@@ -2347,28 +2347,24 @@ -for event - in +s = Event.g @@ -2382,33 +2382,16 @@ n_range( -%0A range_va @@ -2408,77 +2408,235 @@ t'%5D, - range_value%5B'sw_lat'%5D, range_value%5B'ne_lng'%5D, range_value%5B'sw_lng'%5D) +%0A range_value%5B'sw_lat'%5D...
08eff1cd735e43a8697fb56047ca4e04120a12e6
Set url scheme to 'https' when executing through AWS API Gateway
drift/fixers.py
drift/fixers.py
# -*- coding: utf-8 -*- """ This module includes various helpers and fixers. """ from flask.json import JSONEncoder from datetime import date class CustomJSONEncoder(JSONEncoder): '''Extend the JSON encoder to treat date-time objects as strict rfc3339 types. ''' def default(self, obj): fro...
Python
0.000049
@@ -1772,16 +1772,282 @@ scheme%0A + elif environ.get('X-Amzn-Vpce-Id'):%0A # This is a (poor) way to see if the request is coming through AWS API Gateway%0A # which only supports https. The API gateway doesn't set 'X-Scheme'.%0A environ%5B'wsgi.url_scheme'%5D = 'https'%0A%0A ...
5c8042aeef01620a69945a3386db1890bbb9348c
Patch for dding PST to date string, thanks to Aaron Brewster for error report
dxtbx/format/FormatSMVADSC.py
dxtbx/format/FormatSMVADSC.py
#!/usr/bin/env python # FormatSMVADSC.py # Copyright (C) 2011 Diamond Light Source, Graeme Winter # # This code is distributed under the BSD license, a copy of which is # included in the root directory of this package. # # An implementation of the SMV image reader for ADSC images. Inherits from # FormatSMV. impo...
Python
0
@@ -3194,24 +3194,131 @@ ry%5B'TIME'%5D)%0A + for format_string in %5B'%25a %25b %25d %25H:%25M:%25S %25Y', '%25a %25b %25d %25H:%25M:%25S %25Z %25Y'%5D:%0A try:%0A epoc @@ -3320,17 +3320,16 @@ epoch = - time.mk @@ -3347,16 +3347,37 @@ trptime( +%0A self._h...
020b3fb2c8867177d84f8ee49b50bdc4279b420e
Extend Trigger - Greeting if user has not been greeted today
EmeraldAI/Application/Main/Brain_ActionTrigger.py
EmeraldAI/Application/Main/Brain_ActionTrigger.py
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import time from os.path import dirname, abspath sys.path.append(dirname(dirname(dirname(dirname(abspath(__file__)))))) reload(sys) sys.setdefaultencoding('utf-8') import rospy from std_msgs.msg import String from EmeraldAI.Logic.Modules import Pid from EmeraldAI.C...
Python
0
@@ -58,16 +58,46 @@ rt time%0A +from datetime import datetime%0A from os. @@ -1652,88 +1652,8 @@ ):%0A%0A - # TODO - check if we saw the user today%0A print dataParts%0A @@ -1696,16 +1696,17 @@ rts%5B1%5D)%0A +%0A @@ -1713,20 +1713,18 @@ -print User() +# Greeting %0A ...
b4eb4743753bbe04ee1254188f145aa6206d32cd
Add support for QSEQ parsing.
skbio/parse/sequences/qseq.py
skbio/parse/sequences/qseq.py
#!/usr/bin/env python # ----------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # ---------------------...
Python
0
@@ -764,16 +764,23 @@ e object + or str %0A @@ -789,24 +789,49 @@ n open qseq +file or a path to a qseq file.%0A%0A s
cb0515c28cc98c2221b86e3a79d107aa7e872454
enable configuration of statsd port and host
monasca_persister/repositories/persister.py
monasca_persister/repositories/persister.py
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # # 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 ap...
Python
0
@@ -727,36 +727,241 @@ er%0A%0A -LOG = log.getLogger(__name__ +STATSD_PORT = int(os.getenv(%22STATSD_PORT%22, %228125%22))%0ASTATSD_HOST = os.getenv(%22STATSD_HOST%22, %22localhost%22)%0ALOG = log.getLogger(__name__)%0Astatsd_connection = monascastatsd.Connection(host=STATSD_HOST, port=STATSD_PORT, max_buffer_size=50 ...
94705d1f4d63e47d2ef677bba13a54daa1d1745c
allow skextremes.models.classic import
skextremes/models/__init__.py
skextremes/models/__init__.py
from . import wind from . import engineering
Python
0
@@ -38,8 +38,30 @@ neering%0A +from . import classic%0A
fab3e606b7b41738a9db738859a44dbaea106f72
Handle imgur gallery URLs.
app/datasources/thumbnails.py
app/datasources/thumbnails.py
import re import urlparse LARGE_THUMBNAIL = 'large' SMALL_THUMBNAIL = 'small' _YFROG_PATH_RE = re.compile('/(\\w+).*') _INSTAGRAM_PATH_RE = re.compile('/p/(\\w+).*') _FLICKR_SHORT_PATH_RE = re.compile('/p/(\\w+).*') _FLICKR_LONG_HOSTNAME_RE = re.compile('farm\\d+\\.static\\.?flickr\\.com') _FLICKR_LONG_PATH_RE = re.c...
Python
0.000001
@@ -561,16 +561,75 @@ ..).*')%0A +_IMGUR_GALLERY_PATH_RE = re.compile('/(gallery/)(%5C%5Cw+).*')%0A _TWITPIC @@ -4282,16 +4282,281 @@ oup(2))%0A + elif hostname == 'imgur.com':%0A # See http://imgur.com/faq#gallery%0A match = _IMGUR_GALLERY_PATH_RE.match(path)%0A if match:%0A thumb...
20a346b7136d5ffb06fa0f5d80871af2a91da5ab
Add pymongo's MongoClient to MasterSlaveConnection
mongolite/master_slave_connection.py
mongolite/master_slave_connection.py
""" Master-Slave integration with for MongoKit adapted for MongoLite Andreas Jung, info@zopyx.com (same license as Mongokit) """ from pymongo.master_slave_connection import MasterSlaveConnection as PymongoMasterSlaveConnection from pymongo import Connection as PyMongoConnection from mongolite.database import Database...
Python
0.000002
@@ -221,16 +221,103 @@ nection%0A +%0Atry:%0A from pymongo import MongoClient as PymongoConnection%0Aexcept ImportError:%0A from pym @@ -344,17 +344,17 @@ on as Py -M +m ongoConn
f51b616c483c22bf1dd49143039ffa81ab9dac1e
Use a default max_records as older versions of the API don't expose it.
download_esri.py
download_esri.py
import requests import json base_url = 'http://gisweb.co.aitkin.mn.us/arcgis/rest/services/MapLayers/MapServer/3' output_file = 'output.geojson' metadata = requests.get(base_url, params={'f': 'json'}).json() bounds = metadata['extent'] fields = metadata['fields'] geom_type = metadata['geometryType'] saved = set() bb...
Python
0
@@ -296,16 +296,66 @@ yType'%5D%0A +max_records = metadata.get('maxRecordCount', 500)%0A saved = @@ -3655,33 +3655,18 @@ == m -etadata%5B'maxRecordCount'%5D +ax_records :%0A
2111c840c11fe2046c87a2767f00b3781a5e2eac
Update dumpling.client.python.py
src/dumpling-service/dumpling.python-client/dumpling.client.python.py
src/dumpling-service/dumpling.python-client/dumpling.client.python.py
import requests class DumplingService: _dumplingUri = 'http://dotnetrp.azurewebsites.net'; @staticmethod def SayHelloAs(username): hello_url = DumplingService._dumplingUri + '/dumpling/test/hi/im/%s'%(username) response = requests.get(hello_url) return response.content @stati...
Python
0.00001
@@ -508,16 +508,20 @@ pen(file +path , 'rb')%7D
182f1ab71ff7abcbf54340c59dc438cacf80d066
Update report API ext method names to match URLs
moniker/api/v1/extensions/reports.py
moniker/api/v1/extensions/reports.py
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved. # # Author: Simon McCartney <simon.mccartney@hp.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # h...
Python
0.000004
@@ -983,20 +983,27 @@ reports +_counts ():%0A - cont @@ -1345,16 +1345,23 @@ reports_ +counts_ domains( @@ -1578,16 +1578,23 @@ reports_ +counts_ records( @@ -1791,32 +1791,32 @@ ethods=%5B'GET'%5D)%0A - def reports_tena @@ -1811,16 +1811,23 @@ reports_ +counts_ tenants(
91f7e96758f048f1473de11d8f6a919be8b98e23
make filename of rected unique and copy files that were imported correctly to central dir
ddsc_worker/localsettings_example_with_comments.py
ddsc_worker/localsettings_example_with_comments.py
DATABASES = { 'default': { 'NAME': 'ddsc', 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'USER': 'xxxx', 'PASSWORD': 'xxxxxxxx', 'HOST': 'xx.xx.xxx.xxx', 'PORT': '', } } CASSANDRA = { 'servers': [ 'xxx.xxx.xxx.xx:9160', 'xx.xxx.xxx.xx:91...
Python
0
@@ -1125,16 +1125,63 @@ ddsc/',%0A + 'accepted_file':%0A 'accepted_file/',%0A %7D%0A%0AIMPOR
c7ae246fce12748f9e6a3e7584e2ca045a1d9138
add version variable
dist/__init__.py
dist/__init__.py
import sys #TODO: #https://stackoverflow.com/questions/6677424/how-do-i-import-variable-packages-in-python-like-using-variable-variables-i #imported = getattr(__import__(package, fromlist=[name]), name) if sys.version_info[0] == 2: from devsim_py27 import * elif sys.version_info[0] == 3 and sys.version_info[1] == 6...
Python
0.000002
@@ -247,32 +247,70 @@ m_py27 import *%0A + from devsim_py27 import __version__%0A elif sys.version @@ -382,16 +382,55 @@ mport *%0A + from .devsim_py36 import __version__%0A elif sys @@ -510,16 +510,55 @@ mport *%0A + from .devsim_py37 import __version__%0A else:%0A @@ -676,8 +676,9 @@ :2%5D)%0A%0A%0A%0A +%...
33ab7a2a7c9000bb86f8617034ad057b83de415d
Add versionadded tag
salt/beacons/network_info.py
salt/beacons/network_info.py
# -*- coding: utf-8 -*- ''' Beacon to monitor statistics from ethernet adapters ''' # Import Python libs from __future__ import absolute_import import logging import psutil log = logging.getLogger(__name__) __virtualname__ = 'network_info' __attrs = ['bytes_sent', 'bytes_recv', 'packets_sent', 'packets_r...
Python
0.000001
@@ -72,16 +72,44 @@ adapters +%0A%0A.. versionadded:: 2015.2.0 %0A'''%0A%0A#
9caf6f3992c74613e0002f142982fce20f42ec4c
update tests that were not passing
framework_agreement_sourcing/tests/test_check_sourcing.py
framework_agreement_sourcing/tests/test_check_sourcing.py
# Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
Python
0
@@ -937,18 +937,25 @@ without_ -po +agreement _is_not_ @@ -1144,28 +1144,27 @@ 'No -Purchase Order Lines +Framework Agreement ', e @@ -1211,18 +1211,33 @@ ng_with_ -po +running_agreement _is_sour @@ -1327,56 +1327,94 @@ rce. -_get_purchase_order_lines = lambda: self.PO.new( +framework_agreement_id = self.Agreem...
d16d715898bae287520841a5936217c6e53788e0
Bump version to 3.5.0rc14
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
Python
0
@@ -638,17 +638,17 @@ 5, %220rc1 -3 +4 %22)%0A__ver
b115430447cc489e6cb83f7bfb954e72aef7927b
comment updated
nab/detectors/numenta/numentaTM_detector.py
nab/detectors/numenta/numentaTM_detector.py
# ---------------------------------------------------------------------- # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or mo...
Python
0
@@ -1438,18 +1438,17 @@ of %22cpp%22 -%0A +. It diff
dc67190ae855de30f0ee33f4d8b34462d44667e9
Change URL scheme `user` to `users`
nightreads/urls.py
nightreads/urls.py
"""nightreads URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
Python
0.000001
@@ -807,16 +807,17 @@ (r'%5Euser +s /', incl @@ -854,16 +854,17 @@ ce='user +s ')),%0A
fe90a66487a55e91614a35ee2ba6474eb1efa712
Remove redundant check
src/jupyter_contrib_nbextensions/nbconvert_support/pre_codefolding.py
src/jupyter_contrib_nbextensions/nbconvert_support/pre_codefolding.py
# -*- coding: utf-8 -*- """ This preprocessor removes lines in code cells that have been marked as `folded` by the codefolding extension """ from nbconvert.preprocessors import Preprocessor from traitlets import Bool, Unicode class CodeFoldingPreprocessor(Preprocessor): """ :mod:`nbconvert` Preprocessor for ...
Python
0.000004
@@ -2508,83 +2508,8 @@ ed%60. -%0A Requires configuration parameter 'NbConvertApp.codefolding = True' %0A%0A @@ -2886,48 +2886,8 @@ %22%22%22%0A - if self.remove_folded_code:%0A @@ -2955,28 +2955,24 @@ - if hasattr(c @@ -3017,28 +3017,24 @@ - - folded =...
dda73bd650b2461a5b315c61488a272e297f62cd
Use the verbosity levels a bit better
dictionary/management/commands/updateDictionary.py
dictionary/management/commands/updateDictionary.py
# coding=utf-8 import codecs from optparse import make_option from daisyproducer.dictionary.models import GlobalWord from daisyproducer.dictionary.forms import VALID_BRAILLE_RE from django.core.management.base import BaseCommand, CommandError from django.db import transaction typeMap = { '*': 0, # No restriction ...
Python
0
@@ -1080,16 +1080,63 @@ tions):%0A + verbosity = int(options%5B'verbosity'%5D)%0A%0A @@ -3134,32 +3134,63 @@ s += 1%0A %0A + if verbosity %3E= 1:%0A self.std
fcf9d3925847a8d64647e8e19ece1befe9de0bdd
use_formasaurs can be string or boolean
loginform/loginform.py
loginform/loginform.py
#!/usr/bin/env python import sys from argparse import ArgumentParser from collections import defaultdict from lxml import html from formasaurus import FormExtractor __version__ = '1.0' # also update setup.py class LoginFormFinder(object): def __init__(self, url, body, username, password, use_formasaurus=True): ...
Python
0.999992
@@ -609,16 +609,45 @@ is True + or use_formasaurus == 'True' :%0A
7b0f08235a6a27b3f9d6615c1211ddb6f9c8fea1
update setup
Python/setup.py
Python/setup.py
from __future__ import absolute_import, print_function import io import os from setuptools import find_packages, setup def read(*names, **kwargs): with io.open( os.path.join(os.path.dirname(__file__), *names), encoding=kwargs.get('encoding', 'utf8'), ) as fp: return fp.read() readm...
Python
0.000001
@@ -509,16 +509,34 @@ end Weel +, Elena Ranguelova ',%0A t
50bb2f0bbc2cfad685f1d84f7f1147bafa23f2fa
add extensions(strong, em, del, ins)
extension.py
extension.py
from markdown.treeprocessors import Treeprocessor from markdown.preprocessors import Preprocessor # from markdown.postprocessors import Postprocessor from markdown.extensions import Extension import re # class MyPostprocessor(Postprocessor): # def run(self, text): # for graph in MyExtension.remember_lines: ...
Python
0
@@ -1,20 +1,73 @@ +from markdown.inlinepatterns import SimpleTagPattern%0A from markdown.treepr @@ -2687,24 +2687,143 @@ _list = %22%22%0A%0A + STRONG_RE = r'(%5C+%5C+)(.*?)%5C+%5C+'%0A DEL_RE = r'(--)(.*?)--'%0A INS_RE = r'(__)(.*?)__'%0A EM_RE = r'(~~)(.*?)~~'%0A%0A def exte @@ -3063,20 +3063,456 @...
05d1f70b2113d8065c4a699dffce089c7b61e7f4
Add docstring for logrotate.set
salt/modules/logrotate.py
salt/modules/logrotate.py
''' Module for managing logrotate. ''' # Import python libs import os import logging # Import salt libs import salt.utils log = logging.getLogger(__name__) default_conf = '/etc/logrotate.conf' def __virtual__(): ''' Only work on posix-like systems ''' # Disable on these platorms disable = ('Win...
Python
0.000001
@@ -2691,16 +2691,545 @@ ion line +%0A%0A CLI Example::%0A%0A salt '*' logrotate.set rotate 2%0A%0A Can also be used to set a single value inside a multiline configuration%0A block. For instance, to change rotate in the following block::%0A%0A /var/log/wtmp %7B%0A monthly%0A ...
dee8c9791947c517cac6563234368362cbe5b1d7
bump version
common.py
common.py
VERSION_YEAR = 2019 VERSION_MONTH = 3 VERSION_DAY = 3 VERSION_REV = 0 whos_in = None twitter = None users = {} twilio_client = None ARGS = {} smmry_api_key = None pubg_api_key = None pubg_api = None # Variable hold trumps last tweet id last_id = 0 trump_chance_roll_rdy = False # Runtime stats duels_conducted = 0 ite...
Python
0
@@ -29,17 +29,17 @@ MONTH = -3 +4 %0AVERSION @@ -49,9 +49,10 @@ Y = -3 +28 %0AVER
559c4ddbeccf687819b4a830fbc4086b01ce727c
Work around MultipleObjectsReturned error
django_project/quotes_app/views/superuser_tools.py
django_project/quotes_app/views/superuser_tools.py
from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.http import HttpResponseRedirect from django.utils.de...
Python
0
@@ -1073,96 +1073,16 @@ -alert('Episode #' + str(episode.id) + 'returns multiple objects!')%0A break +continue %0A
e0559d51bbb2ace2cda4f6ae1edf6d98efe4bf77
Update the hard-coded config settings
dwarf/config.py
dwarf/config.py
#!/usr/bin/env python # # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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 # # Un...
Python
0.000003
@@ -1156,16 +1156,55 @@ 'dwbr0', +%0A 'libvirt_bridge_ip': '10.10.10.1', %0A%0A 'i @@ -1290,48 +1290,8 @@ 292, -%0A%0A 'ec2_metadata_host': '10.10.10.1', %0A
cb0f6736c93e226733ecd0c4db378379022e8f7d
Disable SQL Alchemy tracking in the Webserver (#4707)
airflow/www/app.py
airflow/www/app.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
Python
0
@@ -1956,16 +1956,73 @@ testing +%0A app.config%5B'SQLALCHEMY_TRACK_MODIFICATIONS'%5D = False %0A%0A cs
28770cf4d0995697f7b2c8edad7a56fb8aeabea5
Send email to client working
Sendy.py
Sendy.py
# coding: utf-8 # ! /usr/bin/python __author__ = 'Shahariar Rabby' # # Sendy # ### Importing Send mail file # In[6]: from Sendmail import * # ** Take user email, text plan massage, HTML file ** # In[7]: TO_EMAIL = raw_input("Enter reciver email : ") #Taking Reciver email as input subject = raw_input("Enter Mail...
Python
0
@@ -61,16 +61,65 @@ Rabby'%0A%0A +# This will read details and send email to clint%0A %0A# # Sen
48a63de70673ce96ead7a81709fdd81e872a847d
Revert changes
examples/ensemble/plot_forest_importances_faces.py
examples/ensemble/plot_forest_importances_faces.py
""" ======================================= Pixel importances with forests of trees ======================================= This example shows the use of forests of trees to evaluate the importance of the pixels in an image classification task (faces). The hotter the pixel, the more important. """ print __doc__ impor...
Python
0.000001
@@ -820,48 +820,8 @@ ue,%0A - n_jobs=2,%0A
a8fbacf462e0b93388a848ba4b59b9d4bec5a9a2
Fix scope validation on refresh token grant.
oauthlib/oauth2/rfc6749/grant_types/refresh_token.py
oauthlib/oauth2/rfc6749/grant_types/refresh_token.py
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import unicode_literals, absolute_import import json from oauthlib.common import log from .base import GrantTypeBase from .. import errors from ..request_validator import RequestValidator class R...
Python
0
@@ -4197,868 +4197,29 @@ -# OPTIONAL. The scope of the access request as described by%0A # Section 3.3. The requested scope MUST NOT include any scope%0A # not originally granted by the resource owner, and if omitted is%0A # treated as equal to the scope originally granted by the%0A # ...
a49a87e26d3049f15942c29e98d2306d43454d48
Update Facenet example to use alpha instead of epsilon
examples/facenet_adversarial_faces/facenet_fgsm.py
examples/facenet_adversarial_faces/facenet_fgsm.py
import facenet import tensorflow as tf import numpy as np from cleverhans.model import Model from cleverhans.attacks import FastGradientMethod import set_loader class InceptionResnetV1Model(Model): model_path = "models/facenet/20170512-110547/20170512-110547.pb" def __init__(self): su...
Python
0
@@ -2515,32 +2515,100 @@ for the model%0D%0A + steps = 1%0D%0A eps = 0.01%0D%0A alpha = eps / steps%0D%0A fgsm = F @@ -2663,20 +2663,21 @@ %7B'eps': -0.01 +alpha ,%0D%0A @@ -2859,35 +2859,16 @@ faces1%0D%0A - steps = 1%0D%0A
b4887ede78bef4f74d723a50f2fc6edf35b85fd6
Correct comments
smile_stock_picking_wave_extension/models/stock.py
smile_stock_picking_wave_extension/models/stock.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
Python
0
@@ -5056,34 +5056,28 @@ tion to -transport vouchers +picking wave if this @@ -6196,25 +6196,20 @@ cel -transport voucher +picking wave s%0A
918421a26c762a5afc0161d874ab4fec6ff11cb0
add url
webapp/osmproj1/markerstorage/urls.py
webapp/osmproj1/markerstorage/urls.py
from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from . import views urlpatterns = [ url(r'^markerdata/$', views.markerdata_list), url(r'^markerdata/(?P<pk>[0-9]+)/$', views.markerdata_detail), # url(r'^osm/index.html', views.osm_index), url(r'^o...
Python
0.000013
@@ -762,16 +762,49 @@ index),%0A + url(r'%5E$', views.osm_index),%0A %5D%0A%0Aurlpa
d316513501d21bd04cb64091133b93cacd9bcd3b
Switch RawConfigParser -> ConfigParser.
luigi/configuration.py
luigi/configuration.py
import logging from ConfigParser import RawConfigParser, NoOptionError, NoSectionError class LuigiConfigParser(RawConfigParser): NO_DEFAULT = object() _instance = None _config_paths = ['/etc/luigi/client.cfg', 'client.cfg'] @classmethod def add_config_path(cls, path): cls._config_paths.a...
Python
0
@@ -34,19 +34,16 @@ import -Raw ConfigPa @@ -104,19 +104,16 @@ gParser( -Raw ConfigPa @@ -1510,35 +1510,32 @@ et_with_default( -Raw ConfigParser.get @@ -1656,35 +1656,32 @@ et_with_default( -Raw ConfigParser.get @@ -1811,35 +1811,32 @@ et_with_default( -Raw ConfigParser.get @@ -1975,11 +1975,8 @@ ult( -Raw...
550fd8bc4a9f9e7f780a99b9d925b95883e046ea
remove extra log statement
dfttopif/web.py
dfttopif/web.py
import sys import json import logging import requests from pypif import pif from flask import Flask, request from flask_cors import CORS from dfttopif import * # Configure flask app = Flask(__name__) CORS(app) # Configure logging logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) @app.route('/convert/from...
Python
0.000001
@@ -823,58 +823,8 @@ ut)%0A -%0A logging.info(os.listdir(temp_dir_name))%0A%0A
36b15658906685ea7eaaa3289678c416bc2d23af
Remove sleep from sample script, it was slowing down the tests.
samplecode/generic_script.py
samplecode/generic_script.py
#! /usr/bin/env python import argparse import csv import sys import time # In order to work with kive, scripts which having a inputs # and b inputs must have a+b command line arguments, the first a # arguments specifying paths of input files, the subsequent b # arguments specifying the paths of where outputs are writ...
Python
0
@@ -58,20 +58,8 @@ sys -%0Aimport time %0A%0A# @@ -930,40 +930,8 @@ v):%0A - time.sleep(0.5)%0A
f1c21946cd460f9db993689d9b1944bb0b518d02
allow the uploader to vectorize only
luminoso_api/upload.py
luminoso_api/upload.py
from itertools import islice, chain from luminoso_api import LuminosoClient from luminoso_api.errors import LuminosoAPIError from luminoso_api.json_stream import transcode_to_stream, stream_json_lines ROOT_URL = 'https://api.lumino.so/v3' LOCAL_URL = 'http://localhost:5000/v3' #http://code.activestate.com/recipes/303...
Python
0
@@ -705,32 +705,54 @@ lse, stage=False +, vectorize_only=False ):%0A %22%22%22%0A G @@ -1328,16 +1328,260 @@ (batch)%0A + if vectorize_only:%0A job_id = project.upload('docs/admin', documents, width=8, do_not_build_assocspace=True,%0A do_not_save_ngrams=True, do_not_save_termst...
823bb1548d19c319c9da40c154d14d42eb28c1c2
support a local_settings.py; disable debug
django/rmm/settings.py
django/rmm/settings.py
""" Django settings for rmm project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # ...
Python
0.000001
@@ -801,19 +801,20 @@ DEBUG = -Tru +Fals e%0A%0AALLOW @@ -3081,8 +3081,103 @@ tatic/'%0A +%0A# Import local settings if they exist%0Atry:%0A from .local_settings import *%0Aexcept:%0A pass%0A
9e59de92c246a17ab8fd57b929154962ff4c0fa7
Drop unused test
tests/test_web.py
tests/test_web.py
import asyncio import unittest from unittest import mock from aiohttp import web, log from aiohttp.multidict import CIMultiDict from aiohttp.protocol import HttpVersion11, RawRequestMessage class TestWeb(unittest.TestCase): def setUp(self): self.loop = asyncio.new_event_loop() asyncio.set_event_...
Python
0
@@ -84,112 +84,8 @@ log%0A -from aiohttp.multidict import CIMultiDict%0Afrom aiohttp.protocol import HttpVersion11, RawRequestMessage%0A %0A%0Acl @@ -276,579 +276,8 @@ ()%0A%0A - @unittest.skip('moved to test_web_functional')%0A def test_handler_returns_not_response(self):%0A app = web.Application(loop=...
1e8d5a73957e15826e3eaae0406ab90ff63a4aab
Add missing ws separator between words
magnum/conf/cluster.py
magnum/conf/cluster.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
Python
0.998815
@@ -1737,16 +1737,17 @@ r nodes. + '%0A @@ -1815,16 +1815,17 @@ finity%22, + '%0A @@ -2255,16 +2255,17 @@ alancers + '%0A
de53961eabf4fa35171e11d2905edff1e467c0c3
Use DRF-style regex for url params
djsw_wrapper/router.py
djsw_wrapper/router.py
import re import logging import importlib from django.utils import six from django.conf.urls import url as make_url from djsw_wrapper.utils import Singleton, Template, Resolver from djsw_wrapper.makers import SwaggerViewMaker, SwaggerMethodMaker, SwaggerViewClass from djsw_wrapper.params import SwaggerParameter, Swag...
Python
0
@@ -5023,16 +5023,17 @@ P%3C%5C1%3E%5B%5E/ +. %5D+)', ur
b4c1eb9acba9e5ce74da3ccfda177ccf41c07ab5
Bump revision number
ecks/__init__.py
ecks/__init__.py
""" A simple way to get data out of a remote machine using SNMP without having to deal with a single MIB or OID The goal of Ecks is simple - make it really easy to get get any data from an SNMP service. Ecks is made up of a core class that will collect data via SNMP, and a set of plugins that cont...
Python
0.000001
@@ -1088,9 +1088,13 @@ '0. -4 +5-dev '%0A__
39980bd4063cd55e86f715ecf4c1a0eef48dadce
Update bucket listing to return key names
dbbackup/storage/s3_storage.py
dbbackup/storage/s3_storage.py
""" S3 Storage object. """ import os import boto from boto.s3.key import Key from django.conf import settings from .base import BaseStorage, StorageError ################################ # S3 Storage Object ################################ class Storage(BaseStorage): """ S3 API Storage. """ S3_BUCKET = ge...
Python
0
@@ -2011,24 +2011,65 @@ urn -self.bucket.list +%5Bk.name for k in%0A self.bucket.get_all_keys (pre @@ -2090,16 +2090,17 @@ RECTORY) +%5D %0A%0A de
812031ff7e3017dfcbff4c3434fbd3c2437dcb33
print the information of testcase which is on failure
dev-tools/travis/print-errors-from-test-reports.py
dev-tools/travis/print-errors-from-test-reports.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
Python
0.999999
@@ -1782,16 +1782,148 @@ fail)%0A%0A + failure = testcase.find(%22failure%22)%0A if failure is not None:%0A print_detail_information(testcase, failure)%0A%0A %0Adef mai
8c9da7ada644e806926937087d6b4b06e5b62d54
Allow publish_trajectory to be gracefully interrupted without killing kernel
exotica_python/src/pyexotica/publish_trajectory.py
exotica_python/src/pyexotica/publish_trajectory.py
#!/usr/bin/env python from time import sleep import matplotlib.pyplot as plt import signal trajectoryPlaybackIsShutdown = False def sigIntHandler(signal, frame): global trajectoryPlaybackIsShutdown trajectoryPlaybackIsShutdown = True raise KeyboardInterrupt def is_shutdown(): signal.signal(signal.SI...
Python
0
@@ -1,27 +1,4 @@ -#!/usr/bin/env python%0A%0A from @@ -67,45 +67,8 @@ al%0A%0A -trajectoryPlaybackIsShutdown = False%0A %0Adef @@ -106,259 +106,32 @@ -global trajectoryPlaybackIsShutdown%0A trajectoryPlaybackIsShutdown = True%0A raise KeyboardInterrupt%0A%0Adef is_shutdown():%0A signal.signal(signal.S...
9696de392e04eda79ec3a4754b88ebff2a42e1f9
Move recursion end check.
nonogram-solver.py
nonogram-solver.py
#!/usr/bin/env python3 #width = 5 #height = 5 #clues_x = [[1], [5], [1], [3], [1,2]] #clues_y = [[1,2], [2,1], [4], [1,1], [1]] ## 01011 ## 11010 ## 01111 ## 01001 ## 01000 width = 15 height = 25 clues_x = [ [1], [1,5,8,2], [1,1,1,1,1,4,1], [1,1,2,1,1], [1,2,2,1,1,5], ...
Python
0
@@ -1370,57 +1370,8 @@ d):%0A - if(len(blocks) %3C 1):%0A return %5Bset()%5D%0A%0A @@ -1379,16 +1379,16 @@ es = %5B%5D%0A + for @@ -1499,16 +1499,92 @@ ks%5B0%5D)%7D%0A + if len(blocks) == 1:%0A res.append(base)%0A else:%0A @@ -1639,24 +1639,28 @@ 0%5D+1,...
aba9a06b640b755bc206ba7acd22710a88318d13
remove migration dep
django_namespace_perms/migrations/0001_initial.py
django_namespace_perms/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-17 09:57 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('auth',...
Python
0.000001
@@ -301,132 +301,8 @@ = %5B%0A - ('auth', '0008_alter_user_username_max_length'),%0A migrations.swappable_dependency(settings.AUTH_USER_MODEL),%0A
50efd64eac4fd7dbd003f32377ac2b520b1ecee6
normalize inputs in functional_common_information
dit/multivariate/functional_common_information.py
dit/multivariate/functional_common_information.py
""" The functional common information. """ from collections import deque from itertools import combinations from ..distconst import insert_rvf, modify_outcomes from ..helpers import flatten, normalize_rvs from ..math import close from ..utils import partitions from .entropy import entropy from .dual_total_correlatio...
Python
0.999956
@@ -7071,24 +7071,94 @@ on.%0A %22%22%22%0A + rvs, crvs, rv_mode = normalize_rvs(dist, rvs, crvs, rv_mode)%0A %0A dtc = du
de87714f192937e6b7aa5fc66ea785a36432c0fd
Set MEDIA_URL for production
notaso/settings.py
notaso/settings.py
import os from configurations import Configuration, values class Common(Configuration): BASE_DIR = os.path.dirname(os.path.dirname(__file__)) ENVIRONMENT = values.Value(environ_prefix=None, default='DEVELOPMENT') SECRET_KEY = values.SecretValue(environ_prefix=None) DEBUG = values.BooleanValue(Fals...
Python
0
@@ -5311,16 +5311,43 @@ ws.com/' +%0A MEDIA_URL = STATIC_URL %0A%0A AW
f92d054a6ea8db18ef225b75af34aafb045d3492
Add DOCUMENTS_URL to config
config.py
config.py
import os import jinja2 basedir = os.path.abspath(os.path.dirname(__file__)) class Config(object): DEBUG = True S3_DOCUMENT_BUCKET = os.getenv('DM_S3_DOCUMENT_BUCKET') API_URL = os.getenv('DM_API_URL') API_AUTH_TOKEN = os.getenv('DM_ADMIN_FRONTEND_API_AUTH_TOKEN') BASE_TEMPLATE_DATA = {} SECR...
Python
0
@@ -168,24 +168,99 @@ NT_BUCKET')%0A + DOCUMENTS_URL = 'https://assets.dev.digitalmarketplace.service.gov.uk'%0A API_URL @@ -285,16 +285,16 @@ I_URL')%0A - API_ @@ -981,24 +981,100 @@ TION = True%0A + DOCUMENTS_URL = 'https://assets.test.digitalmarketplace.service.gov.uk'%0A SECRET_K @@ -1559,1...
0cb45bbc1c7b6b5f1a2722e85159b97c8a555e0c
Update the docblock of the example
examples/providers/factory_deep_init_injections.py
examples/providers/factory_deep_init_injections.py
"""`Factory` providers deep init injections example.""" from dependency_injector import providers class Regularizer: def __init__(self, alpha): self.alpha = alpha class Loss: def __init__(self, regularizer): self.regularizer = regularizer class ClassificationTask: def __init__(self, l...
Python
0.000001
@@ -16,16 +16,55 @@ oviders +- building a complex object graph with deep ini
29c8e1bc228e67a01b50c01867b696f7ebf779f1
encode the url
tg/controllers.py
tg/controllers.py
"""Basic controller class for turbogears""" import urlparse, urllib from tg.decorated import ObjectDispatchController, DecoratedController from pylons import request, response from tg.exceptions import HTTPFound class TurboGearsController(ObjectDispatchController): """Basis TurboGears controller class which is der...
Python
0.999996
@@ -1537,16 +1537,82 @@ , True)%0A + if isinstance(url, unicode):%0A url = url.encode('utf8')%0A foun
4f3504b79d14cac70d285924ebd55ffd7bd4bd80
change order to prevent overwritten variable (2)
vip_hci/preproc/derotation.py
vip_hci/preproc/derotation.py
#! /usr/bin/env python """ Module with frame de-rotation routine for ADI. """ from __future__ import division, print_function __author__ = 'Carlos Alberto Gomez Gonzalez' __all__ = ['cube_derotate', 'frame_rotate'] import numpy as np import warnings try: import cv2 no_opencv = False except ImportE...
Python
0
@@ -5283,45 +5283,8 @@ .')%0A - array_der = np.zeros_like(array)%0A @@ -5429,24 +5429,65 @@ nproc == 1:%0A + array_der = np.zeros_like(array)%0A for
b98839de990e3c4b1cd1a5730df512c2f9bc472a
add test models
django_spaghetti/tests/models.py
django_spaghetti/tests/models.py
from django.db import models class PoliceOfficer(models.Model): """ An officer of the NYPD """ badge_number = models.IntegerField(max_length=10, primary_key=True) first_name = models.CharField(max_length=200) surname = models.CharField(max_length=200) rank = models.CharField(max_length=200)...
Python
0
@@ -403,126 +403,8 @@ rs%22) -%0A station = models.ForeignKey(%22PoliceStation%22,related_name=%22officers%22)%0A%0Aclass PoliceStation(models.Model):%0A pass %0A%0Acl @@ -478,34 +478,16 @@ ength=10 -, primary_key=True )%0A bu @@ -577,16 +577,95 @@ fficer)%0A + officers = models.ForeignKey(%22PoliceOff...
2e69a9d7512faed13d876d4f58375fbb454e7fcb
test to get_group method use of mock
connector_cva/tests/test_cva_config_settings.py
connector_cva/tests/test_cva_config_settings.py
# -*- coding: utf-8 -*- # © <2016> <Jarsa Sistemas, S.A. de C.V.> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase class TestCvaConfigSettings(TransactionCase): """ This will test model cva config settings """ def setUp(self): ...
Python
0
@@ -178,16 +178,66 @@ ionCase%0A +from mock import MagicMock%0Afrom lxml import etree%0A %0A%0Aclass @@ -464,16 +464,67 @@ .setUp() +%0A self.cva = self.env%5B'cva.config.settings'%5D %0A%0A de @@ -588,20 +588,16 @@ cva -_obj = self. env%5B @@ -596,56 +596,11 @@ elf. -env%5B'cva.config.settings'%5D...
2c10f636b8091dac27a4ceb3d9f26e44116abb80
Change orm's address to ip_address
plugins/http_plugin.py
plugins/http_plugin.py
from plugin_template import Template from BaseHTTPServer import BaseHTTPRequestHandler from sqlalchemy import Column, Integer, String, DateTime from base import Base import json import datetime import logging class Plugin(Template): """Reads an http request, responds to client, and adds data to db. Inherit T...
Python
0.000006
@@ -2548,16 +2548,19 @@ name%22: %22 +ip_ address%22
e394d8b0550c0398d96b01ff3d49bb1e7b692908
Bump version
datetimerange/__version__.py
datetimerange/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.6.0" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
Python
0
@@ -204,17 +204,17 @@ = %220.6. -0 +1 %22%0A__main
945a90c7e1ad379b8310382ce7ceb61cf79f1e1d
make config.py output directly applicable
config.py
config.py
import pytoml as toml import os def load_env(): """ load environment variables from the environment. If empty, use default values from config.toml.example. :return: config dictionary of dictionaries. """ with open('config.toml.example') as defaultconf: configdict = toml.load(defaultco...
Python
0
@@ -1435,19 +1435,17 @@ (key + %22 - = += %22 + str(
8bb25b130e1da9e0ea97c703abca203dfb899491
allow frontend loading without config
config.py
config.py
import socket, os from subprocess import Popen, PIPE from Websheet import record import json # we already checked for this error in php land try: config_jo = json.loads(open('config.json').read()) except: config_jo = {} # empty dict # if you are using safeexec, securely running java should be something like t...
Python
0.000001
@@ -225,21 +225,8 @@ = %7B%7D - # empty dict %0A%0A# @@ -328,24 +328,92 @@ a_prefix():%0A + if (config_jo == %7B%7D): return %22error: config.json doesn't exist%22%0A jail = c
83d0f621daa538524f381408081a86fcd7412573
Improve YAML examples - windows/win_iis_webapplication.py (#19402)
lib/ansible/modules/windows/win_iis_webapplication.py
lib/ansible/modules/windows/win_iis_webapplication.py
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # # This file is part of Ansible # # Ansible 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 t...
Python
0.000003
@@ -1905,33 +1905,53 @@ S = +r '''%0A -$ ansible -i hosts -m +- name: Add ACME webapplication on IIS%0A win @@ -1973,31 +1973,61 @@ tion - -a %22 +:%0A name -= +: api +%0A site -= +: acme +%0A state: present%0A phy @@ -2040,35 +2040,26 @@ path -=c:%5C +: C: %5Capps%5C -%5C acme%5C -%5C ...
913ecdd419943af603f4556e4f44c5b59df17462
Improve plan filters
dbaas/physical/admin/plan.py
dbaas/physical/admin/plan.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib import admin from django_services import admin as services_admin from ..service.plan import PlanService from ..models import PlanAttribute from dbaas_cloudstack.models import PlanAttr from dbaas_nfsaas.models import Pla...
Python
0
@@ -1409,16 +1409,49 @@ ctive%22, +%22engine%22, %22environments%22, %22is_ha%22 )%0A li
a4603e1233aaf816d68c10376799679ae36b4e42
use string format to generate cache key
elephant/keys.py
elephant/keys.py
# -*- coding: utf-8 -*- from collections import OrderedDict import inspect def _namespace(obj): module = obj.__module__ or __name__ if hasattr(obj, '__qualname__'): name = obj.__qualname__ return '.'.join((module, name)) klass = getattr(obj, '__self__', None) if klass and not inspec...
Python
0.000003
@@ -458,16 +458,44 @@ name = + '%7B%7D.%7B%7D'.format(%0A klass._ @@ -501,24 +501,29 @@ __name__ - + '.' + +,%0A obj.__n @@ -524,24 +524,34 @@ bj.__name__%0A + )%0A else:%0A @@ -803,33 +803,76 @@ y = -generic_key + '.' + _args +'%7B%7D.%7B%7D'.format(%0A generic...
fc108f28faa6e99342c03035bb1693053dd59420
Use docker-py main branch
docker_host_provisioner/docker_host_provisioner.py
docker_host_provisioner/docker_host_provisioner.py
__author__ = 'kobyn' """ Docker provisioner tasks. """ import time from cloudify.decorators import operation from cloudify.utils import get_local_ip import docker import socket get_ip = get_local_ip container_cmds = ['/bin/sh -c "while true; do echo hello world; sleep 1; done"', '/usr/bin/python -m ...
Python
0.000001
@@ -1426,80 +1426,8 @@ me'%5D -,%0D%0A entrypoint=None, cpu_shares=None, working_dir=None )%0D%0A
b8375bbf32e70e9488288f33fb08e5da34b5d1b7
refactored in order to remove the category
dbcollection/dataset/funs.py
dbcollection/dataset/funs.py
""" Functions to download/process a dataset using a constructor. """ import os from .list_datasets import datasets def fetch_dataset_constructor(name): """Fetches a dataset constructor class. Parameters ---------- name : str Name of the dataset. Returns ------- str Name ...
Python
0.999938
@@ -453,25 +453,24 @@ ---%0A -Exception +KeyError %0A @@ -501,14 +501,13 @@ not -appear +exist on @@ -532,39 +532,11 @@ -for category in datasets.keys() +try :%0A @@ -537,33 +537,29 @@ ry:%0A -if name i +retur n datasets%5Bc @@ -561,81 +561,39 @@ ets%5B -category%5D.keys():%0A ...
465c36fddb0727622a901ead3a0c936aa13b56ce
Disable CSRF_TOKEN in config.py
config.py
config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db') SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
Python
0.000001
@@ -57,16 +57,42 @@ le__))%0A%0A +WTF_CSRF_ENABLED = False%0A%0A SQLALCHE
f260b52a6eef1c210a8b6b9f4ad1ce0c0c98d86f
fix error in route initialization
src/c3nav/routing/route.py
src/c3nav/routing/route.py
# flake8: noqa import copy from collections import OrderedDict, deque import numpy as np from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ def describe_location(location, locations): if location.can_describe: final_location = locations.get(locatio...
Python
0.000002
@@ -1252,37 +1252,42 @@ on and any(self. -origi +destinatio n_addition):%0A
b6ec7f6e81aa24415aed5d799192a62e7fbd224f
Add django_bouncy to installed apps
schoolidolapi/settings.py
schoolidolapi/settings.py
""" Django settings for schoolidolapi project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ....
Python
0
@@ -1261,24 +1261,45 @@ rometheus',%0A + 'django_bouncy',%0A 'contest
643dddf3118af4675954848671e38b20cd8234fb
use config_location instead of hardwired default
QGL/config.py
QGL/config.py
#Package configuration information import json import os.path import sys #Load the configuration from the json file and populate the global configuration dictionary rootFolder = os.path.dirname(os.path.abspath(__file__)) rootFolder = rootFolder.replace('\\', '/') # use unix-like convention QGLCfgFile = os.path.join(...
Python
0.000001
@@ -68,17 +68,49 @@ rt sys%0A%0A -# +from . import config_location%0A%0A# Load the @@ -142,16 +142,18 @@ son file +%0A# and pop @@ -194,16 +194,104 @@ tionary%0A +%0AQGLCfgFile = config_location.get_config_path()%0A%0Aif not os.path.isfile(QGLCfgFile):%0A rootFold @@ -338,16 +338,20 @@ ile__))%0A + ro...
854f78c80c79928cedab9dc80f11375e5c173cab
Update tf-23-monadic.py. We can eliminate the extra parameter in the __init__. Let the naming in get_input method more clear.
22-passive-aggressive/tf-23-monadic.py
22-passive-aggressive/tf-23-monadic.py
#!/usr/bin/env python import sys, re, operator, string # # The PassiveAggressive class for this example # class TFPassiveAggressive: def __init__(self, v): self._e = None self._offending_func = None self._value = v def bind(self, func): if self._e == None: try: ...
Python
0
@@ -152,11 +152,8 @@ self -, v ):%0A @@ -232,17 +232,20 @@ value = -v +None %0A%0A de @@ -680,19 +680,22 @@ t_input( -arg +ignore ):%0A a @@ -2343,20 +2343,16 @@ ressive( -None ).bind(g @@ -2461,10 +2461,8 @@ rintme() -%0A%0A
8ad3e9b969576346a02237fccb9376e391c43f9f
fix test to check order of filenames
tests/datasets_tests/test_directory_parsing_classification_dataset.py
tests/datasets_tests/test_directory_parsing_classification_dataset.py
import unittest import numpy as np import os from PIL import Image import tempfile from chainer import testing from chainercv.datasets import directory_parsing_label_names from chainercv.datasets import DirectoryParsingClassificationDataset from chainercv.utils import assert_is_classification_dataset def _save_img...
Python
0
@@ -2857,32 +2857,313 @@ or=self.color)%0A%0A + img_names = %5Bos.path.split(filename)%5B-1%5D%0A for filename in dataset.img_filenames%5D%0A self.assertEqual(%0A img_names%5B:self.n_img_per_class%5D,%0A %5B'img%7B%7D.%7B%7D'.format(i, self.suffix)%0A ...
9ca92efe4b9ed99018bc2eeadca17ae71f8ac60b
Update pocs/mount/__init__.py
pocs/mount/__init__.py
pocs/mount/__init__.py
from glob import glob from pocs.mount.mount import AbstractMount # pragma: no flakes from pocs.utils import error from pocs.utils import load_module from pocs.utils.location import create_location_from_config from pocs.utils.logger import get_root_logger def create_mount_from_config(config, mount_info=None, earth_l...
Python
0
@@ -2042,16 +2042,28 @@ created + from config ')%0A%0A