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
7c683cbb4a9a15e15bc522c90e018c1fb5707418
Fix "upload" command garbling and truncating files on Windows. If it's a binary file, use 'rb'!
command/upload.py
command/upload.py
"""distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).""" from distutils.errors import * from distutils.core import Command from distutils.spawn import spawn from distutils import log from md5 import md5 import os import socket import platform import ConfigParser import htt...
Python
0
@@ -2421,16 +2421,21 @@ filename +,'rb' ).read()
c1682bf0f795d74d376fb22364b691ae7db97995
Fix python test to work on Windows
src/com/facebook/buck/parser/buck_test.py
src/com/facebook/buck/parser/buck_test.py
from buck import glob_internal, LazyBuildEnvPartial from pathlib import Path, PurePosixPath import os import shutil import sys import tempfile import unittest class FakePath(PurePosixPath): def glob(self, pattern): return self.glob_results.get(pattern) def is_file(self): return True def fak...
Python
0.000002
@@ -5490,42 +5490,153 @@ %5B -'b/a/c/a/A.java', 'b/a/c/a/B.java' +%0A os.path.join('b', 'a', 'c', 'a', 'A.java'),%0A os.path.join('b', 'a', 'c', 'a', 'B.java'),%0A %5D,%0A
24b86c78a6420006eabf6c27535f946edc612385
Handle no tags in repository better
git_gutter_compare.py
git_gutter_compare.py
import sublime import sublime_plugin ST3 = int(sublime.version()) >= 3000 if ST3: from GitGutter.view_collection import ViewCollection else: from view_collection import ViewCollection class GitGutterCompareCommit(sublime_plugin.WindowCommand): def run(self): self.view = self.window.active_view() ...
Python
0
@@ -452,16 +452,45 @@ _list()%0A + if self.results:%0A @@ -1660,32 +1660,55 @@ decode(%22utf-8%22)%0A + if result:%0A return %5B @@ -1769,66 +1769,20 @@ ')%5D%0A -%0A -def parse_result(self, result):%0A if not result + else :%0A @@ -1845,34 +1845,52 @@ ito...
0e627888f214947b8e021542cb3f2fc0fb07e087
correct testing
testing/test_sct_segment_graymatter.py
testing/test_sct_segment_graymatter.py
#!/usr/bin/env python ######################################################################################### # # Test function sct_segment_graymatter # # --------------------------------------------------------------------------------------- # Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca> # Author...
Python
0
@@ -1193,16 +1193,29 @@ ertfile +'+path_data+' t2s/MNI-
b5ea2179f9c89badf50fdd51217d4e0f70a5cb88
Remove unnecessary try/except functools.update_wrapper import.
django_extensions/admin/__init__.py
django_extensions/admin/__init__.py
# coding=utf-8 # # Autocomplete feature for admin panel # import six import operator from six.moves import reduce import django from django.http import HttpResponse, HttpResponseNotFound from django.conf import settings from django.db import models from django.db.models.query import QuerySet from django.utils.encoding...
Python
0
@@ -78,16 +78,53 @@ perator%0A +from functools import update_wrapper%0A from six @@ -633,156 +633,8 @@ at%0A%0A -try:%0A from functools import update_wrapper%0A assert update_wrapper%0Aexcept ImportError:%0A from django.utils.functional import update_wrapper%0A%0A %0Acla
920872db456987e5bd5002b3bf3fc2168dcbdff4
fix name
django_extra_tools/conf/defaults.py
django_extra_tools/conf/defaults.py
"""Default configuration""" # auth.backends.SuperUserAuthenticateMixin username separator AUTH_BACKEND_USERNAME_SEPARATOR = ':' XHR_MIDDLEWARE_ALLOWED_ORIGINS = '*' XHR_MIDDLEWARE_ALLOWED_METHODS = ['POST', 'GET', 'OPTIONS', 'PUT', 'DELETE'] XHR_MIDDLEWARE_ALLOWED_HEADERS = ['Content-Type', 'Authorization', 'Location...
Python
0.019891
@@ -42,34 +42,36 @@ nds. +Through Super -UserAuthenticateMixin +userModelBackend use
a4a01c466c916f5c4ff44d40bc5e052e98951f1d
Bump version
sqlitebiter/__version__.py
sqlitebiter/__version__.py
__author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016, {}".format(__author__) __license__ = "MIT License" __version__ = "0.29.0" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
Python
0
@@ -130,17 +130,17 @@ = %220.29. -0 +1 %22%0A__main
8ac2103bdef4bc3fe0c81dbbc0015ebad1a1c624
fix syntax
doc/examples/edges/plot_skeleton.py
doc/examples/edges/plot_skeleton.py
""" =========== Skeletonize =========== Skeletonization reduces binary objects to 1 pixel wide representations. This can be useful for feature extraction, and/or representing an object's topology. ``skeletonize`` works by making successive passes of the image. On each pass, border pixels are identified and removed on...
Python
0.000023
@@ -397,17 +397,16 @@ object.%0A -%0A %22%22%22%0Afrom @@ -2133,17 +2133,16 @@ ons.%0A#%0A# - %60%60skele
05458457f12618cc69970cd2bda87e25e29384a4
simplify the code (Thx Stefan)
doc/examples/plot_peak_local_max.py
doc/examples/plot_peak_local_max.py
""" ==================== Finding local maxima ==================== The ``peak_local_max`` function returns the coordinates of local peaks (maxima) in an image. A maximum filter is used for finding local maxima. This operation dilates the original image and merges neighboring local maxima closer than the size of the di...
Python
0.000001
@@ -1223,51 +1223,26 @@ lot( -%5Bp%5B1%5D for p in coordinates%5D, %5Bp%5B0%5D for p in +coordinates%5B:, 1%5D, coo @@ -1249,16 +1249,21 @@ rdinates +%5B:, 0 %5D, 'r.')
c19ed101135b090de15bb13e940a62a2b28dd5b3
Add style and image as allowed tags in markdown
dpb/settings.py
dpb/settings.py
""" Django settings for dpb project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import os SECRET_KEY = os.getenv("SECRET_KEY", "CHANGE_ME") DEBUG = os.getenv(...
Python
0
@@ -4091,16 +4091,40 @@ 'ul',%0A + 'img',%0A 'style',%0A %5D%0AMARKDO
43cbfcab71b0ec92f39e97c87edc2e7c60516784
Fix to allow Overlay.from_values to work with nested containers
holoviews/core/overlay.py
holoviews/core/overlay.py
""" Supplies Layer and related classes that allow overlaying of Views, including Overlay. A Layer is the final extension of View base class that allows Views to be overlayed on top of each other. Also supplies ViewMap which is the primary multi-dimensional Map type for indexing, slicing and animating collections of Vi...
Python
0
@@ -3073,16 +3073,32 @@ y, val). +map(lambda x: x. display( @@ -3104,16 +3104,28 @@ ('auto') +, %5BOverlay%5D) %0A%0A%0A d
e00a82a31de820f28474cb5de47c5715dafd8d18
use the largest remainder method for distributing change in ratio_split()
hordak/utilities/money.py
hordak/utilities/money.py
from decimal import Decimal def ratio_split(amount, ratios): """ Split in_value according to the ratios specified in `ratios` This is special in that it ensures the returned values always sum to in_value (i.e. we avoid losses or gains due to rounding errors). As a result, this method returns a list o...
Python
0
@@ -22,16 +22,59 @@ ecimal%0A%0A +from hordak.defaults import DECIMAL_PLACES%0A %0Adef rat @@ -1138,120 +1138,196 @@ -ratio_total = sum(ratios)%0A divided_value = amount / ratio_total%0A values = %5B%5D%0A for ratio in ratios:%0A +precision = Decimal(10) ** Decimal(-DECIMAL_PLACES)%0A assert amo...
535e646a66186b04347e1ada5c82c957df5e7cff
Add test for invalid ignore entries.
test/runner/lib/sanity/validate_modules.py
test/runner/lib/sanity/validate_modules.py
"""Sanity test using validate-modules.""" from __future__ import absolute_import, print_function import collections import json import os from lib.sanity import ( SanitySingleVersion, SanityMessage, SanityFailure, SanitySuccess, SanitySkipped, ) from lib.util import ( SubprocessError, dis...
Python
0
@@ -4925,32 +4925,704 @@ ))%0A%0A + for path in sorted(ignore.keys()):%0A if os.path.exists(path):%0A continue%0A%0A for line in sorted(ignore%5Bpath%5D.values()):%0A # Keep files out of the list which no longer exist in the repo.%0A ...
36427387c053fa77b8fef1f529235f6f7107f467
move working tree assertion after veryfing dir
dvc/utils/fs.py
dvc/utils/fs.py
import errno import logging import os import shutil import stat import nanotime from shortuuid import uuid from dvc.exceptions import DvcException from dvc.scm.tree import is_working_tree from dvc.system import System from dvc.utils import dict_md5 from dvc.utils import fspath from dvc.utils import fspath_py35 from d...
Python
0.000001
@@ -672,41 +672,8 @@ ee): -%0A assert is_working_tree(tree) %0A%0A @@ -711,16 +711,54 @@ path)):%0A + assert is_working_tree(tree)%0A%0A
29d151366d186ed75da947f2861741ed87af902b
Add missing import to settings
website/addons/badges/settings/__init__.py
website/addons/badges/settings/__init__.py
from .defaults import * # noqa logger = logging.getLogger(__name__) try: from .local import * # noqa except ImportError as error: logger.warn('No local.py settings file found')
Python
0.000001
@@ -1,12 +1,52 @@ +# -*- coding: utf-8 -*-%0Aimport logging%0A%0A from .defaul
29aad4894a31f5b7b58cf8434fd3d88b253b2609
Add tests for min/maxValue ranges for Histogram
test/src/unittests/stats/test_histogram.py
test/src/unittests/stats/test_histogram.py
#!/usr/bin/env python # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
Python
0
@@ -1168,18 +1168,17 @@ 0.0001) - %0A + %0A def t @@ -2118,18 +2118,16 @@ 0.109%5D - %0A exp @@ -2271,17 +2271,16 @@ 5614035%5D - %0A%0A (o @@ -3060,32 +3060,32 @@ edEdges, 0.001)%0A - self.assertA @@ -3159,16 +3159,871 @@ 0.001)%0A%0A + # Test minValue/maxValue ranges.%0A expectedEdge...
6c64674447bd988eef80a4a927acde2eabe04236
Modify error messag
googkit/lib/plugin.py
googkit/lib/plugin.py
import os import googkit.lib.path from googkit.lib.error import GoogkitError INIT_FILE = '__init__.py' COMMAND_FILE = 'command.py' def load(tree): base_dir = googkit.lib.path.plugin() for filename in os.listdir(base_dir): plugin_dir = os.path.join(base_dir, filename) if not os.path.isdir(p...
Python
0.000001
@@ -863,157 +863,80 @@ -msg = 'Invalid plugin %7Bmodule_name%7D do not have register method.'.format(%0A module_name=module_name)%0A raise GoogkitError(msg +raise GoogkitError('No register method found for plugin: ' + module_name )%0A%0A
5da59174363eacc49a08587a93701242c833cfd9
change 'types' to 'type' in line 85 to remove an error
hs_modelinstance/forms.py
hs_modelinstance/forms.py
__author__ = 'Mohamed' from django.forms import ModelForm from django import forms from crispy_forms.layout import * from crispy_forms.bootstrap import * from models import * from hs_core.forms import BaseFormHelper from hs_core.hydroshare import users class ModelOutputFormHelper(BaseFormHelper): def __init__(se...
Python
0.000008
@@ -3637,17 +3637,16 @@ ist(type -s =%5B'Model
1b84cc660848fdee7ed68c17772542956f47e89d
Add `lower` parameter to grab.tools.russian::slugify method
grab/tools/russian.py
grab/tools/russian.py
# coding: utf-8 from __future__ import absolute_import from ..tools.encoding import smart_unicode from pytils.translit import translify import re MONTH_NAMES = u'января февраля марта апреля мая июня июля августа '\ u'сентября октября ноября декабря'.split() RE_NOT_ENCHAR = re.compile(u'[^-a-zA-Z0-9]', ...
Python
0.000001
@@ -500,16 +500,28 @@ fault='' +, lower=True ):%0A v @@ -832,16 +832,52 @@ rip('-') +%0A if lower:%0A value = value .lower()
88f0faa73beeafc30248210c4c6b99b7a9ccbdba
Add AUTOMATIC_REVERSE_PTR option to cfg
config_template.py
config_template.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) # BASIC APP CONFIG WTF_CSRF_ENABLED = True SECRET_KEY = 'We are the world' BIND_ADDRESS = '127.0.0.1' PORT = 9393 LOGIN_TITLE = "PDNS" # TIMEOUT - for large zones TIMEOUT = 10 # LOG CONFIG LOG_LEVEL = 'DEBUG' LOG_FILE = 'logfile.log' # For Docker, leave ...
Python
0
@@ -2341,16 +2341,133 @@ PV6_PTR = False%0A +%0A# Create reverse lookup domain if not exists and PTR record from%0A# A and AAAA records%0AAUTOMATIC_REVERSE_PTR = False%0A
0cc0d4a5ddf938f176c2384503ef88bb31c91898
Transform new schema to old schema, to keep share_v1 up to date
scrapi/processing/elasticsearch.py
scrapi/processing/elasticsearch.py
from __future__ import absolute_import import logging from elasticsearch import Elasticsearch from elasticsearch.exceptions import NotFoundError from elasticsearch.exceptions import ConnectionError from scrapi import settings from scrapi.processing.base import BaseProcessor logger = logging.getLogger(__name__) logg...
Python
0
@@ -270,16 +270,68 @@ ocessor%0A +from scrapi.base.transformer import JSONTransformer%0A %0A%0Alogger @@ -1032,16 +1032,68 @@ re=400)%0A + es.indices.create(index='share_v1', ignore=400)%0A except C @@ -1865,16 +1865,72 @@ ) +%0A self.process_normalized_v1(raw_doc, normalized) %0A%0A de @@ -25...
400df6a27da9225cd6ae68d064fafb588b25d503
Change computation for numerical stability
libs/boxes/bbox_transform.py
libs/boxes/bbox_transform.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import numpy as np import warnings def bbox_transform(ex_rois, gt_rois...
Python
0.000001
@@ -2223,24 +2223,26 @@ newaxis%5D%0A + # pred_w = np @@ -2273,24 +2273,26 @@ newaxis%5D%0A + # pred_h = np @@ -2326,16 +2326,131 @@ waxis%5D%0A%0A + pred_w = np.exp(dw + np.log(widths%5B:, np.newaxis%5D))%0A pred_h = np.exp(dh + np.log(heights%5B:, np.newaxis%5D))%0A%0A%0A pred
909087e5badca063b6124ebda19c4315a1e6a3a8
fix dynamoDB doc test
tests/functional/docs/test_dynamodb.py
tests/functional/docs/test_dynamodb.py
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
Python
0
@@ -1266,16 +1266,32 @@ _writer( +auto_dedup=False )'%5D,%0A
959897478bbda18f02aa6e38f2ebdd837581f1f0
Fix test for changed SctVerificationResult
tests/test_sct_verify_signature.py
tests/test_sct_verify_signature.py
from os.path import join, dirname from utlz import flo from ctutlz.sct.verification import verify_signature def test_verify_signature(): basedir = join(dirname(__file__), 'data', 'test_sct_verify_signature') signature_input = \ open(flo('{basedir}/signature_input_valid.bin'), 'rb').read() signa...
Python
0.000001
@@ -439,57 +439,14 @@ -got_verified, got_output, got_cmd_res = %5C%0A +assert ver @@ -498,119 +498,16 @@ key) -%0A%0A assert got_verified is True%0A assert got_output == 'Verified OK%5Cn'%0A assert got_cmd_res.exitcode == 0 + is True %0A%0A @@ -567,57 +567,14 @@ -got_verified, got_outp...
f72277113ce8155a1725bb69929c83cb95183bd8
order events by room
pyconca2017/pycon_schedule/models.py
pyconca2017/pycon_schedule/models.py
from datetime import datetime from django.db import models """ Presentation """ class Speaker(models.Model): """ Who """ email = models.EmailField(unique=True) full_name = models.CharField(max_length=255) bio = models.TextField(default='') twitter_username = models.CharField(max_length=255, nul...
Python
0.998462
@@ -3144,16 +3144,55 @@ ) +%0A ordering = ('location__name',) %0A%0A @p
b174dbb9cdc352bb83cbedf4ffce54bf29c22729
Remove debug print statement from history_parser Chromium import
lib/history_parser.py
lib/history_parser.py
#!/usr/bin/env python # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
Python
0.000003
@@ -5381,29 +5381,8 @@ um'%0A - print new_path%0A
9cb554c13ae3cec85fd2a3bf0afd9ae2b6cca96a
Refactor target.py
construi/target.py
construi/target.py
import construi.console as console from compose.project import Project from compose.cli.docker_client import docker_client import dockerpty import sys class Target(object): def __init__(self, config): self.config = config self.project = Project.from_dicts( 'construi', config.service...
Python
0.000002
@@ -342,161 +342,127 @@ -def run(self):%0A try:%0A self.setup()%0A%0A service = self.project.get_service(self.config.construi%5B'name'%5D)%0A%0A for cmd i +@property%0A def client(self):%0A return self.project.client%0A%0A @property%0A def commands(self):%0A...
b6a5dcef6a612098dc6abddec831980792c23ddf
Allow API key to be set in config for rottentomatoes_list
flexget/plugins/input/rottentomatoes_list.py
flexget/plugins/input/rottentomatoes_list.py
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils.cached_input import cached try: from flexget.plugins.api_rottentomatoes import lists except ImportError: raise...
Python
0
@@ -1534,32 +1534,75 @@ lf.movie_lists)%0A + root.accept('text', key='api_key')%0A return r @@ -1724,16 +1724,62 @@ es = %5B%5D%0A + api_key = config.get('api_key', None)%0A @@ -1813,24 +1813,105 @@ ig.items():%0A + if type(l_names) is not list: %0A continue...
e73d69d258ab595ee8353efd85a6f37829b47b2b
update docstring
pysat/instruments/methods/general.py
pysat/instruments/methods/general.py
# -*- coding: utf-8 -*- """Provides generalized routines for integrating instruments into pysat. """ from __future__ import absolute_import, division, print_function import pandas as pds import pysat import logging logger = logging.getLogger(__name__) def list_files(tag=None, sat_id=None, data_path=None, format_s...
Python
0
@@ -531,106 +531,65 @@ ine -is intended to be used by pysat instrument modules supporting%0A a particular NASA CDAWeb dataset +provides a standard interfacefor pysat instrument modules .%0A%0A
6b6d3779cd23c188c808387b9f4095ea75da3284
Add a way to get the resources depended on by an output
heat/engine/output.py
heat/engine/output.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 # ...
Python
0.99996
@@ -592,16 +592,50 @@ rt six%0A%0A +from heat.common import exception%0A from hea @@ -659,16 +659,16 @@ unction%0A - %0A%0Aclass @@ -955,16 +955,42 @@ cription +%0A self._deps = None %0A%0A de @@ -1074,24 +1074,24 @@ ving it.%22%22%22%0A - func @@ -1124,16 +1124,539 @@ path)%0A%0A + def ...
0f43efc9c611f4b8bd93a42f85db3e14106915ba
fix burst not work bug
pyspider/database/local/projectdb.py
pyspider/database/local/projectdb.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<roy@binux.me> # http://binux.me # Created on 2015-01-17 12:32:17 import os import re import six import logging from pyspider.database.base.projectdb import ProjectDB as BaseProjectDB class Projec...
Python
0.000001
@@ -676,16 +676,17 @@ s*rate.* +? (%5Cd+(%5C.%5C @@ -697,16 +697,23 @@ )', re.I + %7C re.M )%0A bu @@ -749,16 +749,17 @@ *burst.* +? (%5Cd+(%5C.%5C @@ -770,16 +770,23 @@ )', re.I + %7C re.M )%0A%0A d @@ -932,27 +932,28 @@ elf.rate_re. -mat +sear ch(script)%0A @@ -1088,11 +1088,12 @@ _re. -mat +sear c...
74e4d69a6ab501e11ff266d1ad77992d0203729f
Include os stuff
thumbor_rackspace/loaders/cloudfiles_loader.py
thumbor_rackspace/loaders/cloudfiles_loader.py
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2013 theiconic.com.au development@theiconic.com.au import pyrax def load(context, path, callback): if(...
Python
0
@@ -257,16 +257,53 @@ com.au%0A%0A +from os.path import join, expanduser%0A import p
1fe57b534a200e771f0698de9e1910635e4f3222
allow specifying table
custom/icds_reports/management/commands/migrate_tables.py
custom/icds_reports/management/commands/migrate_tables.py
from __future__ import absolute_import, print_function from __future__ import unicode_literals import argparse import inspect import logging import subprocess import sys from datetime import datetime, date import csv342 as csv from six.moves import input logger = logging.getLogger(__name__) def parse_date(s, defau...
Python
0.000001
@@ -674,24 +674,36 @@ nd_date,%0A + only_table, confirm, dr @@ -1000,16 +1000,221 @@ nd_date) +%0A if only_table:%0A filtered_tables = %5B%0A table for table in filtered_tables if table%5B0%5D == only_table%0A %5D%0A if not filtered_tables:%0A raise Exception(%22No table to ...
61ad96b4a0ba15cfdf9600c15ce8366eda7ef4f4
Allow overriding of list filter properties (mainly used for changing title)
ixxy_admin_utils/list_filters.py
ixxy_admin_utils/list_filters.py
import datetime from django.contrib.admin import SimpleListFilter, FieldListFilter from django.utils import timezone from django.utils.translation import ugettext_lazy as _ def makeRangeFieldListFilter(lookups, nullable=False, title=None): """Mostly based on https://djangosnippets.org/snippets/2779/ ...
Python
0
@@ -168,16 +168,400 @@ as _%0A%0A%0A +def custom_field_list_filter(title=None):%0A%0A # Allow overriding of%0A # ('events__type', custom_field_list_filter(title='event type')),%0A%0A class Wrapper(FieldListFilter):%0A def __new__(cls, *args, **kwargs):%0A instance = FieldListFilter.create(*...
adcf722f41d47f0adb7b7b4a1a5f04a153dabd53
Test the new pipeline method call
tests/python/pipeline/test-pipeline.py
tests/python/pipeline/test-pipeline.py
#!/usr/bin/env python #ckwg +5 # Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to # KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, # Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. def log(msg): import sys sys.stderr.write("%s\n" % msg) def test_imp...
Python
0
@@ -2322,24 +2322,124 @@ port_name1)%0A + p.edge_for_connection(proc_name1, port_name1,%0A proc_name2, port_name2)%0A p.input_
d55210495fde133b8b76ee1f55e593dd43389e0e
Update to use new HTTP APIs.
src/livestreamer/plugins/ongamenet.py
src/livestreamer/plugins/ongamenet.py
from livestreamer.compat import str, bytes from livestreamer.exceptions import PluginError, NoStreamsError from livestreamer.plugin import Plugin from livestreamer.stream import RTMPStream from livestreamer.utils import urlget import re class Ongamenet(Plugin): StreamURL = "http://dostream.lab.so/stream.php" ...
Python
0
@@ -1,47 +1,4 @@ -from livestreamer.compat import str, bytes%0A from @@ -32,21 +32,8 @@ port - PluginError, NoS @@ -105,32 +105,30 @@ mer. -stream import RTMPStream +plugin.api import http %0Afro @@ -146,21 +146,22 @@ mer. -utils +stream import urlg @@ -156,22 +156,26 @@ import -urlget +RTMPStream %0A%0A...
1ab7829903e377033d439052337d98176cd16ae7
Version checking
treeinterpreter/treeinterpreter.py
treeinterpreter/treeinterpreter.py
# -*- coding: utf-8 -*- import numpy as np from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier, _tree from sklearn.ensemble import RandomForestRegressor from sklearn.ensemble import RandomForestClassifier def _get_tree_paths(tree, node_id, depth=0): """ Returns all paths through the tree as...
Python
0
@@ -217,16 +217,210 @@ ssifier%0A +from distutils.version import LooseVersion%0Aimport sklearn%0Aif LooseVersion(sklearn.__version__) %3C LooseVersion(%220.17%22):%0A raise Exception(%22treeinterpreter requires scikit-learn 0.17 or later%22)%0A %0A%0Adef _g
e78d613f66df5f10b59e47b6cfce619182d1297f
Update run.py
src/main/app-resources/py-ndvi/run.py
src/main/app-resources/py-ndvi/run.py
#!/usr/bin/env python import site import os import sys site.addsitedir('/application/share/python/lib/python2.6/site-packages') #print sys.path #os.environ['PYTHONUSERBASE'] = '/application/share/python' #print 'Base:', site.USER_BASE #print 'Site:', site.USER_SITE import ndvi sys.path.append('/usr/lib/ciop/python/...
Python
0.000001
@@ -362,96 +362,141 @@ ', ' -Hello World')%0A%0A#myvar = ciop.getparam('param1')%0A%0A#ciop.log('DEBUG', 'value is: ' + myvar +Calculating NDVI')%0A%0A# create an output folder for the results%0Aoutput.path = os.environ%5B'TMPDIR'%5D + '/output' %0Aos.makedirs(output.path )%0A%0A#
0048794fd6e71f58bf88d84ddefb1e9a0194efca
Fix the mock-image used in test-steps unittests.
tests/test_steps/test_source_extraction.py
tests/test_steps/test_source_extraction.py
import unittest from tkp.testutil import db_subs, data from ConfigParser import SafeConfigParser from tkp.config import parse_to_dict from tkp.testutil.data import default_job_config from tkp.testutil import Mock import tkp.steps.source_extraction import tkp.accessors class MockImage(Mock): def extract(self, *args...
Python
0
@@ -9,16 +9,35 @@ nittest%0A +import numpy as np%0A from tkp @@ -282,16 +282,17 @@ essors%0A%0A +%0A class Mo @@ -392,16 +392,99 @@ kwargs)%0A + @property%0A def rmsmap(self, *args, **kwargs):%0A return np.zeros((1))%0A%0A %0Aclass T
a019f2f5f2dd18761b2c6bce252232dd680d65f1
order my tasks by lastedit as well
python/mod_python/firefox/firefox.py
python/mod_python/firefox/firefox.py
from mod_python import apache import sys, os sys.path.append("/usr/lib") import feedparser, time, pickle feeds = None dumpfile = "/home/vmiklos/ftp/vmiklos.hu/htdocs/startup/feeds" def dumpcache(): global feeds try: socket = open(dumpfile, "w") pickle.dump(feeds, socket) socket.close() except TypeError: os...
Python
0
@@ -1835,18 +1835,16 @@ der= -dateopened +lastedit &sor
edf1e96e56272a10ad767f13e6e8cc886f98055c
Test consecutive Coordinator.heartbeat calls #17
tests/unit/test_stream/test_coordinator.py
tests/unit/test_stream/test_coordinator.py
import functools from bloop.stream.shard import Shard from . import build_get_records_responses def test_coordinator_repr(coordinator): coordinator.stream_arn = "repr-stream-arn" assert repr(coordinator) == "<Coordinator[repr-stream-arn]>" def test_heartbeat_latest(coordinator, session): find_records_id...
Python
0
@@ -267,15 +267,8 @@ beat -_latest (coo @@ -1883,8 +1883,829 @@ , 1, 2%5D%0A +%0A%0Adef test_heartbeat_until_sequence_number(coordinator, session):%0A %22%22%22After heartbeat() finds records for a shard, the shard doens't check during the next heartbeat.%22%22%22%0A shard = Shard(stream_arn=coordinator.stream...
a0c3465b6e8a91da1865971ff97ecf44360fd290
Set filter theshold as a paramter for function build_dict of dataset imikolov
python/paddle/v2/dataset/imikolov.py
python/paddle/v2/dataset/imikolov.py
# Copyright (c) 2016 PaddlePaddle 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 applic...
Python
0
@@ -1297,16 +1297,28 @@ ld_dict( +typo_freq=50 ):%0A %22 @@ -2059,31 +2059,8 @@ '%5D%0A%0A - TYPO_FREQ = 50%0A @@ -2103,17 +2103,17 @@ %5D %3E -TYPO_FREQ +typo_freq , wo
213d6a42d505fb7ca320873cafdc187cf65d10ed
add unit tests for escaping curlies
tests/unit/pypyr/format/string_test.py
tests/unit/pypyr/format/string_test.py
""""string.py unit tests.""" import pypyr.format.string import pytest def test_string_interpolate_works(): context = {'key1': 'down', 'key2': 'valleys', 'key3': 'value3'} input_string = 'Piping {key1} the {key2} wild' output = pypyr.format.string.get_interpolated_string(input_string, context) assert ...
Python
0
@@ -741,32 +741,1040 @@ n incorrect%22)%0A%0A%0A +def test_string_interpolate_escapes_double_curly():%0A context = %7B'key1': 'down', 'key2': 'valleys', 'key3': 'value3'%7D%0A input_string = 'Piping %7B%7B down the valleys wild'%0A output = pypyr.format.string.get_interpolated_string(input_string, context)%0A...
e84b2e11088878d44433bfc767b8abba79eca0a7
use environment variable for config folder
litleSdkPython/Configuration.py
litleSdkPython/Configuration.py
#Copyright (c) 2011-2012 Litle & Co. # #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, publish, distri...
Python
0.000001
@@ -1358,16 +1358,101 @@ Folder = + os.environ%5B'LITLE_SDK_CONFIG'%5D%5C%0A if 'LITLE_SDK_CONFIG' in os.environ else os.path
24e42d5d4a21c1f3ffd36a163b89ee7f39375945
Update P05_trafficLight add assertion to check for red light
books/AutomateTheBoringStuffWithPython/Chapter10/P05_trafficLight.py
books/AutomateTheBoringStuffWithPython/Chapter10/P05_trafficLight.py
# This program emulates traffic lights at intersections with assertions market_2nd = {"ns": "green", "ew": "red"} mission_16th = {"ns": "red", "ew": "green"} def switchLights(stoplight): for key in stoplight.keys(): if stoplight[key] == "green": stoplight[key] = "yellow" elif stopligh...
Python
0
@@ -443,16 +443,98 @@ %22green%22%0A + assert %22red%22 in stoplight.values(), %22Neither light is red! %22 + str(stoplight)%0A %0A%0Aswitch
dbd74718645cec4aaec419b48c2ab0c0e15a9821
Fix up entity indexed at
ingestors/manager.py
ingestors/manager.py
import magic import logging import balkhash from pprint import pprint # noqa from tempfile import mkdtemp from followthemoney import model from banal import ensure_list from normality import stringify from pantomime import normalize_mimetype from balkhash.utils import safe_fragment from servicelayer.archive import ini...
Python
0.000042
@@ -2295,16 +2295,86 @@ child):%0A + %22%22%22Derive entity properties by knowing it's parent folder.%22%22%22%0A @@ -2414,24 +2414,56 @@ s not None:%0A + # Folder hierarchy:%0A @@ -2594,24 +2594,165 @@ , parent.id) +%0A # Avoid re-ingest re-notification:%0A ...
304a220e99694ec6b41a31db8150c7f4604f6ef5
Remove old logging import
flexget/components/notify/notifiers/gotify.py
flexget/components/notify/notifiers/gotify.py
import logging from http import HTTPStatus from requests.exceptions import RequestException from urllib.parse import urljoin from flexget import plugin from flexget.event import event from flexget.plugin import PluginWarning from flexget.utils.requests import Session as RequestSession, TimedLimiter plugin_name = 'g...
Python
0.000001
@@ -1,20 +1,4 @@ -import logging%0A%0A from @@ -280,17 +280,16 @@ imiter%0A%0A -%0A plugin_n @@ -306,45 +306,8 @@ ify' -%0Alog = logging.getLogger(plugin_name) %0A%0Are
77ac4b3cc97731c0fcb387a10fadd1509e057a6d
update with main function and header
controller/test.py
controller/test.py
#!/usr/bin/python2.7 import constants import sys sys.path.insert(0, "./view/") import viewAssessment import viewQuestion import viewTopic import viewSection import viewCourse import viewUser sys.path.insert(0, "./edit/") import editAssessment import editQuestion import editTopic import editSection import editCourse ...
Python
0
@@ -14,16 +14,158 @@ thon2.7%0A +%22%22%22%0Acreated_by: Micah Halter%0Acreated_date: 2/28/2015%0Alast_modified_by: Micah Halter%0Alast_modified_date: 3/2/2015%0A%22%22%22%0A%0A#imports %0Aimport @@ -654,16 +654,44 @@ t User%0A%0A +# functions%0Adef main():%0A print(vi @@ -726,8 +726,62 @@ opi...
d7006769cb868a368c40e5408671088278581ece
add DD_HISTOGRAM_PERCENTILES to config_builder.py
config_builder.py
config_builder.py
#!/opt/datadog-agent/embedded/bin/python ''' This script is used to generate the configuration of the datadog agent. ''' from os import getenv, environ import logging from urllib2 import urlopen, URLError, HTTPError from socket import getdefaulttimeout, setdefaulttimeout from ConfigParser import ConfigParser class C...
Python
0.000001
@@ -2654,24 +2654,111 @@ dogstatsd')%0A + self.set_from_env_mapping('DD_HISTOGRAM_PERCENTILES', 'histogram_percentiles')%0A ####
0353392f7c597354c79f8a13cff33e35881d02b4
Remove @expectedFailure from test_html_import()
future/tests/test_standard_library_renames.py
future/tests/test_standard_library_renames.py
""" Tests for the future.standard_library module """ from __future__ import absolute_import, unicode_literals, print_function from future import standard_library from future import six import sys import textwrap import unittest from subprocess import check_output from future.standard_library import RENAMES, REPLACED...
Python
0
@@ -3366,38 +3366,8 @@ ))%0A%0A - @unittest.expectedFailure%0A @@ -3386,32 +3386,32 @@ l_import(self):%0A + import h @@ -3469,16 +3469,46 @@ l.parser +%0A self.assertTrue(True) %0A%0A @u @@ -3694,16 +3694,46 @@ ookiejar +%0A self.assertTrue(True) %0A%0A @u @@ -3963,16 +3963,4...
b8cec88e733237b94fafb2aa978dcb6b758c954f
Add string representation of Log
irclogview/models.py
irclogview/models.py
from django.db import models from django.core.urlresolvers import reverse from picklefield.fields import PickledObjectField from . import utils class Channel(models.Model): name = models.SlugField(max_length=50, unique=True) updated = models.DateTimeField(auto_now=True) class Meta: ordering = ['...
Python
0.999989
@@ -816,16 +816,155 @@ date')%0A%0A + def __unicode__(self):%0A return u'#%25s - %25s' %25 (self.channel.name,%0A self.date.strftime('%25Y-%25m-%25d'))%0A%0A def
28fd64565ea2e7b1e40e88e6121936d03a77b444
Fix task set generator.
generic-8-link/generated/generate_task_set.py
generic-8-link/generated/generate_task_set.py
#!/usr/bin/python template = ''' environment {{ robot_filename: "../robot/setup.robot" environment_filename: "../environment/obstacles_{1_difficulty}.stl" max_underestimate: 20.0 }} generator {{ type: {2_generator_type} seed: {6_seed} keys: 2 keys: 3 keys: 5 keys: 7 keys: 11 keys: 13 }} index {{ ...
Python
0.000006
@@ -301,16 +301,38 @@ eys: 13%0A + keys: 17%0A keys: 19%0A %7D%7D%0Aindex @@ -737,33 +737,33 @@ : '''%0A q: -1 +2 0%0A q: 10%0A q: 10%0A @@ -746,33 +746,33 @@ : 20%0A q: -1 +2 0%0A q: 10%0A q: 10%0A @@ -755,33 +755,33 @@ : 20%0A q: -1 +2 0%0A q: 10%0A q: 10%0A @@ -764,33 +764,33 @...
b18f23adba22641910e19d056cf3e3a97477540a
update trace
geoconnect/apps/dv_notify/metadata_updater.py
geoconnect/apps/dv_notify/metadata_updater.py
from __future__ import print_function import os import json import requests # for POST if __name__=='__main__': import sys CURRENT_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(os.path.join(CURRENT_DIR, '../')) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geoconnect.settings.loc...
Python
0.000001
@@ -2895,32 +2895,91 @@ etadata_params)%0A + print ('update url: %25s' %25 self.api_update_url)%0A req @@ -3176,16 +3176,104 @@ == 200:%0A + %0A print ('request text: %25s' %25 req.text)%0A %0A
c62a658eb469e449372207f146f60375d7497f63
update dataset api
ismrmrdpy/dataset.py
ismrmrdpy/dataset.py
# Copyright (c) 2014-2015 Ghislain Antony Vaillant. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of...
Python
0.000001
@@ -1803,32 +1803,71 @@ x):%0A pass +%0A%0A def number_of_acquisitions(self): %0A %0A de @@ -1851,32 +1851,37 @@ (self):%0A +pass%0A %0A def append_ @@ -1957,32 +1957,65 @@ x):%0A pass +%0A%0A def number_of_images(self): %0A %0A de @@ -1999,32 +1999,37 @@ (self)...
1bd6943acf40ea049091b5437b6ecec71c907d07
Set default logging level to error
tools/nodeset_compiler/nodeset_compiler.py
tools/nodeset_compiler/nodeset_compiler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. ### ### Authors: ### - Chris Iatrou (ichrispa@core-vector.net) ### - Juli...
Python
0.000006
@@ -4168,24 +4168,55 @@ on='count',%0A + default=1,%0A
7f46a10bf1391b52b9b83171a1291a2a79bfba8a
Remove unused dependency simplejson.
tools/pdtools/pdtools/controller_client.py
tools/pdtools/pdtools/controller_client.py
import os from simplejson.scanner import JSONDecodeError from six.moves.urllib.parse import urlparse from .authenticated_client import AuthenticatedClient from .config import PdtoolsConfig from .devices.camera import Camera from .util import LoginGatherer LOCAL_DEFAULT_USERNAME = "paradrop" LOCAL_DEFAULT_PASSWORD = ...
Python
0
@@ -7,55 +7,8 @@ os%0A -from simplejson.scanner import JSONDecodeError%0A from
b558941fce5933f2b3b145ee3bf9f7452086b8f3
Update hr_employee.py
l10n_br_hr/models/hr_employee.py
l10n_br_hr/models/hr_employee.py
# (c) 2014 Kmee - Rafael da Silva Lima <rafael.lima@kmee.com.br> # (c) 2014 Kmee - Matheus Felix <matheus.felix@kmee.com.br> # (c) 2016 KMEE Informática - Daniel Sadamo <daniel.sadamo@kmee.com.br> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from datetime import datetime from erpbrasil.base.fiscal ...
Python
0.000019
@@ -532,17 +532,16 @@ loyee'%0A%0A -%0A natu
3effb540220f4ce1918d0210e882d926e268473f
Bump P4Runtime to v1.2.0
tools/build/bazel/p4lang_workspace.bzl
tools/build/bazel/p4lang_workspace.bzl
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") P4RUNTIME_VER = "1.0.0" P4RUNTIME_SHA = "667464bd369b40b58dc9552be2c84e190a160b6e77137b735bd86e5b81c6adc0" def generate_p4lang(): http_archive( name = "com_github_p4lang_p4runtime", urls = ["https://github.com/p4lang/p4runtime/ar...
Python
0.000001
@@ -82,17 +82,17 @@ ER = %221. -0 +2 .0%22%0AP4RU @@ -108,72 +108,72 @@ = %22 -667464bd369b40b58dc9552be2c84e190a160b6e77137b735bd86e5b81c6adc0 +0fce7e06c63e60a8cddfe56f3db3d341953560c054d4c09ffda0e84476124f5a %22%0A%0Ad
64e902fae3117c246272cbde943d013da1345b7b
Fix RenameField alteration
gravity/migrations/0003_tiltbridge_mdns_id.py
gravity/migrations/0003_tiltbridge_mdns_id.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2019-03-18 23:46 from __future__ import unicode_literals from django.db import migrations, models import django.core.validators class Migration(migrations.Migration): dependencies = [ ('gravity', '0002_tilt_refactor'), ] operations = [ ...
Python
0
@@ -1058,152 +1058,8 @@ ),%0A - migrations.RenameField(%0A model_name='tiltbridge',%0A old_name='api_key',%0A new_name='mdns_id',%0A ),%0A
5389663818e3bdf10556e0a8d7d4ceeb14d798d1
Exclude even more non-essential directories from the release tarball.
tools/export_tarball/export_tarball.py
tools/export_tarball/export_tarball.py
#!/usr/bin/python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This tool creates a tarball with all the sources, but without .svn directories. It can also remove files which are not strictly re...
Python
0.000013
@@ -943,24 +943,68 @@ o3d/tests',%0A + 'third_party/angle/samples/gles2_book',%0A 'third_p @@ -1028,24 +1028,58 @@ tionaries',%0A + 'third_party/hunspell/tests',%0A 'third_p @@ -1140,13 +1140,833 @@ rty/ -vc_80 +sqlite/test',%0A 'third_party/vc_80',%0A 'third_party/xdg-utils/tests',%0A 'thir...
86c7d73e312115da1dfea6f7b73e768de0d35519
Fix some typos
hypchat/jsonobject.py
hypchat/jsonobject.py
from __future__ import absolute_import, division import json import re _urls_to_objects = {} class Linker(object): """ Responsible for on-demand loading of JSON objects. """ url = None def __init__(self, url, parent=None, _requests=None): self.url = url self.__parent = parent self._requests = _requests or ...
Python
0.999999
@@ -2273,32 +2273,38 @@ a room.%0A%09%09%22%22%22%0A%09%09 +self._ requests.post(se @@ -2330,24 +2330,24 @@ on', data=%7B%0A - %09%09%09'color': @@ -2571,16 +2571,22 @@ %09%09%22%22%22%0A%09%09 +self._ requests @@ -2801,16 +2801,22 @@ son):%0A%09%09 +self._ requests @@ -3337,21 +3337,49 @@ e room.%0A - %09%0...
2957b4020a7c3eeeaab63d0f5088b47b9b53395c
Raise non 404 Error in generate-tempest-plugin-list.py
tools/generate-tempest-plugins-list.py
tools/generate-tempest-plugins-list.py
#! /usr/bin/env python # Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
Python
0.000007
@@ -3030,16 +3030,81 @@ n False%0A + # We should not ignore non 404 errors.%0A raise err%0A p =
fc4aada050fd995ecf5375871fa1e6ed1884293f
fix hail-apiserver.py module path (#4850)
hail/python/hail-apiserver/hail-apiserver.py
hail/python/hail-apiserver/hail-apiserver.py
import hail as hl from hail.utils.java import Env, info import logging import flask hl.init() app = flask.Flask('hail-apiserver') @app.route('/execute', methods=['POST']) def execute(): code = flask.request.json info(f'execute: {code}') jir = Env.hail().expr.Parser.parse_value_ir(code, {}, {}...
Python
0
@@ -279,16 +279,21 @@ ().expr. +ir.IR Parser.p
1d10582d622ce6867a85d9e4e8c279ab7e4ab5ab
Revert "Don't complain about \r when core.autocrlf is on in Git"
src/etc/tidy.py
src/etc/tidy.py
#!/usr/bin/python import sys, fileinput, subprocess err=0 cols=78 config_proc=subprocess.Popen([ "git", "config", "core.autocrlf" ], stdout=subprocess.PIPE) result=config_proc.communicate()[0] autocrlf=result.strip() == b"true" if result is not None else False def report_err(s): global err print("%s:%d:...
Python
0
@@ -37,20 +37,8 @@ nput -, subprocess %0A%0Aer @@ -54,208 +54,8 @@ 78%0A%0A -config_proc=subprocess.Popen(%5B %22git%22, %22config%22, %22core.autocrlf%22 %5D,%0A stdout=subprocess.PIPE)%0Aresult=config_proc.communicate()%5B0%5D%0Aautocrlf=result.strip() == b%22true%22 if result is not None else False%0A%0A def ...
f5fa434c6e0b7ed68bf8969203c355459e319ac8
removed extraneous comma
src/data/data_pool.py
src/data/data_pool.py
# -*- coding: utf-8 -*- from __future__ import division import os, re from sentence import Sentence import logging import re from learn.partition import partition_data logging.basicConfig(filename='glm_parser.log', level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(messa...
Python
0.999635
@@ -5385,17 +5385,16 @@ regex, 1 -, )%0A%09for d
9dcf5e0b30141641a0e182257b34720bcf07d730
Fix typo in S3_Bucket_With_Versioning_And_Lifecycle_Rules.py (#693)
examples/S3_Bucket_With_Versioning_And_Lifecycle_Rules.py
examples/S3_Bucket_With_Versioning_And_Lifecycle_Rules.py
# Converted from S3_Bucket.template located at: # http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ from troposphere import Output, Ref, Template from troposphere.s3 import Bucket, PublicRead, VersioningConfiguration, \ LifecycleConfiguration, LifecycleRule, NoncurrentVersionTransition, \ Life...
Python
0.998464
@@ -1094,19 +1094,20 @@ le Confi +gu ra -g tion%0A%0A
a378649f85f0bc55060ad0238e426f587bc2ff1a
Send location only when printing exception (Avoid leaking ID/UUID)
core/exceptions.py
core/exceptions.py
""" exceptions - Core exceptions """ class InvalidMembership(Exception): """ The membership provided is not valid """ pass class SourceNotFound(Exception): """ InstanceSource doesn't have an associated source. """ pass class RequestLimitExceeded(Exception): """ A limit was ...
Python
0
@@ -707,16 +707,17 @@ rovider: + %25s%22 %5C%0A @@ -748,16 +748,25 @@ provider +.location ,)%0A p
1d5b3322f8f2f18640e640d7f015814df4274a89
Upgrade default go to 1.8.3. (#4799)
contrib/go/src/python/pants/contrib/go/subsystems/go_distribution.py
contrib/go/src/python/pants/contrib/go/subsystems/go_distribution.py
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import sub...
Python
0
@@ -1270,16 +1270,18 @@ ult='1.8 +.3 ', finge
93323426c22a08965544b19c818e53c8f2b29e8c
clean select_channel widget
ldk/gui/select_channel_widget.py
ldk/gui/select_channel_widget.py
# -*- coding: utf-8 -*- from pyqtgraph.Qt import QtGui, QtCore class SelectChannelWidget(QtGui.QWidget): def __init__(self, plot_widget): super(SelectChannelWidget, self).__init__() self.plot_widget = plot_widget self.layout = QtGui.QGridLayout() self.adc...
Python
0
@@ -340,661 +340,208 @@ -for i in range(2):%0A self.adc_checkbox.append(QtGui.QCheckBox('ADC '+str(i+1), self))%0A self.adc_checkbox%5Bi%5D.setCheckState(QtCore.Qt.Checked)%0A self.layout.addWidget(self.adc_checkbox%5Bi%5D,0,i,QtCore.Qt.AlignCenter)%0A %0A self.d...
0f4e977f18dc1e3b9bbe2f25c3c326ac769fecbd
order size to have thumbnail in first
insight/api/async.py
insight/api/async.py
# -*- coding: utf-8 -*- """Async API view""" from flask import abort, request from redis import StrictRedis import json from insight.api.config import INSIGHT_ENGINES try: import settings except ImportError: settings = None REDIS_QUEUE_KEY = getattr(settings, 'REDIS_QUEUE_KEY', 'insight') REDIS_HOST = getatt...
Python
0
@@ -2150,21 +2150,29 @@ zes'%5D = +sorted( sizes +) %0A %0A
68d54aec7a44aeae72f63155e0e0e11e6dd658a1
Add test for invalid option
tests/chainer_tests/links_tests/loss_tests/test_negative_sampling.py
tests/chainer_tests/links_tests/loss_tests/test_negative_sampling.py
import unittest import numpy import chainer from chainer import cuda from chainer.functions.loss import negative_sampling from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.parameterize(*testing.pro...
Python
0.000004
@@ -3223,16 +3223,722 @@ _gpu)%0A%0A%0A +class TestNegativeSamplingInvalidReductionOption(unittest.TestCase):%0A%0A def setUp(self):%0A self.link = links.NegativeSampling(3, %5B10, 5, 2, 5, 2%5D, 3)%0A self.x = numpy.random.uniform(-1, 1, (2, 3)).astype(numpy.float32)%0A self.t = numpy.random.r...
ea545f205fd495f996b90910857af6e87da14272
update adapter to use new scheme
courses/adapter.py
courses/adapter.py
from courses.models import Semester, Department, Course from ccxp.fetch import Browser def update_departments(browser=None): if browser is None: browser = Browser() new = update = 0 for department in Browser().get_departments(): if Department.objects.filter(abbr=department['abbr']).exists(...
Python
0
@@ -74,32 +74,227 @@ mport Browser%0A%0A%0A +def get_browser(browser=None):%0A if browser is None:%0A browser = Browser()%0A print(browser.get_captcha_url())%0A browser.set_captcha(input('Input captcha from above url: '))%0A%0A%0A def update_depar @@ -410,25 +410,23 @@ ment in -B +b rowser ...
044edd3d9e6d14b8394a881fdb6389923e73545a
Add back system_health_info to the base of lovelace (#43382)
homeassistant/components/lovelace/__init__.py
homeassistant/components/lovelace/__init__.py
"""Support for the Lovelace UI.""" import logging import voluptuous as vol from homeassistant.components import frontend from homeassistant.config import async_hass_config_yaml, async_process_component_config from homeassistant.const import CONF_FILENAME from homeassistant.core import callback from homeassistant.exce...
Python
0
@@ -1207,16 +1207,70 @@ _slug,%0A) +%0Afrom .system_health import system_health_info # NOQA %0A%0A_LOGGE
1eb90901e936a93ab2f5353080df9bad8c5d44bd
Update class comment
htmresearch/regions/CoordinateSensorRegion.py
htmresearch/regions/CoordinateSensorRegion.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
Python
0
@@ -1258,16 +1258,48 @@ networks + using NuPIC's CoordinateEncoder .%0A%0A It
7eed2f61039a87f4163aef949740e1629378bd35
That should be a string
src/subreddits.py
src/subreddits.py
import logging.handlers from datetime import datetime from datetime import timedelta import database import globals import reddit import strings import utility log = logging.getLogger("bot") def processSubreddits(): subredditsCount = 0 postsCount = 0 messagesSent = 0 foundPosts = [] for subreddits in database....
Python
1
@@ -1048,16 +1048,20 @@ eddit %22+ +str( submissi @@ -1073,16 +1073,17 @@ breddit) +) %0A%09%09%09subm @@ -1466,16 +1466,20 @@ eddit': +str( submissi @@ -1490,16 +1490,17 @@ ubreddit +) %7D)%0A%09%09%09if
0116f38160c03939306470127f0489c98aeee954
Update nanomsg build file
shipyard/shipyard/nanomsg/build.py
shipyard/shipyard/nanomsg/build.py
"""Build nanomsg from source.""" from foreman import define_parameter, define_rule, decorate_rule from shipyard import ( ensure_directory, git_clone, run_commands, install_packages, copy_libraries, ) (define_parameter('deps') .with_doc("""Build-time Debian packages.""") .with_type(list) .wi...
Python
0
@@ -1177,20 +1177,66 @@ udo +c make -install +--build . --target install%0A sudo ldconfig %0A
fe3798cf932880b2eac14e86d2652d08fdcbd093
Make method static to make it easier to move later.
src/tdl/client.py
src/tdl/client.py
__author__ = 'tdpreece' __author__ = 'tdpreece' import logging import time import json from collections import OrderedDict import stomp logger = logging.getLogger('tdl.client') logger.addHandler(logging.NullHandler()) class Client(object): def __init__(self, hostname, port, username): self.hostname = ho...
Python
0
@@ -1585,16 +1585,61 @@ ge_from( +self.implementation_map, self.remote_broker, headers, @@ -2638,32 +2638,50 @@ ener(Listener):%0A + @staticmethod%0A def process_ @@ -2690,36 +2690,65 @@ xt_message_from( -self +implementation_map, remote_broker , headers, messa @@ -2771,20 +2771,24 @@ ponse = -self +Lis...
535b1ea375465713f7505016e40d3fcd7533341f
write dtm
lexos/models/similarity_model.py
lexos/models/similarity_model.py
import os import numpy as np import pandas as pd from os import makedirs from flask import request from typing import Optional from os.path import join as path_join from sklearn.metrics.pairwise import cosine_similarity from lexos.helpers import constants from lexos.models.base_model import BaseModel from lexos.helpers...
Python
0.999971
@@ -5816,9 +5816,180 @@ '%5Cn')%0A%0A + # append the pandas data frame to the file%0A with open(out_file_path, 'a') as f:%0A self._similarity_maker().to_csv(f)%0A%0A return out_file_path %0A
22f3b74fec790847c3e353aad84b51252637a90f
Revert "oe.path.relative: switch to a different appraoch"
lib/oe/path.py
lib/oe/path.py
def join(*paths): """Like os.path.join but doesn't treat absolute RHS specially""" from os import sep from os.path import normpath return normpath(sep.join(paths)) def relative(src, dest=None): """ Return a relative path from src to dest(default=cwd). >>> relative("/usr/bin", "/tmp/foo/bar") ...
Python
0
@@ -88,60 +88,22 @@ -from os import sep%0A from os.path import normpath%0A +import os.path %0A @@ -110,16 +110,24 @@ return +os.path. normpath @@ -127,19 +127,19 @@ ormpath( -sep +%22/%22 .join(pa @@ -171,13 +171,8 @@ dest -=None ):%0A @@ -221,21 +221,8 @@ dest -(default=cwd) .%0A%0A @@ -411,47...
0f004830bd220ad8da1d4b151897630431d2f195
tweak scoring functions, always
cryptools/crack.py
cryptools/crack.py
# -*- coding: utf-8 -*- import string from stringutils import convert, freq def brute_xor(cyphertext, st_freqs): """Bruteforce a given single-character XOR-encrypted cyphertext. Statistical information is used to choose which character is the most likely key. :param cyphertext: the cyphertext to cr...
Python
0
@@ -17,16 +17,28 @@ f-8 -*-%0A +import math%0A import s @@ -437,23 +437,20 @@ essage, -distanc +scor e)%60%60%0A @@ -914,23 +914,20 @@ -distanc +scor e = 0.0%0A @@ -973,72 +973,15 @@ # -use two classifiers, based on pos'n in std freq list & freq dist +scoring %0A @@ -1097,16 +1097,17 @@ st_...
d48099080cedc81e70f79cbf45514cd77c5329eb
fix recorder bug
uliweb/contrib/recorder/middle_recorder.py
uliweb/contrib/recorder/middle_recorder.py
from uliweb import Middleware from uliweb.utils.common import request_url class RecorderrMiddle(Middleware): ORDER = 600 def process_response(self, request, response): from uliweb import settings, functions, json_dumps import base64 #if not debug status it'll quit ...
Python
0.000001
@@ -488,13 +488,16 @@ if -s and +not s or s.s
f9cc0155ba076f73d63d2106373371044b5f144d
add testsrequired for skipModule
lib/runtest.py
lib/runtest.py
#!/usr/bin/env python # Copyright (C) 2015 Intel Corporation # # Released under the MIT license (see COPYING.MIT) # ./runtest.py -b build_data.json -a tag -f test.manifest import sys import os import time import unittest import inspect from functools import wraps BASEDIR = os.path.abspath(os.path.join(os.path.dirna...
Python
0
@@ -3699,16 +3699,92 @@ tslist%0A%0A + #add testsrequired for skipModule %0A tc.testsrequired = tc.testslist%0A%0A depl
c6a9fcfe817128d3e7b0f52625bcd2e6c1c92f76
fix #4491: auth1 test needs sapi for login (#4492)
tests/auth1_test.py
tests/auth1_test.py
# -*- coding: utf-8 -*- u"""Test sirepo.auth :copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function import pytest from pykern import pkcollections from sirepo import srunit @sru...
Python
0
@@ -537,16 +537,38 @@ t flask%0A + import sirepo.api%0A impo @@ -1108,16 +1108,70 @@ try:%0A + # TODO(rorour): get sapi from current request%0A @@ -1220,16 +1220,40 @@ ='myapp' +, sapi=sirepo.api.Base() )%0A
5798b7e66b17aa24564d379619faa4d16651a821
fix up benchmark test to actually work. Hasn't been run in a while, obviously
tests/benchmarks.py
tests/benchmarks.py
# Brute Force: # 481 hits # 29637.96 usec/pass # # Memory-based Rtree Intersection: # 481 hits # 1216.70 usec/pass # \Disk-based Rtree Intersection: # 481 hits # 2617.95 usec/pass import random import timeit try: import pkg_resources pkg_resources.require('Rtree') except: pass from rtree import Rtree as...
Python
0
@@ -2946,25 +2946,27 @@ ction:%22%0A -print len +hits = list (disk_in @@ -2988,16 +2988,32 @@ n(bbox)) +%0Aprint len(hits) , %22hits%22 @@ -3389,16 +3389,21 @@ esult = +list( disk_ind @@ -3434,24 +3434,25 @@ jects=%22raw%22) +) %0A print l
646db72eca34f6006d189f0a143d0c00388d1955
Update viehicle.py
sketches/ev_steering_1/viehicle.py
sketches/ev_steering_1/viehicle.py
class Viehicle(): def __init__(self, x, y): self.acceleration = PVector(0, 0) self.velocity = PVector(0, 0) self.location = PVector(x, y) self.r = 8.0 self.maxspeed = 5 self.maxforce = 0.1 self.d = 25 def update(self): self.velocity.add(s...
Python
0
@@ -449,28 +449,24 @@ mult(0)%0A - %0A def app
50af61832d781a5730c0b6d35a24e3ac4f1a5282
Always return nil if something went wrong
rsqueakvm/plugins/database_plugin.py
rsqueakvm/plugins/database_plugin.py
# -*- coding: utf-8 -*- from rsqueakvm.database import dbm from rsqueakvm.error import PrimitiveFailedError from rsqueakvm.plugins.plugin import Plugin from rsqueakvm.primitives.bytecodes import * from rsqueakvm.model.database import W_DBObject from sqpyte import interpreter from sqpyte.capi import CConfig DatabaseP...
Python
0.878975
@@ -3500,90 +3500,19 @@ uery -.column_type(0) == CConfig.SQLITE_NULL:%0A return interp.space.w_nil%0A elif + is None or que @@ -3569,64 +3569,32 @@ r -aise PrimitiveFailedError('First column not an integer') +eturn interp.space.w_nil %0A
6032ba08c0222bd0f10f045d242d48a2b4db92ff
change in the qc file structure
ehive/runnable/process/RunMutiQC.py
ehive/runnable/process/RunMutiQC.py
import os, subprocess,fnmatch from shutil import copy2 from ehive.runnable.IGFBaseProcess import IGFBaseProcess from igf_data.utils.fileutils import get_temp_dir,remove_dir class RunMutiQC(IGFBaseProcess): def param_defaults(self): params_dict=super(IGFBaseProcess,self).param_defaults() params_dict.update({ ...
Python
0.000001
@@ -1971,23 +1971,16 @@ fastqc'%5D -.keys() %5D)%0A @@ -2055,23 +2055,16 @@ screen'%5D -.keys() %5D)%0A
e2adcd5681a0afbed7be7c1451dfcdaf66d9790c
Indent the if for _img (derp)
swood/sample.py
swood/sample.py
from PIL import Image import numpy as np from . import complain import pyfftw import wave pyfftw.interfaces.cache.enable() class CalculatedFFT: def __init__(self, avgdata, spacing): self.avgdata = avgdata self.spacing = spacing class Sample: def __init__(self, filename, binsize, volume=0.8,...
Python
0.000114
@@ -3419,32 +3419,36 @@ f._img:%0A + self._img = Imag @@ -3480,24 +3480,28 @@ + (self.length @@ -3518,16 +3518,20 @@ nnels),%0A + @@ -3615,16 +3615,20 @@ + %22raw%22, %22 @@ -3637,16 +3637,20 @@ , 0, 1)%0A + @@ -3720,16 +3720,20 @@ parser%0...
b58c8b4f9d049207b7e7e0e4de7058959df90b70
Use sendgrid's Subject type when sending email. (#1033)
src/appengine/libs/mail.py
src/appengine/libs/mail.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -788,16 +788,58 @@ rt Mail%0A +from sendgrid.helpers.mail import Subject%0A from sen @@ -1436,23 +1436,32 @@ subject= +Subject( subject +) ,%0A
425ae0042b050773e7c55f3cdc34ca3a68069238
use test app
sacrud/pyramid_ext/tests/__init__.py
sacrud/pyramid_ext/tests/__init__.py
# -*- coding: utf-8 -*- from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine, orm import unittest from sacrud.tests.test_models import User, Profile, PHOTO_PATH, Base from sacrud.action import get_relations, delete_fileobj, read, update, delete from sacrud.action import get_pk, index, create fr...
Python
0.000001
@@ -2649,16 +2649,20 @@ = self. +test app.get(
b393b432c4f24906e1919999402ed56bde49086e
Fix test case - found another trunk tunnel on layer 0.
integration-test/546-road-sort-keys-tunnel.py
integration-test/546-road-sort-keys-tunnel.py
# tunnels at level = 0 #https://www.openstreetmap.org/way/167952621 assert_has_feature( 16, 10475, 25324, "roads", {"kind": "highway", "kind_detail": "motorway", "id": 167952621, "name": "Presidio Pkwy.", "is_tunnel": True, "sort_rank": 333}) # http://www.openstreetmap.org/way/259492762 assert_has_feature...
Python
0
@@ -292,18 +292,18 @@ /2594927 -62 +89 %0Aassert_ @@ -331,16 +331,16 @@ 1926 -7 +6 , 2463 -4 +5 , %22r @@ -410,18 +410,18 @@ 2594927 -62 +89 ,%0A %22 @@ -432,20 +432,20 @@ %22: %22 -Raymond Blvd +McCarter Hwy .%22,
c3b92c1de1c8a2b9e0b3e585277186d5e453a06e
Copy the namespace of the root as well, otherwise it gets added to the string elements themselves and this gets messy and ugly
java/graveyard/support/scripts/copy-string.py
java/graveyard/support/scripts/copy-string.py
#!/usr/bin/env python import os import os.path import sys import lxml.etree source_path = os.path.expanduser('~/workspace/git/android/packages/apps/Mms') #source_path = os.path.expanduser('~/workspace/git/android/platform/packages/apps/Mms') #source_path = os.path.expanduser('~/workspace/git/android/frameworks/base/...
Python
0
@@ -1931,19 +1931,133 @@ ent( -'resources' +%0A source_root.getroot().tag,%0A nsmap=source_root.getroot().nsmap )%0A
eeb2276306942120481f2b3e5b41056cb9cdfb5d
Add citations to edges
indra/cx_assembler.py
indra/cx_assembler.py
import json import itertools from collections import OrderedDict from indra.statements import * class CxAssembler(): # http://www.ndexbio.org/data-model/ def __init__(self): self.statements = [] self.existing_nodes = {} self.existing_edges = {} self.cx = {'nodes': [], 'edges': [...
Python
0
@@ -403,59 +403,222 @@ ' -networkAttributes': %5B%5D%7D%0A self.id_counter = 0 +citations': %5B%5D, 'edgeCitations': %5B%5D,%0A 'networkAttributes': %5B%5D%7D%0A self.id_counter = 0%0A%0A def _get_new_id(self):%0A ret = self.id_counter%0A self.id_counter += 1%0A ...
8944bbec97ffdb026bc1662028f8a8bd8633c23a
Remove child/parent aspect.
ingestors/ingestor.py
ingestors/ingestor.py
import sys import traceback import os.path import logging import importlib import inspect import hashlib from datetime import datetime try: import magic except ImportError as error: logging.exception(error) class States: """Available ingestor states.""" #: Initiated, but no processing was done yet. ...
Python
0.000009
@@ -3141,21 +3141,8 @@ ath, - parent=None, mim @@ -3373,197 +3373,8 @@ str%0A - :param parent: Indicates parent file if this is was part of a composed%0A file. Examples: archives, email files, etc.%0A :type parent: :py:class:%60Ingestor%60%0A @@ -3461,64 +3461,8 @@ th)%0A ...
90c42beafe4dc5168224fd96cf7891695c7cf346
fix save default values
ini_tools/ini_file.py
ini_tools/ini_file.py
import os from config_parser import WZConfigParser from profile_loader import Profile, get_profiles_name_list from generate_ini_header import get_header class WZException(Exception): pass class IniFile(dict): profiles = get_profiles_name_list() def get_profile_for_ini(self): name = os.path.base...
Python
0.000001
@@ -1797,19 +1797,24 @@ t')) == +str( val +) :%0A
8f898be3d642bb4690e19b7e91ba087fba68dac0
Fix bug that conditions are ignored other than last [ignore_properties add-on]
jumeaux/addons/judgement/ignore_properties.py
jumeaux/addons/judgement/ignore_properties.py
# -*- coding:utf-8 -*- """For example of config judgement: - name: jumeaux.addons.judgement.ignore_properties config: ignores: - title: reason image: https://......png link: https://...... conditions: - path: '/route' changed: ...
Python
0
@@ -331,18 +331,16 @@ ems'%5D%5B0%5D - %0A @@ -2417,32 +2417,24 @@ %22added%22: -payload. diff_keys.ad @@ -2437,32 +2437,32 @@ s.added.reject(%0A + @@ -2568,32 +2568,24 @@ %22removed%22: -payload. diff_keys.re @@ -2692,32 +2692,32 @@ ),%0A + @@ -27...
59bdc15846158db9123a764f87cdb0dd1a959a22
remove print statements from unit test
test_qudt4dt.py
test_qudt4dt.py
__author__ = 'adam' #import urllib #import time #from subprocess import Popen #import shlex #import os import fusekiutils import qudt4dt import unittest class TestQudt(unittest.TestCase): def setUp(self,result = None): self.barb = qudt4dt.Barbara("http://localhost:3030") def test_get_uni...
Python
0.000018
@@ -1008,37 +1008,16 @@ nkine'%5D%0A - print result%0A @@ -1581,29 +1581,8 @@ e'%5D%0A - print result%0A
3640cb895bb93d144a615d4b745af135016d67af
order imports
src/plone.server/plone/server/__init__.py
src/plone.server/plone/server/__init__.py
# -*- encoding: utf-8 -*- # create logging import logging logger = logging.getLogger('plone.server') from zope.i18nmessageid import MessageFactory # noqa _ = MessageFactory('plone') # load the patch before anything else. from plone.server import patch # noqa # load defined migrations from plone.server.migrate impor...
Python
0.000002
@@ -22,166 +22,8 @@ -*- -%0A# create logging%0Aimport logging%0Alogger = logging.getLogger('plone.server')%0A%0Afrom zope.i18nmessageid import MessageFactory # noqa%0A_ = MessageFactory('plone') %0A%0A# @@ -98,16 +98,89 @@ # noqa%0A +%0Afrom plone.server import interfaces%0Afrom plone.server import languages%0A%...
93473bed77b3cfdfea8e943d65f5661aff3fc8de
add show plot in example code
librosa/util/_nnls.py
librosa/util/_nnls.py
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Non-negative least squares''' # The scipy library provides an nnls solver, but it does # not generalize efficiently to matrix-valued problems. # We therefore provide an alternate solver here. # # The vectorized solver uses the L-BFGS-B over blocks of # data to efficient...
Python
0
@@ -4064,16 +4064,35 @@ ayout()%0A + %3E%3E%3E plt.show()%0A '''%0A
d6b509d7c625016a6ae5514a8b4d0e3dd6d6a9f4
Set up global tempdir manager in BaseCommand
src/pip/_internal/cli/base_command.py
src/pip/_internal/cli/base_command.py
"""Base Command class, and related routines""" from __future__ import absolute_import, print_function import logging import logging.config import optparse import os import platform import sys import traceback from pip._internal.cli import cmdoptions from pip._internal.cli.command_context import CommandContextMixIn f...
Python
0
@@ -889,16 +889,80 @@ et_prog%0A +from pip._internal.utils.temp_dir import global_tempdir_manager%0A from pip @@ -3186,32 +3186,226 @@ st%5Bstr%5D) -%3E int%0A + # Intentionally set as early as possible so globally-managed temporary%0A # directories are available to the rest of the code.%0A self...