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
34e67f6e5328fc3a2579debaa9f7901b1422caa1
Update functional test with new syntax
tests/functional_tests.py
tests/functional_tests.py
''' Created on Oct 25, 2014 @author: lauritz ''' from fakelargefile import FakeLargeFile, RepeatingSegment BG = """\ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and ...
Python
0
@@ -1067,16 +1067,69 @@ %0A%0A%22%22%22%0A%0A%0A +import logging%0A%0A%0Alog = logging.getLogger(__name__)%0A%0A%0A def test @@ -1460,16 +1460,18 @@ sf.org/%3E +%5Cn %22)%0A f @@ -1479,16 +1479,24 @@ f.insert +_literal (deleted
c77768961cd3b86d5ddc49f75fc5536dff5550fc
fix per suggestion by gholmes
euca2ools/nc/commands/bundleandupload.py
euca2ools/nc/commands/bundleandupload.py
# Copyright 2009-2013 Eucalyptus Systems, Inc. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of source code must retain the above copyright notice, # this list of conditions ...
Python
0
@@ -5050,77 +5050,8 @@ f):%0A - if self.args.get('kernel') and self.args.get('ramdisk'):%0A @@ -5140,36 +5140,32 @@ - - cert=self.args%5B' @@ -5164,36 +5164,32 @@ f.args%5B'cert'%5D,%0A - @@ -5226,36 +5226,32 @@ %5B'privatekey'%5D,%0A - ...
ced78a7f24d0a2e5288263e4e523e8bb5c97c464
Update GPU plugin for latest version of nvidia-smi
guild/plugins/gpu.py
guild/plugins/gpu.py
# Copyright 2017-2020 TensorHub, 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 writ...
Python
0
@@ -3445,38 +3445,34 @@ rcent(val):%0A -assert +if val.endswith(%22 @@ -3474,22 +3474,22 @@ th(%22 %25%22) -, val%0A +:%0A retu @@ -3514,16 +3514,101 @@ ) / 100%0A + elif %22N/A%22 in val:%0A return None%0A else:%0A assert False, repr(val)%0A %0A%0Adef _p @@ -3620,38 +3620,34 @@ ...
70b11f2a824fa4b85bc7031aa07271e74d36f7d5
remove now-unused RwhoClient constructor args
agent/lib/api_client.py
agent/lib/api_client.py
import json import requests import socket import sys from .exceptions import * from .log_util import * class RwhoClient(): def __init__(self, url, host_name=None, host_fqdn=None, auth_method=None, auth_user=None, ...
Python
0
@@ -226,344 +226,103 @@ None -,%0A auth_method=None,%0A auth_user=None,%0A auth_pass=None):%0A self.url = url%0A self.host_name = host_name%0A self.host_fqdn = host_fqdn%0A self.auth_method = auth_method%0A self.auth_u...
221bf7e5faf612feab30680b065a81b85f0ac634
Upgrade config tests.
tdda/testconfig.py
tdda/testconfig.py
import os import sys import unittest class TestSystemConfig(unittest.TestCase): def test_01_tdda_path(self): print('\ntype tdda') os.system('type tdda') print('which tdda') os.system('which tdda') def test_02_path(self): print('$PATH') os.system('echo $PATH') ...
Python
0
@@ -149,29 +149,87 @@ -os.system('type tdda' +with os.popen('type tdda') as f:%0A path = f.read()%0A print(path )%0A @@ -262,25 +262,29 @@ -os.system +with os.popen ('which @@ -289,16 +289,70 @@ h tdda') + as f:%0A path = f.read()%0A print(path) %0A%0A de @@...
9325f1505e731d4ccb59b009dbc653d47a4a43fc
change default option only in Catalina
spyder_terminal/confpage.py
spyder_terminal/confpage.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """Spyder terminal configuration page.""" # Standard library imports import os # Third party imports from qtpy.QtWidgets import (QVBoxLayout, QGroupBox, QGridLayout...
Python
0
@@ -226,16 +226,32 @@ mport os +%0Aimport platform %0A%0A# Thir @@ -266,16 +266,59 @@ imports%0A +from distutils.version import LooseVersion%0A from qtp @@ -1523,19 +1523,28 @@ form - == +.startswith( 'linux' +) :%0A @@ -1607,27 +1607,258 @@ -default_option = 'z +mac_ver = LooseVersion(platform.mac_ver(...
a6bdff1bad08a0395f3ed29004c0d6a064061d99
Bump version
sqliteschema/__version__.py
sqliteschema/__version__.py
# encoding: utf-8 __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016, {}".format(__author__) __license__ = "MIT License" __version__ = "0.16.2" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
Python
0
@@ -152,11 +152,11 @@ %220.1 -6.2 +7.0 %22%0A__
d97947fa3f8ecb145392992a90a1c19b4567ab2c
Tag new release: 2.2.10
floo/version.py
floo/version.py
PLUGIN_VERSION = '2.2.9' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.03' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
Python
0
@@ -19,9 +19,10 @@ 2.2. -9 +10 '%0A#
a0cc5b209dd84e58649ea49f3de25472350bd938
Remove unnecessary print statement
floq/helpers.py
floq/helpers.py
import numpy as np def n_to_i(num, n): """ Translate num, ranging from -(n-1)/2 through (n-1)/2 into an index i from 0 to n-1 If num > (n-1)/2, map it into the interval This is necessary to translate from a physical Fourier mode number to an index in an array. """ cutoff = (n-1)/...
Python
0.999627
@@ -726,26 +726,8 @@ mat%0A - print product%0A
22e2e4887eea8b4ade6da7c72d46f91d74d643e5
Remove unused string import.
wqflask/wqflask/database.py
wqflask/wqflask/database.py
# Module to initialize sqlalchemy with flask import os import sys from string import Template from typing import Tuple from urllib.parse import urlparse import importlib import contextlib import MySQLdb def read_from_pyfile(pyfile, setting): orig_sys_path = sys.path[:] sys.path.insert(0, os.path.dirname(pyfi...
Python
0
@@ -63,36 +63,8 @@ sys%0A -from string import Template%0A from
d807b3fb8628ac4e296969a96fb2b769b76efb90
Add filtered get_queryset for public news
aldryn_news/managers.py
aldryn_news/managers.py
# -*- coding: utf-8 -*- import datetime from collections import Counter from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils import timezone from hvad.models import TranslationManager from taggit.models import Tag, TaggedItem class CategoryManager(TranslationMan...
Python
0
@@ -2843,361 +2843,566 @@ r):%0A -%0A def using_translations(self):%0A # not overriding get_queryset, as hvad doesn't use that%0A qs = super(PublishedManager, self).using_translations()%0A qs = qs.filter(publication_start__lte=timezone.now())%0A qs = qs.filter(models.Q(publication_end__i...
c664640f7bb54bc29f2955a531fdebbb62920711
Extend error message to mention that missing Python bindings may be the problem.
src/versioncontrol/__init__.py
src/versioncontrol/__init__.py
""" The versioncontrol sub-package provides an abstraction layer around different revision/version control systems. Only the functionality required for recording version numbers and switching the working copy between different versions is wrapped - for more complex tasks such as merging, branching, etc., the version co...
Python
0
@@ -1811,16 +1811,43 @@ nstalled + or missing Python bindings : %25s%22 %25
909711c30817276c8817880a06577d5821d4032c
Update driver.py
tegrabot/driver.py
tegrabot/driver.py
import serial import time import math class Driver: #ser = serial.Serial("/dev/ttyACM0", 9600) #motorPorts=[] #motor setup 2 def __init__(self): def driveMotor(self, speed): motorSpeed =90 if(speed > 0): motorSpeed = speed*90 motorSpeed+=90 ...
Python
0.000001
@@ -1,12 +1,1314 @@ +'''%0ACopyright (c) 2014, Rishi Desai%0AAll rights reserved.%0A%0ARedistribution and use in source and binary forms, with or without%0Amodification, are permitted provided that the following conditions are met:%0A%0A* Redistributions of source code must retain the above copyright notice, this%0A l...
028ce1950782a6dcd2f69260410a318ce5fbddf2
return 200 or given status code for every queryset based response
src/yard/resources/__init__.py
src/yard/resources/__init__.py
#!/usr/bin/env python # encoding: utf-8 from django.core.exceptions import ObjectDoesNotExist from django.core.paginator import Paginator, EmptyPage from django.core import serializers from django.http import HttpResponse, HttpResponseNotFound, HttpResponseBadRequest from yard.except...
Python
0.000004
@@ -4517,27 +4517,8 @@ atus - if exists else 204 )%0A
9dbb1eb79b7b39a93468f38d9a8086e594b6876b
Update tests for cleansing of the urls
Bookie/bookie/tests/test_delicious/__init__.py
Bookie/bookie/tests/test_delicious/__init__.py
"""Test that we're meeting delicious API specifications""" from datetime import datetime import transaction import unittest import urllib from nose.tools import ok_, eq_ from bookie.tests import settings, global_config from bookie.models import DBSession from bookie.models import Bmark, NoResultFound from bookie.model...
Python
0
@@ -2725,23 +2725,16 @@ rl == u' -http:// google.c @@ -3212,39 +3212,32 @@ url == unicode(' -http:// google.com')).on @@ -3886,23 +3886,16 @@ nicode(' -http:// google.c
5ca5395bce09cdbba40550efdcace2d3faff3c65
Check for k and R
tests/test_bodies.py
tests/test_bodies.py
import pytest from astropy import units as u from astropy.tests.helper import assert_quantity_allclose from poliastro.bodies import Body, Earth, Jupiter, Sun def test_body_has_k_given_in_constructor(): k = 3.98e5 * u.km ** 3 / u.s ** 2 earth = Body(None, k, "") assert earth.k == k def test_body_from_pa...
Python
0
@@ -759,36 +759,42 @@ ():%0A k = -3.98e5 +1.26712763e17 * u. -k m ** 3 / u.s @@ -795,24 +795,47 @@ / u.s ** 2%0A + R = 71492000 * u.m%0A _name = @@ -940,29 +940,48 @@ ert -type( +jupiter.k == k%0A assert jupiter -) +.R == -Body +R %0A%0A%0Ad
ca5151ee58f84715850cd90b5c0a431bcc109452
add not implement error for kugou
src/you_get/extractor/kugou.py
src/you_get/extractor/kugou.py
#!/usr/bin/env python __all__ = ['kugou_download'] from ..common import * from json import loads from base64 import b64decode def kugou_download(url, output_dir=".", merge=True, info_only=False): if url.lower().find("5sing")!=-1: html=get_html(url) ticket=r1(r'"ticket":\s*"(.*)"',html) j...
Python
0
@@ -231,16 +231,45 @@ %22)!=-1:%0A + #for 5sing.kugou.com%0A @@ -632,24 +632,30 @@ ir)%0A +else:%0A %0A # h @@ -650,126 +650,77 @@ -%0A # html = get_html(url)%0A # title = r1(r'var SongName = %22(.*)%22;', htm +#for the www.kugou.com/%0A raise NotImplementedErro...
89e3d4ae0a7be5baef6354324b2e7f8623564c94
Use 'array' rather than 'real' for data array name in olfactory stimulus generation script.
examples/olfaction/data/gen_olf_input.py
examples/olfaction/data/gen_olf_input.py
#!/usr/bin/env python """ Generate sample olfactory model stimulus. """ import numpy as np import h5py osn_num = 1375 dt = 1e-4 # time step Ot = 2000 # number of data point during reset period Rt = 1000 # number of data point during odor delivery period Nt = 4*Ot + 3*Rt # number of data points in time t = np.arang...
Python
0
@@ -721,12 +721,13 @@ et(' -real +array ', (
248588d141f350d6b00ef24ed1f99bf1e460b25c
add new test
tests/test_bzoinq.py
tests/test_bzoinq.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_bzoinq ---------------------------------- Tests for `bzoinq` module. """ import pytest from bzoinq import bzoinq # @pytest.fixture # def response(): # """Sample pytest fixture. # See more at: http://doc.pytest.org/en/latest/fixture.html # """ # ...
Python
0.000001
@@ -1742,24 +1742,42 @@ e Monitor%22)%0A + time.sleep(3)%0A b.stop()
5339a1b42eec00926330f58fd565e9a71d2d7093
add two ciphers tests
tests/test_cipher.py
tests/test_cipher.py
#!/usr/bin/env python from Crypto.Hash import SHA256 from mock import Mock import random import unittest from kryptonite import Cipher, DecryptionError from tests.utils import random_string class TestCipher(unittest.TestCase): def test_cipher_basic(self): key = Cipher.generate_key() cipher = Ci...
Python
0.998729
@@ -773,16 +773,255 @@ d(enc)%0A%0A + def test_two_ciphers(self):%0A key = Cipher.generate_key()%0A cipher1 = Cipher(key)%0A cipher2 = Cipher(key)%0A msg = %22magic%22%0A enc = cipher1.encrypt(msg)%0A self.assertEquals(cipher2.decrypt(enc), msg)%0A%0A def
617f4aca90b8fe24e38f5550044561e71e510c3f
fix the client test
tests/test_client.py
tests/test_client.py
#!/usr/bin/env python # coding=utf-8 """Test scriptworker.client """ import arrow import json import mock import os import pytest from shutil import copyfile from scriptworker.exceptions import ScriptWorkerTaskException import scriptworker.client as client import scriptworker.utils as utils TEST_DATA_DIR = os.path.joi...
Python
0.000025
@@ -1894,16 +1894,24 @@ config)%5B +'task'%5D%5B %22this_is
e9fdfbdcaea462227b1cf52cf8f9a5a1cd845133
add CashbookItem class and some methods
py-sl4a/sum-money2.py
py-sl4a/sum-money2.py
#!/usr/bin/python # -*- coding: utf-8 -*- import re import fileinput import os.path def int_ruby_style(string): """parse a string into an integer like String#to_s on Ruby""" try: return int( string.replace( '_', '' ) ) except ValueError: return 0 def warn_file_format( out, line, file_name, line_no ): ...
Python
0
@@ -79,16 +79,788 @@ s.path%0A%0A +class CashbookItem:%0A def __init__(self, name, price, income, group, date = None):%0A self.name = name%0A self.price = price%0A self.income = income%0A self.group = group%0A self.date = date%0A%0A @classmethod%0A def parse_no_date(klass, lines):%0A %22%22%22pars...
15c039dcf43cc3029ab8524edb17f2c619974757
Test case of getting core members updated to include Bob Tolbert (either he was added recently to core or I had missed it before some how but test was passing :-/ )
tests/test_github.py
tests/test_github.py
#!/usr/bin/env python import os plugin_to_load = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../plugins/github.hy") from hy.importer import import_file_to_module g = import_file_to_module("github", plugin_to_load) def test_get_github_issue(): expected = " ".join( ...
Python
0
@@ -1400,16 +1400,31 @@ + %22Bob Tolbert%22, %22Will K @@ -1439,28 +1439,11 @@ ne%22, - %22Morten Linderud%22,%0A +%0A @@ -1462,17 +1462,34 @@ - +%22Morten Linderud%22, %22Abhish
765a6b8e0ea87a5472bd5be393c003739d4fb466
add argument parser
py/desiutil/census.py
py/desiutil/census.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ =============== desiutil.census =============== Determine the number of files and size in DESI data file systems. """ from __future__ import (absolute_import, division, print_function, unicode_literals) ...
Python
0.000027
@@ -318,204 +318,1590 @@ s)%0A%0A -%0Adef main():%0A %22%22%22Entry point for the :command:%60desi_data_census%60 script.%0A%0A Returns%0A -------%0A :class:%60int%60%0A Exit status that will be passed to :func:%60sys.exit%60.%0A %22%22%22%0A return 0 +def get_options(test_args=None):%0A %2...
87753b0bff057b61879e2dbcc4dceba7aec95451
Disable pool generation by default
settings/const.py
settings/const.py
import urllib2 #Database settings database_connect = "dbname='ridprod'" kv1_database_connect = "dbname='kv1tmp'" iff_database_connect = "dbname='ifftmp'" pool_generation_enabled = True #NDOVLoket settings ndovloket_url = "data.ndovloket.nl" ndovloket_user = "voorwaarden" ndovloket_password = "geaccepteerd" auth_handl...
Python
0
@@ -178,11 +178,12 @@ d = -Tru +Fals e%0A%0A#
954cd188279d4cde471b17b16ab59b3956d4126f
Refactor test slightly
test/auth_tests.py
test/auth_tests.py
from __future__ import absolute_import import captable import unittest import datetime class AuthTests(unittest.TestCase): """Test authorization of classes of securities""" def setUp(self): """Initialize a blank captable and authorize multiple classes of securities""" class ClassAComm...
Python
0
@@ -82,16 +82,171 @@ tetime%0A%0A +%0Aclass ClassACommon(captable.CommonStock):%0A name = %22Class A Common Stock%22%0A%0Aclass ClassBCommon(captable.CommonStock):%0A name = %22Class B Common Stock%22%0A%0A class Au @@ -448,277 +448,8 @@ %22%22%22%0A - class ClassACommon(captable.CommonStock):%0A ...
99563f3a2dc61923eb52449f17f208f78f2667bf
add a --run option that re-loads (hackily) a -ccds.fits table from a previous runbrick run
py/legacypipe/runs.py
py/legacypipe/runs.py
from legacypipe.survey import LegacySurveyData class DecamSurvey(LegacySurveyData): def filter_ccd_kd_files(self, fns): return [fn for fn in fns if 'decam' in fn] def filter_ccds_files(self, fns): return [fn for fn in fns if 'decam' in fn] def filter_annotated_ccds_files(self, fns): ...
Python
0
@@ -2134,16 +2134,717 @@ rn 200%0A%0A +class RerunWithCcds(LegacySurveyData):%0A def get_brick_by_name(self, brickname):%0A # BRUTAL HACK -- runbrick.py's stage_tims first calls%0A # get_brick_by_name, then ccds_touching_wcs... save the%0A # brickname here for later use when reading the CCDs fi...
26154817691dd5da92d94894e12bb1422c26e038
Change cli timeout arg to resemble previous interface
py3tftp/cli_parser.py
py3tftp/cli_parser.py
import argparse import logging from sys import exit from py3tftp import __version__ EPILOG = """ Released under the MIT license. Copyright 2016 Matt O. <matt@mattscodecave.com> """ logging_config = { 'format': '%(asctime)s [%(levelname)s] %(message)s', 'level': logging.INFO, 'filename': None } def prin...
Python
0
@@ -1135,16 +1135,21 @@ '-- +conn- timeout' @@ -1142,32 +1142,56 @@ -conn-timeout',%0A + dest=%22timeout%22,%0A default=
3962f20dc1de8f243bda400b4db6e67acb8694c0
Improve the wording of the travel_plans field
pycon/finaid/forms.py
pycon/finaid/forms.py
from django import forms from django.core.exceptions import ValidationError from django.forms import Textarea, Select from django.utils.translation import ugettext_lazy as _ from .models import FinancialAidApplication, FinancialAidMessage, \ FinancialAidReviewData, FinancialAidEmailTemplate, Receipt def validate...
Python
0.998478
@@ -2942,32 +2942,295 @@ %0A ),%0A + 'travel_plans': (%0A %22Please describe your travel plans. %22%0A %22 Planes? Trains? Automobiles?%22%0A %22 If traveling internationally,%22%0A %22 let us know which country you will travel from.%22%...
2f0a3071b235ee64f9ebef0b2deba5c5cd30479e
change debug level
sublime_plugin_lib/__init__.py
sublime_plugin_lib/__init__.py
# Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details. # All rights reserved. Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file.) import logging import os import sublime class PluginLogger(object): """A logger intented to be used ...
Python
0.000001
@@ -460,13 +460,13 @@ el(' -ERROR +DEBUG ')%0A
39bc11ea5ffff8b8835e53b27a98360a7fbab2c2
Fix tests
tests/test_mcache.py
tests/test_mcache.py
import unittest import os import time from subprocess import Popen, PIPE from tests.common import load_check class TestMemCache(unittest.TestCase): def setUp(self): self.agent_config = { "memcache_server": "localhost", "memcache_instance_1": "localhost:11211:mytag", "m...
Python
0.000003
@@ -1907,33 +1907,33 @@ ythirdtag%22%5D%5D), 2 -3 +6 , r)%0A%0A def te @@ -2365,25 +2365,25 @@ d_tag%22%5D%5D), 2 -3 +6 , r)%0A%0A @@ -2848,17 +2848,17 @@ 1%22%5D%5D), 2 -3 +6 , r)%0A%0A
4f858059b324de0ec32f3b3f41f81b63254f4fe9
bump version
weber_utils/__version__.py
weber_utils/__version__.py
__version__ = "1.0.2"
Python
0
@@ -14,9 +14,9 @@ %221. -0.2 +1.0 %22%0A
fefd96ab8a6134e1e4d3de09619ae2c8edd2c354
Test fetching partial object
tests/test_models.py
tests/test_models.py
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import pytest import turbasen class ObjectManager: def __init__(self): self.sted = turbasen.Sted( lisens='Privat', status='Kladd', navn='Testhytta', beskriv...
Python
0
@@ -5205,8 +5205,476 @@ =False)%0A +%0A @pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason=%22API key not set%22)%0A def test_fetch_partial_object(self, configure_dev, object_manager, post_managed_sted):%0A sted = turbasen.Sted(%0A _meta=%7B%0A 'id': object_ma...
2a8ab9658d6d913ba3bbfd1998664742b8198303
Version update
pyffdl/__version__.py
pyffdl/__version__.py
VERSION = (0, 9, 3) __version__ = ".".join([str(x) for x in VERSION])
Python
0
@@ -14,9 +14,9 @@ 9, -3 +4 )%0A%0A_
c4502645291f2ef1a1eaf08801fd4fa99e3beff2
add perf test for .exists() without caching
tests/performance/microbenchmarks/MicroPerf_FileUtilsCaches/run.py
tests/performance/microbenchmarks/MicroPerf_FileUtilsCaches/run.py
from pysys.constants import * from xpybuild.microperf_basetest import MicroPerfPySysTest class PySysTest(MicroPerfPySysTest): OPERATIONS = [ # resultKey (must be a valid filename), command, setup ('fileutils.exists() non-existent file with caching',"utils.fileutils.exists(OUTPUT_DIR+'/doesntexist')", ""), ]
Python
0.000001
@@ -192,16 +192,143 @@ , setup%0A +%09('fileutils.exists() non-existent file without caching',%22utils.fileutils.exists(OUTPUT_DIR+'/doesntexist%25d'%25iteration)%22, %22%22),%0A %09('fileu
96b3c99c0db05dfbaabbd0f135b5add35296ad9e
Make abstract class more explicit
pyinstrument/frame.py
pyinstrument/frame.py
import sys, os from operator import methodcaller class Frame(object): """ Object that represents a stack frame in the parsed tree """ def __init__(self, identifier='', parent=None): self.identifier = identifier self.parent = parent self.self_time = 0 @property def func...
Python
0.999998
@@ -3767,24 +3767,99 @@ end(child)%0A%0A + @property%0A def children(self):%0A raise NotImplementedError()%0A%0A def __re
c478c9978aa3843d1961f9e475e5d6a85c8092d5
Fix xrange fallback
pylibscrypt/common.py
pylibscrypt/common.py
# Copyright (c) 2014-2015, Jan Varho # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL...
Python
0.000002
@@ -21,9 +21,9 @@ -201 -5 +8 , Ja @@ -1283,16 +1283,25 @@ tiful.%0A%0A +try:%0A xrange = @@ -1311,38 +1311,29 @@ ange - if 'xrange' in globals() else +%0Aexcept:%0A xrange = ran
ce93a6f96ecaa3c5e721158abad698ea550c7b80
Rename test case
tests/test_parser.py
tests/test_parser.py
import unittest from hashedindex import textparser class TfidfTestCase(unittest.TestCase): def test_zero_term_frequency(self): assert textparser.tfidf(tf=0, df=10, corpus_size=1) == 0 def test_zero_document_frequency(self): assert textparser.tfidf(tf=10, df=0, corpus_size=1) == 0 def t...
Python
0.000247
@@ -309,32 +309,35 @@ 0%0A%0A def test_ +non zero_document_fr
9aa17b90b8f3413f0621cc25a686774dd809dc84
Add drf serializer for environment variables
frigg/projects/serializers.py
frigg/projects/serializers.py
from rest_framework import serializers from frigg.builds.serializers import BuildInlineSerializer from .models import Project class ProjectSerializer(serializers.ModelSerializer): builds = BuildInlineSerializer(read_only=True, many=True) class Meta: model = Project fields = ( 'i...
Python
0
@@ -123,16 +123,449 @@ oject%0A%0A%0A +class EnvironmentVariableSerializer(serializers.ModelSerializer):%0A%0A def to_representation(self, instance):%0A representation = super().to_representation(instance)%0A if instance.is_secret:%0A representation.value = '%5Bsecret%5D'%0A return r...
2f7d2df80a611f42bb53dff75bd7561d24885dcc
Add answer showing
supersurvey/surveyapp/views.py
supersurvey/surveyapp/views.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.shortcuts import render, render_to_response, redirect from .models import Question, Answer, Session from .forms import SurveyForm # Create your views ...
Python
0.000015
@@ -2476,56 +2476,8 @@ -else:%0A print(%22%D0%9F%D0%BE%D1%88%D0%B5%D0%BB %D0%BD%D0%B0 %D1%85%D1%83%D0%B9%22)%0A resu @@ -2522,10 +2522,414 @@ e(result +)%0A%0A%0Adef survey_answers(request):%0A result = %5B%5D%0A questions_list = Question.objects.get(deleted=False)%0A for question in...
f6ba5955ee070479647db6986c88c3f65a22afdd
Remove redundant line in test.
tests/test_rename.py
tests/test_rename.py
import os import re import sys import pytest from mock import Mock, patch app_path = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, app_path + '/../') from photo_rename import * from stubs import * class TestRename(): """ Tests for method build_new_fn() are in this class. """ @pytest.m...
Python
0.000324
@@ -1206,42 +1206,8 @@ rue%0A - old_fn = OLD_FN_JPG_LOWER%0A @@ -1269,38 +1269,48 @@ lemap = FileMap( -old_fn +OLD_FN_JPG_LOWER , IMAGE_TYPE_JPE
f326bc9220d15c14bd4c175310e6469105c9d348
change type
werobot/crypto/__init__.py
werobot/crypto/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import base64 import socket import struct import time try: from cryptography.hazmat.primitives.ciphers import \ Cipher, algorithms, modes from cryptography.hazmat.backends import default_backend except ImportError: ra...
Python
0.000003
@@ -3718,13 +3718,16 @@ or -( str( +int( time
d0c557547c4aa98cfe47d36a18417557c11b18f9
Bump version
pyqiwi/__version__.py
pyqiwi/__version__.py
# -*- coding: utf-8 -*- # _ _ # _ __ _ _ __ _(_)_ _(_) # | '_ \| | | |/ _` | \ \ /\ / / | # | |_) | |_| | (_| | |\ V V /| | # | .__/ \__, |\__, |_| \_/\_/ |_| # |_| |___/ |_| # Python Qiwi API Wrapper VERSION = (2, 1, 0) __version__ = '.'.join(map(str, VERSI...
Python
0
@@ -276,9 +276,9 @@ 1, -0 +1 )%0A%0A_
ca6a330d629050937bc4543a66059068ae6ec504
update tests
tests/test_script.py
tests/test_script.py
import os.path import subprocess import sys from vulture import __version__ DIR = os.path.dirname(os.path.abspath(__file__)) REPO = os.path.dirname(DIR) WHITELIST = os.path.join(REPO, 'whitelists', 'stdlib.py') def call_vulture(args, **kwargs): return subprocess.call( [sys.executable, 'vulture.py'] + ar...
Python
0.000001
@@ -1306,19 +1306,16 @@ 'vulture -.py %7B0%7D%5Cn'.
2d78a9f0e4ba17aeae135b63f995a47ce085ee24
Patch Trace.batch_log_pdf() (#286)
pyro/poutine/trace.py
pyro/poutine/trace.py
import collections import networkx import torch from torch.autograd import Variable class Trace(networkx.DiGraph): """ Execution trace data structure """ node_dict_factory = collections.OrderedDict def __init__(self, *args, **kwargs): """ :param string graph_type: string specify...
Python
0
@@ -3184,32 +3184,304 @@ * site%5B%22scale%22%5D%0A +%0A # The following line is a quick fix for size mismatch issues,%0A # and should be reverted after this issue is fixed:%0A # https://github.com/uber/pyro/issues/278%0A site_log_p = site_log...
f97fbb50bd5f311230c5b005e238a665e096e867
Fix failing unit test
tests/test_server.py
tests/test_server.py
from multiprocessing import Process from numpy.testing import assert_allclose, assert_raises from six.moves import cPickle from fuel.datasets import MNIST from fuel.schemes import SequentialScheme from fuel.server import start_server from fuel.streams import DataStream, ServerDataStream def get_stream(): return...
Python
0.000015
@@ -627,16 +627,23 @@ f', 't') +, False )%0A%0A d
41e67ec2754919a2fcca77079ebff8e2ac92b440
Update window tests to use .index
tests/test_window.py
tests/test_window.py
# -*- coding: utf-8 -*- """Test for tmuxp Window object.""" from __future__ import (absolute_import, division, print_function, unicode_literals, with_statement) import logging import pytest from libtmux import Pane, Server, Window logger = logging.getLogger(__name__) def test_select_windo...
Python
0
@@ -536,33 +536,24 @@ index = int( -%0A session.atta @@ -564,35 +564,21 @@ _window. -get('window_ index -') )%0A%0A w @@ -690,35 +690,21 @@ _window. -get('window_ index -') ))%0A a @@ -750,35 +750,21 @@ (window. -get('window_ index -') )%0A%0A s @@ -834,26 +834,16 @@ index == - %5C%0A ...
b17540dd2562c74898f1fda181d3a29e6b3c0ea5
Extend tests for _spec_signature
tests/testhelpers.py
tests/testhelpers.py
# Copyright (C) 2007-2011 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ from tests.support import unittest2 from mock import Mock, ANY, call, _spec_signature class SomeClass(object): def one(self, a, b): pass def two(self): ...
Python
0.000001
@@ -193,16 +193,27 @@ k import + MagicMock, Mock, A @@ -4281,17 +4281,16 @@ foo')%0A%0A%0A -%0A def @@ -4871,36 +4871,428 @@ (self):%0A -pass +class BuiltinSubclass(list):%0A attr = %7B%7D%0A%0A mock = _spec_signature(BuiltinSubclass)%0A self.assertEqual(list(mock), %5B%5D)%0...
c9ca2f8864f2640deec038bf1a3f7e6abe79793f
convert input to string
python/2.7/pyutils.py
python/2.7/pyutils.py
import fnmatch import os import sys import subprocess import shlex import signal import time def find_files(rootdir='.', pattern='*'): return [os.path.join(rootdir, filename) for rootdir, dirnames, filenames in os.walk(rootdir) for filename in filenames if fnmatch.fnmatch(filen...
Python
1
@@ -343,24 +343,40 @@ _number(s):%0A + ss = str(s)%0A try:%0A @@ -387,16 +387,17 @@ float(s +s ) # for @@ -473,16 +473,17 @@ omplex(s +s ) # for
025f6c68844101fb45722e7f27dc7854fc1f6065
Update tables.py
grade-2015/KuangJia/tables.py
grade-2015/KuangJia/tables.py
# encoding:utf8 # Python使用ORM框架操作数据库 from sqlalchemy import Column, Integer, String, DateTime, create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Scene(Base): __tablename__ = 'scene' # 表名 id = Column(Integer, prim...
Python
0.000001
@@ -919,47 +919,8 @@ %0A# %E6%9F%A5 -, destory_time = '2015-12-21 12:20:54' %0Ases @@ -1043,16 +1043,17 @@ se()%0A''' +%0A # %E6%94%B9%0Asess
127a707c7e77f0a1fa8066bc24099addb1f429d2
Update version for release
great_expectations/version.py
great_expectations/version.py
__version__ = "0.7.6__develop"
Python
0
@@ -17,15 +17,6 @@ .7.6 -__develop %22%0A
c9d4dd153b582470216bc9e01b55753876136fec
add another test since i'm paranoid
test/holes_test.py
test/holes_test.py
# Copyright (c) 2013 Spotify AB # # 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, s...
Python
0.000014
@@ -694,21 +694,30 @@ ef test_ -holes +root_one_child (self):%0A @@ -1034,18 +1034,18 @@ est_ +many_ holes -_more (sel @@ -1687,17 +1687,21 @@ les_ -even_mo +many_child re +n (sel @@ -1774,39 +1774,10 @@ -annoy = AnnoyIndex(100)%0A +f, bas @@ -1784,16 +1784,21 @@ e_i, n = + 100, 100000, @@ -17...
4ffa677f0c50d535136d983820b48c39e125b447
Fix anything tests didn't pick up
gstack/controllers/regions.py
gstack/controllers/regions.py
#!/usr/bin/env python # encoding: 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, Vers...
Python
0.000002
@@ -1451,39 +1451,38 @@ 'command': 'list -Account +Region s'%7D%0A kwargs = @@ -1555,23 +1555,22 @@ args, ' -account +region ',%0A @@ -2118,15 +2118,14 @@ list -Account +Region s'%7D%0A @@ -2214,23 +2214,22 @@ args, ' -account +region ', func_
4cda0e2ba8588998d7311b7ee1973bc7c3039b83
Update other signer
Channels/Check_Mii_Out_Channel/sign_encrypt.py
Channels/Check_Mii_Out_Channel/sign_encrypt.py
import argparse import binascii import collections import os import pyaes import rsa import struct import subprocess def u8(data): return struct.pack(">B", data) def u16(data): return struct.pack(">H", data) def u32(data): return struct.pack(">I", data) parser = argparse.ArgumentParser(description="S...
Python
0
@@ -1107,16 +1107,26 @@ y in hex + or a path .%22)%0Apars @@ -1252,57 +1252,18 @@ hex -. If not specified, it will generate a random one + or a path .%22)%0A @@ -2197,24 +2197,41 @@ s not None:%0A + try:%0A iv = @@ -2266,16 +2266,83 @@ key%5B0%5D)%0A + except:%0A iv = open(a...
3106a712d0a61801857813c98d31591b0937777d
Update __init__.py
tensorlayer/layers/__init__.py
tensorlayer/layers/__init__.py
#! /usr/bin/python # -*- coding: utf-8 -*- """ TensorLayer provides rich layer implementations trailed for various benchmarks and domain-specific problems. In addition, we also support transparent access to native TensorFlow parameters. For example, we provide not only layers for local response normalization, but also ...
Python
0.000072
@@ -39,475 +39,8 @@ -*- -%0A%22%22%22%0ATensorLayer provides rich layer implementations trailed for%0Avarious benchmarks and domain-specific problems. In addition, we also%0Asupport transparent access to native TensorFlow parameters.%0AFor example, we provide not only layers for local response normalization, but also...
8602f0ab0476740e7373bececa1ce62b980a3fdf
Update curacao.py
holidays/countries/curacao.py
holidays/countries/curacao.py
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Author: ryanss <ryanssdev@icl...
Python
0
@@ -1406,18 +1406,18 @@ a di Pas -co +ku di Resu @@ -2858,16 +2858,17 @@ 6)%5D = %222 +d e Kerstd
421b7e0b495b1eb0e987db2954f09d4f0c34966a
Make tags in Eventset into property
src/morphforge/traces/eventset.py
src/morphforge/traces/eventset.py
#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Copyright (c) 2012 Michael Hull. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
Python
0
@@ -2725,18 +2725,18 @@ elf. +_ tags = -li s +e t(ta @@ -2929,18 +2929,16 @@ elf. +_ tags.a -ppen +d d('E @@ -3337,16 +3337,78 @@ time()%0A%0A + @property %0A def tags(self):%0A return self._tags%0A%0A def
200db2db83d2765413ad62ec43087deee0c1cf6e
Add trailing newline
app/soc/models/__init__.py
app/soc/models/__init__.py
# # Copyright 2008 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
0.998459
@@ -620,8 +620,9 @@ dels.%22%22%22 +%0A
6dad8f100a819ebd3a150dc14f8bcea34f6d3fb4
add extract_read_csv
dsclient/client.py
dsclient/client.py
import os import time from . import bigquery from . import storage from . import datastore from . import compute from . import schema class Client(bigquery.Client, storage.Client, datastore.Client, compute.Client): def __init__(self, project_id, keyfile_path=None, account_email=None): super(Client, self)...
Python
0.000171
@@ -1206,38 +1206,215 @@ gs_uri)%0A -except + s = schema.Schema(table%5B%22schema%22%5D)%0A dtype = s.get_object_dtype()%0A df = self.read_csv(gs_uri, dtype=dtype)%0A df = s.update_dtype(df)%0A finally :%0A if @@ -1406,38 +1406,42 @@ %0A if -b...
f147ac7717058f03da2dbe9721bfbaa712957b81
Test callback padding of JSONP
api/test/test_system.py
api/test/test_system.py
import os import datetime from functools import partial from nose.tools import eq_, ok_ from flask import json import psycopg2 import psycopg2.extras import testing.postgresql import app db = None client = None def setUp(self): global db, client # Create a temporary PG database and populate it with the test ...
Python
0
@@ -4965,24 +4965,45 @@ ch_jsonp():%0A + callback = 'foo'%0A r = clie @@ -5063,20 +5063,30 @@ allback= -foo' +%25s' %25 callback )%0A eq @@ -5172,8 +5172,122 @@ cript')%0A + head = '%25s(' %25 callback%0A tail = ');'%0A eq_(head, r.data%5B0:len(head)%5D)%0A eq_(tail, r.data%5B-len(tail):%5D)%...
b26af5f69b310e35dd871d4d9a7a3b0ed67cf870
add another stats test
test/test_stats.py
test/test_stats.py
__author__ = 'escherba' import unittest from lsh.stats import UncertaintySummarizer from collections import Counter class MyTestCase(unittest.TestCase): def test_uindex(self): """ Example from Manning et al. Introduction to Information Retrieval. CUP. 2009, p. 357. """ ui...
Python
0
@@ -78,16 +78,36 @@ mmarizer +, VarianceSummarizer %0Afrom co @@ -184,16 +184,27 @@ f test_u +ncertainty_ index(se @@ -342,22 +342,20 @@ -uindex +summ = Uncer @@ -373,38 +373,36 @@ rizer()%0A -uindex +summ .add_object(Coun @@ -427,38 +427,36 @@ 1%7D), 6)%0A -uindex +summ .add_object(...
75479530cee5c21f88b122c810650ac9d39251dd
Add support for changing the model's name
elixir/compiler.py
elixir/compiler.py
import os import os.path from xml.etree import ElementTree from elixir.rbx import Container, Script class ModelCompiler: """Creates a ROBLOX Model from source code. It converts folders, Lua files, and ROBLOX models into an XML file that you can import into your game. Usage: # This is just g...
Python
0.000002
@@ -1387,70 +1387,527 @@ -%22%22%22%0A%0A def __init__(self, source, dest, extension=%22.rbxmx%22): +model_name=None : str%0A This is the name of the top-most folder that contains all of your source%0A code.%0A%0A If blank, it will use the name of the last folder in %60source%60. This%0A ...
082c342d59c7752a4f45f016ac63fd4da25a5fad
Fix organization checks in submit serializer
bluebottle/initiatives/serializers.py
bluebottle/initiatives/serializers.py
from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers from rest_framework_json_api.serializers import ModelSerializer from rest_framework_json_api.relations import ( ResourceRelatedField, PolymorphicResourceRelatedField ) from bluebottle.bb_projects.models import ProjectT...
Python
0
@@ -6083,37 +6083,38 @@ ld(%0A -required=Fals +allow_null=Tru e, queryset= @@ -6281,29 +6281,30 @@ -required=Fals +allow_null=Tru e, query
9b0bae44dfd2eab053221479a993784cc78d0532
Use enviromental markers for requiring futures in python < 3.2
src/setup.py
src/setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2015 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud 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 Softwar...
Python
0
@@ -4578,109 +4578,8 @@ )%0A%0A%0A -extra_requirements = ()%0Aif sys.version_info %3C (3, 2):%0A extra_requirements = ('futures%3E=2.1.3',)%0A%0A%0A setu @@ -5658,24 +5658,28 @@ ) +,%0A -+ extra +s _require ment @@ -5674,21 +5674,80 @@ _require -ments +=%7B%0A %22:python_version %3C '3.2'%22: ...
2bde9f7ef0280b0320d8bf4431c636d7ac4f67e3
Update version number
tinycss2/__init__.py
tinycss2/__init__.py
""" tinycss2 ======== tinycss2 is a low-level CSS parser and generator: it can parse strings, return Python objects representing tokens and blocks, and generate CSS strings corresponding to these objects. """ from .bytes import parse_stylesheet_bytes # noqa from .parser import ( # noqa parse_declaration_list, ...
Python
0.000002
@@ -572,9 +572,9 @@ '1. -0.2 +1.0 '%0A
12ce300c3b0101ec75ba805bd5a577e191a5b8fc
fix relation for simple deployment test
tests/01-deploy.py
tests/01-deploy.py
#!/usr/bin/env python3 import unittest import amulet class TestDeploy(unittest.TestCase): """ Trivial deployment test for Apache Kafka. This charm cannot do anything useful by itself, so integration testing is done in the bundle. """ @classmethod def setUpClass(cls): cls.d = amu...
Python
0.000001
@@ -491,24 +491,23 @@ keeper:z -ookeeper +kclient ')%0A%0A
988427d88184ecbfc2aa203a36b53ea17ae1acc2
Fix merge conflict
core/internals.py
core/internals.py
import sys from core import const log = const.log try: from slugify import SLUG_OK, slugify except ImportError: log.error('Oops! `unicode-slugify` was not found.') log.info('Please remove any other slugify library and install `unicode-slugify`') sys.exit(5) import os formats = { 0 : 'track_name', ...
Python
0
@@ -3301,24 +3301,25 @@ h, temp))%0A%0A%0A +%0A def videotim @@ -3420,19 +3420,24 @@ eturn '%7B +0 %7D:%7B +1:02 %7D'.forma @@ -3442,29 +3442,18 @@ mat( -str( time - // - 60 -) , -str( time @@ -3458,26 +3458,16 @@ me %25 60) -.zfill(2)) %0A%0A re @@ -3477,14 +3477,23 @@ n '%7B +0 %7D:%7B -%7D:%7B +...
f6cf76d5687d2fcdc3c6cbaf60d99a2db63231a8
Refactor pantsd integration test framework (#6508)
tests/python/pants_test/pantsd/pantsd_integration_test_base.py
tests/python/pants_test/pantsd/pantsd_integration_test_base.py
# coding=utf-8 # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import functools import os import time from builtins import open from contextlib import c...
Python
0
@@ -1740,30 +1740,38 @@ self. -assert_running +_check_pantsd_is_alive ()%0A r @@ -1797,22 +1797,30 @@ def -assert_running +_check_pantsd_is_alive (sel @@ -1898,55 +1898,261 @@ ), ' -pantsd should be running!'%0A return self._pid +cannot assert that pantsd is running. Try calling assert_started before cal...
aba929bac154e28f5df74be7bb6ec62a94275ce5
format acl tests with yapf
tests/acl_tests.py
tests/acl_tests.py
""" Tests for Consulate.acl """ import json import uuid import httmock import consulate from consulate import exceptions from . import base ACL_OLD_RULES = """key "" { policy = "read" } key "foo/" { policy = "write" } """ ACL_NEW_RULES = """key_prefix "" { policy = "read } key "foo/" { policy = "write...
Python
0
@@ -354,17 +354,16 @@ tCase):%0A -%0A @sta @@ -472,17 +472,16 @@ (self):%0A -%0A @@ -929,33 +929,16 @@ esponse( -%0A 200, jso @@ -970,16 +970,52 @@ n%7D), %7B%7D, +%0A None, 0 @@ -4127,29 +4127,16 @@ .update( -%0A self.uui @@ -4145,2...
b9f4d1c194db90b21bf89610eceec3e29c95df42
Fix formatting
tests/coalaTest.py
tests/coalaTest.py
import os import re import sys import unittest import unittest.mock from pkg_resources import VersionConflict from coalib import coala from coalib.misc.ContextManagers import prepare_file from tests.test_bears.LineCountTestBear import ( LineCountTestBear) from tests.TestUtilities import execute_coala, bear_test_mo...
Python
0.000043
@@ -229,22 +229,16 @@ import -(%0A LineCoun @@ -246,17 +246,16 @@ TestBear -) %0Afrom te
6b52199225ea01dbf2d7631cac8e8e1344494e98
update passenger movement and dependence with taxi driving
core/passenger.py
core/passenger.py
# -*- coding: utf-8 -*- # Copyright (c) 2015 Zhassulan Zhussupov # Author zhzhussupovkz@gmail.com # Passenger class import random import time class Passenger: def __init__(self, world, screen, x, y): self.pygame = world.pygame self.screen, self.world = screen, world model = random.choice([...
Python
0
@@ -1267,21 +1267,290 @@ -self.y += 0.2 +if self.world.taxi.gear == 1:%0A self.y += 0.2%0A elif self.world.taxi.gear == 2:%0A self.y += 0.4%0A elif self.world.taxi.gear == 3:%0A self.y += 0.5%0A elif self.world.taxi.gear == 4:%0A ...
0c9eea5eeb3c361c4b1b39c9435161a03d30aa2d
Use point from pool as seed for new chains to prevent out of sync threads getting stuck at low logL
cpnest/sampler.py
cpnest/sampler.py
import sys import os import numpy as np from math import log from collections import deque import multiprocessing as mp from multiprocessing import Process, Lock, Queue from random import random from . import parameter from . import proposal class Sampler(object): """ Sampler class. Initialisation argumen...
Python
0
@@ -187,16 +187,26 @@ t random +,randrange %0A%0Afrom . @@ -1064,101 +1064,28 @@ m = -parameter.LivePoint(self.user.names)%0A self.param = parameter.LivePoint(self.user.names +self.user.new_point( )%0A @@ -1112,17 +1112,19 @@ = self. -p +inP aram.dim @@ -1403,9 +1403,9 @@ %7B2:. -3 +0 f%7D %25 @@ -18...
fb507530935f3e9e205feca60dfc04eafd008e86
output thinned mcmc chains
cpnest/sampler.py
cpnest/sampler.py
from __future__ import division import sys import os import numpy as np from math import log from collections import deque from random import random,randrange from . import parameter from .proposal import DefaultProposalCycle from . import proposal class Sampler(object): """ Sampler class. Initialisation ...
Python
0.999629
@@ -243,16 +243,95 @@ roposal%0A +%22%22%22%0A hamilton equations collisional gas in a box whose side is shrinking%0A%22%22%22 %0Aclass S
c593f9c3166a072ee69f5debfbceec73385bfa40
fix wrong parentheses
breakseq2/breakseq_pre.py
breakseq2/breakseq_pre.py
#!/usr/bin/env python import pysam import argparse import sys import time import logging import multiprocessing DEFAULT_MIN_SOFT_CLIP=20 DEFAULT_MIN_SOFT_CLIP_MAPQ=10 DEFAULT_MIN_SOFT_CLIP_MATE_MAPQ=10 DEFAULT_BAD_MAP_MAX_SOFT_CLIP=50 DEFAULT_BAD_MAP_MIN_MAPQ=10 DEFAULT_BAD_MAP_MIN_MATE_MAPQ=10 DEFAULT_BAD_MAP_MIN_NM...
Python
0.999998
@@ -5587,17 +5587,16 @@ , bams)) -) , str(ch @@ -5631,16 +5631,17 @@ rt_time) +) %0A ret
26171e8fd87e8f4d8d61d728cdddbf6c99eb5356
mark tasks as such
bsdploy/fabfile_mfsbsd.py
bsdploy/fabfile_mfsbsd.py
# coding: utf-8 from bsdploy.bootstrap_utils import BootstrapUtils from contextlib import contextmanager from fabric.api import env, hide, run, settings from ploy.common import yesno from ploy.config import value_asbool # a plain, default fabfile for jailhosts using mfsbsd env.shell = '/bin/sh -c' @contextmanager ...
Python
0
@@ -145,16 +145,22 @@ settings +, task %0Afrom pl @@ -6050,24 +6050,30 @@ 'reboot')%0A%0A%0A +@task%0A def bootstra @@ -6218,16 +6218,22 @@ rap()%0A%0A%0A +@task%0A def fetc
71c837c2792e6b30c5b93a4848b8b6a3c0ca0308
use parallel in progressbar.py
tests/misc/progressbar.py
tests/misc/progressbar.py
#!/usr/bin/env python # Tai Sakuma <tai.sakuma@gmail.com> from __future__ import print_function import sys import time, random import uuid import alphatwirl ##__________________________________________________________________|| class Task(object): def __init__(self, name): self.name = name def __call_...
Python
0.000001
@@ -141,25 +141,526 @@ import a -lphatwirl +rgparse%0A%0Aimport alphatwirl%0A%0A##__________________________________________________________________%7C%7C%0Aparser = argparse.ArgumentParser()%0Aparser.add_argument('--parallel-mode', default='multiprocessing', choices=%5B'multiprocessing', 'subprocess', 'htcondor'%5D, ...
0d0a081a8b37066b2000cac3395d59e2cc7b29e1
Add another smoke test.
buhmm/tests/test_smoke.py
buhmm/tests/test_smoke.py
""" Smoke tests. """ from nose.tools import * from nose import SkipTest import dit import buhmm import numpy as np class TestSmoke: def setUp(cls): global machines try: from cmpy import machines except ImportError: raise SkipTest('cmpy not available') def tes...
Python
0
@@ -1415,28 +1415,353 @@ ictive_probability(w, 'B'))%0A +%0A def test_infer(self):%0A m = machines.Even()%0A m.prng.seed(0)%0A d = m.symbols(100)%0A x = buhmm.Infer(m, d)%0A evid = x.log_evidence()%0A assert_almost_equal(evid, -68.165400496389665)%0A pred = x.predict...
244d37130690e74201c2c6d1b82345854235d29f
Add relation now also gives "value" the preferentional treatment
UM/Settings/SettingInstance.py
UM/Settings/SettingInstance.py
# Copyright (c) 2016 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. import enum import os from UM.Signal import Signal, signalemitter from UM.Logger import Logger from UM.Decorators import call_if_enabled from . import SettingRelation from . import Validator from . import SettingFuncti...
Python
0.000001
@@ -8151,16 +8151,244 @@ ation)%0A%0A + property_names = SettingDefinition.getPropertyNames()%0A property_names.remove(%22value%22) # Move %22value%22 to the front of the list so we always update that first.%0A property_names.insert(0, %22value%22)%0A @@ -8488,44 +8488,22 @@...
98b40bdc0d348071751da6c463a0ba95037f7d4e
Add metric method
exp/sandbox/recommendation/SoftImpute.py
exp/sandbox/recommendation/SoftImpute.py
""" An implementation of the matrix completion algorithm in "Spectral Regularisation Algorithms for learning large incomplete matrices". """ import numpy import scipy.sparse import scipy.sparse.linalg from apgl.util.SparseUtils import SparseUtils from apgl.util.Util import Util class SoftImpute(object): d...
Python
0.997731
@@ -247,16 +247,63 @@ eUtils %0A +from apgl.util.MCEvaluator import MCEvaluator %0A from apg @@ -2433,16 +2433,107 @@ return U, s, V +%0A %0A def getMetricMethod(self): %0A return MCEvaluator.meanSqError()%0A
4a861a9a3a6070c3a9016f788cbda521e11da3d5
remove test_resolve() test since resolving schema inheritance is now built in to the loadDocument() function when called on schemas; update other calls to work with the latest API
xgds_planner2/xpjsonTest.py
xgds_planner2/xpjsonTest.py
#!/usr/bin/env python #__BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file...
Python
0
@@ -1183,143 +1183,8 @@ e):%0A - def test_resolve(self):%0A schemaDict = xpjson.loadDocument(SCHEMA_PATH)%0A xpjson.resolveSchemaInheritance(schemaDict)%0A%0A @@ -1224,34 +1224,16 @@ chema = -xpjson.PlanSchema( xpjson.l @@ -1256,17 +1256,16 @@ MA_PATH) -) %0A%0A de @@ -1300,34 +1300,16 @...
e39c8f6dd009a18968cd3acda4d4dd91d44330ad
Allow filter of whole traceback
shoogie/logger.py
shoogie/logger.py
import re import socket import sys import traceback from django import http from django.conf import settings from django.views import debug from . import models, utils def log_exception(request=None, exc_type=None, exc_val=None, tb=None): django_request = None if isinstance(request, http.HttpRe...
Python
0
@@ -629,16 +629,24 @@ back(tb) + or None )%0A%0A t @@ -3282,19 +3282,8 @@ , tb -, init=True ):%0A @@ -3357,32 +3357,13 @@ -top = tb%0A if init +if tb :%0A @@ -3398,15 +3398,8 @@ (tb) - or top %0A @@ -3416,16 +3416,35 @@ tb = tb%0A + if tb:%0A @@ -3467,24 +3467,28 @@ t...
89534d3209e258b8071a618d5fbba7c2fa43df18
Allow for selectability of folders on FileField and FileBrowseField.
filebrowser_safe/templatetags/fb_tags.py
filebrowser_safe/templatetags/fb_tags.py
# coding: utf-8 # django imports from django import template from django.utils.encoding import smart_unicode from django.utils.safestring import mark_safe # filebrowser imports from filebrowser_safe.settings import SELECT_FORMATS register = template.Library() @register.inclusion_tag('filebrowser/include/_response....
Python
0
@@ -3544,28 +3544,12 @@ e = -filetype != %22Folder%22 +True %0A
8c0ff9fbc4efabf9b036d70ce696a7f25eccc126
generate stuff
show/generator.py
show/generator.py
import random from datetime import datetime, timedelta from django.conf import settings from generate import IMAGES, VIDEOS from generate.json_loader import load_json SHOW_COUNT = 20 def generate(): objects = [] # gen radio show objects and calendar entries for i in range(1, SHOW_COUNT + 1): # ...
Python
0.999999
@@ -178,16 +178,34 @@ UNT = 20 +%0ACREDIT_COUNT = 20 %0A%0Adef ge @@ -238,19 +238,22 @@ %0A%0A # -gen +create radio s @@ -915,16 +915,676 @@ %7D)%0A%0A +%0A # create some show credits%0A for i in range(1, CREDIT_COUNT + 1):%0A # create show%0A objects.append(%7B%0A %22model%...
705bcf72367120ac9ffe063c3a0d244f432c6a92
fix warning message
tko_contract_invoicing_product_effective_date/models/account_analytic_account.py
tko_contract_invoicing_product_effective_date/models/account_analytic_account.py
# -*- encoding: utf-8 -*- from odoo import models, fields, api, _ from odoo.exceptions import Warning import logging _logger = logging.getLogger(__name__) class AccountAnalyticAccont(models.Model): _inherit = 'account.analytic.account' end_date = fields.Date(u'End Date') def _validate_invoice_creatin...
Python
0.000153
@@ -1316,59 +1316,118 @@ co -ntract_name = '%5B' + self.code or ' ' + '%5D ' + self. +de = self.code or ''%0A name = self.name or ''%0A contract_name = %22%5B%7B%7D%5D %25s%22.format(code) %25 name
5227bf0ef7f7770f5d5781500ad7c2e6a64a061b
add a few comments
CollectAllProxy.py
CollectAllProxy.py
import socket import re from time import sleep from select import select from threading import Thread from StringIO import StringIO from httplib import HTTPResponse class StringySocket(StringIO): def makefile(self, *args, **kw): return self class StringyHttpResponse(object): def __init__(self, con...
Python
0
@@ -242,56 +242,241 @@ -return self%0A%0A%0Aclass StringyHttpResponse(object): +%22%22%22%0A Used to mock set 'rb' flags etc...%0A %22%22%22%0A return self%0A%0A%0Aclass StringyHttpResponse(object):%0A %22%22%22%0A The last thing we need is a nother socket to deal with, lets deal%0A ...
4a6ab36636039b59fef5f73250c6e54b049f2b9f
Update myglobals.py
tests/myglobals.py
tests/myglobals.py
DUMP_DIR = 'tests/rdf-metadata' BASE_URL = 'http://127.0.0.1:8080' # example catalog, dataset and distributions URL_PATHS = [ 'fdp', 'catalog/pbg-ld', 'dataset/sly-genes', 'dataset/spe-genes', 'dataset/stu-genes', 'distribution/sly-genes-gff', 'distribution/spe-genes-gff', 'distribution...
Python
0.000001
@@ -48,17 +48,15 @@ p:// -127 +0 .0.0. -1 +0 :808 @@ -545,9 +545,8 @@ 'nt'%0A%7D%0A -%0A
d8340021b20371a74305a3f550d57d4713b2a5c2
Add field `User.feed_followed_only`
c2corg_api/models/user.py
c2corg_api/models/user.py
import bcrypt from c2corg_api.models.utils import ArrayOfEnum from c2corg_common.attributes import default_langs from c2corg_api.models.schema_utils import restrict_schema from c2corg_api.models.user_profile import UserProfile from sqlalchemy import ( Boolean, Column, CheckConstraint, Integer, DateT...
Python
0
@@ -3384,24 +3384,180 @@ ault='%7B%7D')%0A%0A + # only show updates from followed users in the homepage feed%0A feed_followed_only = Column(%0A Boolean, server_default='FALSE', nullable=False)%0A%0A def upda
b02c745686f4270742bdef388fe2d2560e8a2f0a
switch to 1.5.1 and kill march=native with fire
c_components/conanfile.py
c_components/conanfile.py
from conans import ConanFile, CMake import os import shutil class ImageFlowConan(ConanFile): name = "imageflow_c" version = "0.1.0" license = "AGPLv3" settings = "os", "compiler", "build_type", "arch", "target_cpu" requires = "littlecms/2.7@lasote/stable", "libpng/1.6.21@lasote/stable", "libjpeg-tu...
Python
0.000001
@@ -323,11 +323,11 @@ o/1. -4.2 +5.1 @ima
31d66b0884c7e397f8558ba08796e5cccda89c19
fix merge
ca_nb_moncton/__init__.py
ca_nb_moncton/__init__.py
from __future__ import unicode_literals from utils import CanadianJurisdiction from pupa.scrape import Organization class Moncton(CanadianJurisdiction): classification = 'legislature' division_id = 'ocd-division/country:ca/csd:1307022' division_name = 'Moncton' name = 'Moncton City Council' url = ...
Python
0.000001
@@ -864,16 +864,70 @@ at(i, j) +, division_id='%7B%7D/ward:%7B%7D'.format(self.division_id, i) )%0A%0A
0709b37f36fac67fc80d98f67c03b8fe3ab21893
include last_run_at and total_run_count when loading stored task data
celerycontrib/sqlalchemyscheduler/scheduler.py
celerycontrib/sqlalchemyscheduler/scheduler.py
import json import celery.beat import sqlalchemy as sqla from sqlalchemy import orm from . import model class SQLAlchemyScheduler(celery.beat.Scheduler): database_url = 'sqlite:///data.sqlite' _session = None @property def session(self): if self._session is None: engine = sqla...
Python
0.000006
@@ -1093,16 +1093,134 @@ ),%0A + last_run_at=periodic_task.last_run_at,%0A total_run_count=periodic_task.total_run_count,%0A
d88cb7e63bb6b0ef03b3a2b0388a4ec05d39a057
add pep exception
tools/_blank-tool.py
tools/_blank-tool.py
import os import sys import django sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings") django.setup() from django.contrib.auth.models import User from museum_site.models import * # noqa: E402 def main(): return True ...
Python
0.000006
@@ -233,16 +233,30 @@ ort User + # noqa: E402 %0A%0Afrom m
ca5f5b1b45f7b070d55a73cd09b58dfd3704d096
Replaces print with NotImplementedError
pymouse.py
pymouse.py
# -*- coding: iso-8859-1 -*- import sys class PyMouseMeta(object): def press(self, x, y, button = 0): """Press the mouse on a givven x, y and button. Button is defined as 0 = left, 1 = middle, 2 = right.""" print "Function not implemented" def release(self, x, y): """Release ...
Python
0.999812
@@ -231,37 +231,26 @@ -print %22Function not i +raise NotI mplement @@ -243,33 +243,37 @@ e NotImplemented -%22 +Error %0A%0A def releas @@ -336,37 +336,26 @@ -print %22Function not i +raise NotI mplement @@ -348,33 +348,37 @@ e NotImplemented -%22 +Error %0A%0A def click( @@ -677,37 +67...
5022f61e5eed4d1bb5f8ec491784eb06f168e1ed
Use temporary eclipse workspace directories for DartEditor tests
tools/bots/editor.py
tools/bots/editor.py
#!/usr/bin/python # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import os import sys import bot def GetEditorExecutable(mode, arch): configuration_d...
Python
0
@@ -247,22 +247,267 @@ rt s -ys%0A%0Aimport bot +hutil%0Aimport sys%0Aimport tempfile%0A%0Aimport bot%0A%0Aclass TempDir(object):%0A def __enter__(self):%0A self._temp_dir = tempfile.mkdtemp('eclipse-workspace')%0A return self._temp_dir%0A%0A def __exit__(self, *_):%0A shutil.rmtree(self._temp_dir, ignore_e...
2b2ace4723c7fec68866ce2f74a85a94e5dd6ad3
Change expiration test times a little bit to pass under valgrind.
test/integration/expiration.py
test/integration/expiration.py
#!/usr/bin/python from test_common import * import time def test_function(opts, mc): print "Testing set with expiration" if mc.set("a", "aaa", time=5) == 0: raise ValueError, "Set failed" print "Make sure we can get the element back after short sleep" time.sleep(3) if mc.get("a") != "aaa"...
Python
0
@@ -287,9 +287,9 @@ eep( -3 +1 )%0A @@ -478,9 +478,9 @@ eep( -2 +4 )%0A
3bb7769c405e02fc1078252cafbbd982913fe50c
remove unused variable
youtube_dl/extractor/wat.py
youtube_dl/extractor/wat.py
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( unified_strdate, HEADRequest, int_or_none, ) class WatIE(InfoExtractor): _VALID_URL = r'(?:wat:|https?://(?:www\.)?wat\.tv/video/.*-)(?P<id>[0-9a-z]+)' I...
Python
0.000004
@@ -1488,186 +1488,8 @@ %5D%0A%0A - _FORMATS = (%0A (200, 416, 234),%0A (400, 480, 270),%0A (600, 640, 360),%0A (1200, 640, 360),%0A (1800, 960, 540),%0A (2500, 1280, 720),%0A )%0A%0A
4feb11086c85ce9b70f59240da638351321ce013
Fix PEP8
child_sync_typo3/wizard/child_depart_wizard.py
child_sync_typo3/wizard/child_depart_wizard.py
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __open...
Python
0.000294
@@ -807,28 +807,16 @@ ypo3()%0D%0A - %0D%0A @@ -874,24 +874,16 @@ epart(%0D%0A -
1b2b2fd7bc85137f27ee1438ce45b45b56fdc359
use np.bool as dtype instead of bool
tools/get_texture.py
tools/get_texture.py
#!/usr/bin/env python2 """Calculate texture properties for a masked area.""" from __future__ import absolute_import, division, print_function import argparse from collections import defaultdict import numpy as np import dwi.files import dwi.mask import dwi.standardize import dwi.texture import dwi.util def parse_...
Python
0.000487
@@ -3270,16 +3270,19 @@ , dtype= +np. bool))%0A
1d35ae0a687ccc62a8e2b1c544b5fc96d95fdece
follows output format
test/ostream/test_localfile.py
test/ostream/test_localfile.py
# -*- coding: utf-8 -*- import nose.tools as ns import os from os.path import join from tempfile import gettempdir from relshell.record import Record from relshell.recorddef import RecordDef from relshell.batch import Batch from shellstreaming.core.batch_queue import BatchQueue from shellstreaming.ostream.localfile imp...
Python
0.998621
@@ -395,24 +395,26 @@ ile.txt')%0A%0A%0A +# def teardown @@ -413,24 +413,26 @@ teardown():%0A +# os.remov @@ -713,16 +713,37 @@ ST_FILE, + output_format='csv', input_q @@ -854,57 +854,25 @@ %0A''' -(%0A (%22111%22, )%0A (%22222%22, )%0A)%0A(%0A (%22333%22, )%0A) +%22111%22%0A%22222%22%0A%22333%22...
6b160fc9779456b478c309e67df6e29f04fb248e
Fix opensource build by adding enable_rta to integration_test.bzl
transpiler/javatests/com/google/j2cl/transpiler/integration/integration_test.bzl
transpiler/javatests/com/google/j2cl/transpiler/integration/integration_test.bzl
"""integration_test build macro A build macro that turns Java files into optimized and unoptimized test targets. The set of Java files must have a Main class with a main() function. Example usage: # Creates targets # blaze test :compiled_test # blaze test :uncompiled_test integration_test( name = "foobar", ...
Python
0
@@ -823,32 +823,59 @@ le_gwt = False,%0A + enable_rta = True,%0A enable_b
ea41200780237be03843d6c8f305a4df0ae395a5
Switch to using MiddlewareMixin for Django 1.10
zesty_metrics/middleware.py
zesty_metrics/middleware.py
# -*- coding: utf-8 -*- import time import threading import logging from uuid import uuid1 from hashlib import md5 from django.core.cache import cache from django.db import IntegrityError from user_agents import parse as parse_ua import statsd from . import models from . import conf logger = logging.getLogger('metr...
Python
0
@@ -181,16 +181,69 @@ ityError +%0Afrom django.utils.deprecation import MiddlewareMixin %0A%0Afrom u @@ -1221,22 +1221,31 @@ dleware( -object +MiddlewareMixin ):%0A %22