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
29af0ac8ec3abb392e248561674f1927e28d97ed
Modify sensor to return pressure in bar and temp in celsius
sensor.py
sensor.py
from abc import ABCMeta, abstractmethod from quick2wire import i2c import logging import time logging.basicConfig() class Sensor(object): """ Sensor abstract base class represents interface for pressure sensors. """ __metaclass__=ABCMeta @abstractmethod def getPressure(self): pass @abstr...
Python
0
@@ -2942,15 +2942,21 @@ )%5B0%5D +/100.0 %0A - %0A @@ -3010,16 +3010,26 @@ alc()%5B1%5D + / 10000.0 %0A%0A%0A%0A%0Aif @@ -3187,16 +3187,8 @@ re() - / 100.0 %0A @@ -3279,15 +3279,8 @@ re() - / 10.0 %0A @@ -3319,17 +3319,16 @@ ure), %22 -m bar%22)%0A
c52bb5699cc77d41095516c26ff909d856af8bd1
Add TODOs
src/cloud/firebase_io.py
src/cloud/firebase_io.py
import json from pyrebase import pyrebase from utils import TimeUtils class FirebaseIO(): def __init__(self): # pyrebase_config.json is of format # { # "apiKey": "xxx", # "authDomain": "xxx", # "databaseURL": "xxx", # "storageBucket": "xxx", ...
Python
0.000001
@@ -359,24 +359,57 @@ # %7D%0A%0A + # TODO make configurable%0A with @@ -1937,16 +1937,41 @@ 60*24*7) + # TODO make configurable %0A @@ -2239,16 +2239,54 @@ ation')%0A + # TODO make time configurable%0A
e4be9429e050dae6b1c9e988fa3da3c3e9d1d417
Add bots root directory to parent.py
test/common/parent.py
test/common/parent.py
import os import sys TEST_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BOTS_DIR = os.path.join(os.path.dirname(TEST_DIR), "bots") sys.path.append(os.path.join(BOTS_DIR, "machine")) sys.path.append(os.path.join(TEST_DIR, "common"))
Python
0
@@ -145,16 +145,67 @@ %22bots%22)%0A +sys.path.append(os.path.join(BOTS_DIR)) # for lib%0A sys.path
826f23f0fc7eea4c72dcc26f637f3752bee51b47
Allow tests to be called from parent directory of "test"
test/ctypesgentest.py
test/ctypesgentest.py
import optparse, sys, StringIO sys.path.append("..") import ctypesgencore """ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a single function, test(). test() takes a string that represents a C header file, along with some keyword arguments representing options. It proces...
Python
0.000001
@@ -24,16 +24,103 @@ tringIO%0A +sys.path.append(%22.%22) # Allow tests to be called from parent directory with Python 2.6%0A sys.path
bd7a1f8fe5237efc0de9fd60ddc035cc4be620ca
Update path_helper.py
unintended_ml_bias/new_madlibber/path_helper.py
unintended_ml_bias/new_madlibber/path_helper.py
import os class PathHelper(object): def __init__(self, word_file, sentence_template_file, output_file): if not os.path.exists(word_file): raise IOError("Input word file '{}' does not exist!".format(word_file)) if not os.path.isfile(word_file): raise IOError("Input word file '{}' is not a file!".f...
Python
0.000004
@@ -4,16 +4,17 @@ ort os%0A%0A +%0A class Pa @@ -31,16 +31,17 @@ bject):%0A +%0A def __ @@ -487,32 +487,43 @@ exist!%22.format( +%0A sentence_templat @@ -661,16 +661,27 @@ .format( +%0A sentence @@ -762,16 +762,20 @@ %0A if +not os.path. @@ -799,14 +799,8 @@ ile) - == '' :%0A @...
3d4afd579bdd690c9fba94ee96e52257bf4d79d2
copy production procfile
reactive/huginn.py
reactive/huginn.py
from charms.reactive import ( hook, when, only_once, is_state ) import os.path as path from charmhelpers.core import hookenv, host from charmhelpers.core.templating import render from charmhelpers.fetch import apt_install from shell import shell # ./lib/nginxlib import nginxlib # ./lib/rubylib from r...
Python
0
@@ -1355,16 +1355,202 @@ test%22)%0A + procfile = path.join(hookenv.charm_dir(), 'templates/Procfile')%0A shell(%22cp %25(procfile)s %25(dir)s/Procfile%22 %25 %7B%0A 'procfile': procfile,%0A 'dir': ruby_dist_dir()%0A %7D)%0A%0A bund
86216b39365a7877103dfe075bf8e08a8ce696d0
bump version
radar/__init__.py
radar/__init__.py
__version__ = '2.47.22'
Python
0
@@ -14,11 +14,11 @@ '2.47.2 -2 +3 '%0A
3bfcc096acd5f3ed0cda2427bdc5177bd3e55dd7
bump version
radar/__init__.py
radar/__init__.py
__version__ = '2.46.25'
Python
0
@@ -18,7 +18,7 @@ 46.2 -5 +6 '%0A
d94e862d5775ecedf49fb0e15820b4744573c24c
bump to 1.1.1
radon/__init__.py
radon/__init__.py
'''This module contains the main() function, which is the entry point for the command line interface.''' __version__ = '1.1' def main(): '''The entry point for Setuptools.''' import sys from radon.cli import program, log_error if not sys.argv[1:]: sys.argv.append('-h') try: progr...
Python
0.000001
@@ -117,16 +117,18 @@ _ = '1.1 +.1 '%0A%0A%0Adef
24503b8cd2faed7de757fceb597c5d54b91daf4c
update the interface of mriqc_clf
mriqc/bin/mriqc_clf.py
mriqc/bin/mriqc_clf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: oesteban # @Date: 2015-11-19 16:44:27 """ mriqc_fit command line interface definition """ from __future__ import absolute_import, division, print_function, unicode_literals from sys import version_info import warnings PY3 = version_info[0] > 2 from sklearn.m...
Python
0.000001
@@ -1070,16 +1070,26 @@ t isfile +, splitext %0A%0A wa @@ -3278,16 +3278,139 @@ mfile)%0A%0A + save_classifier = None%0A if opts.save_classifier:%0A save_classifier, clf_ext = splitext(opts.save_classifier)%0A%0A if o @@ -3424,32 +3424,32 @@ in is not None:%0A - train_ex @@ -4171,29 +4...
40b4a52e525b59921a5667740fa81ee3c15e6b06
Switch to future division in mtm_stats.py
mtm_stats/mtm_stats.py
mtm_stats/mtm_stats.py
'''The main script''' from __future__ import print_function from __future__ import absolute_import from future.utils import viewitems # To update with any Cython changes, just run: # python setup.py build_ext --inplace import numpy as np from .sparse_block_array import sba_compress_64 from . import cy_mtm_stats def ...
Python
0
@@ -92,16 +92,48 @@ _import%0A +from __future__ import division%0A from fut @@ -1014,37 +1014,32 @@ p.ceil(len(setB) - * 1. / 64))%0A outp @@ -1884,21 +1884,16 @@ en(setB) - * 1. / 64))%0A @@ -4248,13 +4248,8 @@ : ic - * 1. / u
4d167d2b8ed024d1ea11f6f9ab0743601bddc8f5
word_count
examples/word_count/insert_data.py
examples/word_count/insert_data.py
import sys, os, logging import pymongo import bson import datetime config = { "db_name": "test", "collection_name": "wc", "input_uri": "mongodb://localhost/test.wc", "create_input_splits": True, "split_key": {'_id' : 1}, } if __name__ == '__main__': conn = pymongo.C...
Python
0.998596
@@ -522,47 +522,8 @@ le:%0A - #print ', and line is %25s'%25line%0A @@ -633,43 +633,8 @@ ()%7D%0A - print 'post: %25s '%25post%0A
ebf09008dbb90b5155a9bbdfe395145b1a6b422d
Copy input to working directory - problem with long file names...
Wrappers/Solve/Solve.py
Wrappers/Solve/Solve.py
#!/usr/bin/env python # Solve.py # Copyright (C) 2006 CCLRC, Graeme Winter # # This code is distributed under the BSD license, a copy of which is # included in the root directory of this package. # # A wrapper for the phasing program SOLVE (Tom Terwilliger) # # 11th June 207 # import sys import os if not os.p...
Python
0
@@ -2753,16 +2753,194 @@ N set'%0A%0A + hklin = os.path.join(%0A self.get_working_directory(),%0A os.path.split(self._hklin)%5B-1%5D)%0A%0A shutil.copyfile(self._hklin, hklin)%0A%0A @@ -3560,27 +3560,40 @@ n %25s' %25 -self._hklin +os.path.split(hklin)%5B...
370d58420c48ed5291fb3291a3f89449b2fb5230
Add description to update-production script
docker/update-production.py
docker/update-production.py
#!/usr/bin/env python3 import argparse import subprocess import json import sys parser = argparse.ArgumentParser() args = parser.parse_args() def _info(msg): sys.stdout.write('* {}\n'.format(msg)) sys.stdout.flush() def _run_tutum(args): try: subprocess.check_call(['tutum',] + args, stdout=sub...
Python
0
@@ -108,16 +108,78 @@ tParser( +description='Update production server to latest Docker image.' )%0Aargs =
f4a8121bf38cdd8dea4a828316dc1c117c5ea0f3
update West Devon import script for parl.2017-06-08 (closes #902)
polling_stations/apps/data_collection/management/commands/import_west_devon.py
polling_stations/apps/data_collection/management/commands/import_west_devon.py
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E07000047' addresses_name = 'Democracy_Club__04May2017 - west devon.TSV' stations_name = 'Democracy_Club__04May2017 - west devon.TSV' elections = [ ...
Python
0
@@ -183,177 +183,122 @@ = ' -Democracy_Club__04May2017 - west devon.TSV'%0A stations_name = 'Democracy_Club__04May2017 - west devon.TSV'%0A elections = %5B%0A 'local.devon.2017-05-04',%0A +parl.2017-06-08/Version 2/merged.tsv'%0A stations_name = 'parl.2017-06-08/Version 2/merged.tsv'%0A ele...
4686448c2de3a49f4c1d4593327e1072de9644f7
Return result of the exec runner.
dockermap/map/runner/cmd.py
dockermap/map/runner/cmd.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from ..action import ContainerUtilAction from ..input import ItemType log = logging.getLogger(__name__) class ExecMixin(object): """ Utility mixin for executing configured commands inside containers. """ action_method_na...
Python
0
@@ -905,16 +905,259 @@ ommand%5D%0A + :return: List of exec command return values (e.g. containing the command id), if applicable, or %60%60None%60%60%0A if either no commands have been run or no values have been returned from the API.%0A :rtype: list%5Bdict%5D %7C NoneType%0A @@ -1152...
7b1871b311aae41d699a41da7c6553b45a588313
purge wip about cassandra metrics (not-the-right-place)
feedly/storage/cassandra/models.py
feedly/storage/cassandra/models.py
from cqlengine import columns from cqlengine.models import Model from cqlengine.exceptions import ValidationError class VarInt(columns.Column): db_type = 'varint' def validate(self, value): val = super(VarInt, self).validate(value) if val is None: return try: r...
Python
0
@@ -1317,568 +1317,4 @@ se)%0A -%0A%0Aclass FanoutStats(Model):%0A consumer_feed_id = columns.Ascii(primary_key=True, partition_key=True)%0A fanout_at = columns.DateTime(primary_key=True, partition_key=True)%0A date = columns.DateTime(primary_key=True, clustering_order='desc')%0A producer_feed_id = columns...
8d92e42bc524b72b40232b85fa59d83c05cea29b
send full domain and not only domain name
files/opensteak-metadata-server.py
files/opensteak-metadata-server.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Python
0
@@ -1573,24 +1573,16 @@ n=domain -%5B'name'%5D ,%0A @@ -2858,16 +2858,37 @@ 033%5B91m' +%0A ENDC = '%5C033%5B0m' %0A%0A TA
041f3b69af06dde44a7929675b4f7f6cc056c5c9
Fix missing refresh of apps due to trying to execute both commands in one statement
refreshcommands.py
refreshcommands.py
""" This module is about refreshing Rainmeter from within Sublime Text. This can be either activated via a command or as part of the build system. """ import os.path import sublime import sublime_plugin from . import rainmeter from .path.program_path_provider import get_cached_program_path def calculate_refresh_c...
Python
0.000005
@@ -369,109 +369,21 @@ -refresh_config = %5B%0A rm_exe, %22!Refresh%22, config%0A %5D%0A%0A if activate:%0A if is_inc:%0A +if activate:%0A @@ -427,22 +427,16 @@ , config -, %22&&%22 %5D%0A @@ -441,144 +441,22 @@ - cmds.extend(refresh_config)%0A%0A return c...
f7fc6556e3ef552ed570ad56db7dc3a19b3e75fd
Load config from site
fix-broken-double-redirect/edit.py
fix-broken-double-redirect/edit.py
# -*- coding: utf-8 -*- import argparse import os import re os.environ['PYWIKIBOT_DIR'] = os.path.dirname(os.path.realpath(__file__)) import pywikibot parser = argparse.ArgumentParser() parser.add_argument('-c', '--check', action='store_true', dest='check') parser.set_defaults(check=False) args = parser.parse_args()...
Python
0.000001
@@ -33,16 +33,28 @@ rgparse%0A +import json%0A import o @@ -55,16 +55,16 @@ port os%0A - import r @@ -157,16 +157,83 @@ wikibot%0A +from config import config_page_name # pylint: disable=E0611,W0614%0A %0A%0Aparser @@ -470,16 +470,214 @@ ogin()%0A%0A +config_page = pywikibot.Page(site, config_page_name)%0Acfg = ...
ebc43e2bd72bba3c4c660fd008cdfebdd3d8ece0
change url base
flexget/plugins/search_cpasbien.py
flexget/plugins/search_cpasbien.py
from __future__ import unicode_literals, division, absolute_import import logging import re import urllib from flexget import plugin, validator from flexget.entry import Entry from flexget.event import event from flexget.utils import requests from flexget.utils.soup import get_soup from flexget.utils.search import to...
Python
0.000001
@@ -1783,18 +1783,18 @@ pasbien. -pe +io '%0A
5ec45f9d8a7b4c54ecca0ad48f244c2ab0b8d532
remove no longer necessary package declaration
src/zeit/content/cp/blocks/tests.py
src/zeit/content/cp/blocks/tests.py
# -*- coding: utf-8 -*- # Copyright (c) 2009 gocept gmbh & co. kg # See also LICENSE.txt import zeit.content.cp.blocks import zeit.content.cp.testing def test_suite(): return zeit.content.cp.testing.FunctionalDocFileSuite( 'teaser.txt', 'xml.txt', package=zeit.content.cp.blocks)
Python
0
@@ -266,46 +266,6 @@ txt' -,%0A package=zeit.content.cp.blocks )%0A
ac912883be41ca4db298d6b8cf1a0c56dcf99d33
convert dns name to ip for dns-server
ddns.py
ddns.py
#!/usr/bin/env python3 import os import cgi import cgitb import datetime from configparser import SafeConfigParser from dnsupdate import doUpdate, isValidV4Addr, isValidV6Addr import dns.exception cgitb.enable() configuration_file = "ddns.ini" def read_data(domain): valid_options = ["password", "dns-server", ...
Python
0.999938
@@ -67,16 +67,30 @@ atetime%0A +import socket%0A from con @@ -3220,16 +3220,120 @@ (data)%0A%0A + # convert dns server name to ip%0A data%5B%22dns-server%22%5D = socket.gethostbyname(data%5B%22dns-server%22%5D)%0A%0A%0A def
69eafa95df4bdeb143d40c321f0a312d06efff1f
Add __all__ to segmentation package
skimage/segmentation/__init__.py
skimage/segmentation/__init__.py
from .random_walker_segmentation import random_walker from ._felzenszwalb import felzenszwalb from ._slic import slic from ._quickshift import quickshift from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries from ._clear_border import clear_border from ._join import join_segmentations, relabel_...
Python
0.000919
@@ -322,8 +322,295 @@ rom_one%0A +%0A%0A__all__ = %5B'random_walker',%0A 'felzenszwalb',%0A 'slic',%0A 'quickshift',%0A 'find_boundaries',%0A 'visualize_boundaries',%0A 'mark_boundaries',%0A 'clear_border',%0A 'join_segmentations',%0A ...
c1bb9d50205cdc850f0f3200d747d38252230d89
Correct a typo.
examples/julia-set/bench_dist.py
examples/julia-set/bench_dist.py
# encoding: utf-8 # --------------------------------------------------------------------------- # Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc. # Distributed under the terms of the BSD License. See COPYING.rst. # --------------------------------------------------------------------------- """...
Python
0.023481
@@ -2273,17 +2273,16 @@ arameter -e s%0Are_ax
d59f3259875ffac49668ffb3ce34ca511385ebb7
Fix USE_X_FORWARDED_FOR for proxied environments
rated/settings.py
rated/settings.py
from django.conf import settings DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default') DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100) DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60) RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429) RESPONSE_MESSAGE = g...
Python
0
@@ -597,16 +597,86 @@ ED_REDIS', %7B%7D)%0A%0A +USE_X_FORWARDED_FOR = getattr(settings, 'USE_X_FORWARDED_FOR', False)%0A
b613ecdb3e543a4c39c5bd80359c81e504c1da33
add -mlong-calls to gcc compile parameter
examples/module/rtconfig_lm3s.py
examples/module/rtconfig_lm3s.py
# bsp name BSP = 'lm3s8962' # toolchains EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' PREFIX = 'arm-none-eabi-' CC = PREFIX + 'gcc' CXX = PREFIX + 'g++' AS = PREFIX + 'gcc' AR = PREFIX + 'ar' LINK = PREFIX + 'gcc' TARGET_EXT = 'so' SIZE = PREFIX + 'size' OBJDUMP = PREFIX + 'objdump' ...
Python
0.000002
@@ -402,16 +402,29 @@ -mthumb +-mlong-calls -Dsource
3299cfb4d28999dd266f6fba58804c2d79ad5724
Use absolute path for base_path when not using local_repo_path
rdopkg/repoman.py
rdopkg/repoman.py
import os import re import shutil import time from rdopkg import exception from rdopkg.conf import cfg from rdopkg.utils import log from rdopkg.utils import cmd from rdopkg.utils import tidy_ssh_user from rdopkg import helpers def repo_name_from_url(repo_url): if repo_url: i = repo_url.rfind('/') ...
Python
0.000075
@@ -1491,16 +1491,32 @@ _path = +os.path.abspath( base_pat @@ -1516,16 +1516,17 @@ ase_path +) %0A
bde917596ce45090f6e719c438af251ea390b59e
Replace --platform in pullers with specific args, use custem docker client config dir
def.bzl
def.bzl
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Python
0
@@ -2806,23 +2806,16 @@ ls.%0A -native. git_repo
5e782f6a23a55a1db13a100803f73a9e1ff19c4c
update external-cblas patch directive (#23787)
var/spack/repos/builtin/packages/gsl/package.py
var/spack/repos/builtin/packages/gsl/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Gsl(AutotoolsPackage, GNUMirrorPackage): """The GNU Scientific Library (GSL) is a numeric...
Python
0
@@ -1693,16 +1693,27 @@ , when=%22 +@2.3:2.5.99 +externa @@ -1774,13 +1774,12 @@ 2.99 -99 %22)%0A +%0A
ce869c128d728af4c296eb96ecae0db6f30996a7
Make brnn_ptb_test write checkpoints to temp directory
sonnet/examples/brnn_ptb_test.py
sonnet/examples/brnn_ptb_test.py
# Copyright 2017 The Sonnet Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
Python
0
@@ -2390,16 +2390,190 @@ tmp_dir +%0A # Checkpoint to tmp directory so that test runs hermetically, and there is%0A # no possibility of reusing checkpoints from previous runs.%0A FLAGS.logbasedir = tmp_dir %0A%0A #
88a1cb9001b19f769f8be5dcde5d87be67c61a2f
comment out 1.6
streams/inference/back_integrate.py
streams/inference/back_integrate.py
# coding: utf-8 """ Contains likelihood function specific to back-integration and the Rewinder """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys # Third-party import numpy as np import astropy.units as u # Project from ..coordin...
Python
0
@@ -1826,16 +1826,17 @@ e8, s_x) +# *1.6%0A
19f293bda612e0699c3fdb31de5c5cfebca6fb5e
make demo.py executable
demo.py
demo.py
#!/usr/bin/python """ The MIT License (MIT) Copyright (c) 2016 Luca Weiss Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, cop...
Python
0.000002
c2a3443bd129b51df82826806829d50d6c01ee69
remove password
demo.py
demo.py
import chineseseg string = "蘇迪勒颱風造成土石崩塌,供應台北市用水的南勢溪挾帶大量泥沙,原水濁度一度飆高。" ckip = chineseseg.Ckip("wlzhuang", "xxxxaaaackip") stanford = chineseseg.stanford("/home/wlzhuang/stanford-segmenter-2015-04-20/stanford-segmenter-3.5.2.jar", debug=True) print( "stanford:", stanford.segment(string) ) print( "ckip:", ckip.seg...
Python
0.000449
@@ -96,32 +96,31 @@ ip(%22 -wlzhuang%22, %22xxxxaaaackip +myaccount%22, %22mypassword %22)%0A%0A
f52a1d0a8a02da4504240d13cb2ff2d321f00983
Update comments.
dfpm.py
dfpm.py
#!/usr/bin/env python # encoding: utf-8 """ dfpm Usage: dfpm [--directory DIR] [--platform PLATFORM] update dfpm [--directory DIR] [--platform PLATFORM] install <package>... dfpm [--directory DIR] [--platform PLATFORM] remove <package>... dfpm [--directory DIR] [--platform PLATFORM] upgrade [<package>...
Python
0
@@ -5681,16 +5681,70 @@ manifest +%0A set options/values listed in manifest %0A%0A
fa07c966baeff5bd4b0c1e7437eae98aec16966e
remove .hg* files from pypi tarball
dodo.py
dodo.py
"""dodo file. test + management stuff""" import glob import os import pytest from doit.tools import create_folder DOIT_CONFIG = {'default_tasks': ['checker', 'ut']} CODE_FILES = glob.glob("doit/*.py") TEST_FILES = glob.glob("tests/test_*.py") TESTING_FILES = glob.glob("tests/*.py") PY_FILES = CODE_FILES + TESTING_...
Python
0
@@ -4054,17 +4054,125 @@ %3C (2,7) -%0A + or sys.version_info %3E (2,7,2)%0A%0A # create manifest will all files under version control without .hg* files %0A cmd @@ -4174,16 +4174,18 @@ cmd = +%22%22 %22hg mani @@ -4193,19 +4193,57 @@ est -%3E MANIFEST; +%7C grep -vE %22.*%5C.hg.*%22 %3E MANIFEST %22%22...
c1ae43fd33cd0f8eb3e270907a8ed7e728d1e268
Add captured_at timestamp to POST payload
server.py
server.py
import evdev import requests import json import datetime import yaml def main(): config = load_config() dev = evdev.InputDevice(config['device_path']) output_line('Initialized - Capturing device: ' + str(dev)) for event in dev.read_loop(): if event.type == evdev.ecodes.EV_KEY: event = evdev.categor...
Python
0.000076
@@ -290,46 +290,8 @@ EY:%0A - event = evdev.categorize(event)%0A @@ -307,24 +307,24 @@ line(event)%0A + payloa @@ -550,16 +550,50 @@ event):%0A + event = evdev.categorize(event)%0A return @@ -698,24 +698,24 @@ nt.keycode,%0A - 'state': @@ -762,16 +762,105 @@ eystate%5D +,%0A 'captured...
50fa7ecea878781c8ca8764f09a723ac9be01850
fix test
test/test_bedtools.py
test/test_bedtools.py
import os from sequana import bedtools, sequana_data from sequana.tools import genbank_features_parser from easydev import TempFile def test_threshold(): t = bedtools.DoubleThresholds(-5,5) assert t.low == -5 assert t.high == 5 assert t.low2 == -2.5 t = bedtools.DoubleThresholds(-4, 3) assert...
Python
0.000002
@@ -1251,16 +1251,20 @@ overage( +4001 )%0A%0A b @@ -3769,41 +3769,8 @@ e)%0A%0A - from easydev import TempFile%0A
0880846cde92e49863dfcb2342ff405d06ffe5c9
Format bugfix.
exporters/writers/base_writer.py
exporters/writers/base_writer.py
import gzip import os import shutil import uuid from exporters.logger.base_logger import WriterLogger from exporters.pipeline.base_pipeline_item import BasePipelineItem import tempfile TEMP_FILES_NAME = 'temp' ITEMS_PER_BUFFER_WRITE = 10000 SIZE_PER_BUFFER_WRITE = 0 class ItemsLimitReached(Exception): """ T...
Python
0
@@ -230,17 +230,18 @@ WRITE = -1 +50 0000%0ASIZ @@ -3451,55 +3451,32 @@ h = -os.path.join(self.tmp_folder, str(uuid.uuid4()) +self._get_new_path_name( )%0A @@ -4140,55 +4140,32 @@ h = -os.path.join(self.tmp_folder, str(uuid.uuid4()) +self._get_new_path_name( )%0A @@ -4271,16 +4271,16 @@ h, 'w')%0A - ...
c769a92ba88613932f3b8b881feac37d65ee2b7c
Add __str__ method
coalib/results/SourceRange.py
coalib/results/SourceRange.py
from os.path import relpath from coala_utils.decorators import enforce_signature, get_public_members from coalib.results.SourcePosition import SourcePosition from coalib.results.TextRange import TextRange from coalib.results.AbsolutePosition import AbsolutePosition class SourceRange(TextRange): @enforce_signatu...
Python
0.000001
@@ -4839,16 +4839,1285 @@ _dict%0A%0A + def __str__(self):%0A %22%22%22%0A Creates a string representation of the SourceRange object.%0A%0A If the whole file is affected, then just the filename is shown.%0A%0A %3E%3E%3E str(SourceRange.from_values('test_file', None, None, None, None))%0...
13b6e289f3ced59068d91dff2b2ef12a7805fabe
Create test definitions.
test/test_cronquot.py
test/test_cronquot.py
import unittest import os from cronquot.cronquot import has_directory class CronquotTest(unittest.TestCase): def test_has_directory(self): sample_dir = os.path.join( os.path.dirname(__file__), 'crontab') self.assertTrue(has_directory(sample_dir)) if __name__ == '__main__': un...
Python
0
@@ -280,16 +280,282 @@ _dir))%0A%0A + def test_parse_command(self):%0A pass%0A%0A def test_is_cron_script(self):%0A pass%0A%0A def test_normalize_cron_script(self):%0A pass%0A%0A def test_has_cosistency_in_result(self):%0A pass%0A%0A def test_simple_cron_pattern(self):%0A ...
7f821683fa9803fda9b1d12a0229a74c334efdc0
discard phase before amplitude_to_db in HPSS display
docs/examples/plot_hprss.py
docs/examples/plot_hprss.py
# -*- coding: utf-8 -*- """ ===================================== Harmonic-percussive source separation ===================================== This notebook illustrates how to separate an audio signal into its harmonic and percussive components. We'll compare the original median-filtering based approach of `Fitzgerald...
Python
0
@@ -1486,17 +1486,25 @@ e_to_db( -D +np.abs(D) , ref=rp @@ -1628,32 +1628,39 @@ amplitude_to_db( +np.abs( D_harmonic, ref= @@ -1645,32 +1645,33 @@ p.abs(D_harmonic +) , ref=rp), y_axi @@ -1791,32 +1791,39 @@ amplitude_to_db( +np.abs( D_percussive, re @@ -1810,32 +1810,33 @@ abs(D_percussive +) , ref=rp), y_ax...
f6af6c56d71d3dfc76b2ceb5e15b38b914067c3e
fix bug
server.py
server.py
import frame as fm from settings import ConnectReturn as CR from settings import TYPE import socket from threading import Timer class Broker(): def __init__(self, host = "127.0.0.1", port = 8888): self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.serv.bind((host, port)) sel...
Python
0.000001
@@ -5166,15 +5166,8 @@ lean -Session = c
e20cdd293a045dfca1829eed522cb941da2fb558
remove cruft
server.py
server.py
import json import os from bottle import get, run, post, request, HTTPError, response from requests import Session from requests import post as request_post # ---------------------------------------------------------------------------- # Settings # --------------------------------------------------------------------...
Python
0
@@ -1787,45 +1787,8 @@ )%0A%0A%0A -%0A%0Aimport ipdb;ipdb.set_trace()%0A%0A%0A%0A%0A%0A%0A # --
5e4d3c0b28104c1e98ed3e426dab9fc5d4d5a960
Add more comments to loadfail test
test/test_loadfail.py
test/test_loadfail.py
#!bin/env python import subprocess import os.path import unittest, re class TestSaveLoad(unittest.TestCase): @classmethod def setUpClass(self): subprocess.call('rm -rf remote local 2>> /dev/null', shell=True) subprocess.call('mkdir remote; mkdir local', shell=True) subprocess.call(...
Python
0
@@ -142,32 +142,91 @@ UpClass(self):%0A%0A + # ensure we start with a clean slate, just in case%0A subproce @@ -275,32 +275,75 @@ ', shell=True)%0A%0A + # Initialize %22remote%22 repositories%0A subproce @@ -564,32 +564,74 @@ ', shell=True)%0A%0A + # Initialize %22local%22 repo...
c138182451d1e3937cf5f923c9b927dc97a97f38
Fix the logger fix
mycroft/util/signal.py
mycroft/util/signal.py
import os import os.path import tempfile import mycroft import time from mycroft.util.logging import getLogger LOG = getLogger(__name__) def get_ipc_directory(domain=None): """Get the directory used for Inter Process Communication Files in this folder can be accessed by different processes on the machin...
Python
0
@@ -86,12 +86,8 @@ .log -ging imp
38b078eb13a42bf65d1f55141a69fcd8819a1f00
add models
mysite/polls/models.py
mysite/polls/models.py
from django.db import models # Create your models here.
Python
0
@@ -27,31 +27,338 @@ ls%0A%0A -# Create your models here. +class Question(models.Model):%0A question_text = models.CharField(max_length=200)%0A pub_date = models.DateTimeField('date published')%0A%0Aclass Choice(models.Model):%0A question = models.ForeignKey(Question, on_delete=models.CASCADE)%0A choice_te...
bd2d7fe62361594c7a659c2a38938521b6346dba
Text means no encode()
server.py
server.py
#!/usr/bin/env python3 # coding: utf-8 from aiohttp import web import aiohttp_jinja2 import asyncio import functools import jinja2 import os import sys import time import webbrowser from pypi_top_packages_async import get_packages_info from pypi_create_index_html import build_template_values START_TIME = time.time() ...
Python
0.998498
@@ -1523,17 +1523,8 @@ ad() -.encode() )%0A
29835c78d1ddfd934aa552f4c68117a32379c5ea
add lmsd.sqlite
mzos/tests/__init__.py
mzos/tests/__init__.py
from __future__ import absolute_import import zipfile import os.path as op import os import shutil import logging class WithHMDBMixin(object): @staticmethod def unzip_hmdb(): """ Utility to unzip hmdb for test purposes :param self: :return: """ abspath = op.abs...
Python
0.000001
@@ -301,18 +301,28 @@ -abspath = +z = zipfile.ZipFile( op.a @@ -359,66 +359,8 @@ ip') -%0A print abspath%0A z = zipfile.ZipFile(abspath )%0A @@ -485,23 +485,45 @@ b_path, -abspath +'mzos/ressources/hmdb.sqlite' )%0A @@ -852,9 +852,8 @@ exist%22) -%0A
3ffd045be41d226bcf1b533c3f5abf95a932eac0
Remove duplicate test
webcomix/scrapy/tests/test_crawler_worker.py
webcomix/scrapy/tests/test_crawler_worker.py
import pytest from webcomix.exceptions import NextLinkNotFound from webcomix.scrapy.crawler_worker import CrawlerWorker from webcomix.scrapy.verification.verification_spider import VerificationSpider from webcomix.tests.fake_websites.fixture import one_webpage_uri def test_spider_raising_error_gets_raised_by_crawler...
Python
0.000014
@@ -701,440 +701,4 @@ t()%0A -%0Adef test_spider_raising_error_gets_raised_by_crawler_worker(one_webpage_uri):%0A settings = %7B%22LOG_ENABLED%22: False%7D%0A worker = CrawlerWorker(%0A settings,%0A False,%0A VerificationSpider,%0A start_urls=%5Bone_webpage_uri%5D,%0A next_page...
47ce98960cdfcd4c25109845047ad7fc6db2084b
Set serial default timeout to None
nanpy/serialmanager.py
nanpy/serialmanager.py
from nanpy.memo import memoized import fnmatch import logging import serial import sys import time DEFAULT_BAUDRATE = 115200 log = logging.getLogger(__name__) PY3 = sys.version_info[0] == 3 class SerialManagerError(Exception): pass def _auto_detect_serial_unix(preferred_list=['*']): import glob glist...
Python
0.999346
@@ -1014,17 +1014,20 @@ timeout= -1 +None ):%0A
ceb7b806c838a12d3447d0fd9bccc5aae49832d5
Use a new session so that server will not receive signals
garage/multiprocessing/__init__.py
garage/multiprocessing/__init__.py
__all__ = [ 'RpcConnectionError', 'RpcError', 'python', ] import contextlib import logging import os import os.path import random import shutil import subprocess import tempfile import time import garage.multiprocessing.server from garage.multiprocessing.client import Connector from garage.multiprocessin...
Python
0
@@ -1599,16 +1599,40 @@ en(args, + start_new_session=True, env=env
8b23c91b83982a85fe8a711c587d7db50e0bc14a
take 4
server.py
server.py
from flask import Flask, request import json import bot, setup app = Flask(__name__) PAT = '***REMOVED***' PASSWORD = '***REMOVED***' setup.create_persistent_menu(PAT) mr_bot = create_bot(PAT) def create_bot(token): return bot.Bot(token) @app.route('/', methods=['GET']) def handle_verification(): print ...
Python
0.99946
@@ -179,74 +179,21 @@ t = -create_bot(PAT)%0A%0Adef create_bot(token):%0A return bot.Bot(token) +bot.Bot(PAT)%0A %0A%0A@a
05d2421668e663bf9e98ec51ec1d8977ffe8c1b3
Add static folder
server.py
server.py
import os from flask import Flask from flask import send_from_directory from flask_cors import CORS from igc.controller.controller_register import register_controllers from igc.util import cache app = Flask(__name__) CORS(app) app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('database_uri', 'sqlite:///./sqllite.db'...
Python
0.000001
@@ -211,16 +211,40 @@ __name__ +, static_url_path='html' )%0ACORS(a
11e5ce0369250f7c979dc0fe9ea59f25cf12c1e7
Fix after Python 3.11 deprecation of test methods returning values
test/test_toplevel.py
test/test_toplevel.py
import mpi4py import unittest import warnings import os class TestRC(unittest.TestCase): def testCall(self): rc = type(mpi4py.rc)() rc(initialize = rc.initialize) rc(threads = rc.threads) rc(thread_level = rc.thread_level) rc(finalize = rc.finalize) rc(f...
Python
0.000026
@@ -93,25 +93,36 @@ -def testCall(self +@staticmethod%0A def newrc( ):%0A @@ -459,32 +459,29 @@ rc = self. -testCall +newrc ()%0A k @@ -577,24 +577,21 @@ = self. -testCall +newrc ()%0A
d3f8922394ca2e18d624f1d542f2fc13a18475d3
Make sorting links reset pagination
wnpp_debian_net/templatetags/sorting_urls.py
wnpp_debian_net/templatetags/sorting_urls.py
# Copyright (C) 2021 Sebastian Pipping <sebastian@pipping.org> # Licensed under GNU Affero GPL v3 or later from django import template from ..url_tools import url_with_query register = template.Library() INTERNAL_DIRECTION_PREFIX_ASCENDING = '' INTERNAL_DIRECTION_PREFIX_DESCENDING = '-' EXTERNAL_DIRECTION_SUFFIX_A...
Python
0
@@ -1943,10 +1943,18 @@ ure_sort +, page=1 )%0A
300e1461174107f1c2f8523ce105739d42d71803
Write EMAIL_HOST to settings only if specified
fab_bundle/templates/settings.py
fab_bundle/templates/settings.py
from {{ base_settings }} import * DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ({% for admin in admins %} ('{{ admin.name }}', '{{ admin.email }}'),{% endfor %} ) MANAGERS = ADMINS SEND_BROKEN_LINK_EMAILS = True SECRET_KEY = '{{ secret_key }}' BASE_URL = 'http{% if ssl_cert %}s{% endif %}://{{ http_host }}' ME...
Python
0
@@ -1177,16 +1177,35 @@ rom %7D%7D'%0A +%7B%25 if email.host %25%7D EMAIL_HO @@ -1223,24 +1223,35 @@ ail.host %7D%7D' +%7B%25 endif %25%7D %0A%7B%25 if email
432961409ea44f393636f7d4d67742ea6e310bfb
Version up
fixtures_mongoengine/__init__.py
fixtures_mongoengine/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from fixtures_mongoengine.exceptions import FixturesMongoengineException from fixtures_mongoengine.fixture import Fixture from fixtures_mongoengine.mixin import FixturesMixin __version__ = '1.1.1' __license__ = 'MIT' __all__ = [ 'FixturesMongoengine...
Python
0
@@ -253,17 +253,17 @@ = '1.1. -1 +2 '%0A__lice
5db8338ceb258bbe086d3314b5f50a9b6da5cd28
Make import of _constant be absolute import for py3.x; See #388
wrappers/Python/generate_constants_module.py
wrappers/Python/generate_constants_module.py
from __future__ import print_function import os,shutil """ A little module to wrap the params enum for use in Cython code Ian Bell, May 2014 """ def params_constants(enum_key): fName = os.path.join('..','..','include','DataStructures.h') contents = open(fName,'r').read() left = contents.fin...
Python
0
@@ -2566,16 +2566,65 @@ FILE!%5Cn +from __future__ import absolute_import%5Cn%5Cnfrom . import _
891a911b0523ce9ed42916c60934f52ba7dbedcb
Fix up 'limit' and 'expire' options for digest plugin.
flexget/plugins/plugin_digest.py
flexget/plugins/plugin_digest.py
from __future__ import unicode_literals, division, absolute_import import logging from datetime import datetime from sqlalchemy import Column, Unicode, PickleType, Integer, DateTime from flexget import plugin from flexget.db_schema import versioned_base from flexget.entry import Entry from flexget.event import event ...
Python
0
@@ -1697,17 +1697,16 @@ tries = -( session. @@ -1728,39 +1728,8 @@ ry). -%0A filt @@ -1766,17 +1766,16 @@ 'list'%5D) -. %0A @@ -1783,61 +1783,68 @@ - order_by(DigestEntry.added.desc())) +# Remove any entries older than the expire time, if defined. %0A ...
9694d5d0cbdcca874b791e6616dda831f8961373
Add a little debugging to the Papilio target
flipsyfat/targets/papilio_pro.py
flipsyfat/targets/papilio_pro.py
#!/usr/bin/env python3 import argparse from migen import * from flipsyfat.cores.sd_emulator import SDEmulator from flipsyfat.cores.sd_trigger import SDTrigger from misoc.targets.papilio_pro import BaseSoC from migen.build.generic_platform import * from misoc.integration.soc_sdram import * from misoc.integration.build...
Python
0.000001
@@ -1531,16 +1531,210 @@ ctivity) +%0A%0A # Just for debugging%0A self.comb += self.platform.request(%22debug%22).eq(Cat(%0A self.sdemu.ll.card_status%5B5%5D, # appcmd%0A self.sdemu.ll.cmd_in_act%0A )) %0A %0A%0Adef
dc9101601bfea6bc3e8cbd7a58973360cc525d1f
Fix flake8 issue
foundation/organisation/views.py
foundation/organisation/views.py
from django.views.decorators.cache import cache_page from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.shortcuts import get_object_or_404 from django.http import HttpResponse from iso3166 import countries import unicodecsv from .models import (Board, Project...
Python
0
@@ -5581,16 +5581,17 @@ else '', + %5D%0A%0A
f8a3b9fce8bfc7fdce9cb9e90e98d8a9991c3f29
Fix oper data not being encoded. Fixes #452
ydkgen/printer/python/class_has_data_printer.py
ydkgen/printer/python/class_has_data_printer.py
# ---------------------------------------------------------------- # Copyright 2016 Cisco Systems # # 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/LICENS...
Python
0.000001
@@ -1641,32 +1641,33 @@ clazz):%0A +# self._print_has_
177bd7546faea56750a182c46a8fd6a892ff5d6a
Update State turns, those aren't game attributes
game.py
game.py
import datetime import json import map_loader import queue import state import utils class GAME_STATUS(object): """ Game status constants. """ lobby = 'lobby' # In matchmaking lobby, waiting for all players playing = 'playing' # In game mode, waiting for turns complete = 'complete' # Game finished...
Python
0
@@ -1548,24 +1548,66 @@ self. +queue.increment_move()%0A self.state. current_turn @@ -1628,16 +1628,22 @@ if self. +state. current_ @@ -1655,16 +1655,22 @@ == self. +state. max_turn
2a696cd458ab2f67df5a6cfce0fe2016a8106eb4
add default channels
gbot.py
gbot.py
#!/usr/bin/env python # ============================================================================= # file = gbot.py # description = IRC bot # author = GR <https://github.com/shortdudey123> # create_date = 2014-07-09 # mod_date = 2014-07-09 # version = 0.1 # usage = called as a class # notes = # python_ver = 2.7.6 # ...
Python
0.000001
@@ -576,16 +576,59 @@ elay=4)%0A + gbot.setDefautChannels(%7B'##gbot': ''%7D)%0A gbot
40ae754565f52c7631798823d13332b37f52e0c5
fix misuse of msg_split
nethud/proto/telnet.py
nethud/proto/telnet.py
from __future__ import print_function from twisted.internet import reactor, protocol, threads, defer from twisted.protocols.basic import LineReceiver from nethud.proto.client import NethackFactory class TelnetConnection(LineReceiver): def __init__(self, users): self.users = users self.uname = ''...
Python
0.000016
@@ -719,19 +719,16 @@ sg_split -%5B0%5D ) != 2:%0A @@ -843,16 +843,22 @@ auth(msg +_split %5B1%5D)%0A @@ -870,16 +870,22 @@ elif msg +_split %5B0%5D == '
fd9b9f8532bb6e481a18c4ead35e21bd572cd248
Return client station as StationUrl in SecureClient.register(_ex)
nintendo/nex/secure.py
nintendo/nex/secure.py
from nintendo.nex.service import ServiceClient from nintendo.nex.kerberos import KerberosEncryption from nintendo.nex.stream import NexStreamOut from nintendo.nex.common import NexEncoder, DataHolder, StationUrl import random import logging logger = logging.getLogger(__name__) class ConnectionData(NexEncoder): ver...
Python
0
@@ -2086,32 +2086,49 @@ lient_station = +StationUrl.parse( stream.string()%0A @@ -2118,32 +2118,33 @@ (stream.string() +) %0A%09%09logger.info(%22 @@ -3855,16 +3855,33 @@ ation = +StationUrl.parse( stream.s @@ -3887,16 +3887,17 @@ string() +) %0A%09%09logge
07e7e7618b8d24a478dbfae0106a61129bf90f3f
photon as a boolean
databricks/cluster_config.py
databricks/cluster_config.py
import sys import requests import argparse import json from run_databricks_jobs import getJobIds, getRequest def updateJsonFile(fileName): # Open the JSON file for reading jsonFile = open(fileName, "r") data = json.load(jsonFile) jsonFile.close() if args.env == "staging": envCode = "stg...
Python
0.998469
@@ -778,16 +778,157 @@ %0A %7D%0A%0A + # Use photon%0A if args.photon:%0A spark_version = %2210.4.x-photon-scala2.12%22%0A else:%0A spark_version = %2210.4.x-scala2.12%22%0A%0A # Po @@ -2200,21 +2200,16 @@ ion%22%5D = -args. spark_ve @@ -3255,56 +3255,35 @@ ('-- -spark-version', defa...
a1c572b557b6fe5b94186763210f3bfa15f3e660
quick start
marsi/io/__init__.py
marsi/io/__init__.py
# Copyright 2016 Chr. Hansen A/S and The Novo Nordisk Foundation Center for Biosustainability, DTU. # 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....
Python
0.999421
@@ -620,20 +620,94 @@ under the License.%0A +%0Aimport xlwt%0A%0Adef write_excel_file(data_frame, path, molecules):%0A pass%0A
db8a5a8b0316d8784f275b61835a40b9c6bcd8f7
Made option type as integer
hyde.py
hyde.py
#!/usr/bin/env python import os import sys import threading from optparse import OptionParser from hydeengine import Generator, Initializer, Server #import cProfile PROG_ROOT = os.path.dirname(os.path.abspath( __file__ )) def main(argv): parser = OptionParser(usage="%prog [-f] [-q]", version="%prog 0.3b") ...
Python
0.999965
@@ -1837,16 +1837,53 @@ lt=8080, + %0A type='int', %0A
8ff2781029dcd2189879e4c164ae5833bd5b176b
set expected num of containers to 20
tests/common_setup.py
tests/common_setup.py
#!/usr/bin/python # Copyright 2017 Northern.tech AS # # 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 a...
Python
0
@@ -5712,10 +5712,10 @@ ers( -19 +20 , %5B%22
f28494537e1ce281b25ae5a2439386477361cad9
Fix missing import in reminder code.
cogs/reminder.py
cogs/reminder.py
from .utils import checks, db, time from discord.ext import commands import discord import asyncio import datetime class Reminders(db.Table): id = db.PrimaryKeyColumn() expires = db.Column(db.Datetime, index=True) created = db.Column(db.Datetime, default="now() at time zone 'utc'") event = db.Column(d...
Python
0
@@ -92,16 +92,31 @@ asyncio%0A +import asyncpg%0A import d
c39e9fa5952a01de7527da5fc1ec0d04451e300e
change distutils build dir for --with-pydebug python builds.
command/build.py
command/build.py
"""distutils.command.build Implements the Distutils 'build' command.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id$" import sys, os from distutils.core import Command from distutils.util import get_platform def show_compilers (): from distutils.ccompiler import show_compilers...
Python
0
@@ -2074,32 +2074,296 @@ .version%5B0:3%5D)%0A%0A + # Make it so Python 2.x and Python 2.x with --with-pydebug don't%0A # share the same build directories. Doing so confuses the build%0A # process for C modules%0A if hasattr(sys, 'gettotalrefcount'):%0A plat_specifier += '-pydebu...
2774627e095a0e1676f15adf21572436da3af318
use self.window
tests/test_3141596.py
tests/test_3141596.py
import os import re import shutil from functools import wraps from unittest import TestCase from unittesting.utils import UTSetting from unittesting import DeferrableTestCase from unittesting.helpers import TempDirectoryTestCase import sublime version = sublime.version() __dir__ = os.path.dirname(os.path.abspath(__fi...
Python
0.000002
@@ -4539,30 +4539,18 @@ th(s -ublime.active_ +elf. window -() .fol
d253c7138e3f91c2e99ab160fd52ae9a6b4cd425
Test for the _lookup_and_handle_new_spells()
tests/test_classes.py
tests/test_classes.py
import unittest from classes import Paladin from models.spells.loader import load_paladin_spells_for_level class PaladinTests(unittest.TestCase): def setUp(self): self.name = "Netherblood" self.level = 3 self.dummy = Paladin(name=self.name, level=self.level, health=100, mana=100, strength...
Python
0.000002
@@ -3748,16 +3748,700 @@ pells)%0A%0A + def test_lookup_and_handle_new_spells(self):%0A %22%22%22 Should look up the available spells for our level and learn them or update our existing ones%22%22%22%0A Paladin.learned_spells = %7B%7D%0A pl = Paladin(name=%22fuck a nine to five%22)%0A pr...
4885c633fa43c9f98f2894f68b7c2b33a06d3094
test s3 with prefix and without prefix
tests/test_command.py
tests/test_command.py
import boto3 import os import pytest import shutil import sys import tempfile from botocore.exceptions import ClientError from moto import mock_s3 from piprepo import command from piprepo.utils import get_project_name_from_file PACKAGES = [ 'Django-1.11.2-py2.py3-none-any.whl', 'ansible-2.0.0.0.tar.gz', 'a...
Python
0.000013
@@ -2504,24 +2504,36 @@ test_s3_sync +_with_prefix (tempindex): @@ -3430,32 +3430,935 @@ Body'%5D.read()%0A%0A%0A +@mock_s3%0Adef test_s3_sync_without_prefix(tempindex):%0A conn = boto3.resource(%22s3%22)%0A bucket = conn.create_bucket(Bucket='fake-piprepo-bucket')%0A sys.argv = %5B'', 'sync', tempindex%5B'...
95ef8aeb05db779563b72f1f4cbbb6d0d48e37cc
Use raw string in tests/test_cookies.py
tests/test_cookies.py
tests/test_cookies.py
# -*- coding: utf-8 -*- import json import pytest def test_cookies_fixture(testdir): """Make sure that pytest accepts the `cookies` fixture.""" # create a temporary pytest test module testdir.makepyfile(""" # -*- coding: utf-8 -*- def test_valid_fixture(cookies): assert has...
Python
0.00001
@@ -1650,32 +1650,33 @@ template= +r '%25s',%0A @@ -2512,16 +2512,17 @@ emplate= +r '%25s',%0A
83006927725a16615930b748e2a46a85cafc6430
Fix one more typo on make_nearest_neighbour_index
tensorflow_hub/pip_package/setup.py
tensorflow_hub/pip_package/setup.py
# Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Python
0.999999
@@ -2722,18 +2722,42 @@ index.ma -in +ke_nearest_neighbour_index :main '%0A
ddfc569ba310ce2de3b4a4ae63111556646496f8
remove more f-strings
tests/test_keyfile.py
tests/test_keyfile.py
# MIT licensed # Copyright (c) 2018 lilydjwg <lilydjwg@gmail.com>, et al. import os import tempfile import contextlib from nvchecker.source import HTTPError import pytest pytestmark = [pytest.mark.asyncio] @contextlib.contextmanager def unset_github_token_env(): token = os.environ.get('NVCHECKER_GITHUB_TOKEN') ...
Python
0.000118
@@ -868,17 +868,16 @@ _conf = -f '''%5C%0A%5Bex @@ -952,25 +952,37 @@ = %7B -f. name%7D%0A - ''' +'''.format(name=f.name) %0A%0A
1fa3acf2b926162235372f34d368aab31acc14b0
Add unittest exception for timedelta on Python < 2.6
tests/test_max_age.py
tests/test_max_age.py
# -*- coding: utf-8 -*- """ test ~~~~ Flask-CORS is a simple extension to Flask allowing you to support cross origin resource sharing (CORS) using a simple decorator. :copyright: (c) 2014 by Cory Dolphin. :license: MIT, see LICENSE for more details. """ from datetime import timedelta from tests...
Python
0
@@ -303,16 +303,27 @@ medelta%0A +import sys%0A from tes @@ -1957,32 +1957,169 @@ er.%0A '''%0A + # timedelta.total_seconds is not available in older versions of Python%0A if sys.version_info %3C (2, 7):%0A return%0A%0A with sel
b8374e20640630044f59e4b4733e588345e07ab5
Fix unittest in asyncio debug mode
tests/test_prepare.py
tests/test_prepare.py
import inspect from asyncpg import _testbase as tb class TestPrepare(tb.ConnectedTestCase): async def test_prepare_1(self): st = await self.con.prepare('SELECT 1 = $1 AS test') rec = await st.get_first_row(1) self.assertTrue(rec['test']) self.assertEqual(len(rec), 1) sel...
Python
0.000006
@@ -2966,32 +2966,32 @@ f inspect.is -coroutin +awaitabl e(val):%0A @@ -3315,16 +3315,16 @@ t.is -coroutin +awaitabl e(va
a44e3be0b0a6188dfa85fcb53433b64ca81f5f46
test output_subprocess
tests/test_process.py
tests/test_process.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Test scriptharness/process.py """ from __future__ import absolute_import, division, print_function, \ unicode_literals import mock import os import psutil from scriptharness.exceptions import ScriptHarnessFatal import scriptharness.process as shpro...
Python
0.000185
@@ -408,16 +408,32 @@ ort sys%0A +import tempfile%0A import u @@ -2484,16 +2484,814 @@ rip())%0A%0A + def test_output_subprocess(self):%0A %22%22%22test_process %7C output_subprocess%0A %22%22%22%0A stdout = tempfile.NamedTemporaryFile()%0A stderr = tempfile.NamedTemporaryFile()%0A ...
9e62b41dc762b1088bd5c1474678d7e7ed120add
test case with stage parameter
tests/test_profile.py
tests/test_profile.py
import os import sys import pytest from pkgstack.profile import Profile TESTS_PATH=os.path.realpath(os.path.dirname(__file__)) def test_profile_create(tmpdir): config = Profile(os.path.join(TESTS_PATH, 'resources/sample.yml')).config assert config == [ {'install': 'pytest', 'stage': 'test'}, ...
Python
0.000001
@@ -941,16 +941,256 @@ %7D%0A%0A%0A +def test_profile_process_via_stage():%0A%0A assert Profile(os.path.join(TESTS_PATH, 'resources/sample.yml'), stages=%5B'test',%5D).process() == %7B%0A 'packages.successed': 5,%0A 'packages.failed': 0,%0A 'packages.total': 5%0A %7D%0A%0A%0A def test
c2b846468f9f02173f35ce97c0a37da465aa7a92
Fix safe_mmkdir import
tests/test_profile.py
tests/test_profile.py
import pytest import json import os import shutil from great_expectations.profile.base import DataSetProfiler from great_expectations.profile.basic_dataset_profiler import BasicDatasetProfiler from great_expectations.profile.columns_exist import ColumnsExistProfiler from great_expectations.dataset.pandas_dataset impo...
Python
0.000001
@@ -410,16 +410,29 @@ tations. +data_context. util imp
17b196e159fb7dd5b5951ba613e83815186238f9
improve project auth testing
tests/test_project.py
tests/test_project.py
""" Test Project """ import unittest from requests.exceptions import HTTPError from hubstorage import HubstorageClient from hubstorage.utils import millitime from hstestcase import HSTestCase class ProjectTest(HSTestCase): def test_projectid(self): p1 = self.hsclient.get_project(int(self.projectid)) ...
Python
0.000001
@@ -3064,32 +3064,99 @@ tatus_code, 401) +%0A else:%0A self.assertTrue(False, '401 not raised') %0A%0A try:%0A @@ -3307,32 +3307,99 @@ tatus_code, 401) +%0A else:%0A self.assertTrue(False, '401 not raised') %0A%0A try:%0A @@ -3436,32 +3436,45 @@ rojectid, 1, 1)) ...
e24c4d4b225ca5d6c2130677fca34df2b0d2188d
Improve branch coverage
tests/test_reactor.py
tests/test_reactor.py
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2016 Rémi Duraffort # This file is part of ReactOBus. # # ReactOBus 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, ...
Python
0.000001
@@ -3179,24 +3179,89 @@ er%22, %22%7B%7D%22%5D,%0A + %5B%22org.reactobus.lav%22, %22uuid%22, %222016%22, %22lavauser%22, %22%7B%7D%22%5D,%0A %5B%22or
0cef40e4ee30acbee12e179196dfc65c69890518
Add a failed-connect test for sock_connect
tests/test_sockets.py
tests/test_sockets.py
import asyncio import socket import uvloop from uvloop import _testbase as tb _SIZE = 1024 * 1024 class _TestSockets: async def recv_all(self, sock, nbytes): buf = b'' while len(buf) < nbytes: buf += await self.loop.sock_recv(sock, nbytes - len(buf)) return buf def tes...
Python
0.000003
@@ -1958,16 +1958,481 @@ ver())%0A%0A + def test_socket_failed_connect(self):%0A sock = socket.socket()%0A with sock:%0A sock.bind(('127.0.0.1', 0))%0A addr = sock.getsockname()%0A%0A async def run():%0A sock = socket.socket()%0A with sock:%0A ...
244fc6b436398055f650ea3a64e9388586604cd9
Add test for group collection access.
testsuite/test_acl.py
testsuite/test_acl.py
import pytest pytestmark = pytest.mark.django_db def test_collections_acl(client): from django.contrib.auth.models import User, AnonymousUser from hoover.search.models import Collection from hoover.search.views import collections_acl anonymous = AnonymousUser() alice = User.objects.create_user('al...
Python
0
@@ -68,16 +68,22 @@ ions_acl +_users (client) @@ -945,8 +945,988 @@ o, baz%7D%0A +%0A%0Adef test_collections_acl_groups(client):%0A from django.contrib.auth.models import User, AnonymousUser, Group%0A from hoover.search.models import Collection%0A from hoover.search.views import collections_acl%0A anonym...
fa7b2a707be689c57d744d0ada5049dfb6b15789
Set leave=False on pbar
thinc/neural/train.py
thinc/neural/train.py
from __future__ import unicode_literals, print_function from .optimizers import Eve, Adam, SGD, linear_decay from .util import minibatch import numpy.random from tqdm import tqdm class Trainer(object): def __init__(self, model, **cfg): self.ops = model.ops self.model = model self.L2 = cf...
Python
0.000189
@@ -1170,16 +1170,29 @@ shape%5B0%5D +, leave=False ) as pba
603bfdc9cb0f9bf8e29306e161728423f1f57f86
Update dependency bazelbuild/bazel to latest version
third_party/bazel.bzl
third_party/bazel.bzl
# Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0.000001
@@ -655,128 +655,128 @@ = %22 -87550ea81d92796facbb068a6ce7365326d00aff%22%0Abazel_sha256 = %227abdba2562f80ae8327627b554785173b65f8758cf98f901b595d8d252210b94 +6820bea27ff251086d683793c379e1d327bdd193%22%0Abazel_sha256 = %2248d36a03f519f17ea0f0e082857c5e71dd375c7a5f1ce198f72d790ffa833356 %22%0A
34721c0078d564538a4cf20ac15560a1bf119bac
Update dependency bazelbuild/bazel to latest version
third_party/bazel.bzl
third_party/bazel.bzl
# Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0.000021
@@ -655,128 +655,128 @@ = %22 -81f5771b0a5d26884841bbdecc77166142c87ca1%22%0Abazel_sha256 = %22d4787388b73177edf0d618e49a802d76b60e91adcee8e8aec882aeb02671046d +dc7db2490a9bf6941a1bcb1fbfc709fff1f37739%22%0Abazel_sha256 = %220a15609a976bc1d8e588d6252b12880723ff14bf06d6b73488853bcef8717840 %22%0A
fd641ebb631d4b7d03bf978de2dc22f4c2966dd5
Update Bazel to latest version
third_party/bazel.bzl
third_party/bazel.bzl
# Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0.000016
@@ -591,128 +591,128 @@ = %22 -f3d1683fcb3c4a25c4c4b8251d00ddfa66f958ba%22%0Abazel_sha256 = %2244643a2437c709cec8bf4a0f7a1bb0c31ba5e8a04680a6a669352b7e3a0545ef +1c03c8c4fac1e1028fcb5bb342da3a7fdfc88327%22%0Abazel_sha256 = %22e2d73ad1de6001669c87e0ec954738641dc6eb7e960f04601f7a260699bb0b9e %22%0A
b3abe856ff2e430f64c60d28b77e95c73b842b47
fix wrong table header
src/search.py
src/search.py
import xml.etree.ElementTree as ET import texttable as tt import re from config import user_id, password from datetime import date from wos import WosClient def _draw_table(data): # Generate table tab = tt.Texttable() tab.add_rows(data) tab.set_cols_align(['l', 'l', 'l']) tab.header(['year', 'id'...
Python
0.000008
@@ -306,27 +306,31 @@ r(%5B' -y +Y ear', ' -id', 'title +Title', 'ID WOS '%5D)%0A
2feb3880dc390f202f0280f764eea6f2a39af9e1
Fix the way stepper moves. Fix indentation.
src/server.py
src/server.py
#!/usr/bin/env python3 import sys from pymata_aio.pymata3 import PyMata3 from pymata_aio.constants import Constants class Actuator: """ This class represent the motor used on my robot, it tries to create the same interface for different kind of motors :param board instance of pymata_aio.pymata3.PyM...
Python
0
@@ -3381,30 +3381,24 @@ delta_angle( -self, angle)%0A%0A @@ -3606,16 +3606,120 @@ n = -1%0A%0A + # We only need positive number of steps when the direction is known%0A steps = abs(steps)%0A%0A @@ -3736,28 +3736,16 @@ n range( -direction * steps):%0A @@ -3901,17 +3901,17 @@ = (step -...
cdfa28910b48ae8847203ea8ad9ab8f173a64027
Format with black.
spotseeker_server/org_filters/__init__.py
spotseeker_server/org_filters/__init__.py
""" Copyright 2013 Board of Trustees, University of Illinois 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
@@ -2817,17 +2817,17 @@ ttings, -' +%22 SPOTSEEK @@ -2843,17 +2843,17 @@ _FILTERS -' +%22 ):%0A
f09c65f980fd9a7364d038ca8eb0b007f74677f5
Increase version
tinymce_4/__init__.py
tinymce_4/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.0.24'
Python
0
@@ -42,7 +42,11 @@ .0.2 -4 +5-dev '%0A
0bcc5d7a292b8176f0f3dc1be0baa03ddf81919e
Add async_remove_config_entry_device support to lookin (#73381)
homeassistant/components/lookin/__init__.py
homeassistant/components/lookin/__init__.py
"""The lookin integration.""" from __future__ import annotations import asyncio from collections.abc import Callable, Coroutine from datetime import timedelta import logging from typing import Any import aiohttp from aiolookin import ( Climate, LookInHttpProtocol, LookinUDPSubscriptions, MeteoSensor, ...
Python
0
@@ -660,16 +660,72 @@ otReady%0A +from homeassistant.helpers import device_registry as dr%0A from hom @@ -6113,8 +6113,542 @@ load_ok%0A +%0A%0Aasync def async_remove_config_entry_device(%0A hass: HomeAssistant, entry: ConfigEntry, device_entry: dr.DeviceEntry%0A) -%3E bool:%0A %22%22%22Remove lookin config en...
db5060b32374c24cbe6e41b7405a16166fde0ecf
remove unused stuff and update the names (same as in owm sensor)
homeassistant/components/sensor/forecast.py
homeassistant/components/sensor/forecast.py
""" homeassistant.components.sensor.forecast ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Forecast.io service. Configuration: To use the Forecast sensor you will need to add something like the following to your config/configuration.yaml sensor: platform: forecast api_key: YOUR_APP_KEY monitored_conditions: - ...
Python
0
@@ -79,17 +79,16 @@ ~~~~~~~%0A -%0A Forecast @@ -3226,22 +3226,19 @@ an -OpenWeatherMap +Forecast.io sen @@ -3332,24 +3332,23 @@ name = ' -Forecast +Weather '%0A @@ -3660,18 +3660,16 @@ turn '%7B%7D - - %7B%7D'.for @@ -4235,24 +4235,24 @@ 'summary':%0A + @@ -4286,200 +4286,8 @@ ary%0A...
197fad99d2e60064dca76bec41400390bc0a2937
Remove mail templates since we're not testing them here; might be good to include a test for this elsewhere
helpdesk/tests/test_get_email.py
helpdesk/tests/test_get_email.py
from helpdesk.models import Queue, Ticket from helpdesk.management.commands.get_email import process_email from django.test import TestCase from django.core import mail from django.core.management import call_command from django.test.client import Client from django.utils import six from django.core.urlresolvers import...
Python
0
@@ -641,16 +641,17 @@ e):%0A +# fixtures @@ -675,16 +675,66 @@ e.json'%5D + # may don't need this, not testing templates here %0A%0A de
fb705488aedeec3de842cd0be1b7aff9fe018962
Allow to specify additional external links for Javadocs
tools/bzl/javadoc.bzl
tools/bzl/javadoc.bzl
# Copyright (C) 2016 The Android Open Source Project # # 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 ag...
Python
0
@@ -963,16 +963,104 @@ source%22%0A + external_docs = %5B%22http://docs.oracle.com/javase/8/docs/api%22%5D + ctx.attr.external_docs%0A cmd = @@ -1061,16 +1061,16 @@ cmd = %5B%0A - %22r @@ -1501,58 +1501,60 @@ %22 --link%22, %22http://docs.oracle.com/javase/8/docs/api%22 + %22.join(%5B'-link %25s' %25 ...