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
da26428a6f7adf58e7cfed8ece61fc42ed76345e
Remove commented out code. pep8/pyflakes
src/recore/amqp.py
src/recore/amqp.py
# -*- coding: utf-8 -*- # Copyright Β© 2014 SEE AUTHORS FILE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # #...
Python
0.000071
@@ -772,25 +772,8 @@ fsm%0A -import threading%0A %0A%0AMQ @@ -1135,55 +1135,9 @@ ds)%0A - out.debug('Attemtping to open channel...') %0A + @@ -1243,24 +1243,109 @@ EXCHANGE'%5D)%0A + out.debug('Attemtping to open channel with connect string: %25s' %25 connect_string)%0A recore.a @@ -1514,16 +1514,...
af06b3ec3594564ba4f822760f3b436dd7fa0b73
drop _ScanIterPairs helper
aioredis/util.py
aioredis/util.py
from urllib.parse import urlparse, parse_qsl from .log import logger _NOTSET = object() # NOTE: never put here anything else; # just this basic types _converters = { bytes: lambda val: val, bytearray: lambda val: val, str: lambda val: val.encode('utf-8'), int: lambda val: str(val).encode('utf-...
Python
0
@@ -2126,20 +2126,16 @@ %0Aclass _ -Base ScanIter @@ -2136,16 +2136,17 @@ anIter:%0A +%0A __sl @@ -2335,42 +2335,8 @@ lf%0A%0A -%0Aclass _ScanIter(_BaseScanIter):%0A%0A @@ -2397,32 +2397,32 @@ and self._cur:%0A + self @@ -2635,395 +2635,8 @@ t%0A%0A%0A -class _ScanIterPairs(_BaseScanIter)...
c7feaaf8bdec70c9c5eda402eedb411c5976abfd
Fix a typo. Cut some unnecessary output.
src/count/countGoodKeysByTarget.py
src/count/countGoodKeysByTarget.py
"""Given a SEQ(Text, Text) input file to use as an RDD, where the value field is supposed to be a dictionary in JSON, count the number of occurances of each unique key in the set of dictionaries, for each publisher. Print the resulting map (key => count), sorted by key.""" import argparse import json import sys from ...
Python
0.003516
@@ -4618,17 +4618,17 @@ rint %22no -C +D omainNam @@ -4721,32 +4721,59 @@ ionsCount.value%0A + if not args.byUrl:%0A print %22noTit @@ -4799,32 +4799,36 @@ itleCount.value%0A + print %22noTit @@ -4868,32 +4868,36 @@ ribsCount.value%0A + print %22noTit
cb3b30ee147938380930ecb81f2160b311dcad8c
Check index data size
karabo_data/validation.py
karabo_data/validation.py
from argparse import ArgumentParser from functools import partial from glob import glob import h5py import numpy as np import os import sys from .reader import DataCollection, H5File, FileAccess class ValidationError(Exception): def __init__(self, problems): self.problems = problems def __str__(self...
Python
0.000001
@@ -3039,31 +3039,889 @@ ile. -_read_index(src, group) +get_index(src, group)%0A%0A if (first.ndim != 1) or (count.ndim != 1):%0A record(%0A %22Index first / count are not 1D%22,%0A first_shape=first.shape,%0A count_...
ce2cf07d9fa9dc3bdd229b1cbb56745784e3049d
Fix stray char.
law/sandbox/docker.py
law/sandbox/docker.py
# -*- coding: utf-8 -*- """ Docker sandbox implementation. """ __all__ = ["DockerSandbox"] from law.sandbox.base import Sandbox class DockerSandbox(Sandbox): sandbox_type = "docker" @property def image(self): return self.name def cmd(self, task, task_cmd): # get args for the do...
Python
0
@@ -412,17 +412,16 @@ %22--rm%22%5D) -: %0A
33d817f78c1b4a1ce18247020caa8d5144f38210
modify score in annotation.qc.uniq() to include gene length
annotation/qc.py
annotation/qc.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Run quality control (QC) on gene annotation. MAKER output was used during testing. Several aspects of annotation QC are implemented in this script. - Trim UTRs. MAKER sometimes predict UTRs that extend into other genes. - Remove overlapping models. """ import sys fr...
Python
0.000001
@@ -454,16 +454,53 @@ st_open%0A +from jcvi.formats.sizes import Sizes%0A from jcv @@ -869,24 +869,33 @@ uniq gffile + cdsfasta %0A%0A Remove @@ -1270,18 +1270,76 @@ est -EAD score. +combined score. Score is defined by:%0A%0A score = (1 - AED) * length %0A @@ -1447,33 +1447,33 @@ if len(args) != -1 +...
699085edd1db5aa7a827a16ffffcbcc9a69cbf52
Add forgotten imports for bucketlist endpoints
app/endpoints.py
app/endpoints.py
from flask import request, Blueprint from flask_restful import Api from controllers.accounts_manager import LoginResource, RegisterResource from controllers.bucketlist import GetAllBucketLists, GetBucketList from controllers.bucketlist_items import BucketListItems bucketlist_blueprint = Blueprint('bucket_list', __na...
Python
0
@@ -173,14 +173,8 @@ ort -GetAll Buck @@ -184,13 +184,18 @@ ists -, Get +Resource, Buck @@ -200,16 +200,24 @@ cketList +Resource %0Afrom co
6908060af5b872e54d42f63e580591931b7ff230
Check empty string
museum_site/scroll.py
museum_site/scroll.py
from django.db import models class Scroll(models.Model): # Constants SCROLL_TOP = """``` β•žβ•€β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•€β•‘ β”‚ Scroll ### β”‚ β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•‘ β”‚ β€’ β€’ β€’ β€’ β€’ β€’ β€’ β€’ β€’β”‚""" SCROLL_BOTTOM = ...
Python
0.026724
@@ -1324,16 +1324,25 @@ if +line and line%5B0%5D
43a348865dcc21e9d88ebf05fd794fed2b7b350c
Update suite
mx.irbuilder/suite.py
mx.irbuilder/suite.py
suite = { "mxversion" : "5.70.2", "name" : "java-llvm-ir-builder", "versionConflictResolution" : "latest", "imports" : { "suites" : [ { "name" : "sulong", "version" : "38a5bad302f48d676f15a0b3fd9b02f6f3a8abdd", "urls" : [ ...
Python
0.000001
@@ -234,48 +234,48 @@ : %22 -38a5bad302f48d676f15a0b3fd9b02f6f3a8abdd +f25a652b20e9c2c7d99fbd3844b64a44da5547a6 %22,%0A
e00b7c612f34c938a3d42dada006874ffea021c8
complete localizer
app/localizer.py
app/localizer.py
# -*- coding: utf-8 -*- """ localizer localize bounding boxes and pad rest of image with zeros (255, 255, 255) """ import os import cv2 import numpy as np from app.cv.serializer import deserialize_json from app.settings import CV_SAMPLE_PATH, BOUNDINGBOX test_image = CV_SAMPLE_PATH + 'pos/img_00003.jpg' class Loca...
Python
0.000001
@@ -153,226 +153,329 @@ np%0A -%0Afrom app.cv.serializer import deserialize_json%0Afrom app.settings import CV_SAMPLE_PATH, BOUNDINGBOX%0A%0Atest_image = CV_SAMPLE_PATH + 'pos/img_00003.jpg'%0A%0A%0Aclass Localizer(object):%0A%0A def __init__(self, path_to_image): +import multiprocessing as mp%0A%0Afrom app.pipeli...
73b9246164994049d291d5b482d4dbf2ca41a124
Rename master branch to main
tests/app/test_accessibility_statement.py
tests/app/test_accessibility_statement.py
import re import subprocess from datetime import datetime def test_last_review_date(): statement_file_path = "app/templates/views/accessibility_statement.html" # test local changes against master for a full diff of what will be merged statement_diff = subprocess.run( [f"git diff --exit-code origi...
Python
0.999013
@@ -195,20 +195,18 @@ ainst ma -ster +in for a f @@ -319,12 +319,10 @@ n/ma -ster +in --
bb3208c3a60de65a7288e494e718e340b55ad27c
Update bad path test
tests/commands/load/test_load_case_cmd.py
tests/commands/load/test_load_case_cmd.py
# -*- coding: utf-8 -*- import os import tempfile import pytest from scout.commands import cli from scout.demo import load_path, ped_path from scout.parse import case from scout.server.extensions import store def test_load_case_no_yaml_no_ped(mock_app, institute_obj): """Test loading a case into scout without a...
Python
0.000001
@@ -6592,26 +6592,20 @@ t %22E -xception: bad path +rror opening %22 in
561bf654507ab0ed3176fb4bc1b9e0976ff7c72a
Make whitespace flake8 compliant
tests/integration/long/test_large_data.py
tests/integration/long/test_large_data.py
import Queue from struct import pack import unittest import cassandra from cassandra import ConsistencyLevel from cassandra.cluster import Cluster from cassandra.decoder import dict_factory from cassandra.query import SimpleStatement from tests.integration.long.utils import create_schema # Converts an integer to an...
Python
0.00578
@@ -4319,19 +4319,16 @@ )%5D, i)%0A%0A -%0A%0A%0A def @@ -4653,33 +4653,32 @@ ion, table, 0)%0A%0A -%0A def test_wid @@ -5013,33 +5013,32 @@ ion, table, 0)%0A%0A -%0A def test_wid @@ -5727,17 +5727,16 @@ le, 0)%0A%0A -%0A def
5f5bdcf5c6b6fb70dc94945d463c5200a46699d6
revert unfinished task test
tests/integration/unfinished_task_test.py
tests/integration/unfinished_task_test.py
# third party import pytest # syft absolute import syft as sy from syft.core.node.common.action.save_object_action import SaveObjectAction from syft.core.store.storeable_object import StorableObject @pytest.mark.general def test_unfinished_task(get_clients) -> None: print("running test_unfinished_task") clie...
Python
0.000167
@@ -1,8 +1,30 @@ +# stdlib%0Aimport time%0A%0A # third @@ -472,46 +472,20 @@ -int_pointer.block_with_timeout(secs=10 +time.sleep(5 )%0A @@ -798,47 +798,20 @@ -list_pointer.block_with_timeout(secs=10 +time.sleep(5 )%0A
da3a4e8036a5933a9ce00f42795c8ca398925c38
Update geogig_init_repo.py
lib/rogue/geogig_init_repo.py
lib/rogue/geogig_init_repo.py
from base64 import b64encode from optparse import make_option import json import urllib import urllib2 import argparse import time import os import subprocess #==# import _geogig_init_repo #==# parser = argparse.ArgumentParser(description='Initialize GeoGig repository and optionally add to GeoServer instance. If you w...
Python
0.000001
@@ -585,17 +585,24 @@ rgument( -%22 +'-gs', ' --geoser @@ -604,17 +604,17 @@ eoserver -%22 +' , help=%22 @@ -693,17 +693,24 @@ rgument( -%22 +'-ws', ' --worksp @@ -712,17 +712,17 @@ orkspace -%22 +' , help=%22
64cbe20e2a415d4ee294862acc02a6a7682d7af3
Isolate memcache test from network
tests/nydus/db/backends/memcache/tests.py
tests/nydus/db/backends/memcache/tests.py
from __future__ import absolute_import from tests import BaseTest from nydus.db import create_cluster from nydus.db.base import BaseCluster from nydus.db.backends.memcache import Memcache import mock import pylibmc class MemcacheTest(BaseTest): def setUp(self): self.memcache = Memcache(num=0) de...
Python
0.000001
@@ -846,24 +846,62 @@ iors=None)%0A%0A + @mock.patch('pylibmc.Client.get')%0A def test @@ -914,24 +914,29 @@ cluster(self +, get ):%0A p @@ -988,65 +988,166 @@ -self.assertEquals(p.get('MemcacheTest_with_cluster'), Non +result = p.get('MemcacheTest_with_cluster')%0A get.assert_called_once...
a19a52a42486eaa8e849d2f0a175f9a76497029d
bump version number
intercom/__init__.py
intercom/__init__.py
__version__ = "0.0.6"
Python
0.000004
@@ -16,6 +16,7 @@ 0.0. -6%22 +7%22%0A
4324418262824f59e9b38dc01673f694d434f7d4
add check
lesscpy/plib/call.py
lesscpy/plib/call.py
""" """ import re from urllib.parse import quote as urlquote from .node import Node import lesscpy.lessc.utility as utility import lesscpy.lessc.color as Color class Call(Node): def parse(self, scope): name = ''.join(self.tokens.pop(0)) parsed = self.process(self.tokens, scope) if name == '...
Python
0
@@ -196,24 +196,56 @@ lf, scope):%0A + if not self.parsed:%0A name @@ -275,16 +275,20 @@ pop(0))%0A + @@ -333,24 +333,28 @@ pe)%0A + + if name == ' @@ -358,16 +358,20 @@ = '%25(':%0A + @@ -391,16 +391,20 @@ format'%0A + @@ -425,32 +425,36 @...
53a6446064fc055313e2377773242773f3c75870
Remove worthless logging
investor/Investor.py
investor/Investor.py
#!/usr/bin/env python3 import datetime import json import requests import logging import time # investor imports from investor import LoanFilter from investor import Loan class Investor: 'A simple class to interact with your LendingClub account' def __init__(self, iid, authKey, investAmt=25, productionMode=False...
Python
0.000001
@@ -2330,103 +2330,8 @@ ds %5D -%0A%09%09if num_loans != len(loans):%0A%09%09%09self.logger.info('Filtering out loan(s) already invested in') %0A%0A%09%09
b4abd0045178f3368fb1ddc0ba5b96094c933c22
Verify domain exists before scanning
musubi/scan.py
musubi/scan.py
""" Scan multiple DNSBLs for IP addresss or domain. Copyright (c) 2012, Rob Cakebread All rights reserved. If you give the domain, musubi will try to find all your IP addresses for each mail server by querying MX DNS records and then doing a lookup for the IPs. If your mail server uses round-robin DNS, this of cou...
Python
0
@@ -646,16 +646,31 @@ net_calc +, verify_domain %0A%0Areques @@ -2677,16 +2677,59 @@ eError:%0A + if verify_domain(arg):%0A @@ -2758,24 +2758,28 @@ _hosts(arg)%0A + @@ -2812,16 +2812,112 @@ (hosts)%0A + else:%0A raise RuntimeError('Ca...
17ef07228722df5c15d48dc799074e1b0136831d
fix dict.has_key usage for python3
myhdl/_enum.py
myhdl/_enum.py
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2008 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by t...
Python
0.000009
@@ -2010,24 +2010,32 @@ if +name in codedict .has_key @@ -2030,22 +2030,8 @@ dict -.has_key(name) :%0A
d23a53f5c97a3939952ecb8f39d24603fe0d4bab
bump `datadog-checks-base` version (#9718)
mysql/setup.py
mysql/setup.py
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from codecs import open from os import path from setuptools import setup HERE = path.abspath(path.dirname(__file__)) # Get version info ABOUT = {} with open(path.join(HERE, "datadog_checks", "mysql", "_...
Python
0
@@ -756,17 +756,17 @@ ase%3E=20. -1 +2 .0'%0A%0Aset
1ecf42f474b17e01de12d235a29b08e7f18d0726
bump version to v1.10.3
ndd/package.py
ndd/package.py
# -*- coding: utf-8 -*- """Template package file""" __title__ = 'ndd' __version__ = '1.10.2' __author__ = 'Simone Marsili' __summary__ = '' __url__ = 'https://github.com/simomarsili/ndd' __email__ = 'simo.marsili@gmail.com' __license__ = 'BSD 3-Clause' __copyright__ = 'Copyright (c) 2020, Simone Marsili' __classifiers_...
Python
0
@@ -83,17 +83,17 @@ = '1.10. -2 +3 '%0A__auth
527ccd5790aa08d33387b43fd25beb2ed20335c7
remove defaults, use self.asserts
tensorflow/python/ops/script_ops_test.py
tensorflow/python/ops/script_ops_test.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000028
@@ -2216,36 +2216,16 @@ nstant(1 -, dtype=dtypes.int32 ),%0A @@ -2247,36 +2247,16 @@ nstant(2 -, dtype=dtypes.int32 ),%0A ) @@ -2252,39 +2252,49 @@ t(2),%0A )%0A +self. assert - +Equal( call_count == 1 @@ -2291,13 +2291,12 @@ ount - == +, 1 +) # @@ -2588,36 +2588,16 @@ nstant(3 -, dtype=...
10f0807b9ab85bfa6f6bbb4ed533e1a8af642571
fix bug in raw service
lib/svtplay_dl/service/raw.py
lib/svtplay_dl/service/raw.py
from __future__ import absolute_import import os import re from svtplay_dl.service import Service from svtplay_dl.fetcher.hds import hdsparse from svtplay_dl.fetcher.hls import hlsparse from svtplay_dl.fetcher.dash import dashparse class Raw(Service): def get(self): if self.exclude(): return ...
Python
0
@@ -1317,16 +1317,43 @@ treams:%0A + if stream:%0A @@ -1386,16 +1386,20 @@ eys()):%0A +
905c6d82c0b568788cd755cb5a98b0e24550f9a5
test .to() method on particle collection
streams/nbody/tests/test_particles.py
streams/nbody/tests/test_particles.py
# coding: utf-8 """ """ from __future__ import absolute_import, unicode_literals, division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys # Third-party import astropy.units as u import numpy as np import pytest from ...misc.units import UnitSystem from ..particles i...
Python
0
@@ -2123,12 +2123,444 @@ pe == (20,3) +%0A%0Adef test_to():%0A r = np.random.random(size=(10,3))*u.kpc%0A v = np.random.random(size=(10,3))*u.kpc/u.Myr%0A m = np.random.random(10)*u.M_sun%0A %0A pc = ParticleCollection(r=r, v=v, m=m, unit_system=usys)%0A %0A usys2 = UnitSystem(u.km, u.s, u.kg) ...
6a2aa6051c7922d1b2b37824d92634a4880e9ff2
Correct semantic version format.
tensorflow_probability/python/version.py
tensorflow_probability/python/version.py
# Copyright 2018 The TensorFlow Probability 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 o...
Python
0.00053
@@ -1235,17 +1235,17 @@ , '0.4.0 -. +- dev'%0A__v @@ -1268,19 +1268,8 @@ oin( -s for s in %5B%0A @@ -1326,19 +1326,21 @@ ERSION,%0A - +%5D)%0Aif _VERSIO @@ -1351,68 +1351,67 @@ FFIX -,%0A%5D if s) # Prevent trailing dot when version suffix is empty. +:%0A __version__ = '%7B%7D-%7B%7D'.format(__version__...
82665b999fb07e3ebc41de8132ba9d22dc04140c
Change version number back to 0.8.0.dev
neo/version.py
neo/version.py
# -*- coding: utf-8 -*- version = '0.7.1'
Python
0.000001
@@ -34,9 +34,13 @@ '0. -7.1 +8.0.dev '%0A
a42ae6f2c761809813b9851bc1e449e3dac685ba
Remove mongo _id from resource.
superdesk/items.py
superdesk/items.py
from datetime import datetime from flask import request, url_for from . import mongo from . import rest from .auth import auth_required from .utils import get_random_string from .io.reuters_token import ReutersTokenProvider tokenProvider = ReutersTokenProvider() class ItemConflictException(Exception): pass def...
Python
0
@@ -333,16 +333,42 @@ (item):%0A + item.pop('_id', None)%0A item @@ -1127,34 +1127,8 @@ d):%0A - data.pop('_id', None)%0A @@ -2245,23 +2245,21 @@ ).sort(' -version +first Created'
d1cc7c4cc0122c3f1d3e21941ad0726b30718b25
use num
test/functional/feature_llmqdkgerrors.py
test/functional/feature_llmqdkgerrors.py
#!/usr/bin/env python3 # Copyright (c) 2015-2020 The Dash Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import DashTestFramework ''' llmq-dkgerrors.py Simulate and check DKG e...
Python
0.00001
@@ -957,36 +957,33 @@ ribution-omit', -True +1 )%0A qh = s @@ -1233,37 +1233,33 @@ ribution-omit', -False +0 )%0A self.m @@ -1306,36 +1306,33 @@ tribution-lie', -True +1 )%0A qh = s @@ -1622,36 +1622,33 @@ 'justify-omit', -True +1 )%0A qh = s @@ -2005,37 +2005,33 @@ 'justify-omi...
b3761729b156367229b5cd8895d225cb13d3267a
Fix example `Set-Based Column Map Expectation` template import (#6134)
examples/expectations/set_based_column_map_expectation_template.py
examples/expectations/set_based_column_map_expectation_template.py
""" This is a template for creating custom SetBasedColumnMapExpectations. For detailed instructions on how to use it, please see: https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_set_based_column_map_expectations """ from great_expectations.expectations.r...
Python
0
@@ -312,21 +312,19 @@ tations. -regex +set _based_c
bfc291e36abc95683a6483f8bb5ff0a2c6465631
Add missing "cpp" fragment to `swift_module_alias`.
swift/internal/swift_module_alias.bzl
swift/internal/swift_module_alias.bzl
# Copyright 2018 The Bazel 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 la...
Python
0.00031
@@ -7042,24 +7042,49 @@ Swift.%0A%22%22%22,%0A + fragments = %5B%22cpp%22%5D,%0A implemen
407bb78c34b769f8d993853761234c60e1fbeabd
Update util.py
tabpy-server/tabpy_server/app/util.py
tabpy-server/tabpy_server/app/util.py
import csv import logging import os from datetime import datetime from OpenSSL import crypto logger = logging.getLogger(__name__) def log_and_raise(msg, exception_type): ''' Log the message and raise an exception of specified type ''' logger.fatal(msg) raise exception_type(msg) def validate_ce...
Python
0.000001
@@ -2895,28 +2895,16 @@ lse, %7B%7D%0A - %0A log
99e9ef79178d6e2dffd8ec7ed12b3edbd8b7d0f1
Add basket total to context
longclaw/longclawbasket/views.py
longclaw/longclawbasket/views.py
from django.shortcuts import render from django.views.generic import ListView from longclaw.longclawbasket.models import BasketItem from longclaw.longclawbasket import utils class BasketView(ListView): model = BasketItem template_name = "longclawbasket/basket.html" def get_context_data(self, **kwargs): ...
Python
0.99994
@@ -378,29 +378,115 @@ -return %7B%22basket%22: items +total_price = sum(item.total() for item in items)%0A return %7B%22basket%22: items, %22total_price%22: total_price %7D%0A
1d07732e0fae0dca9eae1d89de913a1e124e32fc
Disable some prod optimisations
lutrisweb/settings/production.py
lutrisweb/settings/production.py
import os from base import * # noqa DEBUG = False MEDIA_URL = '//lutris.net/media/' FILES_ROOT = '/srv/files' ALLOWED_HOSTS = ['.lutris.net', '.lutris.net.', ] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'lutris', 'USER': 'lutris', 'PASS...
Python
0
@@ -390,16 +390,17 @@ +# 'CONN_MA @@ -712,16 +712,18 @@ er',%0A)%0A%0A +# SESSION_
a281790b2ed4d16ab7d7611a9faa6f418f53826e
Create log if it doesn’t exist
swutils.py
swutils.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ swutils ~~~~~~~ Provides methods for interacting with ScraperWiki boxes Examples: Schedule a job:: job = lambda x: 'hello %s' % x exception_handler = ExceptionHandler('reubano@gmail.com').handler run_or_schedule(job, True, exception_...
Python
0
@@ -1815,24 +1815,94 @@ ger(logname) +%0A open(logfile, 'w').close() if not p.exists(logfile) else None %0A%0A def em
59a34073226d317c8d02e60ee13ac1e7a84cb41c
Patch for an Issue #1057
lib/core/bigarray.py
lib/core/bigarray.py
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ try: import cPickle as pickle except: import pickle import os import tempfile from lib.core.exception import SqlmapSystemException from lib.core.settings import BIGARR...
Python
0
@@ -1269,16 +1269,37 @@ s.pop()%0A + try:%0A @@ -1350,32 +1350,36 @@ + self.chunks%5B-1%5D @@ -1396,16 +1396,231 @@ oad(fp)%0A + except IOError, ex:%0A errMsg = %22exception occurred while retrieving data %22%0A errMsg += %22fro...
cd9fc5a6ea8925de67041408d96a63beccf573a2
add docopt
taksman.py
taksman.py
#!/usr/bin/env python import os import errno import re from pprint import pprint def show_by_course(tasks): courses = set(tasks[name].get('course') for name in tasks) courses -= set([None]) courses = sorted(courses) for course in courses: print print "Course: %s" % course cours...
Python
0
@@ -15,16 +15,243 @@ python%0A +%22%22%22 Assignment management tool for school.%0AUsage:%0A taksman.py (-h %7C --help)%0A taksman.py add %3Centry%3E%0A taksman.py course%0A taksman.py date%0A taksman.py debug%0A%0AExamples:%0A taksman.py add 033-reading%0A%0AOptions:%0A -h, --help%0A%22%22%22%0A%0A import o ...
616f2419774136b6cd98bc6dbee31bf39a99acea
add zhihu special spider
DataHouse/zhihu/zhihu_special_spider.py
DataHouse/zhihu/zhihu_special_spider.py
""" a web spider for Zhihu Special """ import random import os import time import logging import requests from pymongo import MongoClient import pandas as pd logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', d...
Python
0
@@ -1678,16 +1678,58 @@ data'%5D:%0A + if _ is not None:%0A @@ -1755,16 +1755,20 @@ item(_)%0A +
362312ad1a26dbecf0c4942c9a6e7042cbaab3bd
Test the rest of Roman masters
test-mm.py
test-mm.py
from psautohint import autohint from psautohint import psautohint def getFonts(masters, baseDir): options = autohint.ACOptions() options.quiet = True fonts = [] infos = [] for master in masters: path = "%s/%s/font.ufo" % (baseDir, master) font = autohint.openUFOFile(path, None, Fal...
Python
0.000002
@@ -1573,27 +1573,77 @@ = %5B%22 -Black%22, %22ExtraLight +Regular%22, %22Light%22, %22ExtraLight%22, %22Medium%22, %22Semibold%22, %22Bold%22, %22Black %22%5D%0A
6aa5e2c95c0f529aa2803395779ca7274d5795b1
Bump version to 1.0.1-machtfit-67
src/oscar/__init__.py
src/oscar/__init__.py
import os # Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. VERSION = (1, 0, 1, 'machtfit', 66) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): return '{}.{}.{}-{}-{}'.format(*VERSION) # Cheeky setting that allows each template to be acces...
Python
0
@@ -115,17 +115,17 @@ tfit', 6 -6 +7 )%0A%0A%0Adef
20f705417f9fce36c1c568d1fc2ee1a65373c336
Fix MRPC link (#1247)
tensor2tensor/data_generators/mrpc.py
tensor2tensor/data_generators/mrpc.py
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
Python
0
@@ -1440,16 +1440,24 @@ a%252F -WNLI.zip +mrpc_dev_ids.tsv ?alt @@ -1473,21 +1473,21 @@ ken= -068ad0a0-ded7 +ec5c0836-31d5 -%22%0A @@ -1504,29 +1504,29 @@ %224 -bd7-99a5-5e00222e0faf +8f4-b431-7480817f1adc %22)%0A
d9c2bb2de79db80bc94509cb6a23de7f85e6e899
update tests
tests/test_pecanstreet_dataset_adapter.py
tests/test_pecanstreet_dataset_adapter.py
import sys sys.path.append('../') from disaggregator import PecanStreetDatasetAdapter import unittest class PecanStreetDatasetAdapterTestCase(unittest.TestCase): def setUp(self): db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres" self.psda = PecanStreetDatasetAdapter(db_u...
Python
0.000001
@@ -1414,16 +1414,36 @@ pass%0A%0A +fast = TestSuite()%0A%0A if __nam
e1da85d46f84a35198959881b55196db4e0a67c4
Fix loading of description.yaml
lava_results_app/utils.py
lava_results_app/utils.py
import os import yaml import logging import subprocess from django.utils.translation import ungettext_lazy from django.conf import settings from django.http import Http404 from linaro_django_xmlrpc.models import AuthToken def help_max_length(max_length): return ungettext_lazy( # pylint: disable=no-member ...
Python
0.000155
@@ -753,24 +753,1137 @@ filename%0A%0A%0A +class V2Loader(yaml.Loader):%0A def remove_pipeline_module(self, suffix, node):%0A if 'lava_dispatcher.pipeline' in suffix:%0A suffix = suffix.replace('lava_dispatcher.pipeline', 'lava_dispatcher')%0A return self.construct_python_object(suffix, no...
52ebe157585019c9be01b22638fff924ba328892
Increase delay (to fix tests that are failing randomly on travis but are always passing on my locale machine)
test/test_modes/test_goto_assignments.py
test/test_modes/test_goto_assignments.py
""" Test the autocomplete mode """ from pyqode.core.api import TextHelper from pyqode.qt import QtCore, QtWidgets from pyqode.qt.QtTest import QTest from pyqode.python import modes as pymodes from test.helpers import editor_open def get_mode(editor): return editor.modes.get(pymodes.GoToAssignmentsMode) @editor_...
Python
0
@@ -708,33 +708,33 @@ QTest.qWait( -1 +5 000)%0A assert @@ -1237,33 +1237,33 @@ QTest.qWait( -1 +5 000)%0A assert
93f912b9eb3a17ab24b0a7a67ad2297a7bae6e91
Fix .aar building on Mac
tensorflow/lite/java/aar_with_jni.bzl
tensorflow/lite/java/aar_with_jni.bzl
"""Generate zipped aar file including different variants of .so in jni folder.""" load("@build_bazel_rules_android//android:rules.bzl", "android_binary") def aar_with_jni( name, android_library, headers = None, flatten_headers = False): """Generates an Android AAR given an Android ...
Python
0.000002
@@ -2565,33 +2565,33 @@ cp - -r +R L $$origdir/$(lo @@ -2805,17 +2805,17 @@ cp - -r +R L $$orig
eb5d7f91286779ff0f3b6d7c829967f74ef1db7a
replace managers by plain functions
testbot.py
testbot.py
# -*- coding: utf-8 -*- from bot import Tofbot import unittest from collections import namedtuple def print_resp(msg): print (" -> %s" % msg) class TestTofbot(Tofbot): def __init__(self, nick, name, chan, origin): chans = [chan] self.nick = nick Tofbot.__init__(self, nick, name, ch...
Python
0.000041
@@ -808,259 +808,52 @@ )%0A%0A%0A -class BotAction:%0A def __init__(self, +def bot -, +_ action -):%0A %22%22%22%0A If length=None, just expect one and return it (not a list).%0A %22%22%22%0A self.bot = bot%0A self.action = action%0A self.msgs = %5B%5D%0A%0A def __en...
935754be7aa6efc5b39096edee24c3d987ae32e7
fix #55 : default value issue fixed
myql/contrib/table/binder.py
myql/contrib/table/binder.py
from base import Base, BaseInput, BasePaging from xml.etree import cElementTree as xtree class Binder(Base): """Class describing binders : select, insert, update, delete name : select, insert, update, delete itemPath : dotted path i.e : products.product produces : json or xml urls...
Python
0.000001
@@ -475,9 +475,8 @@ nds= -3 0, u @@ -678,16 +678,51 @@ Seconds) + if pollingFrequencySeconds else '' %0A @@ -1522,16 +1522,28 @@ paging') + and item%5B1%5D :%0A
dca9df0e0a01fb383500bd8e8172263e19a1d453
Fix tests
lcapy/tests/test_super.py
lcapy/tests/test_super.py
from lcapy import * import unittest import sympy as sym class LcapyTester(unittest.TestCase): """Unit tests for lcapy """ def assertEqual2(self, ans1, ans2, comment): try: self.assertEqual(ans1, ans2, comment) except AssertionError as e: ans1.pprint() ...
Python
0.000003
@@ -13,16 +13,122 @@ mport *%0A +from lcapy.phasor import PhasorDomainVoltage%0Afrom lcapy.superposition_voltage import SuperpositionVoltage%0A import u @@ -640,24 +640,30 @@ ltage(Phasor +Domain Voltage(3)). @@ -768,32 +768,38 @@ ltage(2), Phasor +Domain Voltage(3)).is_a @@ -946,16 +946,22 @@ , Phasor +Domain ...
b60ee89e5a0c8d689a08994325210b60e4a7fd23
add Cell properties edit_url, self_url and new_url
src/ekklesia_portal/helper/cell.py
src/ekklesia_portal/helper/cell.py
from __future__ import annotations from webob import Request from typing import Any, Iterable, Dict, Type, ClassVar import case_conversion import inspect import jinja2 from ekklesia_portal.helper.utils import cached_property from markupsafe import Markup _cell_registry: Dict[Any, Cell] = {} def find_cell_by_model_i...
Python
0
@@ -5704,16 +5704,305 @@ model)%0A%0A + @cached_property%0A def self_url(self) -%3E str:%0A return self.link(self._model)%0A%0A @cached_property%0A def edit_url(self) -%3E str:%0A return self.link(self._model, '+edit')%0A%0A @cached_property%0A def new_url(self) -%3E str:%0A retu...
48e280177123902001e4ff6fb3e178190b435054
fix test for Exscript.workqueue.MainLoop.
tests/Exscript/workqueue/MainLoopTest.py
tests/Exscript/workqueue/MainLoopTest.py
import sys, unittest, re, os.path, threading sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src')) from Exscript.workqueue import MainLoop class MainLoopTest(unittest.TestCase): CORRELATE = MainLoop def setUp(self): pass def testMainLoop(self): lock = threa...
Python
0
@@ -163,16 +163,62 @@ MainLoop +%0Afrom Exscript.workqueue.Job import ProcessJob %0A%0Aclass @@ -444,16 +444,26 @@ ainLoop( +ProcessJob )%0A
f62c53af583657ee13d220edbb25803bbc3c9c22
Fix style
tests/cupy_tests/core_tests/test_core.py
tests/cupy_tests/core_tests/test_core.py
import unittest import numpy import cupy from cupy.core import core class TestGetSize(unittest.TestCase): def test_none(self): self.assertEqual(core.get_size(None), ()) def test_list(self): self.assertEqual(core.get_size([1, 2]), (1, 2)) def test_tuple(self): self.assertEqual(...
Python
0.000001
@@ -2603,16 +2603,17 @@ rray((2, + 3), dtyp
523216bbf6f21757651e41ac307bc296041b7963
load nonlinux_config if the platform is not linux
tests/docker/test_async_docker_client.py
tests/docker/test_async_docker_client.py
import os import warnings from tornado.testing import AsyncTestCase, gen_test from remoteappmanager.docker.async_docker_client import AsyncDockerClient from tests.docker.config import nonlinux_config from tests import utils class TestAsyncDockerClient(AsyncTestCase): def setUp(self): super().setUp() ...
Python
0.000477
@@ -3,16 +3,27 @@ port os%0A +import sys%0A import w @@ -1325,16 +1325,17 @@ = None%0A +%0A @@ -1368,16 +1368,44 @@ .environ + and sys.platform != 'linux' :%0A
6bec22cd51288c94dff40cf0c973b975538040d5
Increase timeout for test_long_running_job test
tests/integration/minion/test_timeout.py
tests/integration/minion/test_timeout.py
# -*- coding: utf-8 -*- ''' Tests for various minion timeouts ''' # Import Python libs from __future__ import absolute_import import os import sys import salt.utils.platform # Import Salt Testing libs from tests.support.case import ShellCase class MinionTimeoutTestCase(ShellCase): ''' Test minion timing fu...
Python
0.000008
@@ -822,10 +822,10 @@ out= -45 +90 ,%0A
d03c3ed9212fc341964295ff167c512daecbb8bb
Improve auto_send validation
sbc_email/models/correspondence.py
sbc_email/models/correspondence.py
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Roman Zoller, Emanuel Cino, Michael Sandoz # # The licence is in the file __ope...
Python
0.000001
@@ -4800,72 +4800,52 @@ -# If sponsor does not need translation, valid is True by default +partner_langs = self.supporter_languages_ids %0A @@ -4862,35 +4862,20 @@ n = -self.suppo +pa rt +n er_lang -uages_id s & @@ -4923,16 +4923,79 @@ common:%0A + types = self.communication_type_ids.mapped(...
0bb2ebc52e720a3d693ca14f3621fd710ea36d4b
use make_result_iq
tests/twisted/vcard/test-avatar-async.py
tests/twisted/vcard/test-avatar-async.py
""" Test support for retrieving avatars asynchronously using RequestAvatars. """ import base64 import hashlib from servicetest import EventPattern from gabbletest import exec_test, acknowledge_iq def test(q, bus, conn, stream): conn.Connect() _, iq_event = q.expect_many( EventPattern('dbus-signal', ...
Python
0.000003
@@ -191,16 +191,32 @@ ledge_iq +, make_result_iq %0A%0Adef te @@ -725,16 +725,39 @@ iq = + make_result_iq(stream, iq_even @@ -764,16 +764,17 @@ t.stanza +) %0A vca @@ -784,20 +784,28 @@ = iq -_event.query +.firstChildElement() %0A @@ -959,34 +959,8 @@ '))%0A - iq%5B'type'%5D = 'result'%0A
cf4d8318557d971cee1869fe8cbac82cc6316020
Change expected exception
plotly/tests/test_core/test_file/test_file.py
plotly/tests/test_core/test_file/test_file.py
""" test_meta: ========== A module intended for use with Nose. """ import random import string import requests from unittest import TestCase from nose.plugins.attrib import attr import plotly.plotly as py from plotly.exceptions import PlotlyRequestError @attr('slow') class FolderAPITestCase(TestCase): def se...
Python
0.000002
@@ -1470,44 +1470,26 @@ ept -requests.exceptions.RequestException +PlotlyRequestError as @@ -1532,17 +1532,8 @@ = e. -response. stat
80c5f67f483ad24308c3a348b1c5a82780459c6b
Modify cql_sac_benchmark to use rlds data.
tf_agents/benchmark/cql_sac_benchmark.py
tf_agents/benchmark/cql_sac_benchmark.py
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Python
0.00147
@@ -969,164 +969,8 @@ al%0A%0A -# TODO(b/205172779): Data needs moved to a team based URL.%0A# LINT.IfChange%0ATRANSITIONS_DIR_NAME = 'transitions'%0A# LINT.ThenChange(tf_agents/copy.bara.sky)%0A%0A %0Acla @@ -1515,83 +1515,8 @@ %22%22%22%0A - self.root_data_dir = os.path.join(root_data_dir, TRANSITIONS_DIR_NAME)...
8ea43f44d6bca215909f6a3435b89f596442a863
add get_permission_object to PollExportView, fixes #3700
meinberlin/apps/polls/exports.py
meinberlin/apps/polls/exports.py
from django.utils.translation import ugettext as _ from rules.contrib.views import PermissionRequiredMixin from adhocracy4.comments.models import Comment from adhocracy4.exports import mixins from adhocracy4.exports import views as export_views from adhocracy4.polls import models as poll_models from meinberlin.apps.us...
Python
0
@@ -1510,32 +1510,105 @@ hange_project'%0A%0A + def get_permission_object(self):%0A return self.module.project%0A%0A def get_quer
6cfc94d8a03439c55808090aa5e3a4f35c288887
Use assert_allclose so we can see the appveyor failure
menpodetect/tests/opencv_test.py
menpodetect/tests/opencv_test.py
from menpodetect.opencv import (load_opencv_frontal_face_detector, load_opencv_eye_detector) import menpo.io as mio takeo = mio.import_builtin_asset.takeo_ppm() def test_frontal_face_detector(): takeo_copy = takeo.copy() opencv_detector = load_opencv_frontal_face_detector() ...
Python
0
@@ -1,8 +1,50 @@ +from numpy.testing import assert_allclose%0A from men @@ -944,33 +944,42 @@ )%0A assert - +_allclose( len(pcs) == 1%0A as @@ -958,37 +958,37 @@ llclose(len(pcs) +, -== 1 +) %0A assert take
b8d0a7cbac6ab2415a1d059a1f68428e9312f3cb
Make our error page handlers work on Django 2.0 (#969)
judge/views/error.py
judge/views/error.py
import traceback from django.shortcuts import render from django.utils.translation import gettext as _ def error(request, context, status): return render(request, 'error.html', context=context, status=status) def error404(request): # TODO: "panic: go back" return render(request, 'generic-message.html',...
Python
0
@@ -227,24 +227,40 @@ r404(request +, exception=None ):%0A # TOD @@ -462,32 +462,48 @@ error403(request +, exception=None ):%0A return er
4e92dabe65416a3a751a0b38e75512b6daa1ba38
Remove useless imports
ticketshop/ticketapp/tests/test_views.py
ticketshop/ticketapp/tests/test_views.py
from django.test import Client from django.contrib.auth.models import User from django.contrib.messages.storage.base import Message from django.contrib.messages.constants import ERROR from django.test import TestCase from ..models import TicketType, Ticket, TicketPurchase, Coupon class TicketPurchaseViewTest(TestCase...
Python
0.000007
@@ -71,117 +71,8 @@ User -%0Afrom django.contrib.messages.storage.base import Message%0Afrom django.contrib.messages.constants import ERROR %0A%0Afr @@ -145,32 +145,16 @@ cket -, TicketPurchase, Coupon +Purchase %0A%0Acl
bec1d224771daefd9ce18c81b14f550e59b1577a
DidelEntity.__getattr__ raises the correct exception
didel/base.py
didel/base.py
# -*- coding: UTF-8 -*- try: from urlparse import urljoin except ImportError: # Python 3 from urllib.parse import urljoin from bs4 import BeautifulSoup ROOT_URL = 'http://didel.script.univ-paris-diderot.fr' class DidelError(Exception): """ Base exception for Didel errors """ pass class D...
Python
0.195904
@@ -2597,11 +2597,16 @@ ise -Typ +Attribut eErr
d65bc5b70dfa381f650dc4c1e136680b8f6c9649
Improve documentation in example
kafka/transaction.py
kafka/transaction.py
""" Transactional commit and rollback semantics for consumer. """ from logging import getLogger from kafka.common import check_error, OffsetCommitRequest, OffsetOutOfRangeError class KafkaTransaction(object): """ Provides transactional commit/rollback semantics around a `SimpleConsumer`. Usage assumes t...
Python
0.000002
@@ -758,16 +758,60 @@ n_info() +%0A consumer.fetch_last_known_offsets() %0A%0A @@ -1062,14 +1062,8 @@ sage -.value ):%0A
2b383dd8d4a00b5f355d83cd0cb2e142e312d754
fix drop database function
dbaas/drivers/mysqldb.py
dbaas/drivers/mysqldb.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import logging import _mysql as mysqldb import _mysql_exceptions from contextlib import contextmanager from . import BaseDriver, DatabaseInfraStatus, AuthenticationError, ConnectionError, GenericDriverError, \ DatabaseAlreadyExists, Cr...
Python
0
@@ -369,16 +369,38 @@ seStatus +, DatabaseDoesNotExist %0Afrom ut @@ -515,16 +515,41 @@ = 1007%0A +ER_DB_DROP_EXISTS = 1008%0A ER_ACCES @@ -580,49 +580,49 @@ _CAN -_ NOT_ -CONNECT = 2003 +USER = 1396 %0AER_CAN +_ NOT_ -USER = 1396 +CONNECT = 2003 %0A%0A%0Ac @@ -5721,170 +5721,100 @@ -print %22@@@@@@@@@@...
ac0a9cec36925f630735f5109e5507923ddd0067
Remove stray debug print
openprescribing/dmd/management/commands/import_ncso_concessions.py
openprescribing/dmd/management/commands/import_ncso_concessions.py
# coding=utf8 import io import re from backports import csv from django.core.management import BaseCommand from dmd.models import NCSOConcession, DMDVmpp def convert_ncso_name(name): # Some NCSO records have non-breaking spaces name = name.replace(u'\xa0', '') # Some NCSO records have multiple spaces...
Python
0.000003
@@ -1919,38 +1919,8 @@ er:%0A - print(record)%0A
f7e93c3d4f9699d8d6b1ea3d0c9587b59e9c6552
disable run once variable
src/netius/servers/wsgi.py
src/netius/servers/wsgi.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Netius System # Copyright (C) 2008-2012 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
Python
0.000001
@@ -3940,19 +3940,20 @@ nce%22%5D = -Tru +Fals e%0D%0A%0D%0A
31e3f4486eba2d933582a00a643700ac2f51ab56
add blank string for null colmun
optional/_data_generation/create_SNPChrPosOnRef_bcp_with_allele.py
optional/_data_generation/create_SNPChrPosOnRef_bcp_with_allele.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re import gzip from pyfasta import Fasta path_to_fasta = sys.argv[1] path_to_bcp = sys.argv[2] # GRCh37.p13 # $ wget -r ftp://ftp.ncbi.nlm.nih.gov/genbank/genomes/Eukaryotes/vertebrates_mammals/Homo_sapiens/GRCh37.p13/Primary_Assembly/assembled_chromoso...
Python
0.999683
@@ -1110,32 +1110,44 @@ rd%5B0%5D, record%5B1%5D +, '', '', '' %5D)%0A%0A @@ -1740,16 +1740,28 @@ ecord%5B1%5D +, '', '', '' %5D)%0A%0A
6572d939bf841da1a63791f8cf21050bdbd71601
Convert for+if to list comprehension
plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py
plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. import UM.Settings.SettingsError #To indicate that a file is of incorrect format. import configparser #To read config files. import io #To write config files to strings as if they were files. ## Creates a new profile ins...
Python
0
@@ -3097,32 +3097,73 @@ s%22)%0A +self._disabled_settings_defaults = %5Bitem for item in disa @@ -3197,106 +3197,41 @@ %22,%22) -:%0A if item != %22%22:%0A self._disabled_settings_defaults.append(item) + if item != %22%22%5D # Split by comma. %0A%0A
364a3ac475eac1895fa58b48003ee8b786d012cc
Version bump
oauth_api/__init__.py
oauth_api/__init__.py
__version__ = '0.5.2'
Python
0.000001
@@ -16,7 +16,7 @@ 0.5. -2 +3 '%0A
1f98e497136ce3d9da7e63a6dc7c3f67fedf50b5
Save the observation if the form was valid.
observations/views.py
observations/views.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import messages from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.views.generic.edit import FormView from braces.views import LoginRequiredMixin from .forms import O...
Python
0.000001
@@ -582,16 +582,239 @@ tion')%0A%0A + def form_valid(self, form):%0A observation = form.save(commit=False)%0A observation.observer = self.request.observer%0A observation.save()%0A return super(AddObservationView, self).form_valid(form)%0A%0A %0Aclass U
6353dd8caa3656b8c37280bcccd56cfaa78ff67a
Add API for making authenticated API requests
valohai_cli/api.py
valohai_cli/api.py
import platform from urllib.parse import urljoin, urlparse import requests from requests.auth import AuthBase from valohai_cli import __version__ as VERSION from valohai_cli.exceptions import APIError, ConfigurationError from valohai_cli.settings import settings class TokenAuth(AuthBase): def __init__(self, net...
Python
0.000001
@@ -69,16 +69,62 @@ equests%0A +from click.globals import get_current_context%0A from req @@ -304,16 +304,57 @@ ettings%0A +from valohai_cli.utils import force_text%0A %0A%0Aclass @@ -1767,57 +1767,197 @@ sp%0A%0A - @classmethod%0A def from_settings(cls): +%0Adef _get_current_api_session():%0A %22%22%22%...
513b2ca1d3499e3786f1769ce67c41ba16b70419
switch the default prompt to "" from None
virtualenv/core.py
virtualenv/core.py
import sys import click from virtualenv import __version__ from virtualenv.builders.legacy import LegacyBuilder from virtualenv.builders.venv import VenvBuilder def select_builder(python, builders=None): # Determine what Python we're going to be using. If this is None we'll use # the Python which we're curr...
Python
0.999907
@@ -3021,16 +3021,32 @@ rompt%22,%0A + default=%22%22,%0A help
1b2a1bb5f4c99f80c3664a40796939732e9fe91c
bump dev version
bndl/__init__.py
bndl/__init__.py
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
Python
0
@@ -1074,12 +1074,20 @@ (0, -6 +7 , 0 +, 'dev2' )%0A__
ee3ee6810f1f8fcc535e29f0f2a2af425dcea7c4
add db_handler instance to lint_github
lintable_lintball/lintball.py
lintable_lintball/lintball.py
# Copyright 2015-2016 Capstone Team G # # 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
@@ -663,16 +663,101 @@ uuid4%0A%0A +from lintable_db.database import DatabaseHandler%0Afrom lintable_db.models import User%0A from lin @@ -1072,16 +1072,68 @@ eLinter%0A +from lintable_processes.db_handler import DBHandler%0A from lin @@ -1322,16 +1322,49 @@ uid4()): +%0A logger = logging.getLogger() %0A%0A ...
01fe200a09b0e5987116364c954da576200893f8
Version 1.1.1
livinglots_owners/__init__.py
livinglots_owners/__init__.py
__version__ = '1.1.0'
Python
0
@@ -16,7 +16,7 @@ 1.1. -0 +1 '%0A
891e37943b568fa342e01c5f4439501713bf4681
fix paths
data_processing.py
data_processing.py
#!/usr/bin/python """ Flask app to run data retrieval tasks for Open Humans """ import imp import json import logging import os import pkgutil import sys from functools import partial import requests from celery.signals import (after_setup_logger, after_task_publish, task_postrun, task_...
Python
0.000267
@@ -4327,19 +4327,59 @@ oin( -sys.path%5B0%5D +%0A os.path.dirname(os.path.abspath(__file__)) , 's @@ -5230,24 +5230,67 @@ _sources():%0A + logging.info('Adding %22%25s%22', name)%0A%0A DATA
b159d28dc965e60843f2617b4ae40d6c04cd2604
Optimize sensitive areas API
geotrek/api/v2/views/sensitivity.py
geotrek/api/v2/views/sensitivity.py
from __future__ import unicode_literals from django.conf import settings from django.db.models import F, Case, When from django_filters.rest_framework.backends import DjangoFilterBackend from rest_framework.permissions import IsAuthenticatedOrReadOnly from geotrek.api.v2 import serializers as api_serializers, \ v...
Python
0.000001
@@ -1106,24 +1106,74 @@ hed=True) %5C%0A + .select_related('species', 'structure') %5C%0A .pre @@ -1194,16 +1194,27 @@ 'species +__practices ') %5C%0A
9433fa8970341cb2d024bceb0e23e93fbfb71393
Update python test
solidity/python/FormulaTestSale.py
solidity/python/FormulaTestSale.py
from sys import argv from decimal import Decimal from random import randrange from Formula import calculateSaleReturn def formulaTest(supply,reserve,ratio,amount): fixed = Decimal(calculateSaleReturn(supply,reserve,ratio,amount)) real = Decimal(reserve)*(1-(1-Decimal(amount)/Decimal(supply))**(100/Decim...
Python
0.000001
@@ -919,14 +919,8 @@ )%0A%0A%0A -n = 0%0A wors @@ -955,64 +955,32 @@ = 0%0A -while n %3C size: # avoid creating a large range in memory +%0A%0Afor n in xrange(size): %0A @@ -1511,15 +1511,4 @@ es)%0A - n += 1%0A
a0bac1e9020233f886f939fa6b0b7b15f7ea70f9
set daemon to false when executing standard commands
lux/core/commands/__init__.py
lux/core/commands/__init__.py
''' .. autoclass:: Command :members: :member-order: bysource ''' import argparse import logging from pulsar import Setting, Application, ImproperlyConfigured, isawaitable from pulsar.utils.config import Config, LogLevel, Debug, LogHandlers from lux import __version__ from lux.utils.async import maybe_green c...
Python
0.000006
@@ -3360,16 +3360,47 @@ p(argv)%0A + app.cfg.daemon = False%0A
6d31622fa4170966cf67a6cfa77895efa796991e
put proper dotpay gateway link
getpaid/backends/dotpay/__init__.py
getpaid/backends/dotpay/__init__.py
import datetime from decimal import Decimal import hashlib import logging from django.utils import six from six.moves.urllib.parse import urlencode from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.utils.timezone import utc from django.utils.translation imp...
Python
0
@@ -1050,10 +1050,13 @@ pay. -eu +pl/t2 /'%0A
e364bdf7723ca45ac1000eda13a76cf1b19f0ad8
Remove a debug print
plugins/plugin_node_manager/src/plugin_node_manager/launch_item.py
plugins/plugin_node_manager/src/plugin_node_manager/launch_item.py
#!/usr/bin/env python ################################################################################ # # Copyright Airbus Group SAS 2015 # All rigths reserved. # # File Name : setup.py # Authors : Martin Matignon # # If you find any bug or if you have any question please contact # Adolfo Suarez Roos <adolfo.suarez@ai...
Python
0.000028
@@ -2087,40 +2087,8 @@ %0A - print 'coucou'%0A %0A
3c916451ebb584a72fb0a92c2a577427ff10003c
Make Height Change Also Be A Valid Ping
dataserv/Farmer.py
dataserv/Farmer.py
import hashlib from dataserv.run import db from datetime import datetime from sqlalchemy import DateTime from dataserv.Validator import is_btc_address def sha256(content): """Finds the sha256 hash of the content.""" content = content.encode('utf-8') return hashlib.sha256(content).hexdigest() class Farme...
Python
0
@@ -2820,24 +2820,75 @@ validate()%0A%0A + self.ping() # also serves as a valid ping%0A farm
efc6f47616bc2128eee885383f43cf9d42bdb374
Include non partners but owners or payers
mchimp_generationsocis-sql.py
mchimp_generationsocis-sql.py
#!/usr/bin/env python #-*- coding: utf8 -*- import psycopg2 import config import dbutils import codecs import sys from consolemsg import step, error, fail, warn def esPersonaFisica(soci) : return 0 if soci.nif[2] in "ABCDEFGHJNPQRSUVW" else 1 def ambPuntDeMilers(numero) : return '{:,}'.format(numero).replace...
Python
0
@@ -154,16 +154,54 @@ il, warn +%0Afrom namespace import namespace as ns %0A%0Adef es @@ -696,16 +696,62 @@ vested,%0A + ARRAY%5B8%5D @%3E categories AS essoci,%0A @@ -1117,32 +1117,60 @@ address.email,%0A + categories,%0A @@ -1520,32 +1520,94 @@ AS ncontracte...
31caceefaa2f6b6dc7d2601d8537e613ce600743
Use account's static groups instead of a conversation's groups for dialogue group state
go/apps/dialogue/view_definition.py
go/apps/dialogue/view_definition.py
import json from django.http import HttpResponse from django.forms import Form from go.api.go_api import client from go.api.go_api.client import GoApiError from go.conversation.view_definition import ( ConversationViewDefinitionBase, ConversationTemplateView) class DialogueEditView(ConversationTemplateView): ...
Python
0.000001
@@ -873,16 +873,129 @@ text))%0A%0A + contact_store = conversation.user_api.contact_store%0A groups = contact_store.list_static_groups()%0A%0A @@ -1170,33 +1170,14 @@ in -conversation.get_ groups -() %5D,%0A
efcf5628225e5c07bcc1f3a9741557a12d4421aa
Remove dictionary pruning
src/project/corpus.py
src/project/corpus.py
import sys import codecs from os import listdir from os.path import isdir, isfile, join, splitext from random import sample from math import ceil from nltk.corpus import stopwords from gensim.interfaces import TransformationABC from gensim.corpora import Dictionary, MmCorpus, TextCorpus from gensim.utils import Clipped...
Python
0.000001
@@ -908,24 +908,40 @@ doc in docs +, prune_at=None. )%0A @@ -1258,16 +1258,29 @@ below=20 +, keep_n=None ) # Fil
513817ef4ede24ce7609afb9d025107d8f96532b
Fix test on Windows
gouda/tests/test_decode_barcodes.py
gouda/tests/test_decode_barcodes.py
import unittest import shutil from pathlib import Path from gouda.engines import ZbarEngine from gouda.scripts.decode_barcodes import main from utils import temp_directory_with_files TESTDATA = Path(__file__).parent.joinpath('test_data') @unittest.skipUnless(ZbarEngine.available(), 'ZbarEngine unavailable') clas...
Python
0
@@ -1917,32 +1917,54 @@ empdir.iterdir() +, key=lambda p: p.name )%5D%0A )
db22f7a508524409f5e03fdbcbf6a394670ebbde
Use built-in auth views
sweettooth/auth/urls.py
sweettooth/auth/urls.py
from django.conf.urls.defaults import patterns, url from django.views.generic import TemplateView urlpatterns = patterns('', url(r'login/$', 'django.contrib.auth.views.login', dict(template_name='login.html'), name='login'), url(r'logout/$', 'django.contrib.auth.views.logout', name='logout'), url(r'regist...
Python
0.000001
@@ -174,16 +174,24 @@ .login', +%0A dict(te @@ -288,16 +288,59 @@ logout', +%0A dict(template_name='logout.html'), name='l
91a30d8e5cd18e3c5e6c5f00e48f44d6b33346b5
clean up cache initialization in mail completer
roles/dotfiles/files/.vim/rplugin/python3/deoplete/sources/mail.py
roles/dotfiles/files/.vim/rplugin/python3/deoplete/sources/mail.py
from .base import Base from itertools import chain from deoplete.util import parse_buffer_pattern, getlines import re from subprocess import PIPE, Popen import string class Source(Base): def __init__(self, vim): super().__init__(vim) self.filetypes = ['mail'] self.name = 'mail' s...
Python
0.000001
@@ -721,32 +721,316 @@ self, context):%0A + self.__cache()%0A%0A def gather_candidates(self, context):%0A result = self.__pattern.search(context%5B'input'%5D)%0A if result is not None:%0A if not self.__candidates:%0A self.__cache()%0A return self.__candidate...
87d2780a710e98c3b824583a2cf2607461bce35c
remove an unnecessary import
roles/dotfiles/files/.vim/rplugin/python3/deoplete/sources/mail.py
roles/dotfiles/files/.vim/rplugin/python3/deoplete/sources/mail.py
from .base import Base from itertools import chain from deoplete.util import parse_buffer_pattern, getlines import re from subprocess import PIPE, Popen import string class Source(Base): def __init__(self, vim): super().__init__(vim) self.filetypes = ['mail'] self.name = 'mail' s...
Python
0.000005
@@ -151,22 +151,8 @@ open -%0Aimport string %0A%0Acl
92f0dd46bbc1f6fa8d9539d026d6ec1e968cbcfc
Drop inaccessible code from singleton.py
sympy/core/singleton.py
sympy/core/singleton.py
"""Singleton mechanism""" from .assumptions import ManagedProperties class SingletonRegistry(object): """ A map from singleton classes to the corresponding instances. """ def __init__(self): self._classes_to_install = {} # Dict of classes that have been registered, but that have not ...
Python
0.000001
@@ -898,80 +898,8 @@ j)%0A%0A - def __delattr__(self, name):%0A delattr(self.__class__, name)%0A%0A @@ -3543,141 +3543,4 @@ lf%5D%0A -%0A # Inject pickling support.%0A def __getnewargs__(self):%0A return ()%0A self.__getnewargs__ = __getnewargs__%0A
9b3702c9240ed533ccf9f08ba666103234a53c6c
Return the room_alias when GETing public rooms.
synapse/storage/room.py
synapse/storage/room.py
# -*- coding: utf-8 -*- # Copyright 2014 matrix.org # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
0.000003
@@ -3249,20 +3249,161 @@ tent - FROM rooms +, room_alias FROM rooms %22%0A + %22LEFT JOIN %22%0A + %22room_aliases ON room_aliases.room_id = rooms.room_id %22%0A + %22 LEFT @@ -3823,16 +3823,30 @@ %22topic%22 +, %22room_alias%22 %5D%0A%0A
32fba62d157953eaeea6e5885a7ea860632a1945
rename filter function and set the second parameter as required
sync_settings/helper.py
sync_settings/helper.py
# -*- coding: utf-8 -*- import os, re from urllib import parse def getDifference (setA, setB): return list(filter(lambda el: el not in setB, setA)) def getHomePath (fl = ""): if isinstance(fl, str) and fl != "": return joinPath((os.path.expanduser('~'), fl)) return os.path.expanduser('~') def existsPath(p...
Python
0
@@ -884,16 +884,21 @@ exclude +Files ByPatter @@ -919,21 +919,16 @@ patterns - = %5B%5D ):%0A isV
9d53e369e9757c659c72ca1e8bbb8eea8080ab2d
Add possiblity to pass an output stream to the update method
updater.py
updater.py
import configparser import hashlib import json import os import requests def go_through_files(cur_dir, data, repo_name, bw_list, is_whitelist): updated = False for content in data: path = os.path.join(cur_dir, content['name']) print(path) # check if file is in the black/whitelist ...
Python
0
@@ -49,16 +49,27 @@ mport os +%0Aimport sys %0A%0Aimport @@ -144,24 +144,32 @@ is_whitelist +, output ):%0A updat @@ -276,16 +276,29 @@ int(path +, file=output )%0A%0A @@ -461,24 +461,37 @@ n whitelist%22 +, file=output )%0A @@ -644,16 +644,29 @@ rectory%22 +, file=output )%0A @@ -849,...
e4bde56715b838116e2a0c06be20c8391570d0ab
Refactor popup creation into a function
updates.py
updates.py
#!/usr/bin/python3 # requires system Python and the python3-apt package from collections import OrderedDict # Starting with Python 3.7, we could just use vanilla dicts import apt # ImportError? apt install python3-apt def describe(pkg): # Python 3.7 equivalent: # return {"Name": pkg.name, "Installed": pkg.installed....
Python
0.000001
@@ -1353,16 +1353,257 @@ n%5Bpkg%5D)%0A +%09def make_popup(lines):%0A%09%09nonlocal popup%0A%09%09popup = curses.newwin(min(height - 3, 8), width - 4, 2, 2)%0A%09%09popup.erase()%0A%09%09popup.border()%0A%09%09for i, line in enumerate(lines):%0A%09%09%09popup.addstr(i + 1, 1, line)%0A%09%09popup.refresh()%0A%09%09curs...
c3c703c6d8b434da40beef6202bf2cbdc01e50a1
Add configured tests
gym/wrappers/tests/test_wrappers.py
gym/wrappers/tests/test_wrappers.py
import gym from gym import error from gym import wrappers from gym.wrappers import SkipWrapper import tempfile import shutil def test_skip(): every_two_frame = SkipWrapper(2) env = gym.make("FrozenLake-v0") env = every_two_frame(env) obs = env.reset() env.render() def test_no_double_wrapping():...
Python
0.000001
@@ -282,16 +282,612 @@ nder()%0A%0A +def test_configured():%0A env = gym.make(%22FrozenLake-v0%22)%0A env = wrappers.TimeLimit(env)%0A env.configure()%0A%0A # Make sure all layers of wrapping are configured%0A assert env._configured%0A assert env.env._configured%0A env.close()%0A%0Adef test_double...
fa0174185832fac608cc1b65255231a73aac630a
fix evacuate call on branched lient
healing/handler_plugins/evacuate.py
healing/handler_plugins/evacuate.py
from healing.handler_plugins import base from healing import exceptions from healing.openstack.common import log as logging from healing import utils LOG = logging.getLogger(__name__) class Evacuate(base.HandlerPluginBase): """evacuate VM plugin. Data format in action_meta is: 'evacuate_host': True...
Python
0
@@ -810,16 +810,23 @@ vacuate( +server= data.tar @@ -883,16 +883,27 @@ + host=None, on_shar @@ -921,68 +921,8 @@ True -,%0A find_host=True )%0A
5336ff3967f4e297237045ca0914ae5257e3a767
fix csv output in one autoplot
htdocs/plotting/auto/scripts/p92.py
htdocs/plotting/auto/scripts/p92.py
import psycopg2.extras import pyiem.nws.vtec as vtec import datetime import pandas as pd def get_description(): """ Return a dict describing how to call this plotter """ d = dict() d['data'] = True d['cache'] = 3600 d['description'] = """This map depicts the number of days since a Weather Fore...
Python
0.000046
@@ -1568,16 +1568,54 @@ me(rows) +%0A df.set_index('wfo', inplace=True) %0A%0A m
a8d639cbac2439c0079b86b72dd3daee6505e9d0
Update version file
version.py
version.py
"""Versioning controlled via Git Tag, check setup.py""" __version__ = "0.3.2"
Python
0
@@ -73,7 +73,7 @@ 0.3. -2 +3 %22%0A
360523b6d71c06f13f2a26b775c52cf598f380a0
Update version.py to include public domain declaration.
version.py
version.py
"""Calculate the current package version number based on git tags. This module provides `read_version_git` to read the output of "git describe" and modify its output modified to conform to the versioning scheme that setuptools uses (see PEP 386). Releases must be tagged with the following format: v<num>(.<num>)+...
Python
0
@@ -1,8 +1,55 @@ +# This file is placed into the public domain.%0A%0A %22%22%22Calcu