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
1d24e23d3468d2ebfda8d8dbb966a6bf7ef8989e
Fix up UTs
tests/test_jira_issue_tracker.py
tests/test_jira_issue_tracker.py
# -*- coding: utf-8 -*- import conftest import jira import jira.client import pytest import zazu.plugins.jira_issue_tracker __author__ = "Nicholas Wiles" __copyright__ = "Copyright 2016" @pytest.fixture def tracker_mock(): return zazu.plugins.jira_issue_tracker.JiraIssueTracker('https://jira', 'ZZ', None) @pyt...
Python
0
@@ -4035,24 +4035,96 @@ at('LC-10')%0A + uut.validate_id_format('Lc-10')%0A uut.validate_id_format('lc-10')%0A with pyt @@ -4202,34 +4202,33 @@ date_id_format(' -lc +3 -10')%0A assert @@ -4255,18 +4255,17 @@ sue id %22 -lc +3 -10%22 is
e6a3e61ffce9bccfd0f112303e39d686c7d851b9
fix describe form test
tests/test_management_command.py
tests/test_management_command.py
# -*- coding: utf-8 -*- import os import sys import shutil import logging import importlib from django.core.management import call_command, find_commands, load_command_class from django.test import TestCase from django.utils.six import StringIO, PY3 from django_extensions.management.modelviz import use_model class ...
Python
0.000008
@@ -3428,32 +3428,34 @@ orms.CharField%5C( +.* label=u?'Name'%22) @@ -3606,16 +3606,18 @@ rField%5C( +.* label=u?
321adc1f8de9ee6df8dd0ff66be321f1e5feafcc
Rename API endpoint
httpobs/website/backend/api.py
httpobs/website/backend/api.py
from httpobs.scanner.grader import get_score_description, GRADES from httpobs.scanner.tasks import scan from httpobs.scanner.utils import valid_hostname from httpobs.website import add_response_headers, sanitized_api_response from flask import Blueprint, jsonify, request from os import environ import httpobs.database...
Python
0.000001
@@ -2409,14 +2409,20 @@ rade -Totals +Distribution ', m
0efb8c4347b944c692e3352382bf36de1c9f5ef4
Fix test_client with no webpack manifest
indico/testing/fixtures/app.py
indico/testing/fixtures/app.py
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import os import pytest from indico.web.flask.app import make_app from indico.web.flask.wrappers import ...
Python
0
@@ -231,16 +231,71 @@ t pytest +%0Afrom flask_webpackext.ext import _FlaskWebpackExtState %0A%0Afrom i @@ -1508,24 +1508,83 @@ context.%22%22%22%0A + mocker.patch.object(_FlaskWebpackExtState, 'manifest')%0A mocker.p
2b72700dbd3b25c5a9b85663bd0a660da89322a4
Support template list in get_template_module
indico/web/flask/templating.py
indico/web/flask/templating.py
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
Python
0
@@ -1336,16 +1336,24 @@ ate_name +_or_list , **cont @@ -1543,24 +1543,34 @@ nja_env.get_ +or_select_ template(tem @@ -1579,16 +1579,24 @@ ate_name +_or_list )%0A re
0dd9b060fd2f4f6f52f74199fd7c704f884f2e12
Check that 'run-tox' is used instead of 'tox'
tools/jenkins-projects-checks.py
tools/jenkins-projects-checks.py
#! /usr/bin/env python # Copyright 2014 SUSE Linux Products GmbH # # 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.021828
@@ -4944,24 +4944,80 @@ ema, entry)%0A + result += _check_tox_builder(schema, entry)%0A @@ -5673,16 +5673,778 @@ count%0A%0A%0A +def _check_tox_builder(schema, entry):%0A count = 0%0A if schema == JOB or schema == JOB_TEMPLATE:%0A if 'builders' in entry:%0A for b in en...
9398fa3f674dbed430cc5bd6178c07cc83c81c60
remove unnecessary print
treeano/sandbox/nodes/spp_net.py
treeano/sandbox/nodes/spp_net.py
""" from "Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition" http://arxiv.org/abs/1406.4729 """ from __future__ import division, absolute_import from __future__ import print_function, unicode_literals import numpy as np import theano import theano.tensor as T import treeano import treeano.n...
Python
0.000413
@@ -2541,38 +2541,8 @@ ls%5D%0A - print(mp_kwargs_list)%0A
849ba5fe3d4ad8799fb6cf75a49380312fb3ebdc
Fix use of str instead of bytes when cloaking
txircd/modules/extra/cloaking.py
txircd/modules/extra/cloaking.py
from twisted.internet.abstract import isIPAddress, isIPv6Address from twisted.plugin import IPlugin from txircd.config import ConfigValidationError from txircd.module_interface import IMode, IModuleData, Mode, ModuleData from txircd.utils import expandIPv6Address, isValidHost, lenBytes, ModeType from zope.interface imp...
Python
0.000009
@@ -3366,33 +3366,34 @@ %0A%09%09%09 -hashedParts.append(sha256 +ipHashText = %22%7B%7D%7B%7D%22.format (sel @@ -3422,34 +3422,33 @@ aking_salt%22, %22%22) - + +, %22%22.join(piecesG @@ -3445,32 +3445,118 @@ in(piecesGroup)) +%0A%09%09%09ipHashBytes = ipHashText.encode(%22utf-8%22)%0A%09%09%09hashedParts.append(s...
6102f840c68e98a6c09aeb30055d6e58fa9c5006
Put temporary files in system's tempdir
typhon/tests/files/test_utils.py
typhon/tests/files/test_utils.py
from tempfile import NamedTemporaryFile from typhon.files import compress, decompress class TestCompression: data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910" def create_file(self, filename): with open(filename, "w") as file: file.write(self.data) def check_file(self, filename): ...
Python
0
@@ -13,16 +13,28 @@ e import + gettempdir, NamedTe @@ -45,16 +45,16 @@ aryFile%0A - %0Afrom ty @@ -473,32 +473,48 @@ edTemporaryFile( +dir=gettempdir() ) as file:%0A @@ -819,32 +819,48 @@ edTemporaryFile( +dir=gettempdir() ) as file:%0A @@ -1162,32 +1162,48 @@ edTemporaryFile( +dir=gettempdir() ) a...
0f4c91b55b5f6640954c4f3b459c286fc5f87b53
Clarify and improve error handling
data/CPNWH_Downloader.py
data/CPNWH_Downloader.py
"""Use this to directly download CPNWH data. To prevent timeout errors with their server, the data is downloaded from each herbaria separately. """ import pandas as pd import requests import argparse # Parse arguments parser = argparse.ArgumentParser( description='Download CPNWH data into multiple files') pars...
Python
0.000001
@@ -196,16 +196,30 @@ rgparse%0A +import string%0A %0A%0A# Pars @@ -874,19 +874,21 @@ region_ -url +query = text_ @@ -908,16 +908,55 @@ trip()%0A%0A +family_url = %22&QueryCount=1&Family1=%22%0A%0A herbaria @@ -1290,25 +1290,29 @@ rbarium%0A -timed_out +unknown_error _herbari @@ -1319,24 +1319,20 @@ a = %5B%...
9c2514fce4d8d6c46fddae8e79afe66631b468ae
add outer_width to RackTable (#7766)
netbox/dcim/tables/racks.py
netbox/dcim/tables/racks.py
import django_tables2 as tables from django_tables2.utils import Accessor from dcim.models import Rack, RackReservation, RackRole from tenancy.tables import TenantColumn from utilities.tables import ( BaseTable, ButtonsColumn, ChoiceFieldColumn, ColorColumn, ColoredLabelColumn, LinkedCountColumn, MarkdownColumn, ...
Python
0
@@ -1843,16 +1843,328 @@ t'%0A ) +%0A outer_width = tables.TemplateColumn(%0A template_code=%22%7B%7B record.outer_width %7D%7D %7B%7B record.outer_unit %7D%7D%22,%0A verbose_name='Outer Width'%0A )%0A outer_depth = tables.TemplateColumn(%0A template_code=%22%7B%7B record.outer_depth %...
59706b4f3e45fbd3ea107e63f04181cbd89b9749
Remove conntrackd comment
neutron/conf/agent/l3/ha.py
neutron/conf/agent/l3/ha.py
# Copyright (c) 2014 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
Python
0.000006
@@ -914,45 +914,9 @@ ived -/conntrackd '%0A ' + conf
62763ded79e1afe1b37da0522f126e21ce18ab65
Rename ComparableResponse to TestResponse
flaskext/attest.py
flaskext/attest.py
from __future__ import absolute_import from __future__ import with_statement from contextlib import contextmanager from flask import (Response, request, template_rendered as jinja_rendered) from flask.signals import Namespace from flask.testing import FlaskClient from decorator import decorator signals = Namespace() ...
Python
0.999974
@@ -377,26 +377,20 @@ %0A%0Aclass -Comparable +Test Response @@ -1877,18 +1877,12 @@ pp, -Comparable +Test Resp
9d9302bdd961f21f36bbfd61265aa7c1e7117401
don't perform the check if first_edit is None
follower/models.py
follower/models.py
from datetime import datetime import pytz from django.db import models import feedparser feedparser.USER_AGENT='OSMFollower/1.0 +http://mapexplorer.org' # Create your models here. class Mapper(models.Model): user=models.CharField(max_length=20) scan_date=models.DateTimeField('last_scan_date',null=True,blank=Tr...
Python
0.999994
@@ -1712,39 +1712,23 @@ -is_older_edit=first_edit_date %3C +%0A if sel @@ -1736,33 +1736,50 @@ .first_edit_date -%0A +==None or %5C%0A if s @@ -1770,32 +1770,26 @@ -if self. + first_edit_d @@ -1795,31 +1795,31 @@ date -==None or is_older_edit + %3C self.first_edi...
3ae39e06cd3695b5640a2a1c079bb32f4c7126b4
Switch from tuples to lists in Django's settings
antxetamedia/settings.py
antxetamedia/settings.py
import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'd2w#o#(!antcw5e%(#p5*pu(x=zhw60^byh$)ps+4#e8m#-fj!' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] INST...
Python
0
@@ -322,25 +322,25 @@ LLED_APPS = -( +%5B %0A 'django @@ -1167,17 +1167,17 @@ chive',%0A -) +%5D %0A%0AMIDDLE @@ -1191,17 +1191,17 @@ ASSES = -( +%5B %0A 'dj @@ -1659,17 +1659,17 @@ eware',%0A -) +%5D %0A%0ASITE_I @@ -3432,17 +3432,17 @@ ILERS = -( +%5B ('text/x @@ -3483,10 +3483,9 @@ er') -,) +%5D ...
9da0110c6d36c099cefecb7d653159f16175a139
fix bug
dataset/research/job.py
dataset/research/job.py
""" Classes Job and Experiment. """ import os from collections import OrderedDict from copy import copy import dill from .. import Pipeline, Config, inbatch_parallel class Job: """ Contains one job. """ def __init__(self, executable_units, n_iters, repetition, configs, branches, name): """ Pa...
Python
0.000001
@@ -3182,39 +3182,32 @@ f._parallel_run( -batch, iteration, name) @@ -3197,32 +3197,39 @@ (iteration, name +, batch )%0A @@ -3385,23 +3385,16 @@ lel_run( -batch, iteratio @@ -3396,24 +3396,31 @@ ration, name +, batch )%0A se
cfbe7778e441f5851dc0efbacdfebd5209c31742
bump version
cupy/_version.py
cupy/_version.py
__version__ = '11.0.0b3'
Python
0
@@ -18,8 +18,9 @@ .0.0 -b3 +rc1 '%0A
bb6f7d8a6e71c7b74697b9db46abdd8d0b831ec9
Remove unnecessary import and print statement
run_experiment.py
run_experiment.py
#!/usr/bin/env python import argparse from collections import namedtuple from glob import glob import itertools as it import os import os.path import sys import numpy as np import pandas as pd from otdet.detector import OOTDetector from otdet.evaluation import TopListEvaluator from otdet.feature_extraction import Re...
Python
0.000005
@@ -140,19 +140,8 @@ path -%0Aimport sys %0A%0Aim @@ -6878,52 +6878,4 @@ y))%0A -%0A print('Done', file=sys.stderr, flush=True)%0A
eac2f296e855f92d040321edee943ad5f8a8fb39
Add filtering to view (nc-463)
nodeconductor/events/views.py
nodeconductor/events/views.py
from rest_framework import generics, response from nodeconductor.events import elasticsearch_client class EventListView(generics.GenericAPIView): def list(self, request, *args, **kwargs): order_by = request.GET.get('o', '-@timestamp') elasticsearch_list = elasticsearch_client.ElasticsearchResult...
Python
0
@@ -244,16 +244,125 @@ stamp')%0A + event_types = request.GET.getlist('event_type')%0A search_text = request.GET.get('search_text')%0A @@ -427,16 +427,29 @@ ultList( +%0A user=req @@ -472,16 +472,66 @@ order_by +, event_types=event_types, search_text=search_text )%0A%0A
f975aa9aa03e4334be927f618e136205af055df0
change the code because the returning data format is changed
rundemo.py
rundemo.py
#!/usr/bin/env python """ author: Lu LIU created at: 2014-07-25 Description: a sample of how to use pymmrouting to find multimodal optimal paths in transportation networks """ from pymmrouting.routeplanner import MultimodalRoutePlanner from pymmrouting.inferenceengine import RoutingPlanInferer from termcolor ...
Python
0.000048
@@ -3054,18 +3054,13 @@ s%5B%22r -esult list +outes %22%5D): @@ -3101,27 +3101,23 @@ %22 + r%5B%22 -description +summary %22%5D + %22 = @@ -3158,27 +3158,25 @@ if r%5B%22 -is existen -t +ce %22%5D is Tr @@ -3204,35 +3204,33 @@ ored(str(r%5B%22 -is existen -t +ce %22%5D), %22green%22 @@ -3274,19 +3274,17 ...
d62f3bc97bd318ebaf68e97ccc2629d9f8f246b5
Correct the pyproj minimum version.
sources/mapnik/setup.py
sources/mapnik/setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup, find_packages def prerelease_local_scheme(version): """ Return local scheme version unless building on master in CircleCI. This function returns the local scheme version number (e.g. 0.0.0.dev<N>+g<HASH>) unless bu...
Python
0
@@ -1594,17 +1594,17 @@ proj%3E=2. -0 +2 .0',%0A
a44992f584e6e23ff683f80798f2c672626f9481
bump rankabrand scraper, to get new chocolate ratings
scraper.py
scraper.py
# -*- coding: utf-8 -*- # Copyright 2014 SpendRight, 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 b...
Python
0
@@ -1995,16 +1995,16 @@ (201 -5, 5, 23 +6, 1, 14 ),%0A
236e1cd509b0f06469e78caef5ac0b8e2abca0b6
Use the OSXApp class when packaging OS X applications.
sdk/env.py
sdk/env.py
import app import osx_app import linux_app import os import platform import sys import os.path as p class PackagingEnvironment(object): def __init__(self, version, target_os, product_name="kroll"): self.target_os = target_os if target_os is 'linux': self.App = linux_app.LinuxApp if target_os is 'osx': sel...
Python
0
@@ -329,16 +329,19 @@ osx_app. +OSX App%0A%09%09if
32a69f96821a543dc8efd1b11b2bf5fa129c4b87
Starting fraction is 1
EVLA_pipeline1.3.0/EVLA_pipe_fake_flagall.py
EVLA_pipeline1.3.0/EVLA_pipe_fake_flagall.py
''' On mixed setups, flagall is already run. This defines the variables set during that script so it doesn't need to be run multiple times. ''' logprint("Starting EVLA_pipe_fake_flagall.py", logfileout='logs/flagall.log') time_list = runtiming('flagall', 'start') QA2_flagall = 'Pass' logprint("These value a...
Python
0.999999
@@ -494,17 +494,17 @@ total = -0 +1 .0%0Astart
f70421a0c3143648f7dd2491ad031e62ca92792a
increment version for password rest admin form fix
accountsplus/__init__.py
accountsplus/__init__.py
__version__ = '1.3.1' default_app_config = 'accountsplus.apps.AccountsConfig'
Python
0
@@ -12,17 +12,17 @@ = '1.3. -1 +2 '%0A%0Adefau
bb165b4f8fc88ab3de26b0b52f07ada612e87f2b
Fix test cases related to getting tags and fields
tests/client_test.py
tests/client_test.py
""" InfluxAlchemy client tests. """ import mock import influxdb from influxalchemy.client import InfluxAlchemy from influxalchemy.measurement import Measurement from influxalchemy.query import InfluxDBQuery @mock.patch("influxdb.InfluxDBClient") def test_query(mock_flux): db = influxdb.InfluxDBClient(database="f...
Python
0
@@ -1059,38 +1059,45 @@ n_value = %5B%7B -%22name%22: %22fizz%22 +'tagKey': 'sensor_id' %7D%5D%0A mock_ @@ -1246,32 +1246,45 @@ nt.new(%22 -foo%22)) == %5B%22fizz +environment%22)) == %5B%22sensor_id %22%5D%0A%0A%0A@mo @@ -1425,32 +1425,135 @@ alue = %5B -%7B%22name%22: %22fizz%22%7D +%0A %7B'fieldKey': ...
499a74ff3256b3c6fb6a0ca4e2fd9578f2948cc8
correct variable names
tests/eguene_test.py
tests/eguene_test.py
""" eugene_test.py """ import os import sys import numpy as np import pandas as pd sys.path.append('~/GitHub/eugene') import eugene.Config from eugene.Population import Population # Setup up variable and truth configuration eugene.Config.var['x'] = np.linspace(0, 8.0 * np.pi, 1024) eugene.Config.truth = eugene.Conf...
Python
0.84164
@@ -94,16 +94,35 @@ .append( +os.path.expanduser( '~/GitHu @@ -131,16 +131,17 @@ eugene') +) %0A%0Aimport @@ -251,27 +251,27 @@ gene.Config. -var +VAR %5B'x'%5D = np.l @@ -314,21 +314,21 @@ .Config. -truth +TRUTH = eugen @@ -332,27 +332,27 @@ gene.Config. -var +VAR %5B'x'%5D * np.s @@ -364,27 +364,27 @@ gen...
b4439ef76148f73581e6df0bf593504ae796578a
correct a bug in geo to country code.
dbpedia/geoToCountry.py
dbpedia/geoToCountry.py
from urllib2 import urlopen def getCountry(lat, lng): url = "http://ws.geonames.org/countryCode?lng=" + str(lng) + "&lat=" + str(lat) country = urlopen(url).read().strip() return country
Python
0
@@ -175,16 +175,58 @@ strip()%0A +%09if len(country) != 2:%0A%09%09return %22Unknown%22%0A retu
9c8bfff17254cf88e11517a278bb60ad4c83e41b
Add revised alg_strongly_connected_components.py
alg_strongly_connected_components.py
alg_strongly_connected_components.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division def dfs_recur(adj_dict, start_vertex, visited_set, discover_ls, finish_ls): visited_set.add(start_vertex) discover_ls.append(start_vertex) for neighbor_vertex in adj_dict[start_verte...
Python
0.000001
@@ -112,1724 +112,49 @@ def -dfs_recur(adj_dict, start_vertex, visited_set, %0A discover_ls, finish_ls):%0A visited_set.add(start_vertex)%0A discover_ls.append(start_vertex)%0A for neighbor_vertex in adj_dict%5Bstart_vertex%5D:%0A if neighbor_vertex not in visited_set:%0A dfs_r...
580f6d4164d2cbdc9ee8594c3e1f71a1055483cd
Remove superfluous log message in authz realms code
anchore_engine/subsys/auth/realms.py
anchore_engine/subsys/auth/realms.py
from yosai.core.realm.realm import AccountStoreRealm from yosai.core.authz.authz import WildcardPermission, DefaultPermission import rapidjson from anchore_engine.db import AccountTypes from anchore_engine.plugins.authorization.client import AuthzPluginHttpClient, Action from anchore_engine.subsys import logger clas...
Python
0.000003
@@ -2093,122 +2093,8 @@ erm) -%0A logger.info(%22Requires: %7B%7D w/case %7B%7D%22.format(required_permission, required_permission.case_sensitive)) %0A%0A
d41f30419e6acf6d51b14ee7efc2260f6fc0485f
Return exit code 1 on docker build image failure
scripts/build-images.py
scripts/build-images.py
import os, re from argparse import ArgumentParser from glob import glob from subprocess import call class DockerImage: def __init__(self, dockerfile, versioned=False): self.dockerfile = dockerfile self.dockerfile_folder = os.path.dirname(self.dockerfile) self.versioned = versioned ...
Python
0.000056
@@ -6,16 +6,21 @@ t os, re +, sys %0A%0Afrom a @@ -2606,16 +2606,37 @@ it('%5Cn') +%0Aprint(changed_files) %0A%0Adocker @@ -3557,16 +3557,40 @@ ing %7B0%7D' +.format(image.full_name) )%0A @@ -3587,37 +3587,43 @@ e))%0A -break +sys.exit(1) %0A print(%22
5b5081ca6bba90f2e15022d2b6e3e293e3a9cc11
test if _search_final_redirect function finds last_redirects.txt
tests/simple_test.py
tests/simple_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from har2tree import CrawledTree from pathlib import Path import datetime import os import uuid class SimpleTest(unittest.TestCase): http_redirect_ct: CrawledTree @classmethod def setUpClass(cls) -> None: test_dir = ...
Python
0.000265
@@ -1832,24 +1832,355 @@ &src=1%22)%0D%0A%0D%0A + def test_search_final_redirect(self) -%3E None:%0D%0A self.http_redirect_ct.root_hartree.har._search_final_redirect()%0D%0A self.assertEqual(self.http_redirect_ct.root_hartree.har.final_redirect, %22https://consent.youtube.com/ml?continue=https://www.y...
687bb616deca1372d69ba0781c61a8ea62112426
Allow RO commands in oq workers
openquake/commands/workers.py
openquake/commands/workers.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2017-2019 GEM Foundation # # OpenQuake 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 Licen...
Python
0.000026
@@ -834,16 +834,54 @@ rpool%0A%0A%0A +ro_commands = ('status', 'inspect')%0A%0A%0A @sap.scr @@ -984,16 +984,44 @@ %0A if +(cmd not in ro_commands and config.d @@ -1042,16 +1042,28 @@ user and +%0A getpass @@ -1087,16 +1087,17 @@ enquake' +) :%0A
a4b84eb95d35fefa2dde356cb31eb888c4110e00
Fix a flaky test in PyPy.
tests/test__patch.py
tests/test__patch.py
import time import unittest import mongomock try: import pymongo _HAVE_PYMONGO = True except ImportError: _HAVE_PYMONGO = False try: from unittest import mock except ImportError: import mock @unittest.skipIf(not _HAVE_PYMONGO, 'pymongo not installed') class PatchTest(unittest.TestCase): """...
Python
0.000003
@@ -2415,32 +2415,65 @@ .MongoClient()%0A%0A + mock_sleep.reset_mock()%0A%0A with sel
19b0b1ed7e94ae4bb05f57baf3163850a64df8f9
test exports
opensfm/test/test_commands.py
opensfm/test/test_commands.py
import argparse from opensfm import commands from opensfm.test import data_generation def run_command(command, args): parser = argparse.ArgumentParser() command.add_arguments(parser) parsed_args = parser.parse_args(args) command.run(parsed_args) def test_run_all(tmpdir): data = data_generation....
Python
0.000003
@@ -713,16 +713,143 @@ ualsfm,%0A + commands.export_openmvs,%0A commands.export_pmvs,%0A commands.export_bundler,%0A commands.export_colmap%0A %5D%0A%0A
dcf07a4e538e0d97f1c04dc11d12f7dee9a91f11
add docs test
tests/test_client.py
tests/test_client.py
import json from functools import partial from nose.tools import ok_, eq_, nottest from solnado import SolrClient from tornado import gen from tornado.testing import AsyncTestCase, gen_test class ClientTestCase(AsyncTestCase): def setUp(self): super(ClientTestCase, self).setUp() self.client = Solr...
Python
0
@@ -2823,28 +2823,497 @@ %0A eq_(200, res.code)%0A +%0A @gen_test%0A def test_add_json_documents(self):%0A d = %5B%0A %7B%22id%22:%22123%22, %22title%22:%22test_add%22%7D,%0A %7B%22id%22:%22456%22, %22title%22:%22bar_baz%22%7D,%0A %5D%0A yield gen.Task(partial(se...
823189201f00ceefcd55ebf2c2eb20e7ac8aeee5
Fix cloner test
tests/test_cloner.py
tests/test_cloner.py
#!/usr/bin/env python # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2014 Wikimedia Foundation 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://ww...
Python
0.999985
@@ -1613,224 +1613,8 @@ B')%0A -%0A A.addPatchset(%5B'project_one.txt'%5D)%0A B.addPatchset(%5B'project_two.txt'%5D)%0A self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))%0A self.fake_gerrit.addEvent(B.getPatchsetCreatedEvent(1))%0A%0A @@ -1907,47 +1907,8 @@ %22)%0A%0A - ...
a047ffe078d0e383512e269123a22e6da8ece074
use unittest.mock if available.
tests/test_colors.py
tests/test_colors.py
# Copyright © 2015 Jakub Wilk <jwilk@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, p...
Python
0
@@ -11,16 +11,21 @@ t %C2%A9 2015 +-2016 Jakub W @@ -1104,16 +1104,91 @@ TWARE.%0A%0A +try:%0A import unittest.mock as mock%0Aexcept ImportError:%0A import mock%0A%0A import m
a4afaf066e2c90ea86f3462a13bc3e3045369024
change to doc
signapp.py
signapp.py
#!/usr/bin/env python """ signapp.py created by Rolly Maulana Awangga """ import config import pymongo import urllib import random import time from Crypto.Cipher import AES class Signapp(object): def __init__(self): self.key = config.key self.iv = config.iv self.opendb() def opendb(self): self.conn = pym...
Python
0.000002
@@ -1379,19 +1379,18 @@ sign%0A%09%09d -ata +oc = %7B%22NPM
0c30226cf6037ce6a3938cfb1e8b98fe5ef4d767
Test for miss configured skeletor cfg
tests/test_config.py
tests/test_config.py
import sys from skeletor.config import Config from .base import BaseTestCase from .helpers import nostdout class ConfigTests(BaseTestCase): """ Argument Passing & Config Tests. """ base_args = ['-n', 'test_skeleton'] def _set_cli_args(self, args): with nostdout(): sys.argv = sys.ar...
Python
0
@@ -1477,32 +1477,49 @@ not_list(self):%0A + try:%0A self._se @@ -1545,29 +1545,16 @@ e_args)%0A - try:%0A @@ -1631,32 +1631,32 @@ ept SystemExit:%0A - asse @@ -1643,28 +1643,387 @@ it:%0A assert True%0A + else:%0A assert False%0A%0A ...
b3e7bfab5920c45a19ba0ca67a8c0119714579ad
Update dtruss() tests
tests/test_dtrace.py
tests/test_dtrace.py
#!/usr/bin/env python # Copyright (C) 2015 Dmitry Rodionov # This file is part of my GSoC'15 project for Cuckoo Sandbox: # http://www.cuckoosandbox.org # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. import os import sys import unittest import sub...
Python
0.000018
@@ -890,16 +890,88 @@ output)%0A +%09%09self.assertEqual(sum(x.name == %22write_nocancel%22 for x in output), 1)%0A%0A %0Adef bui
83ef747830be964d43612bb081fba40e13c79b9f
fix test at Travis CI
tests/test_engine.py
tests/test_engine.py
#!/usr/bin/env python """ Tests for `plumbery` module. """ import io import socket import unittest from libcloud.common.types import InvalidCredsError from plumbery.__main__ import main from plumbery.engine import PlumberyEngine myPlan = """ --- safeMode: True --- # Frankfurt in Europe locationId: EU6 regionId: dd...
Python
0
@@ -3716,32 +3716,142 @@ tesIO(myPlan)))%0A + self.engine.set_user_name('fake_name')%0A self.engine.set_user_password('fake_password')%0A main
9c07e657bc4cd64adbb7aa6f04afc0dfa4960d3e
Update sepal/datasets/tasks.py
sepal/datasets/tasks.py
sepal/datasets/tasks.py
import os from django.conf import settings #import yaafelib as yf import wave import contextlib from celery import task from sepal.datasets.models import * from sepal.datasets.utils import filter_by_key, find_dict_by_item @task() def handle_uploaded_file(f): '''Saves an uploaded data source to MEDIA_ROOT/data_s...
Python
0
@@ -37,17 +37,16 @@ ttings%0A%0A -# import y
52d8442068af3fbd848c32334327e48e623769c2
Change test class name
tests/test_helper.py
tests/test_helper.py
# -*- coding: utf-8 -*- # from python_utils.helper import _Helper #from python_utils import helper import unittest import python_utils class TestPprint(unittest.TestCase): def setUp(self): pass def tearDown(self): pass
Python
0.000004
@@ -16,16 +16,47 @@ tf-8 -*- +%0A%22%22%22Tests for _Helper class.%22%22%22 %0A%0A# from @@ -92,16 +92,17 @@ Helper%0A# + from pyt @@ -142,22 +142,20 @@ nittest%0A -import +from python_ @@ -159,16 +159,39 @@ on_utils +.helper import _Helper%0A %0A%0Aclass @@ -199,13 +199,18 @@ estP -print +ythonUtils (uni ...
0a2951103ba70dc94f685b6fa3261ff371a78205
Revert ganesha integration - update due to intermediate code changes between initial/revert action
ovs/extensions/fs/exportfs.py
ovs/extensions/fs/exportfs.py
# Copyright 2014 CloudFounders NV # # 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
@@ -918,16 +918,116 @@ portfs'%5D +%0A self._restart = %5B'/usr/bin/sudo', '-u', 'root', '/etc/init.d/nfs-kernel-server', 'restart'%5D %0A%0A de @@ -3920,28 +3920,67 @@ subprocess.call(cmd)%0A + subprocess.call(self._restart)%0A
6b2f403ce33205ec681ba1a511c2d52db02f6a36
Use pipelines for cache busting scans for better performance
oz/plugins/aws_cdn/actions.py
oz/plugins/aws_cdn/actions.py
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals # Module for generating hashes for files that match a glob, and putting that # hash in redis to allow us to generate cache-busting URLs later import os import oz import oz.app import oz.plugins.redis import oz.plugins.a...
Python
0
@@ -553,16 +553,44 @@ ection() +%0A pipe = redis.pipeline() %0A%0A # @@ -1542,21 +1542,20 @@ _buster( -redis +pipe , f.path @@ -1569,8 +1569,28 @@ e_hash)%0A +%0A pipe.execute()%0A
b587557ab27598d7b1d273fbc445f27b40613a29
Update production bucket name.
us_ignite/settings/production.py
us_ignite/settings/production.py
# Production settings for us_ignite import datetime import os import urlparse from us_ignite.settings import * # Sensitive values are saved as env variables: env = os.getenv PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) # settings is one directory up now here = lambda *x: os.path.join(PROJECT_ROOT, '..',...
Python
0
@@ -986,14 +986,8 @@ = ' -local- us-i
e509bb74406243829810d011af7c5d1a7a5368e7
add test case for client credential. #6
tests/test_oauth2.py
tests/test_oauth2.py
# coding: utf-8 import os import tempfile import unittest from urlparse import urlparse from flask import Flask from .oauth2_server import create_server, db from .oauth2_client import create_client class BaseSuite(unittest.TestCase): def setUp(self): app = Flask(__name__) app.debug = True ...
Python
0
@@ -2738,16 +2738,480 @@ .data%0A%0A%0A +class TestCredentialAuth(BaseSuite):%0A def test_get_access_token(self):%0A auth_code = 'confidential:confidential'.encode('base64').strip()%0A url = ('/oauth/access_token?grant_type=client_credentials'%0A '&scope=email+address&username=admin&pass...
9c61b0d27873c8c1ea2ba2311f547625a83bf7be
Add cached_function to API
tests/test_parser.py
tests/test_parser.py
import requests import yaml from unittest import TestCase from mfnf.api import HTTPMediaWikiAPI from mfnf.parser import HTML2JSONParser, ArticleContentParser class TestParser(TestCase): def setUp(self): self.api = HTTPMediaWikiAPI(requests.Session()) self.title = "Mathe für Nicht-Freaks: Analysis...
Python
0.000002
@@ -4,28 +4,14 @@ ort -requests%0Aimport yaml +shelve %0A%0Afr @@ -38,16 +38,46 @@ estCase%0A +%0Aimport requests%0Aimport yaml%0A%0A from mfn @@ -172,82 +172,577 @@ ser%0A -%0Aclass TestParser(TestCase):%0A%0A def setUp(self):%0A self +from mfnf.utils import CachedFunction%0A%0Aclass TestParser(TestCas...
e4e24755dd6dc78e26b3653a5a01d3a1f3c2055f
Check that upload parameters are processed correctly
tests/test_photos.py
tests/test_photos.py
import unittest import openphoto import test_base class TestPhotos(test_base.TestBase): def test_delete_upload(self): """ Test photo deletion and upload """ # Delete one photo using the OpenPhoto class, passing in the id self.assertTrue(self.client.photo.delete(self.photos[0].id)) #...
Python
0
@@ -1119,32 +1119,56 @@ now three photos + with the correct titles %0A self.ph @@ -1241,24 +1241,117 @@ .photos), 3) +%0A for photo in self.photos:%0A self.assertEqual(photo.title, self.TEST_TITLE) %0A%0A #
6ddaf77adb3a3d1ad42eee06aae657fe15f77fa7
revert to assertions
tests/test_readme.py
tests/test_readme.py
import doctest def test_readme(): errs, _ = doctest.testfile('../README.rst', report=True) if errs > 0: raise ValueError( '{} errors encountered in README.rst'.format( errs))
Python
0.999542
@@ -98,124 +98,20 @@ -if errs %3E 0:%0A raise ValueError(%0A '%7B%7D errors encountered in README.rst'.format(%0A +assert not errs -)) %0A
55e6f07a804bb857fab63dfe82dcb228ce1de12e
Replace os.path with ntpath in tests
tests/test_rename.py
tests/test_rename.py
from unittest import TestCase from mock import mock from exifread import IfdTag from pictures.rename import rename from tests import helpers def ifd_tag_from(date_time_original): return IfdTag(None, None, None, date_time_original, None, None) class MockFile(object): def __init__(self, filename, mode): ...
Python
0
@@ -1,12 +1,26 @@ +import ntpath%0A from unittes @@ -40,30 +40,8 @@ Case -%0Afrom mock import mock %0A%0Afr @@ -65,16 +65,38 @@ t IfdTag +%0Afrom mock import mock %0A%0Afrom p @@ -632,106 +632,8 @@ s%0A%0A%0A -def create_mock_join():%0A return lambda path, *paths: r'%7B%7D%5C%7B%7D'.format(path, '%5C%5C'.join(...
7ef0fe9f1a2b91c72c2709ed025780547e329403
Update test
tests/test_ricker.py
tests/test_ricker.py
import pytest from ricker.ricker import ricker class TestRicker: def test_output_number(self): assert len(ricker()) == 2 def test_default_output(self): t, s = ricker() assert len(t) == len(s) def test_error(self): with pytest.raises(ValueError): ricker(f=0)
Python
0.000001
@@ -78,21 +78,22 @@ est_ -output_number +default_output (sel @@ -108,33 +108,117 @@ -assert len(ricker()) == 2 +dt = 0.002%0A length = 1%0A s = ricker(len=length, dt=dt)%0A assert len(s) == int(length / dt) %0A%0A @@ -224,38 +224,37 @@ def test_ -default_output +input_check_f (self)...
298b85a7c36e536a985b7ccffc8fefa135baa187
Fix TestRunner test case
tests/test_runner.py
tests/test_runner.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from multiprocessing import Lock import git import mock import pytest from badwolf.runner import TestContext, TestRunner @pytest.fixture(scope='function') def push_context(): return TestContext( 'deepanalyzer/badwolf', ...
Python
0.000001
@@ -74,16 +74,42 @@ iterals%0A +import os%0Aimport tempfile%0A from mul @@ -223,16 +223,70 @@ tRunner%0A +from badwolf.bitbucket import PullRequest, Changesets%0A %0A%0A@pytes @@ -674,29 +674,31 @@ text):%0A r -eturn +unner = TestRunner( @@ -719,16 +719,177 @@ Lock())%0A + runner.clone_path = os.path.join...
050e6ee000e89fb0ebeff5dcb2b6d79b10e92069
Fix monkeypatching for older scipy versions
tests/test_things.py
tests/test_things.py
from __future__ import division import stft import numpy import pytest @pytest.fixture(params=[1, 2]) def channels(request): return request.param @pytest.fixture(params=[0, 1, 4]) def padding(request): return request.param @pytest.fixture(params=[2048]) def length(request): return request.param @pyt...
Python
0
@@ -2168,24 +2168,159 @@ nkeypatch):%0A + # Try monkeypatching signal.cosine away.%0A # Ignore AttributeErrors during monkeypatching, for older scipy versions%0A try:%0A import s @@ -2331,16 +2331,20 @@ .signal%0A + monk @@ -2390,16 +2390,56 @@ raiser)%0A + except AttributeError:%0A ...
893e09b14eabff3a6ec2ff87db0499bc3fd2a213
fix tests to use forced aligner
tests/transcriber.py
tests/transcriber.py
import os import unittest class Transcriber(unittest.TestCase): audio = 'examples/data/lucier.mp3' def test_resources(self): from gentle import Resources from gentle.util.paths import get_binary resources = Resources() k3 = get_binary("ext/k3") self.assertEqual(os.pat...
Python
0
@@ -26,25 +26,21 @@ %0A%0Aclass -Transcrib +Align er(unitt @@ -92,16 +92,58 @@ ier.mp3' +%0A transcript = %22i am sitting in a room%22 %0A%0A de @@ -319,25 +319,24 @@ xt/k3%22)%0A -%0A self.ass @@ -331,72 +331,73 @@ -self.assertEqual(os.path.exists(resources.full_hclg_path), True) +model = ...
72e948719145579eb7dfb9385b921f8eb6ea1384
Add more exemplar primitive generators
tests/v4/conftest.py
tests/v4/conftest.py
from .context import tohu from tohu.v4.primitive_generators import * from tohu.v4.derived_generators import * __all__ = ['EXEMPLAR_GENERATORS', 'EXEMPLAR_PRIMITIVE_GENERATORS', 'EXEMPLAR_DERIVED_GENERATORS'] def add(x, y): return x + y EXEMPLAR_PRIMITIVE_GENERATORS = [ Constant("quux"), Integer(100, 200...
Python
0
@@ -267,24 +267,44 @@ ERATORS = %5B%0A + Boolean(p=0.3),%0A Constant @@ -317,32 +317,69 @@ %22),%0A -Integer(100, 200 +FakerGenerator(method=%22name%22),%0A Float(12.34, 56.78 ),%0A H @@ -407,36 +407,24 @@ -FakerGenerator(method=%22name%22 +Integer(100, 200 ),%0A
e6305725a57bd6daca24e66699a8e3b0ead8d866
Split long line
utils/ci/topology_integration.py
utils/ci/topology_integration.py
#!/usr/bin/env python2 # pylint: disable=missing-docstring import time import signal import threading from emuvim.dcemulator.net import DCNetwork from mininet.node import RemoteController from emuvim.api.sonata import SonataDummyGatekeeperEndpoint class SigTermCatcher: def __init__(self, net): self.net =...
Python
0.000995
@@ -997,22 +997,62 @@ ler, - monitor=True, +%0A monitor=True,%0A ena
0efe12805e67fd08d7d1a63274faf993e2514b88
remove debug code
vagrant/tournament/tournament.py
vagrant/tournament/tournament.py
#!/usr/bin/env python # # tournament.py -- implementation of a Swiss-system tournament # # Allows recording of tied matches. # Matches opponents of relative standings. # Pairs players in unique matches. # # TODO: implement match byes # TODO: implement pairing for odd number of players # TODO: implement Opponent match w...
Python
0.000492
@@ -399,59 +399,8 @@ pg2%0A -import pprint%0A%0App = pprint.PrettyPrinter(indent=4)%0A %0A%0Ade
d49997058c54bfeabe21a7284bdf3cf07c76075b
add doc
usr/sbin/local_fs_job_manager.py
usr/sbin/local_fs_job_manager.py
#!/usr/bin/env python ############################################################################### # Copyright (c) 2015 Tencent Inc. # Distributed under the MIT license # (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) # # Project: Cloud Image Migration Tool # Filename: lo...
Python
0
@@ -451,58 +451,8 @@ :44%0A - # Description: derived job manager for local FS%0A #### @@ -624,16 +624,350 @@ anager): +%0A %22%22%22%0A Derived class of BaseJobManager.%0A Traverse local files and submit.%0A%0A Attributes:%0A mandatory_options: Configuration options required by this class. This i...
4be23d19f25c0b6f0231339608301558d477a0f6
add program details
vagrant/tournament/tournament.py
vagrant/tournament/tournament.py
#!/usr/bin/env python # # tournament.py -- implementation of a Swiss-system tournament # import psycopg2 import pprint pp = pprint.PrettyPrinter(indent=4) def connect(): """Connect to the PostgreSQL database. Returns a database connection.""" return psycopg2.connect("dbname=tournament") def deleteMatches...
Python
0
@@ -81,16 +81,312 @@ nament%0A# +%0A# Allows recording of tied matches.%0A# Matches opponents of relative standings.%0A# Pairs players in unique matches.%0A#%0A# TODO: implement match byes%0A# TODO: implement pairing for odd number of players%0A# TODO: implement Opponent match win tie breaker algorithm%0A# TODO: imple...
12d22221df5786caee510cc167c9ef29f9155488
Correct name of output file
var/www/cgi-bin/abundanceConf.py
var/www/cgi-bin/abundanceConf.py
#!/home/daniel/Software/anaconda3/bin/python # Import modules for CGI handling import cgi, cgitb from abundanceDriver import abundancedriver from emailSender import sendEmail def cgi2dict(form): """Convert the form from cgi.FieldStorage to a python dictionary""" params = {} for key in form.keys(): ...
Python
0.000365
@@ -755,56 +755,8 @@ ing%0A - import os%0A os.system('touch /tmp/test1')%0A @@ -974,20 +974,22 @@ mp/abund -ance +result s.dat')%0A
ced3fd5fc8945fbb0ac79b3e90833173b1c72e93
disable not callable
pages/tasks.py
pages/tasks.py
from celery import task from pages.models import UploadedImage from pages.settings import IMG_PATH @task() def upload_to_s3(img, account, tags, filename): img_obj = UploadedImage( img=img, account=account, tags=tags ) img_obj.save() print filen...
Python
0.00012
@@ -1,12 +1,13 @@ +%0A from celery @@ -97,15 +97,78 @@ ATH%0A -@task() +%0A# XXX - not callable on pylint!%0A@task()#pylint: disable=not-callable %0Adef
438d21cc81355c3cf0768d8d8a84834252e5d56d
Add fix to get rid of random file closings and CRC-32 errors
parse/utils.py
parse/utils.py
import bz2 import zipfile import tarfile import re from chemtools import fileparser from project.utils import StringIO def parse_file_list(files): for f in files: if f.name.endswith(".zip"): with zipfile.ZipFile(f, "r") as zfile: for name in [x for x in zfile.namelist() if not ...
Python
0
@@ -355,30 +355,96 @@ -yield zfile.open(name) +newfile = StringIO(zfile.open(name).read(), name=name)%0A yield newfile %0A @@ -745,22 +745,35 @@ -yield +newfile = StringIO( tfile.ex @@ -783,24 +783,81 @@ ctfile(name) +.read(), name=name)%0A yield newfile ...
1742665f867233b32a49bfb47d354a3d7b9c034a
Add uninstalled versions of lcmtypes to the PYTHONPATH. This way, #2250 doesn't bite us as we edit the code.
drake/examples/Cars/steering_command_driver.py
drake/examples/Cars/steering_command_driver.py
#!/usr/bin/env python """Publishes steering commands over LCM. """ # Adapted from drake/examples/Cars/SteeringCommandDriver.py. import argparse import copy import math import os import sys import pygame THIS_FILE = os.path.abspath(__file__) THIS_DIR = os.path.dirname(THIS_FILE) DRAKE_DIR = os.path.dirname(os.path.d...
Python
0
@@ -375,16 +375,95 @@ KE_DIR)%0A +DRAKE_LCMTYPES_DIR = os.path.join(%0A DRAKE_DIR, %22pod-build/lcmgen/lcmtypes%22)%0A DRAKE_PY @@ -542,16 +542,92 @@ extend(%5B +%0A DRAKE_LCMTYPES_DIR, # First (to pick up local edits to messages).%0A os.path. @@ -667,29 +667,16 @@ ages%22),%0A - os.p
56181811197ad7e7b2d2d92f39f118ae0195afe5
use dictionary comprehension instead of explicitly building dict iteratively
web_frontend/osmaxx/countries/utils.py
web_frontend/osmaxx/countries/utils.py
import os from django.contrib.gis.geos import MultiPolygon, Polygon, GEOSGeometry from osmaxx.countries._settings import POLYFILE_LOCATION POLYFILE_ENDING = '.poly' def get_polyfile_name_to_file_mapping(): polyfile_mapping = {} for possible_polyfile in os.listdir(POLYFILE_LOCATION): if possible_pol...
Python
0.000001
@@ -212,58 +212,19 @@ -polyfile_mapping = %7B%7D%0A for possible_polyfile in +filenames = os. @@ -253,111 +253,215 @@ ION) -: %0A - if possible_polyfile.endswith(POLYFILE_ENDING):%0A name, _ = possible_polyfile.spl +return %7B%0A _extract_country_name_from_polyfile_name(filename): ...
08b5ccc5ff94ced8d582d1f023901d2ea25aca53
Disable timeout on reindex
udata/core/search/commands.py
udata/core/search/commands.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from udata.commands import manager from udata.search import es, adapter_catalog log = logging.getLogger(__name__) @manager.option('-t', '--type', dest='doc_type', default=None, help='Only reindex a given type') def reindex(doc_type=None...
Python
0.000001
@@ -927,16 +927,31 @@ bj in qs +.timeout(False) :%0A
a54ab99145cdf986705d02877bf8ff13834e3f70
Use abspath for virtualenv
km3pipe/utils/qrunprocessor.py
km3pipe/utils/qrunprocessor.py
#!/usr/bin/env python # Filename: qrunprocessor.py # Author: Tamas Gal <tgal@km3net.de> """ ========================================= Create a summary for a given list of runs ========================================= Use this batch runner to process a given list of run numbers with a script, which takes a `-o` to cre...
Python
0.000001
@@ -2860,16 +2860,32 @@ NVENV = +os.path.abspath( args%5B'-v @@ -2886,16 +2886,17 @@ gs%5B'-v'%5D +) %0A CLU
a7fc707a9bf34547fca3c4cc70f8b834d0e1f9ac
Fix docstring formatting (blocks doc build)
numpy/testing/decorators.py
numpy/testing/decorators.py
"""Decorators for labeling test objects Decorators that merely return a modified version of the original function object are straightforward. Decorators that return a new function object need to use nose.tools.make_decorator(original_function)(decorator) in returning the decorator, in order to preserve metadata such ...
Python
0.000156
@@ -4148,24 +4148,25 @@ --------- +- %0A fail_co
bd0745f9434686907a2951e2056701ae4db53978
allow numeric values for SUGAR_LOGGER_LEVEL (silbe) #1038
src/sugar/logger.py
src/sugar/logger.py
# Copyright (C) 2007 Red Hat, Inc. # # This 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 the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distribu...
Python
0.000092
@@ -1248,40 +1248,15 @@ ir%0A%0A -def set_level(level):%0A levels +_LEVELS = %7B @@ -1283,19 +1283,16 @@ .ERROR,%0A - @@ -1336,19 +1336,16 @@ - 'debug' @@ -1363,19 +1363,16 @@ .DEBUG,%0A - @@ -1406,36 +1406,133 @@ O %7D%0A - if levels.has_key(level) +def set_level(le...
bec88bc52a0eb410353b68c10c946c58360dabf2
exists return tuple not string
erpnext/crm/doctype/appointment/test_appointment.py
erpnext/crm/doctype/appointment/test_appointment.py
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest import datetime def create_test_lead(): test_lead = frappe.db.exists({'doctype':'Lead','lead_name':'Test Lead'}) if test_lead: ...
Python
0.999999
@@ -353,24 +353,30 @@ d',test_lead +%5B0%5D%5B0%5D )%0A test_l @@ -784,16 +784,22 @@ ointment +%5B0%5D%5B0%5D )%0A te
6a2d047d857d6b40a43c826b23b49921a7c8fc3b
use issubset
onadata/libs/permissions.py
onadata/libs/permissions.py
from collections import defaultdict from django.contrib.contenttypes.models import ContentType from guardian.shortcuts import ( assign_perm, remove_perm, get_users_with_perms) from onadata.apps.api.models import OrganizationProfile from onadata.apps.main.models.user_profile import UserProfile from onadata.a...
Python
0.000008
@@ -2144,112 +2144,122 @@ -return all(%5Bl in set(permissions)%0A for l in set(cls.class_to_permissions%5Btype(obj)%5D)%5D +perms_for_role = set(cls.class_to_permissions%5Btype(obj)%5D)%0A%0A return perms_for_role.issubset(set(permissions) )%0A%0A
56e9a075ce238cdb9a4d8664a8886d20bf41d476
make role list DRY
onadata/libs/permissions.py
onadata/libs/permissions.py
from collections import defaultdict from django.contrib.contenttypes.models import ContentType from guardian.shortcuts import ( assign_perm, remove_perm, get_users_with_perms) from onadata.apps.api.models import OrganizationProfile from onadata.apps.main.models.user_profile import UserProfile from onadata.a...
Python
0.000022
@@ -4929,264 +4929,8 @@ )%0A%0A -ROLES = %7Brole.name: role for role in %5BReadOnlyRole,%0A DataEntryRole,%0A EditorRole,%0A ManagerRole,%0A OwnerRole%5D%7D%0A ROLE @@ -...
a705a96be4f8616c5fcd6bca33300b0536a143d8
Set the login url in settings.
onlineweb4/settings/base.py
onlineweb4/settings/base.py
import os import sys from django.contrib.messages import constants as messages # Directory that contains this file. PROJECT_SETTINGS_DIRECTORY = os.path.dirname(globals()['__file__']) # Root directory. Contains manage.py PROJECT_ROOT_DIRECTORY = os.path.join(PROJECT_SETTINGS_DIRECTORY, '../..') #PROJECT_ROOT_DIRECTORY...
Python
0
@@ -1456,16 +1456,43 @@ ineUser' +%0ALOGIN_URL = '/auth/login/' %0A%0AMEDIA_
c5984a34e3bef6d69ebffe41f690819e5693f1d5
fix post model
src/tours/models.py
src/tours/models.py
import authtools from django.conf import settings from django.db import models from django.http import request class Tour(models.Model): title_pt = models.CharField(max_length=100, blank=True, null=False) title_gb = models.CharField(max_length=100, blank=True, null=False) title_de = models.CharField(max_l...
Python
0
@@ -2992,75 +2992,8 @@ 00)%0A - publish = models.DateField(auto_now=False, auto_now_add=False)%0A
ea87db99ff5e662ddda4ea6bcf3369c75969fd3c
Refactor user-creation parameters
src/users/models.py
src/users/models.py
import datetime from django.conf import settings from django.contrib.auth.models import ( AbstractBaseUser, BaseUserManager, PermissionsMixin, ) from django.core import signing from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.db import models from django.template.load...
Python
0
@@ -545,29 +545,16 @@ te_user( -%0A self, em @@ -571,32 +571,8 @@ ord, - is_staff, is_superuser, **e @@ -1132,25 +1132,84 @@ -is_active +last_login = extra_fields.pop('last_login', now)%0A date_joined = extra @@ -1225,25 +1225,25 @@ op(' -is_active', False +date_joined', now )%0A ...
eb76abed3402a403637ae7486f692df8bba72ea3
reorder code for better readability
src/vimpdb/proxy.py
src/vimpdb/proxy.py
import os import sys import socket from subprocess import call from subprocess import Popen from subprocess import PIPE PROGRAM = os.environ.get("VIMPDB_VIMSCRIPT", "vimpdb") SERVERNAME = os.environ.get("VIMPDB_SERVERNAME", "VIMPDB") def getPackagePath(instance): module = sys.modules[instance.__module__] ret...
Python
0.000323
@@ -373,24 +373,773 @@ Vim(object): +%0A %22%22%22%0A use subprocess to launch Vim instance that use clientserver mode%0A to communicate with Vim instance used for debugging.%0A %22%22%22%0A%0A def _remote_expr(self, expr):%0A p = Popen(%5BPROGRAM, '--servername',%0A SERVERNAME,...
148da580d7b15c51aa147b3472168b816842310f
change arg format
ssh_auth_methods.py
ssh_auth_methods.py
import subprocess, sys, threading from queue import Queue from math import ceil def get_auth_methods(hostname, port=22, timeout=5.0, verbose=False): try: if sys.version_info.minor < 3: success_output = subprocess.check_output([ 'ssh', # prevents ominous error on ...
Python
0.001303
@@ -3853,23 +3853,25 @@ erbose, +' timeout +' =timeout
f577ff84c7231dff4fe01e7e9b73f1b497993b41
remove commented out code and debug statements.
openxc/tools/obd2scanner.py
openxc/tools/obd2scanner.py
""" This module contains the methods for the ``openxc-obd2scanner`` command line program. `main` is executed when ``openxc-obd2scanner`` is run, and all other callables in this module are internal only. """ import argparse from .common import device_options, configure_logging, select_device import json def scan(co...
Python
0
@@ -553,14 +553,21 @@ ge(0 -, 0x88 +xd0ff, 0xd101 ):%0A @@ -625,17 +625,17 @@ est(0x7d -f +0 , mode=0 @@ -635,17 +635,18 @@ mode=0x -1 +22 , bus=bu @@ -959,466 +959,9 @@ )))%0A - # if item%5B'success'%5D:%0A # if 'name' in item:%0A # print('f...
24b8e2f7440926d6d1c384a7289dfb5d1124e82f
Add article on core admin
opps/core/admin/__init__.py
opps/core/admin/__init__.py
# -*- coding: utf-8 -*- from opps.core.admin.channel import * from opps.core.admin.profile import * from opps.core.admin.source import *
Python
0
@@ -17,16 +17,54 @@ f-8 -*-%0A +from opps.core.admin.article import *%0A from opp
b1903d4cca8e9fb46468b52250610a9ecf2f3c90
Make some functions private
atamaTrack.py
atamaTrack.py
"""atamaTrack """ import os.path import sys import cv2 import numpy from modules import getXY, piv # constants TIME_STEP = 0.1 # time step in second TOTAL_FRAMES = 20 # number of frames to track D_RANGE = 15 # ???: something parametor for the pattern finding def main(file_path): # load a movie file fi...
Python
0.000024
@@ -536,32 +536,33 @@ ame%0A image = +_ load_image(captu @@ -743,32 +743,33 @@ , ii)):%0A +_ dump_result(0.0, @@ -870,32 +870,33 @@ image = +_ load_image(captu @@ -918,32 +918,33 @@ gray_image = +_ to_grayscale(ima @@ -977,16 +977,17 @@ image = +_ load_ima @@ -1042,16 +1042,17 @@ im...
6dd8294b414c6b997171a36c3f28a029dc0dab78
Update rest_framework_simplejwt.authentication
rest_framework_simplejwt/authentication.py
rest_framework_simplejwt/authentication.py
from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.utils.six import text_type from django.utils.translation import ugettext_lazy as _ from jose import jwt from rest_framework import HTTP_HEADER_ENCODING, authentication from rest_framework.exceptions import Authentication...
Python
0.000001
@@ -197,16 +197,54 @@ ort jwt%0A +from jose.exceptions import JOSEError%0A from res @@ -461,15 +461,28 @@ ode( -'utf-8' +HTTP_HEADER_ENCODING )%0A%0AU @@ -2352,12 +2352,12 @@ ept -Type +JOSE Erro
4d8cd2d206a85b31737ecad62f7c756d9aecce3d
Add the target name to the GwtIncompatible strip rule.
build_defs/internal_do_not_use/j2cl_java_library.bzl
build_defs/internal_do_not_use/j2cl_java_library.bzl
"""Common utilities for creating J2CL targets and providers.""" load(":j2cl_transpile.bzl", "J2CL_TRANSPILE_ATTRS", "j2cl_transpile") load(":j2cl_js_common.bzl", "J2CL_JS_ATTRS", "JS_PROVIDER_NAME", "j2cl_js_provider") # Constructor for the Bazel provider for J2CL. _J2clInfo = provider(fields = ["_J2clJavaInfo"]) de...
Python
0.999998
@@ -3139,17 +3139,42 @@ mpatible -%22 + from %25s%22 %25 ctx.label.name ,%0A
38a0a51ec72733b92f58f2d0208e195ccd8523c7
Set authserver's default user/pass to be the default set in settings.py
authserver.py
authserver.py
#!/usr/bin/env python # ##### BEGIN AGPL LICENSE BLOCK ##### # This file is part of SimpleMMO. # # Copyright (C) 2011, 2012 Charles Nelson # # 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 Foundati...
Python
0.000001
@@ -3887,39 +3887,69 @@ ame= -%22Username%22, password=%22Password%22 +settings.DEFAULT_USERNAME, password=settings.DEFAULT_PASSWORD )%0A
cf096184562d723d321f179732aa25f03be35c6d
build graphs without saving the dents
auto_fetch.py
auto_fetch.py
#!/usr/bin/env python ############################################################################### ## ## digger - Digging into some data mines ## Copyright (C) 2010 Thammi ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU Affero General Public License as pu...
Python
0.000001
@@ -935,21 +935,74 @@ rom -microblogging +os.path import join, exists%0A%0Afrom microblogging import *%0Afrom test imp @@ -1613,16 +1613,163 @@ (msg)%0A %0A +def user_exists(service, user):%0A return exists(user_path(service, user))%0A%0Adef user_path(service, user):%0A return join('auto', service, user)%0A%...
faf222f62ae748b7ebd964cd04a4e579022032ca
Fix #154 (#155)
dftimewolf/lib/state.py
dftimewolf/lib/state.py
"""This class maintains the internal dfTimewolf state. Use it to track errors, abort on global failures, cleanup after modules, etc. """ # TODO(tomchop): Make sure docstrings here follow the same type hinting as the # rest of the codebase from __future__ import print_function from __future__ import unicode_literals i...
Python
0.000002
@@ -6373,17 +6373,17 @@ 0:s%7D %7B1 -: +! s%7D'.form
8b504c7913a23d77d3dfb36e3d77722e5a1243aa
Add example manager_url
autosnatch.py
autosnatch.py
#!/usr/bin/env python3 import requests import json import time from re import compile from requests.auth import HTTPBasicAuth from time import sleep import pydle #edit this _what_username = '' _what_password = '' _what_irc_token = '' _manager_url = '' # also accepts the transcode add url http://seedbox/transcode/requ...
Python
0
@@ -245,16 +245,59 @@ _url = ' +http://seedbox.example.com/json/add_torrent ' # also
cf46e08ebcd8a5d855ef7f21554d2d8edfac04f1
Update the navboxes to be somewhat relevant.
avenue/web.py
avenue/web.py
# -*- coding: utf-8 -*- # Copyright (c) 2012 Michael Babich # See LICENSE.txt or http://opensource.org/licenses/MIT '''Acts as an interface between what Flask serves and what goes on in the rest of the application. ''' from avenue import app, api from flask import render_template, make_response from copy import copy i...
Python
0
@@ -387,346 +387,8 @@ %5B%5D%0A -navbar.append(%7B'title' : 'Avenue',%0A 'content' : 'Read about the Avenue platform that runs this website.',%0A 'link' : '/about'%7D)%0A%0Anavbar.append(%7B'title' : 'Federation',%0A 'content' : 'Form federations with your friends a...
f21a53ccb0c354cf925d059f0ca007cf0fbba829
fix bug: rpc cup 100%
spider/rpc.py
spider/rpc.py
# -*- coding: utf-8 -*- import logging import sys import json from collections import deque from time import sleep from multiprocessing import Process import pika from scrapy.utils.project import get_project_settings from task import crawl, gen_lxmlspider, gen_blogspider SETTINGS = get_project_settings() def t...
Python
0
@@ -1122,16 +1122,34 @@ = True%0A + p.start()%0A @@ -1244,32 +1244,49 @@ while True:%0A + sleep(2)%0A connecti
53ff0431378003126199d33a1f70faffa43bf792
Add some simple view testing with django.test.Client
tic_tac_toe/tests.py
tic_tac_toe/tests.py
import unittest from .game import Game, GameException class TicTacToeTest(unittest.TestCase): "Basic tests for Tic Tac Toe game" def testEmptyGame(self): "Empty game, computer vs computer, always ties" game = Game() while not game.is_over(): game.play() # game shoul...
Python
0.000001
@@ -1,12 +1,24 @@ +import json%0A import unitt @@ -22,16 +22,109 @@ ittest%0A%0A +from django.core.urlresolvers import reverse, NoReverseMatch%0Afrom django.test import Client%0A%0A from .ga @@ -154,16 +154,17 @@ eption%0A%0A +%0A class Ti @@ -170,16 +170,20 @@ icTacToe +Game Test(uni @@ -1797,8 +1797,1564 @@ ...
93d3012b74dda05e058fc343d252173f33722bc1
change default crawl date
split_data.py
split_data.py
#!/usr/bin/env python import os import logging import argparse import random import json import time import datetime def load_data(filename): with open(filename, 'r') as f: for line in f: yield json.loads(line.strip()) def read_date(date_str): try: return time.strptime(date_str, '...
Python
0.000001
@@ -1025,12 +1025,12 @@ 13-0 -7-22 +8-01 ')%0A
ea416504c287bc5a3716289b57ebfd15bb770b9d
Use a string instead of a file
sql/branch.py
sql/branch.py
from gratipay import wireup env = wireup.env() db = wireup.db(env) participants = [] with open('./sql/emails.txt') as f: emails = [line.rstrip() for line in f] participants = db.all(""" SELECT p.*::participants FROM participants p WHERE email_address IN %s """, (tuple(emails), ...
Python
0
@@ -1,8 +1,20 @@ +import sys%0A%0A from gra @@ -78,67 +78,134 @@ v)%0A%0A -participants = %5B%5D%0A%0Awith open('./sql/ +# Temporary, will fill with actual values when running script%0A email -s.txt') as f:%0A +_txt = %22%22%22%0A rohitpaulk@live.com%0A abcd@gmail.com%0A%22%22%22%0A%0A emai @@ -214,14 +21...
5949f025227f90f1c2d99b07e7da50aef0dfc94a
modify V3 Status return into V2 status return
src/geni/am/gram_am2.py
src/geni/am/gram_am2.py
# AM API V2 version of Gram aggregate manager # For testing against tools (Flack, portal) that speak AM API V2 # Since Gram is written to support V3 from am2 import Slice, ReferenceAggregateManager from am2 import AggregateManager, AggregateManagerServer from am3 import ReferenceAggregateManager as ReferenceAggregateMa...
Python
0.000046
@@ -2826,33 +2826,551 @@ tials, options)%0A -# + print %22RET_V3%22 + str(ret_v3)%0A ret_v2 = ret_v3%0A value = ret_v2%5B'value'%5D%0A value%5B'geni_resources'%5D = value%5B'geni_slivers'%5D%0A slice_state = 'ready'%0A for res_status in value%5B'geni_resources'%5D:%0A ...
36e3ee242098f1768e009fca320c5d94142529d1
set debug to false
ui/app.py
ui/app.py
from flask import Flask, redirect, url_for, flash, g, config, session from flask_restful import Api from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, UserMixin, current_user, login_user from werkzeug.security import generate_password_hash, check_password_hash from flask_restful import Resour...
Python
0.99987
@@ -1149,16 +1149,6 @@ run( -debug=True )%0A
e3d00d26d00875628f4e43873b5fed14b2474f75
Revert "FIX: bad logic in Pipeline."
scikits/learn/pipeline.py
scikits/learn/pipeline.py
""" Pipeline: chain transforms and estimators to build a composite estimator. """ # Author: Edouard Duchesnay # Gael Varoquaux # Virgile Fritsch # Alexandre Gramfort # Licence: BSD from .base import BaseEstimator class Pipeline(BaseEstimator): """ Pipeline of transforms with a final estim...
Python
0
@@ -4135,19 +4135,18 @@ %22fit%22) -and +or hasattr @@ -4150,16 +4150,20 @@ ttr(t, %22 +fit_ transfor @@ -4167,18 +4167,19 @@ form%22)) -or +and %5C%0A @@ -4197,36 +4197,32 @@ hasattr(t, %22 -fit_ transform%22), Val @@ -4266,26 +4266,25 @@ diate steps -of +a the chain s @@ -4357,25 +4357,8 @@ ...
1ab90959f3cedea320dce0c31bfee9a6775cef5c
Remove output_extension config
generate_resume.py
generate_resume.py
import argparse import jinja2 import os import yaml import bnrg.filters from debug.debug import dprint class OutputFormat(object): def __init__(self, arg_name, template_extension, output_suffix, output_extension): self.arg_name = arg_name self.template_extension = template_extension self.o...
Python
0
@@ -196,29 +196,11 @@ ffix -, output_extension ):%0A + @@ -328,57 +328,8 @@ fix%0A - self.output_extension = output_extension%0A %0A%0A# @@ -399,19 +399,21 @@ %7B%0A ' -pdf +latex ': Outpu @@ -421,19 +421,21 @@ Format(' -pdf +latex ', 'tex' @@ -444,15 +444,8 @@ None -, 'pdf' ),%0A @@ -515,2...
3dc85ab93e9c295b878579ede6ee797064c71e84
update plos with settings days back
scrapi/harvesters/plos.py
scrapi/harvesters/plos.py
"""PLoS-API-harvester ================= <p>To run "harvester.py" please follow the instructions:</p> <ol> <li>Create an account on <a href="http://register.plos.org/ambra-registration/register.action">PLOS API</a></li> <li>Sign in <a href="http://alm.plos.org/">here</a> and click on your account name. Retrieve your A...
Python
0
@@ -794,16 +794,44 @@ equests%0A +from scrapi import settings%0A from scr @@ -2442,17 +2442,34 @@ medelta( -1 +settings.DAYS_BACK )%0A
62fc93d2847f09d4f4b9f7ed7cf58a55e795d291
Switch to multi-process execution
utils/eliteprospects_utils.py
utils/eliteprospects_utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from urllib.parse import urlparse from collections import namedtuple from concurrent.futures import ThreadPoolExecutor, as_completed import requests from lxml import html from utils import remove_non_ascii_chars # base url for eliteprospects.com BASE_URL = "http://www....
Python
0.000004
@@ -140,22 +140,23 @@ import -Thread +Process PoolExec @@ -474,17 +474,17 @@ RKERS = -8 +4 %0A# named @@ -979,14 +979,15 @@ ith -Thread +Process Pool @@ -1023,22 +1023,24 @@ ERS) as -thread +processe s:%0A @@ -1075,14 +1075,16 @@ -thread +processe s.su @@ -1164,9 +1164,9 @@ ls%5B: -2 +6 0%5D%...
bd1ae8fbcbcdfc649c765259f543f52a5a21c303
Reset root logger before setting up logging
src/hades/common/cli.py
src/hades/common/cli.py
import argparse import logging import os import sys from gettext import gettext as _ from hades import constants class ArgumentParser(argparse.ArgumentParser): """ ArgumentParser subclass that exists with os.EX_USAGE exit code if parsing fails. """ def error(self, message): self.print_usa...
Python
0
@@ -1414,24 +1414,48 @@ ram%0A %22%22%22%0A + reset_cli_logging()%0A if args. @@ -2078,20 +2078,404 @@ stream=sys.stderr)%0A +%0A%0Adef reset_cli_logging():%0A %22%22%22Reset root logger configuration%22%22%22%0A root = logging.root%0A for h in root.handlers:%0A try:%0A h.acquir...
79006657866832d02a8f8f50269246fe1ca78982
Add missing indentation
src/hades/common/cli.py
src/hades/common/cli.py
"""Functionality for the Hades command-line utilities in :mod:`hades.bin`.""" import argparse import functools import logging.handlers import os import sys import textwrap import typing from gettext import gettext as _ from hades import constants class ArgumentParser(argparse.ArgumentParser): """ArgumentParser s...
Python
0.000001
@@ -4458,16 +4458,17 @@ r a%0A + subparse