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
f12dbc789d32d981795db3cbfb51cce9aece9efc
change focal length (add wood height)
fluxghost/utils/laser_pattern.py
fluxghost/utils/laser_pattern.py
# !/usr/bin/env python3 from math import pi, sin, cos # import cv2 laser_on = False def to_image(buffer_data, img_width, img_height): int_data = list(buffer_data) print(int_data[:10]) assert len(int_data) == img_width * img_height, "data length != width * height, %d != %d * %d" % (len(int_data), img_width...
Python
0
@@ -665,32 +665,36 @@ F600 X%22 + str(( +0 - x2) / ratio) + %22 @@ -777,16 +777,16 @@ o, s -low=Fals +peed=Non e):%0A @@ -926,11 +926,12 @@ if s -low +peed :%0A @@ -949,18 +949,34 @@ n %5B%22G1 F -50 +%22 + str(speed) + %22 X%22 + st @@ -970,32 +970,36 @@ ) + %22 X%22 + str(( +0 - x2) / ratio) + %22 @@ ...
f37846159a379922954b76736719c9683fed7541
add HTTPError __str__
framework/exceptions/__init__.py
framework/exceptions/__init__.py
# -*- coding: utf-8 -*- '''Custom exceptions for the framework.''' import copy import httplib as http from flask import request class FrameworkError(Exception): """Base class from which framework-related errors inherit.""" pass class HTTPError(FrameworkError): error_msgs = { http.BAD_REQUEST: { ...
Python
0.000124
@@ -2641,16 +2641,66 @@ )%0A%0A + def __str__(self):%0A return repr(self)%0A%0A def
c9d2c71970779afba7d277bcc5b89799b4a425a5
fix pygments bug that appeared in python3 migration
frontend/src/cloogle_pygments.py
frontend/src/cloogle_pygments.py
import urllib import sys import codecs import pygments import pygments.lexers import pygments.formatters from pygments.token import Literal, Name, Operator _escape_html_table = { ord('&'): u'&amp;', ord('<'): u'&lt;', ord('>'): u'&gt;', ord('"'): u'&quot;', ord("'"): u'&#39;', } CLEAN_SYNTAX_TOKEN...
Python
0
@@ -6,16 +6,22 @@ t urllib +.parse %0Aimport @@ -3797,17 +3797,14 @@ )%0A%0A%0A +# try:%0A - with @@ -3834,28 +3834,24 @@ ) as f:%0A - - inp = u''%0A @@ -3848,28 +3848,24 @@ p = u''%0A - - for l in f:%0A @@ -3872,20 +3872,16 @@ - - inp += l @@ -3898,20 +3898,16 @@ atin1')...
a049ec4ebfa59e4f0ffc98f113f6e9f3cf7a336d
Fix checkpoint fullstack
karbor/tests/fullstack/test_checkpoints.py
karbor/tests/fullstack/test_checkpoints.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Python
0.000143
@@ -3755,24 +3755,94 @@ volumes%22%22%22%0A + self.skipTest('Requires cinder protection plugin adjustment')%0A volu
4eb90c33557fbc8ecd0ed0a88976ffe5c91607e3
get event date from segment U 'data_ocorrencia' position: 138-145
l10n_br_cnab_import/file_cnab240_parser.py
l10n_br_cnab_import/file_cnab240_parser.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Luis Felipe Mileo - mileo at kmee.com.br # Fernando Marcato Rodrigues # Copyright 2015 KMEE - www.kmee.com.br # # This program is free software: you can redistribute it and/or modify # ...
Python
0.999995
@@ -3793,16 +3793,36 @@ amount +and data_ocorrencia from seg @@ -4317,32 +4317,242 @@ count + rebate)%0A + # replace vencimento with data_ocorrencia%0A transacoes%5B-1%5D%5B'date'%5D = datetime.datetime.strptime(%0A str(evento.data_ocorrenci...
4812f64b651ab64881510d38d4e35ce4ce22b04f
Fix method has same name as property
examples/speech_recognition/data/asr_dataset.py
examples/speech_recognition/data/asr_dataset.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import numpy as np from fairseq.data import FairseqDataset from . import data_utils from .collaters import Seq2SeqCollater class ...
Python
0.000007
@@ -2711,24 +2711,28 @@ self. +s2s_ collater = S @@ -3290,16 +3290,20 @@ rn self. +s2s_ collater
08c29fcae3c622b0f47a0b73338b372ddcee42eb
support py2
utils/search.py
utils/search.py
#!/usr/bin/env python """ Filter tweet JSON based on a regular expression to apply to the text of the tweet. search.py <regex> file1 Or if you want a case insensitive match: search.py -i <regex> file1 """ import re import sys import json import argparse import fileinput from twarc import json2csv if le...
Python
0
@@ -213,16 +213,55 @@ 1%0A%0A%22%22%22%0A%0A +from __future__ import print_function%0A%0A import r
57435f651d1d517e1ae60b7676dcfff1c1130eb8
add proper type cast()
examples/viewports_override_layer_attributes.py
examples/viewports_override_layer_attributes.py
# Copyright (c) 2022, Manfred Moitzi # License: MIT License from pathlib import Path import ezdxf from ezdxf.layouts import Paperspace MESH_SIZE = 20 DIR = Path("~/Desktop/Outbox").expanduser() if not DIR.exists(): DIR = Path(".") COUNT = 7 LAYER_NAME = "Layer{}" PAPER_WIDTH = 22 PAPER_HEIGHT = 17 MARGIN = 1 de...
Python
0.000001
@@ -53,16 +53,40 @@ License%0A +from typing import cast%0A from pat @@ -3248,18 +3248,24 @@ psp -: += cast( Paperspa @@ -3266,18 +3266,17 @@ perspace - = +, doc.lay @@ -3293,24 +3293,9 @@ t1%22) - # type: ignore +) %0A
23302ebfe91545f7f88ba763753f558df8b224ce
allow insecure content
lg_common/src/lg_common/managed_browser.py
lg_common/src/lg_common/managed_browser.py
import sys import rospy import socket import shutil import os from lg_common import ManagedApplication, ManagedWindow from lg_common.tcp_relay import TCPRelay from lg_common.msg import ApplicationState from tornado.websocket import websocket_connect DEFAULT_BINARY = '/usr/bin/google-chrome' DEFAULT_ARGS = [ '--en...
Python
0
@@ -699,16 +699,56 @@ ion=0',%0A + '--allow-running-insecure-content',%0A '--d
4dc1552bbbdbfb060eb4559c5cded6a5c8e8fd02
Migrate kythe for Bazel 0.27 (#3769)
kythe/cxx/tools/fyi/testdata/compile_commands.bzl
kythe/cxx/tools/fyi/testdata/compile_commands.bzl
"""Rule for generating compile_commands.json.in with appropriate inlcude directories.""" load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") _TEMPLATE = """ {{ "directory": "OUT_DIR", "command": "clang++ -c {filename} -std=c++11 -Wall -Werror -I. -IBASE_DIR {system_includes}", "file...
Python
0
@@ -1385,10 +1385,71 @@ s_impl,%0A + toolchains = %5B%22@bazel_tools//tools/cpp:toolchain_type%22%5D,%0A )%0A
d003765047a8a6796e28531a28ba1364950ccd27
Remove request.POST save - incompatible with DRF v3.6.3.
lms/djangoapps/bulk_enroll/views.py
lms/djangoapps/bulk_enroll/views.py
""" API views for Bulk Enrollment """ import json from edx_rest_framework_extensions.authentication import JwtAuthentication from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView from bulk_enroll.serializers import BulkEnrollmentSerializer from enrollme...
Python
0
@@ -2173,48 +2173,8 @@ ():%0A - request.POST = request.data%0A
cabae8d7732cca922e3fb56db205e41a20186aa3
Remove markdown
DataCleaning/data_cleaning.py
DataCleaning/data_cleaning.py
# -*- coding: utf-8 -*- """ Script for Importing data from MySQL database and cleaning """ import os import pymysql import pandas as pd from bs4 import BeautifulSoup from ftfy import fix_text ## Getting Data # Changing directory os.chdir("") # Running the file containing MySQL information execfile("connection_config...
Python
0.000033
@@ -1391,16 +1391,83 @@ %22, %22%22)%0A%0A +# Remove markdown%0Abody_new = body_new.str.replace(%22%5B$#~%5E*_%5D%22, %22%22)%0A%0A # Cleani @@ -1528,17 +1528,16 @@ %22%5B%5Cr%5Cn%5Ct -$ %5Cxa0%5D%22,
f3ff33932180e177dfd87eada7cf4ba1e253e0b4
fix user view set add queryset
accounts/views.py
accounts/views.py
from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.core.urlresolvers import reverse_lazy from django.shortcuts import get_object_or_404 from django.views.generic import UpdateView, FormView from...
Python
0.000058
@@ -2264,32 +2264,72 @@ cUserSerializer%0A + queryset = TimtecUser.objects.all()%0A ordering = (
2557d93e6607fb61b9ba607ca85f0eb1c9d13871
Update the rfam problems part of export query
luigi/rnacentral/search/exporter.py
luigi/rnacentral/search/exporter.py
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
Python
0
@@ -2535,155 +2535,8 @@ %7D%7D'%0A - when (array_agg(pre.rfam_problems))%5B1%5D = '' then '%7B%7B%7D%7D'%0A when (array_agg(pre.rfam_problems))%5B1%5D is null then '%7B%7B%7D%7D'%0A
abcae974229dc28a60f78b706f7cd4070bc530fa
update doc
lib/ansible/modules/windows/win_feature.py
lib/ansible/modules/windows/win_feature.py
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, Trond Hindenes <trond@hindenes.com> and others # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by #...
Python
0
@@ -2584,16 +2584,109 @@ tp%22 all%0A +ansible -m %22win_feature%22 -a %22name=NET-Framework-Core source=C:/Temp/iso/sources/sxs%22 windows%0A %0A%0A# Play
23b56303d3afa4764d7fa4f4d82eafbaf57d0341
Update the version number
ailib/__init__.py
ailib/__init__.py
# PyAI # The MIT License # # Copyright (c) 2014,2015,2016,2017 Jeremie DECOCK (http://www.jdhp.org) # # 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 l...
Python
0.000045
@@ -1603,17 +1603,17 @@ '0.2.dev -0 +1 '%0A%0A__all
4fb02e4bdf4af30826a00dadc4883cd2d9922541
Fix type errors, move from partial to explicit connector function
aiosqlite/core.py
aiosqlite/core.py
# Copyright 2017 John Reese # Licensed under the MIT license import asyncio import logging import sqlite3 from concurrent.futures import ThreadPoolExecutor from functools import partial from typing import Any, Callable, Iterable __all__ = [ 'connect', 'Connection', 'Cursor', ] Log = logging.getLogger('a...
Python
0
@@ -2632,20 +2632,25 @@ utor(1)%0A +%0A +def connecto @@ -2650,27 +2650,41 @@ onnector - = partial( +() -%3E sqlite3.Connection: %0A @@ -2684,16 +2684,23 @@ +return sqlite3. @@ -2706,26 +2706,28 @@ .connect -,%0A +(%0A database @@ -2714,24 +2714,26 @@ (%0A + dat...
d2cfc7f2fefcb9a317ab3cd18ebc8785fb764d9f
remove last bang
lib/exabgp/bgp/message/open/capability/refresh.py
lib/exabgp/bgp/message/open/capability/refresh.py
#!/usr/bin/env python # encoding: utf-8 """ refresh.py Created by Thomas Mangin on 2012-07-17. Copyright (c) 2012 Exa Networks. All rights reserved. """ # =================================================================== RouteRefresh class RouteRefresh (list): def __str__ (self): return "Route Refresh (unparsed...
Python
0.008047
@@ -1,26 +1,4 @@ -#!/usr/bin/env python%0A # en
4fa4fb3f583e787da9594ac8a714a22981842c71
remove now-bogus test
pydoctor/test/test_commandline.py
pydoctor/test/test_commandline.py
from pydoctor import driver import sys, cStringIO def geterrtext(*options): options = list(options) se = sys.stderr f = cStringIO.StringIO() print options sys.stderr = f try: try: driver.main(options) except SystemExit: pass else: asse...
Python
0.000005
@@ -508,121 +508,8 @@ rr%0A%0A -def test_no_do_nothing():%0A err = geterrtext()%0A assert %22this invocation isn't going to do anything%22 in err%0A%0A def
158e1ee867abac18eaabe366b4f453b3e3dcaa51
Add sort_by to Grondwatermonster.
pydov/search/grondwatermonster.py
pydov/search/grondwatermonster.py
# -*- coding: utf-8 -*- """Module containing the search classes to retrieve DOV groundwater samples.""" import pandas as pd from pydov.types.fields import _WfsInjectedField from .abstract import AbstractSearch from ..types.grondwatermonster import GrondwaterMonster from ..util import owsutil class GrondwaterMonsterS...
Python
0
@@ -3167,16 +3167,45 @@ ry=None, + sort_by=None,%0A return_ @@ -3216,31 +3216,16 @@ ds=None, -%0A max_fea @@ -4367,16 +4367,105 @@ ameter.%0A + sort_by : owslib.fes.SortBy, optional%0A List of properties to sort by.%0A @@ -5797,16 +5797,25 @@ , query, + so...
2d8a3b4dfbd9cfb6c5368c1b4a04e2bd07e97f18
Add Big O time complexity
pygorithm/data_structures/heap.py
pygorithm/data_structures/heap.py
# Author: ALLSTON MICKEY # Contributed: OMKAR PATHAK # Created On: 11th August 2017 from queue import Queue # min-heap implementation as priority queue class Heap(Queue): def parent_idx(self, idx): return idx / 2 def left_child_idx(self, idx): return (idx * 2) + 1 def right_child_idx(sel...
Python
0.000056
@@ -586,11 +586,10 @@ ee ( -fir +la st e @@ -773,16 +773,191 @@ is met.%0A + %0A Best Case: O(1), item is inserted at correct position, no swaps needed%0A Worst Case: O(logn), item needs to be swapped throughout all levels of tree%0A @@ -1402,16 +1402,25 @@ priority +, at root ) f...
4f46ed9ae0e75afe49da3bcb8f9b91cd6ce78544
Remove cached class.
pymatgen/entries/compatibility.py
pymatgen/entries/compatibility.py
#!/usr/bin/env python """ This module implements Compatibility corrections for mixing runs of different functionals. """ from __future__ import division __author__ = "Shyue Ping Ong, Anubhav Jain" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "1.0" __maintainer__ = "Shyue Ping Ong" __email__ ...
Python
0
@@ -648,22 +648,8 @@ s%0A%0A%0A -@cached_class%0A clas
4dfdc6cd8b7b716eaab31cf7e489ecbdb92a1116
Use the record's __class__ rather than self.model, which isn't set in BaseEndpoint.
ajax/endpoints.py
ajax/endpoints.py
from django.core import serializers from django.core.exceptions import ValidationError from django.db import models from django.utils import simplejson as json from django.utils.encoding import smart_str from django.utils.translation import ugettext_lazy as _ from django.db.models.fields import FieldDoesNotExist from a...
Python
0
@@ -1371,34 +1371,40 @@ f = -self.model +record.__class__ ._meta.get_f
579904c318031ed049f697f89109bd6909b68eba
Revise docstring
alg_merge_sort.py
alg_merge_sort.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division def _merge_recur(x_list, y_list): """Merge two sorted lists by recusions.""" if len(x_list) == 0: return y_list if len(y_list) == 0: return x_list if x_list[0] <= y_list[0]: ...
Python
0.000009
@@ -171,17 +171,17 @@ ists by -r +R ecusions @@ -512,25 +512,25 @@ ists by -i +I teration .%22%22%22%0A @@ -521,16 +521,45 @@ teration + (i.e. Two Fingers Algorithm) .%22%22%22%0A @@ -1271,17 +1271,17 @@ sort by -d +D ivide an @@ -1286,17 +1286,17 @@ and -c +C onquer -a +A lgor
919ceccc688b20091f2feabc52bd43c9d2e53d71
move to python3
src/xii/builtin/components/node/attributes/network/node_network.py
src/xii/builtin/components/node/attributes/network/node_network.py
import libvirt import xml.etree.ElementTree as etree from time import sleep from xii import error, need from xii.validator import String, Or, Dict, RequiredKey, Ip from xii.components.node import NodeAttribute class NetworkAttribute(NodeAttribute, need.NeedLibvirt): atype = "network" defaults = "default" ...
Python
0.000031
@@ -2193,16 +2193,21 @@ aces = +list( filter(_ @@ -2254,16 +2254,17 @@ rface%22)) +) %0A%0A
c94f24160e1d9189f13ea0029cccb815fb68d3da
Update postag.py
pythainlp/wangchanberta/postag.py
pythainlp/wangchanberta/postag.py
from typing import Dict, List, Tuple, Union import re from transformers import ( CamembertTokenizer, AutoTokenizer, pipeline, ) _model_name = "wangchanberta-base-att-spm-uncased" _tokenizer = CamembertTokenizer.from_pretrained( f'airesearch/{_model_name}', revision='main') if _model_name ==...
Python
0
@@ -2274,14 +2274,59 @@ tag.tag(text +, corpus = corpus,grouped_word = grouped_word )%0A
2c5a345aa7e21045d6a76225dc192f14b62db4f6
fix review permission manage command
symposion/reviews/management/commands/create_review_permissions.py
symposion/reviews/management/commands/create_review_permissions.py
from django.core.management.base import BaseCommand from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from symposion.proposals.models import ProposalSection class Command(BaseCommand): def handle(self, *args, **options): ct, created = ContentTy...
Python
0
@@ -292,25 +292,16 @@ ct -, created = Conte @@ -322,42 +322,14 @@ .get -_or_create (%0A - model=%22%22,%0A @@ -347,16 +347,26 @@ _label=%22 +symposion_ reviews%22 @@ -383,37 +383,35 @@ -defaults=%7B%22name%22: %22reviews%22%7D%0A + model=%22review%22%0A
f056d43facbb3f5ae0248e590bf09832b41ea9a0
fix assertion: converting numpy array to bool does not default to 'True'.
data_access/read_spectrum_fits.py
data_access/read_spectrum_fits.py
import csv import itertools import os.path import numpy as np import pyfits import astropy.table as table import common_settings from pixel_flags import PixelFlags from data_access.qso_data import QSORecord, QSOData settings = common_settings.Settings() QSO_FILE = settings.get_qso_metadata_fits() # read header name...
Python
0.000004
@@ -3559,67 +3559,171 @@ ata -and ivar_data and and_mask_data and or_mask_data and o_grid +is not None%0A assert ivar_data is not None%0A assert and_mask_data is not None%0A assert or_mask_data is not None%0A assert o_grid is not None %0A
5cb0d875cfe480a30a58aaa7aed71bca20b3aa9b
Allow giving explicit lexer name.
scripts/find_error.py
scripts/find_error.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Lexing error finder ~~~~~~~~~~~~~~~~~~~ For the source files given on the command line, display the text where Error tokens are being generated, along with some context. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :licens...
Python
0
@@ -3113,20 +3113,114 @@ n(fn -):%0A try:%0A +, lexer=None):%0A if lexer is not None:%0A lx = get_lexer_by_name(lexer)%0A else:%0A try:%0A @@ -3273,16 +3273,20 @@ me(fn))%0A + exce @@ -3300,32 +3300,36 @@ eError:%0A + try:%0A @@ -3329,16 +3329,20 @@ ...
c8398415bf82a1f68c7654c8d4992661587fccf7
Update pathlib-recursive-rmdir.py
python/pathlib-recursive-rmdir.py
python/pathlib-recursive-rmdir.py
import pathlib # path: pathlib.Path - directory to remove def removeDirectory(path): for i in path.glob('*'): if i.is_dir(): removeDirectory(i) else: i.unlink() path.rmdir()
Python
0.000001
@@ -178,16 +178,123 @@ nlink()%0A + # NOTE: can replace above lines with %60removeConents(path)%60 scrap form pathlib-recursive-remove-contents %0A path.r
e718615eac8e964b46ded826e68fe1087ee33f09
set DEBUG to False (oops)
frontend/fifoci/settings/base.py
frontend/fifoci/settings/base.py
# This file is part of the FifoCI project. # Copyright (c) 2014 Pierre Bourdon <delroth@dolphin-emu.org> # Licensing information: see $REPO_ROOT/LICENSE """ Django settings for fifoci project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings ...
Python
0.000014
@@ -1035,19 +1035,20 @@ DEBUG = -Tru +Fals e%0ATEMPLA @@ -1058,19 +1058,20 @@ DEBUG = -Tru +Fals e%0A%0AALLOW
85581374377d76e6dfd76e81477c1598c0944959
Add in/out filetypes to searchsettings (python)
python/pysearch/searchsettings.py
python/pysearch/searchsettings.py
# -*- coding: utf-8 -*- ################################################################################ # # searchsettings.py # # class SearchSettings: encapsulates search settings # ################################################################################ import re class SearchSettings(object): """a class...
Python
0
@@ -267,16 +267,47 @@ mport re +%0Afrom filetypes import FileType %0A%0Aclass @@ -560,24 +560,60 @@ ''.split())%0A +# TODO: move filetypes to own group%0A _pattern @@ -720,32 +720,91 @@ ut_filepatterns%0A + in_filetypes out_filetypes%0A @@ -2919,16 +2919,541 @@...
5a84b0161a5bc31b2da5bf6a5458c2c1a3ea9aa9
Define value for DEBUG setting based on environment
jarbas/settings.py
jarbas/settings.py
""" Django settings for Jarbas project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
Python
0.000002
@@ -897,16 +897,52 @@ 'debug') +%0ADEBUG = ENVIRONMENT != 'production' %0A%0AALLOWE
7668331e7cc4f5e2a310fcddcb3f90af4c18bb30
add Python 3 compatibility imports to capabilities.py
python/pywatchman/capabilities.py
python/pywatchman/capabilities.py
# Copyright 2015 Facebook, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the f...
Python
0
@@ -1523,16 +1523,148 @@ AMAGE.%0A%0A +from __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import print_function%0A# no unicode literals%0A%0A import r
67a748197266c30f0ab8977b55bde9df7fe6a96d
Fix loguniform range in tune tutorial (#28131)
python/ray/tune/tests/tutorial.py
python/ray/tune/tests/tutorial.py
# flake8: noqa # Original Code: https://github.com/pytorch/examples/blob/master/mnist/main.py # fmt: off # __tutorial_imports_begin__ import numpy as np import torch import torch.optim as optim import torch.nn as nn from torchvision import datasets, transforms from torch.utils.data import DataLoader import torch.nn.fu...
Python
0
@@ -4760,17 +4760,14 @@ r%22, -1e -10, -0. +- 1),%0A
97545d3055a0e0044723e0cb4b7ffd7803d1dbd5
Make class constants.
qipipe/staging/airc_collection.py
qipipe/staging/airc_collection.py
import re from .staging_error import StagingError __all__ = ['with_name'] EXTENT = {} """A name => collection dictionary for all supported AIRC collections.""" def collection_with_name(name): """ @param name: the OHSU QIN collection name @return: the corresponding AIRC collection """ return EXTEN...
Python
0
@@ -1614,16 +1614,42 @@ up(1))%0A%0A +class AIRCCollection:%0A BREAST = @@ -1722,17 +1722,54 @@ at*/*')%0A -%0A + %22%22%22The Breast collection.%22%22%22%0A%0A SARCOMA @@ -1828,28 +1828,62 @@ %7CS%5Cd+V)(%5Cd+)', '*concat*/*') +%0A %22%22%22The Sarcoma collection.%22%22%22
b3163923a6a17cbfc64ee912c5f351402c3ac367
version bump
amnet/__init__.py
amnet/__init__.py
from amnet.amn import * import amnet.atoms import amnet.smt import amnet.util import amnet.lyap __version__ = "0.0.4"
Python
0.000001
@@ -111,9 +111,9 @@ %220. -0.4 +2.0 %22%0A
ed263e083dcb49bdd3f2d6cc707008cb5fe8ce1b
remove account.reconcile before deleting a account.move
account_statement_ext/account.py
account_statement_ext/account.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joel Grand-Guillaume # Copyright 2011-2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
Python
0
@@ -1258,32 +1258,129 @@ nt.%0A %22%22%22%0A + reconcile_to_delete = %5B%5D%0A reconcile_obj = self.pool.get('account.move.reconcile')%0A for move @@ -1517,58 +1517,123 @@ id:%0A - move_line.reconcile_id.unlink( +%09%09%09%09%09reconcile_to_delete.append(move_line.reco...
9e0c521cc003c9c9096845dd01db2a535aa2c659
Add supports_chunked_encoding attribute to GoogleStorageDriver class.
libcloud/storage/drivers/google_storage.py
libcloud/storage/drivers/google_storage.py
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
Python
0.00015
@@ -4833,8 +4833,46 @@ MESPACE%0A + supports_chunked_encoding = False%0A
55373ddcf68641ec0654b58b8471c01e749366f9
Use a single redis client object for the module
tinman/handlers/redis.py
tinman/handlers/redis.py
"""The RedisRequestHandler uses tornado-redis to support Redis. It will auto-establish a single redis connection when initializing the connection. """ import logging import tornadoredis from tornado import web LOGGER = logging.getLogger(__name__) class RedisRequestHandler(web.RequestHandler): """This request ha...
Python
0
@@ -243,16 +243,37 @@ ame__)%0A%0A +redis_client = None%0A%0A %0Aclass R @@ -434,35 +434,8 @@ %22%22%22%0A - REDIS_CLIENT = 'redis'%0A @@ -511,112 +511,212 @@ def -prepare(self):%0A super(RedisRequestHandler, self).prepare()%0A if not +_connect_to_redis(self):%0A %22%22%22Connect to a...
10766f6f0e66ed3fbe5c6ec23d81926076129163
delete test code
jellyblog/views.py
jellyblog/views.py
from django.shortcuts import render, get_object_or_404, redirect from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from .models import Category, Document def sorted_category(): return_category = list(Category.objects.all()) childList = [] for category in return_category: if ...
Python
0.000001
@@ -2367,39 +2367,8 @@ e):%0A - print(paginator.num_pages)%0A
eb07abeaaa13952b862377c231e81db060bbf1a4
set subgraph_retries config in the retries test (#3076)
tests/integration_tests/tests/agentless_tests/test_task_retries.py
tests/integration_tests/tests/agentless_tests/test_task_retries.py
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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
@@ -1091,32 +1091,94 @@ ries', retries)%0A + self.client.manager.put_config('subgraph_retries', 0)%0A self.cli
9326d6e602234cfe9d0224cc697f273b8036e64c
allow article previews for admin users
source/articles/views.py
source/articles/views.py
from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.views.generic import ListView, DetailView from .models import Article from source.base.utils import paginate from taggit.models import Tag # Current iteration does not use this in nav, but leaving dict # in place f...
Python
0
@@ -4729,39 +4729,480 @@ -queryset = Article.live_objects +if self.request.user.is_staff:%0A # simple method for allowing article preview for editors,%0A # bypassing %60live_objects%60 check on detail view. List pages%0A # populate with public articles only, but admin user can hit...
65972062c03133a79ff77d90f8a11fd16f7d16ff
Correct column name
luigi/tasks/rfam/pgload_go_term_mapping.py
luigi/tasks/rfam/pgload_go_term_mapping.py
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute 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 requir...
Python
0
@@ -982,20 +982,29 @@ id,%0A -name +rfam_model_id %0A)%0ASET%0A
3b20bbe9c0d647ec59fc30e7bb0b786ad3b77609
Add utf-8 encoding
afl_scraper/spiders/afltables.py
afl_scraper/spiders/afltables.py
import scrapy import os import fnmatch from lxml import etree AFL_STAT_HEADER = ["#", "S_ON", "S_OFF", "T_NM", "T_NS", "P_NM", "KI", "MK", "HB", "DI", "GL", "BH", "HO", "TK", "RB", "IF", "CL", "CG", "FF", "FA", "BR", "CP", "UP", "CM", "MI", "1%", "BO", "GA", "%P"] AFL_SUB_ON = " ↑" AFL_SU...
Python
0.002015
@@ -1,12 +1,37 @@ +# -*- coding: utf-8 -*-%0A%0A import scrap @@ -557,9 +557,9 @@ 201 -6 +7 ))%0A
a9aad224d6875e774cd0f7db7e30965ea6a3fbdc
Fix simple typo: taget -> target (#591)
algorithms/search/jump_search.py
algorithms/search/jump_search.py
import math def jump_search(arr,target): """Jump Search Worst-case Complexity: O(√n) (root(n)) All items in list must be sorted like binary search Find block that contains target value and search it linearly in that block It returns a first target value in array reference:...
Python
0.999977
@@ -510,16 +510,17 @@ ntain ta +r get valu
3f2d7df4082b39c6f1fce04ff015b06ab30ad9a1
Use distutils.version instead of pkg_resources
tools/sosreport/tower.py
tools/sosreport/tower.py
# Copyright (c) 2014 Ansible, Inc. # All Rights Reserved. import sos from pkg_resources import parse_version if parse_version(sos.__version__) >= parse_version('3.0'): from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin class tower(Plugin, RedHatPlugin, UbuntuPlugin): '''Collect Ansible Tower ...
Python
0.000001
@@ -72,29 +72,33 @@ rom -pkg_resources +distutils.version import pars @@ -93,23 +93,22 @@ import -parse_v +LooseV ersion%0A%0A @@ -110,23 +110,22 @@ ion%0A%0Aif -parse_v +LooseV ersion(s @@ -147,15 +147,14 @@ %3E= -parse_v +LooseV ersi
9c062d779fe7cb3fc439ff03f25ade58f6045ee5
fix PythonActivity path
androidhelpers.py
androidhelpers.py
from jnius import PythonJavaClass, java_method, autoclass # SERVICE = Autoclass('org.renpy.PythonService').mService SERVICE = autoclass('org.renpy.PythonActivity').mActivity Intent = autoclass('android.content.Intent') BluetoothManager = SERVICE.getSystemService(SERVICE.BLUETOOTH_SERVICE) ADAPTER = BluetoothManager...
Python
0.00012
@@ -137,24 +137,32 @@ ('org.renpy. +android. PythonActivi
f240c72e88e70f771305f44a14907929c6ddacb2
Delete obsolete _robust_bool and get_parent_attr (#265)
aospy/utils/io.py
aospy/utils/io.py
"""Utility functions for data input and output.""" import logging import subprocess import numpy as np def _robust_bool(obj): try: return bool(obj) except ValueError: return obj.any() def get_parent_attr(obj, attr, strict=False): """Search recursively through an object and its parent fo...
Python
0
@@ -103,900 +103,8 @@ p%0A%0A%0A -def _robust_bool(obj):%0A try:%0A return bool(obj)%0A except ValueError:%0A return obj.any()%0A%0A%0Adef get_parent_attr(obj, attr, strict=False):%0A %22%22%22Search recursively through an object and its parent for an attribute.%0A%0A Check if the object has ...
9ff6f01f7319270f66e2cc32aa5201ad53228e8f
Add __init__ and __call_internal__ for isotropicHernquistdf
galpy/df/isotropicHernquistdf.py
galpy/df/isotropicHernquistdf.py
# Class that implements isotropic spherical Hernquist DF # computed using the Eddington formula from .sphericaldf import sphericaldf from .Eddingtondf import Eddingtondf class isotropicHernquistdf(Eddingtondf): """Class that implements isotropic spherical Hernquist DF computed using the Eddington formula""" de...
Python
0.000043
@@ -329,16 +329,25 @@ __(self, +pot=None, ro=None, @@ -592,16 +592,24 @@ __(self, +pot=pot, ro=ro,vo @@ -626,74 +626,1307 @@ def -fE(self,E):%0A # Stub for computing f(E)%0A return None%0A +__call_internal__(self,*args):%0A %22%22%22%0A NAME:%0A%0A __call_internal__%0A%0A ...
c40a2516951d735084eccd184e7ae44ba36510e3
Modify default source value
tests/mq/test_esworker_sns_sqs.py
tests/mq/test_esworker_sns_sqs.py
#!/usr/bin/env python # 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/. # Copyright (c) 2017 Mozilla Corporation # # Contributors: # Brandon Myers bmyers@mozilla.com im...
Python
0.000001
@@ -3090,12 +3090,15 @@ : u' -None +UNKNOWN ',%0A
07f39fbd3e068a01105f0c3a13523d9fbd78cc29
add tests for pathway results
tests/test_pathway_predictions.py
tests/test_pathway_predictions.py
# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
Python
0
@@ -743,64 +743,289 @@ meo. -strain_design.pathway_prediction import PathwayPredictor +core.pathway import Pathway%0Afrom cameo.flux_analysis.analysis import PhenotypicPhasePlaneResult%0Afrom cameo.strain_design.pathway_prediction import PathwayPredictor%0Afrom cameo.strain_design.pathway_prediction.pathway_predictor ...
035f77f9f5db6088a9331e0d9beb0c393982fbe4
rename function plus refactor
web/impact/impact/v1/views/mentor_program_office_hour_list_view.py
web/impact/impact/v1/views/mentor_program_office_hour_list_view.py
# MIT License # Copyright (c) 2019 MassChallenge, Inc. from django.db.models import Value as V from django.db.models.functions import Concat from impact.v1.views.base_list_view import BaseListView from impact.v1.helpers import ( MentorProgramOfficeHourHelper, ) ID_FIELDS = ['mentor_id', 'finalist_id'] NAME_FIELDS...
Python
0.000001
@@ -631,34 +631,41 @@ f self._has_ -participan +mentor_or_finalis t_filter(NAM @@ -706,34 +706,41 @@ ._filter_by_ -participan +mentor_or_finalis t_names(qs)%0A @@ -757,34 +757,41 @@ f self._has_ -participan +mentor_or_finalis t_filter(ID_ @@ -847,103 +847,8 @@ s)%0A%0A - user_name = self.request.query_par...
c5c509ff9e2c4599fcf51044abc9e7cbe4a152e1
remove redundant method [skip ci]
custom/enikshay/management/commands/base_model_reconciliation.py
custom/enikshay/management/commands/base_model_reconciliation.py
import csv from datetime import datetime from django.core.management.base import BaseCommand, CommandError from django.core.mail import EmailMessage from django.conf import settings from custom.enikshay.const import ENROLLED_IN_PRIVATE class BaseModelReconciliationCommand(BaseCommand): email_subject = None ...
Python
0.000003
@@ -1117,96 +1117,8 @@ ue%0A%0A - @staticmethod%0A def get_result_file_headers():%0A raise NotImplementedError%0A%0A @@ -1957,36 +1957,32 @@ fieldnames=self. -get_ result_file_head @@ -2193,20 +2193,16 @@ es=self. -get_ result_f
550e37d703fcc4200dfaf03e483b009d88b02276
bump version number
scrubadub/__init__.py
scrubadub/__init__.py
from typing import Union, List, Dict, Sequence, Optional # convenient imports from .scrubbers import Scrubber from . import filth from . import detectors from . import post_processors from .filth import Filth __version__ = VERSION = "2.0.0.rc0" __all__ = [ 'Scrubber', 'filth', 'detectors', 'post_processors', 'cl...
Python
0.000004
@@ -238,17 +238,17 @@ 2.0.0.rc -0 +1 %22%0A__all_
3074fed515d69af505e41e365738f22764f00695
Configure main chatroom to be open all day
ditto/scripts/setup_test_data.py
ditto/scripts/setup_test_data.py
"""Script to set up test data for a Kvoti instance. As before we tried to do this with migrations but ran into problems early on with custom permissions not being created. In any case, it's probably easier/better to have a single bootstrap script instead of a bunch of data migrations. """ import os from django.conf...
Python
0
@@ -5004,24 +5004,53 @@ =True%0A )%0A + for day in range(7):%0A chat.mod @@ -5078,24 +5078,28 @@ te(%0A + room=room,%0A @@ -5097,16 +5097,20 @@ m=room,%0A + @@ -5117,33 +5117,17 @@ day= -chat.models.Slot.Mon day,%0A + @@ -5151,16 +5151,24 @@ -end=22,%0A + ...
8f90b8cd67b6bca0c8c2123c229b18bd0ee078d8
Implement FlatfileCommentProvider._load_one.
firmant/plugins/datasource/flatfile/comments.py
firmant/plugins/datasource/flatfile/comments.py
import datetime import pytz import os import re from firmant.utils import not_implemented comment_re = r'(?P<year>\d{4}),(?P<month>\d{2}),(?P<day>\d{2}),(?P<slug>.+)' +\ r',(?P<created>[1-9][0-9]*),(?P<id>[0-9a-f]{40})' comment_re = re.compile(comment_re) class FlatfileCommentProvider(object): def __init_...
Python
0
@@ -84,16 +84,64 @@ emented%0A +from firmant.datasource.comments import Comment%0A %0A%0Acommen @@ -501,8 +501,1486 @@ ented()%0A +%0A def _load_one(self, status, entry_pkey, created, id):%0A comment_dt = entry_pkey%5B0%5D.strftime('%25Y,%25m,%25d')%0A comment_filename = '%25s,%25s,%25i,%25s' ...
68ecbb59c856a20f8f00cae47f1075086da982c7
Add bitmask imports to nddata.__init__.py
astropy/nddata/__init__.py
astropy/nddata/__init__.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The `astropy.nddata` subpackage provides the `~astropy.nddata.NDData` class and related tools to manage n-dimensional array-based data (e.g. CCD images, IFU Data, grid-based simulation data, ...). This is more than just `numpy.ndarray` objects, becaus...
Python
0.000015
@@ -713,32 +713,55 @@ ccddata import * +%0Afrom .bitmask import * %0A%0Afrom .. import
f2a9529165d1ab97f9d6f5efef6f67811462dafd
fix pylint issues
sdcm/utils/latency.py
sdcm/utils/latency.py
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be usefu...
Python
0.000002
@@ -603,16 +603,110 @@ lues)%0A%0A%0A +# pylint: disable=too-many-arguments,too-many-locals,too-many-nested-blocks,too-many-branches%0A def coll @@ -1722,17 +1722,16 @@ or all( -%5B val == s @@ -1760,17 +1760,16 @@ sequence -%5D ):%0A
a6883813694b0c41a271b51af4ecca74351690f2
Fix smoothstreamer component test
flumotion/test/test_component_smoothstreamer.py
flumotion/test/test_component_smoothstreamer.py
# -*- Mode: Python; test-case-name: flumotion.test.test_resource -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2009,2010 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # flumotion-fragmented-streaming - Flumotion Advanced fragmented streaming # Licensees having purch...
Python
0.000001
@@ -831,16 +831,27 @@ netutils +, gstreamer %0Afrom fl @@ -3322,32 +3322,234 @@ ef setUp(self):%0A + if not gstreamer.element_factory_exists('keyunitscheduler'):%0A from flumotion.component.effects.kuscheduler %5C%0A import kuscheduler%0A kuscheduler.register()%0A ...
f7e279777995a716dfdee01cc37aed5e94eafa09
ADD multilabel support
ParamSklearn/components/classification/liblinear_svc.py
ParamSklearn/components/classification/liblinear_svc.py
import sklearn.svm from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \ CategoricalHyperparameter, Constant from HPOlibConfigSpace.forbidden import ForbiddenEqualsClause, \ ForbiddenAndConjunction from ParamSklearn.com...
Python
0
@@ -11,16 +11,42 @@ earn.svm +%0Aimport sklearn.multiclass %0A%0Afrom H @@ -1480,37 +1480,32 @@ = None%0A%0A -self. estimator = skle @@ -1544,21 +1544,16 @@ enalty,%0A - @@ -1644,21 +1644,16 @@ - dual=sel @@ -1702,21 +1702,16 @@ - - tol=self @@ -1716,21 +1716,...
1156be60da01ee34230dcf5e9e993e72fbe7b635
make linter happy
test_project/test_project/urls.py
test_project/test_project/urls.py
"""test_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cla...
Python
0.000001
@@ -984,17 +984,16 @@ e_path%0A%0A -%0A from cor
e716a71bad4e02410e2a0908d630abbee1d4c691
Revert the removal of an unused import (in [14175]) that was referenced in documentation. Thanks for noticing, clong.
django/contrib/admin/__init__.py
django/contrib/admin/__init__.py
from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInline from django.contrib.admin.sites import AdminSite, site def autodiscover(): """ Auto-discover INSTALLED_APPS admin.py modules and fail silently when not present. T...
Python
0.000002
@@ -1,28 +1,207 @@ +# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here%0A# has been referenced in documentation.%0Afrom django.contrib.admin.helpers import ACTION_CHECKBOX_NAME%0A from django.contrib.admin.op
e244cbd6052ebae8bf966bbcd60b54375d16c5df
Fix flake8 #2
mongodb_consistent_backup/Common/Config.py
mongodb_consistent_backup/Common/Config.py
import json import mongodb_consistent_backup import sys from datetime import datetime from argparse import Action from pkgutil import walk_packages from yconf import BaseConfiguration from yconf.util import NestedDict def parse_config_bool(item): try: if isinstance(item, bool): return item ...
Python
0.000002
@@ -384,18 +384,18 @@ lower() -is +== %22true%22:
74b3b60cfe6f12f119ac91f04177abc4c7427e5c
bump version
sensorbee/_version.py
sensorbee/_version.py
# -*- coding: utf-8 -*- __version__ = '0.1.1'
Python
0
@@ -37,11 +37,11 @@ = '0.1. -1 +2 '%0A
ec76e31320d41fe4bd8df062f1432ebe476bb798
Update IrrigatorsModel.py
backend/IrrigatorsModel.py
backend/IrrigatorsModel.py
import datetime, re; from sqlalchemy.orm import validates; from server import DB, FlaskServer; from components.validation import validate_word; class Owner_irrigators(DB.Model): id = DB.Column(DB.Integer, primary_key=True, autoincrement=True); name = DB.Column(DB.Integer(20)); notation = DB.Column(DB.Text);...
Python
0
@@ -153,15 +153,9 @@ ass -Owner_i +I rrig
5ed3834cbefcf399dbdd0e7f26a033aba65e7a54
Make detect_soft_applied exit correctly on non-create migrations
django/db/migrations/executor.py
django/db/migrations/executor.py
from __future__ import unicode_literals from django.db import migrations from django.apps.registry import apps as global_apps from .loader import MigrationLoader from .recorder import MigrationRecorder class MigrationExecutor(object): """ End-to-end migration execution - loads migrations, and runs them u...
Python
0.000002
@@ -6744,32 +6744,79 @@ igration = True%0A + else:%0A return False%0A # If we
ff41218c0a63959a34969eefafd9951c48ef667f
convert `test/test_sparql/test_sparql_parser.py` to pytest (#2063)
test/test_sparql/test_sparql_parser.py
test/test_sparql/test_sparql_parser.py
import math import sys import unittest from typing import Set, Tuple from rdflib import Graph, Literal from rdflib.namespace import Namespace from rdflib.plugins.sparql.processor import processUpdate from rdflib.term import Node def triple_set(graph: Graph) -> Set[Tuple[Node, Node, Node]]: return set(graph.tripl...
Python
0
@@ -20,24 +20,8 @@ sys%0A -import unittest%0A from @@ -329,16 +329,20 @@ %0A%0Aclass +Test SPARQLPa @@ -349,32 +349,8 @@ rser -Tests(unittest.TestCase) :%0A @@ -1360,28 +1360,15 @@ -self. assert -NotEqual( + trip @@ -1369,33 +1369,35 @@ t triple_set(g0) -, + != triple_set(g1)) @@ -1395,17 +1395,16 ...
413dfb6e782e16b6509fdb34b1ece89af9d2237f
Simplify number_of_nonisomorphic_trees.
networkx/generators/nonisomorphic_trees.py
networkx/generators/nonisomorphic_trees.py
""" Implementation of the Wright, Richmond, Odlyzko and McKay (WROM) algorithm for the enumeration of all non-isomorphic free trees of a given order. Rooted trees are represented by level sequences, i.e., lists in which the i-th element specifies the distance of vertex i to the root. """ # Copyright (C) 2013 by # ...
Python
0.000082
@@ -1978,27 +1978,32 @@ -f = lambda x: list( +length = sum(1 for _ in noni @@ -2018,17 +2018,21 @@ c_trees( -x +order ))%0A r @@ -2044,18 +2044,11 @@ len -(f(order)) +gth %0A%0A%0Ad
6668b6daca1707be4bacfcf26f03af94b6c82551
raise useful error if dir missing #1540
bcbio/upload/filesystem.py
bcbio/upload/filesystem.py
"""Extract files from processing run into output directory, organized by sample. """ import os import shutil from bcbio import utils from bcbio.log import logger from bcbio.upload import shared def copy_finfo(finfo, storage_dir, pass_uptodate=False): """Copy a file into the output storage directory. """ i...
Python
0
@@ -1846,21 +1846,181 @@ r -eturn +aise ValueError(%22Expect %60dir%60 in upload specification: %22%0A %22http://bcbio-nextgen.readthedocs.io/en/latest/contents/configuration.html#upload%22) %0A if
450f89b6fd2bb44c2e89336594f5037ed409f60d
Return attached command output.
dockermap/map/runner/attached.py
dockermap/map/runner/attached.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from docker.utils import create_host_config from ...functional import resolve_value from ..action import UTIL_ACTION_PREPARE_CONTAINER from ..policy.utils import update_kwargs, get_instance_volumes from .utils import get_preparation_cmd class AttachedC...
Python
0.000001
@@ -6921,16 +6921,69 @@ _name))%0A + return %5B%0A client.run_cmd(cmd)%0A @@ -7049,17 +7049,16 @@ al_path) -: %0A @@ -7058,32 +7058,10 @@ - client.run_cmd(cmd) +%5D %0A
2495d9ddaeb9f57a1a46129eb330e0c2f8636890
Check for non-interactive shell before prompting when deleting
bin/disco_elasticsearch.py
bin/disco_elasticsearch.py
#!/usr/bin/env python """ Manages ElasticSearch """ from __future__ import print_function import argparse import sys from disco_aws_automation import DiscoElasticsearch from disco_aws_automation.disco_aws_util import run_gracefully from disco_aws_automation.disco_logging import configure_logging # R0912 Allow more th...
Python
0
@@ -224,16 +224,27 @@ acefully +, is_truthy %0Afrom di @@ -3158,16 +3158,63 @@ rch(env) +%0A interactive_shell = sys.__stdin__.isatty() %0A%0A if @@ -4290,20 +4290,23 @@ pr -int( +ompt = %22Deletin @@ -4344,16 +4344,23 @@ oys all +of its automate @@ -4374,20 +4374,8 @@ hots - of its data . Be @...
7e24165c828a64389d593c63299df4ff22dcb881
disable swagger docs for tests
rest_auth/urls.py
rest_auth/urls.py
from django.conf import settings from django.conf.urls import patterns, url, include from rest_auth.views import Login, Logout, Register, UserDetails, \ PasswordChange, PasswordReset, VerifyEmail, PasswordResetConfirm urlpatterns = patterns('rest_auth.views', # URLs that do not require a s...
Python
0
@@ -1548,16 +1548,41 @@ gs.DEBUG + and not settings.IS_TEST :%0A ur
5679450ef45bc5a32c9395df9ba0fde50707ba8c
Use smaller points for the ORIGEN analysis
transmutagen/analysis.py
transmutagen/analysis.py
from collections import defaultdict import os import argparse import tables import numpy as np import matplotlib.pyplot as plt from .tests.test_transmute import run_transmute_test from .origen_all import TIME_STEPS from .util import plt_show_in_terminal from .cram import get_CRAM_from_cache, CRAM_coeffs def analyze_...
Python
0.000002
@@ -1239,17 +1239,17 @@ (x, y, ' -o +. ', label
fbabdb62ae4ca02bca4318d085bf0ec9cc7ab3ef
Add color always to easy get the messages (#334)
travis/test_precommit.py
travis/test_precommit.py
#!/usr/bin/env python import logging import os import re import subprocess import sys logging.basicConfig(level=logging.DEBUG) _logger = logging.getLogger(__name__) overwrite = os.environ.get("PRECOMMIT_OVERWRITE_CONFIG_FILES", "") == "1" exclude_lint = os.environ.get("EXCLUDE_LINT", "") root_dir = os.path.dirname(o...
Python
0
@@ -2165,16 +2165,34 @@ %22--all%22 +, %22--color=always%22 %5D%0A st
33ef365bffb3aefa053409a72d44b069bdae8c77
Make django middleware not crash if user isn't set.
blueox/contrib/django/middleware.py
blueox/contrib/django/middleware.py
import sys import traceback import logging import blueox from django.conf import settings class Middleware: def __init__(self): host = getattr(settings, 'BLUEOX_HOST', '127.0.0.1') port = getattr(settings, 'BLUEOX_PORT', 3514) blueox.configure(host, port) def process_request(self, re...
Python
0.000001
@@ -102,16 +102,24 @@ ddleware +(object) :%0A de @@ -897,58 +897,145 @@ -for key in ('version' +return None%0A%0A def process_response(self , -' re -vision'):%0A if +quest, response):%0A # process_request() is not guaranteed to be called%0A if not has @@ -1048,19 +1048,24 @@ ...
869b9c744c589385194c93dccf9b6b14b26b1ec9
Read files from local_directory instead of current dir
diff.py
diff.py
#!/usr/bin/env python """ Copyright (c) 2014-2015 Ranger Harke See LICENSE file for details """ import sys, argparse, io, os, tarfile, base def parse_args(args=None): if args is None: args = sys.argv parser = argparse.ArgumentParser(description='Diff a local tree against a remote one and generate a ...
Python
0
@@ -3256,32 +3256,72 @@ tarfile.add( +os.path.join(self.args.local_directory, filepath , arcname=st @@ -3300,32 +3300,33 @@ ectory, filepath +) , arcname=str(se @@ -4140,24 +4140,64 @@ ile.add( +os.path.join(self.args.local_directory, filepath , arcnam @@ -4188,16 +4188,17 @@ filepath +) , arcnam
42f1d60093a5a816b24e52f088f2d4c2bc6ecb95
Fix logic of modulepath handler when modulepath is not defined
jupyterlmod/handler.py
jupyterlmod/handler.py
import json import os import lmod from functools import partial, wraps from glob import glob from tornado import web from jupyter_core.paths import jupyter_path from notebook.base.handlers import IPythonHandler def jupyter_path_decorator(func): @wraps(func) async def wrapper(self, *args, **kwargs): ...
Python
0.000002
@@ -2996,24 +2996,117 @@ ATH%22 -, %22%22).split(':') +)%0A if result is not None:%0A result = result.split(%22:%22)%0A else:%0A result = %5B%5D %0A
a53d54d9a446147cc115b3329722e1e51e9aff3e
remove locks for pulling difficulty to stop causing api crashing sooner
diff.py
diff.py
#License# #bitHopper by Colin Rice is licensed under a Creative Commons # Attribution-NonCommercial-ShareAlike 3.0 Unported License. #Based on a work at github.com. import re import eventlet from eventlet.green import threading, socket, urllib2 # Global timeout for sockets in case something leaks socket.setdefaulttim...
Python
0
@@ -780,36 +780,8 @@ f):%0A - with self.lock:%0A @@ -850,36 +850,8 @@ f):%0A - with self.lock:%0A @@ -920,36 +920,8 @@ f):%0A - with self.lock:%0A @@ -994,36 +994,8 @@ f):%0A - with self.lock:%0A @@ -1068,36 +1068,8 @@ f):%0A - with self.lo...
a3ff6773651eafdf2c51165cac4c6a43f2aa677b
simplify the channel handling in containers
bioconda_utils/pkg_test.py
bioconda_utils/pkg_test.py
import subprocess as sp import tempfile import tarfile import os import shlex from shutil import which import logging from . import utils from conda_build.metadata import MetaData logger = logging.getLogger(__name__) # Use Miniconda 4.3.27 for now to avoid running into an issue in # 'conda >4.4.7,<4.4.11': https://...
Python
0.000012
@@ -3876,24 +3876,8 @@ -channel, *extra_ chan @@ -3881,24 +3881,24 @@ hannels = %5B%0A + 'fil @@ -4007,231 +4007,8 @@ %5D%0A - # '--channel' currently defaults to 'bioconda' in mulled-build and is%0A # prepended to all remaining channels. To prevent this, i.e., to give%0A # 'conda-forge' a ...
d21843d91132aa29ae56e4f52b77dd51180bfe41
Fix getFutureLastStep usage
tests/auto/tsp_stub_and_stdout_test.py
tests/auto/tsp_stub_and_stdout_test.py
#!/usr/bin/env python import logging import os import time import threading import getopt, sys import dtest def usage(): print "Usage:\n %s --provider=<user>@[<host>]:<stub_path> --consumer=<user>@[<host>]:<stdout_path>" % sys.argv[0] def getUserHostPath(argument): if argument.find("@") != -1: (user,...
Python
0
@@ -1706,30 +1706,28 @@ vel=logging. -WARNIN +DEBU G)%0A%0Astub.add @@ -2288,18 +2288,16 @@ epStatus -() ,%22First @@ -2704,18 +2704,16 @@ epStatus -() ,%22Second
80bdb7748524fb2a01f3f042e11071827302186e
Add Controller, Actuator, and ControlledProcess items
gaphor/RAAML/stpa/stpatoolbox.py
gaphor/RAAML/stpa/stpatoolbox.py
"""The definition for the STPA section of the RAAML toolbox.""" from gaphor.diagram.diagramtoolbox import ( ToolDef, ToolSection, default_namespace, namespace_config, ) from gaphor.diagram.diagramtools import new_item_factory from gaphor.i18n import gettext from gaphor.RAAML import diagramitems, raaml ...
Python
0
@@ -2369,35 +2369,118 @@ factory( -uml_items.ClassItem +%0A sysml_items.PropertyItem, raaml.Controller, config_func=namespace_config%0A ),%0A @@ -2645,35 +2645,116 @@ factory( -uml_items.ClassItem +%0A sysml_items.PropertyItem, raaml.Actuator, config_func=namespace_conf...
d1b1a6d845419b5c1b8bec3d7f3bded83cf6c9a1
Fix ObjectNodeItem upperBound visibility
gaphor/UML/actions/objectnode.py
gaphor/UML/actions/objectnode.py
"""Object node item.""" from gaphor import UML from gaphor.core.modeling.properties import attribute from gaphor.diagram.presentation import ElementPresentation, Named from gaphor.diagram.shapes import Box, EditableText, IconBox, Text, draw_border from gaphor.diagram.support import represents from gaphor.UML.modelfact...
Python
0.000003
@@ -1301,16 +1301,20 @@ n (None, + %22%22, DEFAULT @@ -1398,16 +1398,42 @@ und%7D %7D%7D%22 +%0A or %22%22 ,%0A
2ad8f039112977c4dfdf4389586df74263d753b6
Handle certificate in shaker.py
functest/opnfv_tests/openstack/shaker/shaker.py
functest/opnfv_tests/openstack/shaker/shaker.py
#!/usr/bin/env python # Copyright (c) 2018 Orange and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 """ Shaker_...
Python
0
@@ -2287,16 +2287,133 @@ h='~/')%0A + if os.environ.get('OS_CACERT'):%0A scpc.put(os.environ.get('OS_CACERT'), remote_path='~/os_cacert')%0A @@ -2457,16 +2457,16 @@ ommand(%0A - @@ -2694,32 +2694,49 @@ ASSWORD=%7B%7D && '%0A + '%7B%7D'%0A 'env @@ -3151,24...
5a2500f0f74321fffa02ab405f1b440874f2309e
Add jaxb directory as license check exception.
tools/licensescheck.py
tools/licensescheck.py
#!/usr/bin/python import os, sys, re # Path to eng checkout root directory. To use this as a git pre-commit # hook, copy this script to .git/hooks/pre-commit, set basepath as the # absolute path to your volt checkout and set ascommithook to true. basepath = "../" ascommithook = False prunelist = ('hsqldb19b3', ...
Python
0
@@ -759,16 +759,37 @@ er.java' +,%0A 'jaxb' )%0A%0Adef v
75e941f8010ebc916fa9b38cb40c49b5dbbdea12
fix typo preventing state consistency
Hydraulics/attract_manager.py
Hydraulics/attract_manager.py
import logging import time from threading import Thread import event_manager import hydraulics_drv gAttractModeTimeout = 30 # seconds gAutoAttractModeEnabled = False gOldPos = [0,0,0] gMaxDelta = 20 # 0-4095 scale gAttractModeStartTime = 0 gInAttractMode = False gAttractMonitorThread = None gOriginalDriverInput = "co...
Python
0.000624
@@ -1709,17 +1709,17 @@ obal gIn -a +A ttractMo
0d7add686605d9d86e688f9f65f617555282ab60
Add debugging CLI hook for email sending
opwen_email_server/backend/email_sender.py
opwen_email_server/backend/email_sender.py
from typing import Tuple from opwen_email_server import azure_constants as constants from opwen_email_server import config from opwen_email_server.services.queue import AzureQueue from opwen_email_server.services.sendgrid import SendgridEmailSender QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=config.QUEUES_K...
Python
0
@@ -582,8 +582,317 @@ t', 200%0A +%0A%0Aif __name__ == '__main__':%0A from argparse import ArgumentParser%0A from json import loads%0A from uuid import uuid4%0A%0A parser = ArgumentParser()%0A parser.add_argument('email')%0A args = parser.parse_args()%0A%0A email = loads(args.email)%0A email.se...
13a146c5e4a96d2f01aaecb6fd6839a9c290a2b3
Fix bug assuming multiple '/' in URL
tools/pluginmanager.py
tools/pluginmanager.py
#---------------------------------------------------------------------- # Copyright (c) 2011-2016 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including ...
Python
0.000023
@@ -3412,32 +3412,101 @@ elf, endpoint):%0A + pieces = endpoint.split('/')%0A if len(pieces) %3E 2:%0A key = en @@ -3534,16 +3534,29 @@ +%0A if key i @@ -3584,16 +3584,20 @@ dpoint:%0A +
5875de6fb894a2903ec1f10c7dbc65c7071c7732
Fix NullHandler logger addition
rmqid/__init__.py
rmqid/__init__.py
__version__ = '0.4.0' from rmqid.connection import Connection from rmqid.exchange import Exchange from rmqid.message import Message from rmqid.queue import Queue from rmqid.tx import Tx from rmqid.simple import consumer from rmqid.simple import get from rmqid.simple import publish import logging try: from loggi...
Python
0.000003
@@ -508,16 +508,23 @@ tLogger( +'rmqid' ).addHan
d5345e34deaf5510c8b45f7d5fbed49f9cee8e41
echo 0
echo.py
echo.py
Python
0.999334
@@ -0,0 +1,230 @@ +import IPYthon%0Aimport warnings%0A%0Afrom golix import Ghid%0Afrom hypergolix.service import HypergolixLink%0A%0Ahgxlink = HypergolixLink(threaded=True)%0A%0Awith warnings.catch_warnings():%0A warnings.simplefilter('ignore')%0A IPython.embed()
c260b974426da547600725b9d5814c0e3d35bb53
make more pythonic
robogrid/robot.py
robogrid/robot.py
from .grids import Simple_Grid class Robot(object): def __init__(self, name, grid=None): self.name = name if grid == None: grid = Simple_Grid(20) self.grid = grid start_pos = self.grid.free_position() if start_pos == None: raise ValueError("No space...
Python
0.000028
@@ -2380,17 +2380,18 @@ def is -F +_f inished( @@ -2401,26 +2401,30 @@ f):%0A -if +return self.x == s @@ -2480,51 +2480,5 @@ - 2 -:%0A return True%0A return False %0A
c205b6a8f5d96240aacbe9f99aeecbf3b2d398ed
Fix issue #2411. Don't leak temp file handle. (#2417)
google/cloud/forseti/common/util/file_loader.py
google/cloud/forseti/common/util/file_loader.py
# Copyright 2017 The Forseti Security 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 ap...
Python
0
@@ -1976,17 +1976,24 @@ -_ +tmp_file , output @@ -2018,16 +2018,106 @@ kstemp() +%0A # Ensure the handle returned by mkstemp is not leaked.%0A os.close(tmp_file) %0A%0A wi
2ae23b275eb0ac919fe4fd874663915beb3e7bac
Add domain tag to celery time_to_run metric
corehq/celery_monitoring/signals.py
corehq/celery_monitoring/signals.py
import datetime import inspect from django.core.cache import cache from celery.signals import before_task_publish, task_postrun, task_prerun from dimagi.utils.parsing import string_to_utc_datetime from corehq.util.metrics import push_metrics from corehq.util.quickcache import quickcache @before_task_publish.conne...
Python
0.000001
@@ -1460,32 +1460,52 @@ state=None, -**kw args +=None, kwargs=None, **kw ):%0A from @@ -1624,16 +1624,71 @@ %0A )%0A%0A + domain = get_domain_from_task(task, args, kwargs)%0A%0A get_ @@ -1806,24 +1806,24 @@ task.queue,%0A - 'sta @@ -1834,16 +1834,51 @@ state,%0A + 'domain': domain...
157f5151b4935c1f7f963addb06ea33ea12146e6
replace StreamFieldPanel
meinberlin/apps/cms/models/pages.py
meinberlin/apps/cms/models/pages.py
from django.db import models from wagtail import blocks from wagtail import fields from wagtail.admin import edit_handlers from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.models import Page from wagtail.snippets.edit_handlers import SnippetChooserPanel from meinberlin.apps.actions import blocks...
Python
0
@@ -850,38 +850,32 @@ edit_handlers. -Stream FieldPanel('body @@ -2033,38 +2033,32 @@ edit_handlers. -Stream FieldPanel('body @@ -2489,22 +2489,16 @@ andlers. -Stream FieldPan
3e8e59656892b8ba8e46affb5987a2fbf633ae00
Add some authentication reference documentation.
googleanalytics/auth/__init__.py
googleanalytics/auth/__init__.py
# encoding: utf-8 """ Convenience functions for authenticating with Google and asking for authorization with Google, with `authenticate` at its core. `authenticate` will do what it says on the tin, but unlike the basic `googleanalytics.oauth.authenticate`, it also tries to get existing credentials from the keyring...
Python
0
@@ -1487,24 +1487,591 @@ False):%0A +%22%22%22%0A The %60authenticate%60 function will authenticate the user with the Google Analytics API, %0A using a variety of strategies: keyword arguments provided to this function, credentials%0A stored in in environment variables, credentials stored in the keychain ...
e3ac422da8a0c873a676b57ff796d15fac6fc532
change haproxy config formatting
bin/haproxy_get_ssl.py
bin/haproxy_get_ssl.py
#!/usr/bin/env python import redis, sys, os, json, jinja2 from jinja2 import Template r_server = redis.StrictRedis('127.0.0.1', db=2) check = r_server.get("need_CSR") if check == "1": i_key = "owner-info" data=json.loads (r_server.get(i_key)) email = data['Email'] hostname = data['Hostname'] fron...
Python
0
@@ -1495,26 +1495,24 @@ %25s check%5Cn - %22 %25 (app%5B%22na
cc6c80ad64fe7f4d4cb2b4e367c595f1b08f9d3b
Remove script crash when no sonos is found
i3blocks-sonos.py
i3blocks-sonos.py
#!/usr/bin/env python3 # # By Henrik Lilleengen (mail@ithenrik.com) # # Released under the MIT License: https://opensource.org/licenses/MIT import soco, sys speakers = list(soco.discover()) state = speakers[0].get_current_transport_info()['current_transport_state'] if state == 'PLAYING': if len(sys.argv) > 1 a...
Python
0
@@ -186,17 +186,42 @@ ver())%0A%0A -%0A +if len(speakers) %3E 0:%0A state = @@ -289,16 +289,20 @@ tate'%5D%0A%0A + if state @@ -316,24 +316,28 @@ AYING':%0A + + if len(sys.a @@ -369,32 +369,36 @@ == %221%22:%0A + speakers%5B0%5D.stop @@ -400,16 +400,20 @@ .stop()%0A + ...
74084defad8222ba69340d0d983acdf33ddef17c
Correct the test of assertEqual failing.
calexicon/dates/tests/test_dates.py
calexicon/dates/tests/test_dates.py
import unittest from datetime import date, timedelta from calexicon.dates import DateWithCalendar class TestDateWithCalendar(unittest.TestCase): def setUp(self): date_dt = date(2010, 8, 1) self.date_wc = DateWithCalendar(None, date_dt) def test_equality(self): self.assertTrue(self.d...
Python
0.000021
@@ -570,16 +570,33 @@ al. %22%22%22%0A + try:%0A @@ -602,27 +602,24 @@ self.assert -Not Equal(self.d @@ -635,32 +635,80 @@ ate(2010, 8, 1)) +%0A except AssertionError:%0A pass %0A%0A def test_c
a51231f4a9e588718f77c06481d20eb6d090e996
fix authorization policy a bit
caliopen/api/user/authentication.py
caliopen/api/user/authentication.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import base64 from zope.interface import implements, implementer from pyramid.interfaces import IAuthenticationPolicy, IAuthorizationPolicy from pyramid.security import Everyone, NO_PERMISSION_REQUIRED from pyramid.httpexceptions import HTT...
Python
0.000001
@@ -279,50 +279,8 @@ RED%0A -from pyramid.httpexceptions import HTTPOk%0A %0A%0Afr @@ -659,35 +659,8 @@ ed%0A%0A - # Case sensitive ?%0A @@ -932,16 +932,65 @@ ion%5B1%5D)%0A + # authentication values is user_id:token%0A @@ -3172,90 +3172,184 @@ -result = token%0A log.info(...
aea456e92c434e56ae589e996a9b775af6e1f6eb
Update client
calplus/v1/object_storage/client.py
calplus/v1/object_storage/client.py
import logging import calplus.conf from calplus.base import BaseClient from calplus.exceptions import DriverException CONF = calplus.conf.CONF LOG = logging.getLogger(__name__) class Client(BaseClient): """Top-level object to access CAL API This class must be extended base.Singleton class to make sure o...
Python
0.000001
@@ -1979,39 +1979,40 @@ elf, container, -headers +metadata , **kwargs):%0A @@ -2095,39 +2095,40 @@ %0A :param -headers +metadata (dict): addition @@ -2122,39 +2122,40 @@ ct): additional -headers +metadata to include in t @@ -2367,23 +2367,24 @@ tainer, -headers +metadata , **kwar @@ -4882,39 +488...