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
b761ac7c6c3597354002e14df945cba20e08ccc7
Revert "changing local port to be different from remote port"
fabric_plugin/tunnel.py
fabric_plugin/tunnel.py
# This implementation was copied from the Fabric project directly: # https://github.com/fabric/fabric/blob/master/fabric/context_managers.py#L486 # The purpose was to remove the rtunnel creation printouts here: # https://github.com/fabric/fabric/blob/master/fabric/context_managers.py#L547 from contextlib import conte...
Python
0
@@ -883,24 +883,27 @@ %22%22%22%0A +if local_port = @@ -905,20 +905,25 @@ ort -= _generate_ +is None:%0A loca @@ -920,33 +920,35 @@ local_port -( + = remote_port, loc @@ -942,29 +942,16 @@ ote_port -, local_port) %0A%0A so @@ -1747,21 +1747,22 @@ ddress, -local +remote _port, h @@...
0a7acc0a9adb4185204e964c27c8b4898e286f15
query ped_inform proteção de filtro errado
src/lotes/queries/pedido/ped_inform.py
src/lotes/queries/pedido/ped_inform.py
from pprint import pprint from utils.functions.models import rows_to_dict_list from utils.functions.queries import debug_cursor_execute def ped_inform(cursor, pedido, empresa=1): filtro_empresa = "" if empresa: if not isinstance(empresa, tuple): empresa = (empresa, ) empresas_lis...
Python
0.999093
@@ -341,32 +341,57 @@ mpr in empresa:%0A + if empr:%0A empr @@ -641,16 +641,36 @@ pedido:%0A + if ped:%0A
8922a35a5c0976b9930e269b86361fc2235a6d08
Bump version to 0.5.1.
src/setup.py
src/setup.py
#!/usr/bin/env python # # Copyright 2009, Google 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...
Python
0.000013
@@ -2386,13 +2386,11 @@ ='0. -4.9.2 +5.1 ',%0A
80d832b894dd60bbee1f6ec8dadc556f12adcc39
add command-line test
src/link_parse.py
src/link_parse.py
#!/usr/bin/env python """ Parsing links from streams of data. """ __author__ = "Mark Nottingham <mnot@mnot.net>" __copyright__ = """\ Copyright (c) 2008-2009 Mark Nottingham Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software...
Python
0.000005
@@ -4414,8 +4414,407 @@ return%0A%0A +%0Aif %22__main__%22 == __name__:%0A import sys%0A from red_fetcher import RedFetcher%0A uri = sys.argv%5B1%5D%0A req_hdrs = %5B('Accept-Encoding', 'gzip')%5D%0A class TestFetcher(RedFetcher):%0A def done(self):%0A pass%0A def show_link(link, ta...
0b89abf9cc0e0bbeb50dce7df6d680360e3152c3
disable account and password in default config
tarbell/project_template/config.py
tarbell/project_template/config.py
""" Google doc configuration. If not provided, no Google doc will be used. """ {% if spreadsheet_key %} GOOGLE_DOC = { 'key': '{{ spreadsheet_key }}', 'account': '<gmail address>', 'password': '<password>', } {% else %} # GOOGLE_DOC = { # 'key': '<spreadsheet key>', # 'account': '<gmail address>', #...
Python
0
@@ -148,24 +148,25 @@ ey %7D%7D',%0A +# 'account': ' @@ -183,24 +183,25 @@ ress%3E',%0A +# 'password':
5396109075f0b0c56dc02968256457eed9236722
Fix MemMatrix script's output.
tasks/video/Visualize/MemMatrix.py
tasks/video/Visualize/MemMatrix.py
import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib.animation as animation import getopt import sys options, _ = getopt.getopt(sys.argv[1:], '', ['file=']) filename = 'Ugb_uH72d0I_8_17_memMatrix_step-81382.npy' dpi = 150 fig_size = (2560 / dpi, 1440 / dpi) for opt in ...
Python
0
@@ -643,16 +643,18 @@ igure()%0A +# fig3 = p @@ -665,16 +665,17 @@ igure()%0A +%0A link_mat @@ -776,32 +776,63 @@ ors'%5D%0A%0Aims = %5B%5D%0A +ax1 = fig.add_subplot(1, 2, 1)%0A for i in range(l @@ -851,35 +851,35 @@ e%5B0%5D):%0A im = -plt +ax1 .imshow(link_mat @@ -972,35 +972,36 @@ terval=75, blit= -Tru...
e6f5f6cdaed0d12bd739d7b2de6dc247d899724d
active menu item for picture page
src/picture/views.py
src/picture/views.py
# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.conf import settings from django.contrib.auth.decorators import permission_required from django.shortcuts import render_to_respo...
Python
0.000001
@@ -2199,24 +2199,63 @@ hing', %5B%5D),%0A + 'active_menu_item': 'gallery',%0A %7D, conte
168ceecf6836901749273da65ccb8397ca4e4214
Update forward compatibility horizon to 2020-09-12
tensorflow/python/compat/compat.py
tensorflow/python/compat/compat.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0
@@ -1445,17 +1445,17 @@ 20, 9, 1 -1 +2 )%0A_FORWA
a957f4e1a0488e469a28cdaf373d45d6e473435d
Update forward compatibility horizon to 2021-02-20
tensorflow/python/compat/compat.py
tensorflow/python/compat/compat.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0
@@ -1448,10 +1448,10 @@ 2, -19 +20 )%0A_F
745b98aa465bc05500ffd893c15844cb454011f9
Improve tests
tests/cupy_tests/manipulation_tests/test_kind.py
tests/cupy_tests/manipulation_tests/test_kind.py
import unittest from cupy import testing @testing.gpu class TestKind(unittest.TestCase): _multiprocess_can_split_ = True @testing.for_all_dtypes() @testing.numpy_cupy_array_equal(type_check=False) def test_asfortranarray1(self, xp, dtype): x = xp.zeros((2, 3)) return xp.asfortranarr...
Python
0.000009
@@ -281,16 +281,23 @@ s((2, 3) +, dtype )%0A @@ -293,35 +293,34 @@ ype)%0A ret -urn + = xp.asfortranarr @@ -316,32 +316,145 @@ sfortranarray(x) +%0A self.assertTrue(x.flags.c_contiguous)%0A self.assertTrue(ret.flags.f_contiguous)%0A return ret .strides%0A%0A @t @@ -600,32 +60...
958bb725cce490ecf5d9f2052e739d2b1fe84b3d
Make centroid factory locations a little more plausible
interface/backend/images/factories.py
interface/backend/images/factories.py
import factory import factory.fuzzy from backend.images import models class ImageSeriesFactory(factory.django.DjangoModelFactory): class Meta: model = models.ImageSeries patient_id = factory.Sequence(lambda n: "TEST-SERIES-%04d" % n) series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1....
Python
0.000209
@@ -662,27 +662,27 @@ yInteger(0, -511 +256 )%0A%0A y = f @@ -714,11 +714,11 @@ (0, -511 +256 )%0A%0A @@ -758,8 +758,8 @@ (0, +1 6 -3 )%0A
17e1e267d2fe8f50dabdc8aa83697b10f445e18f
Use Gerrit 2.13.11 from gerritcodereview/gerrit
livetests.py
livetests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License # # Copyright 2018 David Pursehouse. All rights reserved. # # 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 restrictio...
Python
0.00019
@@ -1666,190 +1666,39 @@ i -f version.startswith(%222.14%22) or version.startswith(%222.15%22):%0A image = %22gerritcodereview/gerrit:%22 + version%0A else:%0A image = %22gerritforge/gerrit-ubuntu15.04 +mage = %22gerritcodereview/gerrit :%22 +
51d1be34e4ab3f5b26ccb5b8921209a2c86d791c
Use render instead of render_to_response
Artifactorial/views.py
Artifactorial/views.py
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2014 Rémi Duraffort # This file is part of Artifactorial. # # Artifactorial 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 L...
Python
0.000001
@@ -1072,28 +1072,16 @@ , render -_to_response %0Afrom dj @@ -4026,21 +4026,18 @@ nder -_to_response( +(request, %22Art @@ -4091,28 +4091,16 @@ - %7B'direct @@ -4137,28 +4137,16 @@ - - 'directo @@ -4192,28 +4192,16 @@ - 'files': @@ -4242,28 +4242...
abad19e9004ea6a1ed2d8a8090b6a8ecd559255f
Revert "scanner: capitalize enum entry names"
tools/scanner/context.py
tools/scanner/context.py
# Copyright (c) <2015> <lummax> # Licensed under MIT (http://opensource.org/licenses/MIT) from collections import namedtuple from scanner import parser Interface = namedtuple('Interface', 'name, wl_name, version, description, requests, events, enums') EmptyRequest = namedtuple('EmptyRequest', 'name, is_destructor, me...
Python
0
@@ -5426,16 +5426,8 @@ ame) -.upper() ,%0A
e95b254a3f9df8deae3417a63c51a404d43fa1b4
provide a more helpful error message for secret decryption failures.
awx/main/utils/encryption.py
awx/main/utils/encryption.py
import base64 import hashlib import six from cryptography.fernet import Fernet from django.utils.encoding import smart_str __all__ = ['get_encryption_key', 'encrypt_field', 'decrypt_field', 'decrypt_value'] def get_encryption_key(field_name, pk=None): ''' Generate key for encrypted password based on field...
Python
0.999185
@@ -21,16 +21,31 @@ hashlib +%0Aimport logging %0A%0Aimport @@ -87,16 +87,30 @@ t Fernet +, InvalidToken %0A%0Afrom d @@ -234,16 +234,73 @@ alue'%5D%0A%0A +logger = logging.getLogger('awx.main.utils.encryption')%0A%0A %0Adef get @@ -2891,16 +2891,29 @@ None))%0A%0A + try:%0A retu @@ -2937,12 +2937,4...
e2cda0d6d9d3859a335b26b7dcd2d0178e920c93
Simplify the code.
girder_worker/girder_plugin/utils.py
girder_worker/girder_plugin/utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of ...
Python
0.000315
@@ -3690,32 +3690,40 @@ ry:%0A +result%5B' direct_path = Fi @@ -3717,16 +3717,18 @@ ect_path +'%5D = File( @@ -3806,110 +3806,12 @@ -direct_path = None%0A if direct_path is not None:%0A result%5B'direct_path'%5D = direct_path +pass %0A
9195943db5efcf9c847422d521ef1b0ae4124526
Update __init__.py
fancyimpute/__init__.py
fancyimpute/__init__.py
from __future__ import absolute_import, print_function, division from .solver import Solver from .nuclear_norm_minimization import NuclearNormMinimization from .matrix_factorization import MatrixFactorization from .iterative_svd import IterativeSVD from .simple_fill import SimpleFill from .soft_impute import SoftImput...
Python
0.000014
@@ -631,9 +631,9 @@ 0.5. -3 +4 %22%0A%0A_
b12e96f6365746b21b929bbd827c2070f183b01e
Fix lint issues
feder/domains/models.py
feder/domains/models.py
from feder.organisations.models import Organisation from django.db import models from model_utils.models import TimeStampedModel from django.utils.translation import ugettext_lazy as _ class DomainQuerySet(models.QuerySet): def for_user(self, user): return self class Domain(TimeStampedModel): name = ...
Python
0.000003
@@ -180,16 +180,17 @@ y as _%0A%0A +%0A class Do @@ -271,16 +271,17 @@ n self%0A%0A +%0A class Do
c633074b031fc03b01f00ddb2ea77675a23553db
Add license information.
fedora/accounts/fas2.py
fedora/accounts/fas2.py
import urllib import urllib2 import simplejson from urlparse import urljoin from fedora.tg.client import BaseClient, AuthError, ServerError class FASError(Exception): '''FAS Error''' pass class CLAError(FASError): '''CLA Error''' pass class AccountSystem(BaseClient): def __init__(self, baseURL, ...
Python
0
@@ -1,20 +1,1093 @@ +# -*- coding: utf-8 -*-%0A#%0A# Copyright %C2%A9 2008 Ricky Zhou, Red Hat, Inc. All rights reserved.%0A#%0A# This copyrighted material is made available to anyone wishing to use, modify,%0A# copy, or redistribute it subject to the terms and conditions of the GNU%0A# General Public License v.2. Th...
417471a3089da42074f5f84a7075353f32a88d56
Drop Py2 and six on tests/integration/runners/test_runner_returns.py
tests/integration/runners/test_runner_returns.py
tests/integration/runners/test_runner_returns.py
# -*- coding: utf-8 -*- """ Tests for runner_returns """ from __future__ import absolute_import, print_function, unicode_literals import errno import os import socket import tempfile import pytest import salt.payload import salt.utils.args import salt.utils.files import salt.utils.jid import salt.utils.yaml from test...
Python
0
@@ -1,28 +1,4 @@ -# -*- coding: utf-8 -*-%0A %22%22%22%0A @@ -29,81 +29,8 @@ %0A%22%22%22 -%0Afrom __future__ import absolute_import, print_function, unicode_literals %0A%0Aim @@ -3835,17 +3835,16 @@ %22sudo_%7B -0 %7D%22.forma @@ -4010,14 +4010,12 @@ do_%7B -0 %7D%5C%5C%7B -1 %7D%22.f
0e8ebdff245239de28f3d43897038a7bb37c0b1d
Change row offset
loadNotes.py
loadNotes.py
from synthnotes.generators import NoteGenerator import psycopg2 as psy def main(): generator = NoteGenerator() params = {'database': 'synthea', 'user': 'postgres', 'host': '172.22.10.147'} conn = psy.connect(**params) cur = conn.cursor() cur.execute("""select id, person_id, start, stop from en...
Python
0.000001
@@ -558,9 +558,9 @@ row%5B -5 +2 %5D%0A @@ -580,9 +580,9 @@ row%5B -6 +3 %5D%0A%0A
c5d1e78adce7c3eea36865c16a6e3a5dfe5048f7
Update Curso.py
backend/Controllers/Curso.py
backend/Controllers/Curso.py
from Framework.Controller import Controller from Database.Controllers.Curso import Curso as BDCurso from Models.Curso.RespostaListar import RespostaListar from Models.Curso.RespostaCadastrar import RespostaCadastrar from Models.Curso.RespostaEditar import RespostaEditar from Models.Curso.RespostaVer import RespostaVer ...
Python
0
@@ -549,16 +549,33 @@ campus = + %25s AND id_grau = %25s AND @@ -645,16 +645,51 @@ ()),%22%25%22+ +str(pedido_listar.getIdGrau()),%22%25%22+ pedido_l @@ -1683,16 +1683,58 @@ ximo())%0A +%09%09curso.setMec(pedido_cadastrar.getMec())%0A %09%09return @@ -2537,16 +2537,55 @@ ximo())%0A +%09%09curso.setMec(pedido_e...
cd44f9b09f6a961b621091155f418a11adb55dd3
Document components/ansible
src/xii/builtin/components/ansible/component.py
src/xii/builtin/components/ansible/component.py
from xii.component import Component from xii.need import NeedIO, NeedSSH from xii import error from ansible import NeedAnsible class AnsibleComponent(Component, NeedAnsible, NeedIO, NeedSSH): ctype = "ansible" required_attributes = ["hosts", "run"] default_attributes = ["hosts", "env"] requires = [...
Python
0.000001
@@ -189,16 +189,969 @@ edSSH):%0A + %22%22%22%0A Easily provision created images using standard ansible.%0A%0A .. note::%0A Make sure the ansible commandline tool is installed and working%0A if you want to use this feature.%0A%0A Example definition:%0A ::%0A%0A # vim: set ts=2 sw=2 tw...
56423a90adc82d453c15c51c9168a04b35032a37
reimplement function changeSelection, in this function call super changeSelection and save the item selected by user: this solve the glitch when user change start room
trunk/editor/roommanagerlistwidget.py
trunk/editor/roommanagerlistwidget.py
#!/usr/bin/env python from contextlib import contextmanager from PyQt4.QtGui import * from PyQt4.QtCore import * from structdata import g_project from roomlistwidget import RoomListWidget @contextmanager def blockedSignals(widget): widget.blockSignals(True) try: yield finally: widget.b...
Python
0
@@ -2477,13 +2477,11 @@ tedI -ndexe +tem s()%5B @@ -3127,9 +3127,428 @@ y_list%0A%0A + def changeSelection(self, row, column):%0A %22%22%22%0A reimplementazione della funzione in nella classe base%0A RoomItemListWidget. In questa versione viene anche salvata la %0A room che e' stata se...
f6b8d55bb2f8312f6f3a3218978619cf080ae93b
rollback unrelated changes in crypto module
src/main/python/covata/delta/crypto.py
src/main/python/covata/delta/crypto.py
# Copyright 2017 Covata Limited or its affiliates # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0
@@ -2360,25 +2360,46 @@ backend())%0A%0A -%0A + @staticmethod%0A def generate @@ -2406,16 +2406,20 @@ _key():%0A + # ty @@ -2442,24 +2442,28 @@ APrivateKey%0A + %22%22%22%0A @@ -2462,16 +2462,20 @@ %22%22%22%0A + + Generate @@ -2532,16 +2532,20 @@ can be%0A + extr @...
f627dbbca1c975ecee3a9a764b2ce5872ae105fb
Check if dt is already defined before parsing
events/utils.py
events/utils.py
from datetime import datetime, timedelta import re import collections import pytz from django.db import transaction from django.conf import settings from dateutil.parser import parse as dateutil_parse from rest_framework.exceptions import ParseError from events.models import Keyword, Place from events.sql import coun...
Python
0
@@ -4143,26 +4143,33 @@ ys=1)%0A el -se +if not dt :%0A tr
12c85c4fc304858dc9843bdbf35e787443d9a684
build app on travis
app/scripts/create_env.py
app/scripts/create_env.py
#!/usr/bin/env python3 from distutils.sysconfig import get_python_lib import glob import os import shutil import subprocess import tarfile import tempfile import zipfile import util script_tag = "[OT PyEnv Builder] " script_tab = " " # The project_root_dir depends on the location of this file, so...
Python
0
@@ -5014,337 +5014,8 @@ )%0A%0A%0A -def copy_virtual_env_to_release_dir():%0A %22%22%22%0A Copies artifact %22ENV_DISTPATH/venv.zip%22 to %22releases/venv-%7Bbuild-tag%7D.zip%22%0A %22%22%22%0A tag = util.get_build_tag(util.get_os())%0A shutil.copy(%0A os.path.join(ENV_DISTPATH, 'venv.zip'),%0A ...
65531eda0f1584cb3c8552cef8593cbf69536139
Enable strict warnings in test runs.
tornado/test/runtests.py
tornado/test/runtests.py
#!/usr/bin/env python import unittest TEST_MODULES = [ 'tornado.httputil.doctests', 'tornado.iostream.doctests', 'tornado.util.doctests', 'tornado.test.auth_test', 'tornado.test.curl_httpclient_test', 'tornado.test.escape_test', 'tornado.test.gen_test', 'tornado.test.httpclient_test', ...
Python
0
@@ -867,16 +867,697 @@ ain__':%0A + # The -W command-line option does not work in a virtualenv with%0A # python 3 (as of virtualenv 1.7), so configure warnings%0A # programmatically instead.%0A import warnings%0A # Be strict about most warnings. This also turns on warnings that are%0A # ignored by d...
985637c21ea8684728880a5cd8d1cddbcd0f82ff
add link for geonames field description [ci skip]
cities_light/settings.py
cities_light/settings.py
""" Settings for this application. The most important is TRANSLATION_LANGUAGES because it's probably project specific. .. py:data:: TRANSLATION_LANGUAGES List of language codes. It is used to generate the alternate_names property of cities_light models. You want to keep it as small as possible. By default...
Python
0
@@ -5279,32 +5279,111 @@ es in geonames.%0A + Description of fields: http://download.geonames.org/export/dump/readme.txt%0A %22%22%22%0A geon @@ -5801,32 +5801,111 @@ es in geonames.%0A + Description of fields: http://download.geonames.org/export/dump/readme.txt%0A %22%22%22%0A name
898ca320fe2c5d70e050d55866d8fcf6b2a8d532
Add register_opts function to sslutils
oslo_service/sslutils.py
oslo_service/sslutils.py
# Copyright 2013 IBM Corp. # # 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 t...
Python
0.000006
@@ -855,16 +855,153 @@ ts))%5D%0A%0A%0A +def register_opts(conf):%0A %22%22%22Registers sslutils config options.%22%22%22%0A return conf.register_opts(_options.ssl_opts, config_section)%0A%0A%0A def is_e
f30dc86668aa89e37f3f497f61e78e043c6f8486
add test for unconfirmed balance between restarts
test/functional/mempool_persist.py
test/functional/mempool_persist.py
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mempool persistence. By default, bitcoind will dump mempool on shutdown and then reload it on sta...
Python
0
@@ -2563,16 +2563,67 @@ (%2210%22))%0A + node2_balance = self.nodes%5B2%5D.getbalance()%0A @@ -2630,32 +2630,32 @@ self.sync_all()%0A - %0A self.lo @@ -2887,31 +2887,25 @@ p-start -node0 and +the node -1 +s . Verify @@ -2971,16 +2971,102 @@ oes not. + Verify that node2 calculates its ba...
ad89d2c87e8f835b2ae2cc204393143b783f3480
Add time decorator
src/utils.py
src/utils.py
import pickle import time import unittest def get_date_and_time(): """ Function to create an unique label using the date and time. :rtype: str """ return time.strftime('%d-%m-%Y_%H-%M-%S') def run_test(testClass, header): """ Function to run all the tests from a class of tests. ...
Python
0.000028
@@ -36,16 +36,1061 @@ ittest%0A%0A +timing = %7B%7D%0A%0A%0Adef get_time(f, args=%5B%5D):%0A %22%22%22%0A After using timeit we can get the duration of the function f%0A when it was applied in parameters args. Normally it is expected%0A that args is a list of parameters, but it can be also a single paramet...
339fca8799c69e600bc05a51d248bedeef2cdf59
Remove empty line from process_stdout()
src/utils.py
src/utils.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Utility module for the workflow.""" import logging import os import yaml from colorlog import ColoredFormatter def get_iteration_prexix(i, total): """ Return a String prefix for itarative task phases. :param i int current step. :param total int total steps. ...
Python
0.00001
@@ -4634,10 +4634,24 @@ it(%22%5Cn%22) + if item != %22%22 %5D%0A
a58408c28bffb29fea72d2ec045ffcf23ef3f29a
bump version number to 0.0.1
forums/__init__.py
forums/__init__.py
__version__ = '0.0.0'
Python
0.000126
@@ -12,11 +12,11 @@ = '0.0. -0 +1 '%0A
b12ac1b5741448535e69a8c33b135dd461294779
replace all string view args with callables
foundation/urls.py
foundation/urls.py
from django.conf import settings from django.conf.urls import include, url from django.views.generic import TemplateView from django.views.generic import RedirectView from django.contrib import admin from foundation.organisation.views import relatable_person admin.autodiscover() from haystack.views import SearchVie...
Python
0
@@ -164,41 +164,195 @@ iew%0A -%0Afrom django.contrib import admin +from django.contrib.auth import views as admin_views%0Afrom django.views import defaults as default_views%0A%0Afrom django.contrib import admin%0Afrom django.contrib.sitemaps.views import sitemap %0A%0Afr @@ -1026,37 +1026,28 @@ 400/$', -'django.vi...
7f18e346c330f6560034d4023e98f152e5dc9a52
Remove useless comments
foxybot/foxybot.py
foxybot/foxybot.py
import asyncio import discord import requests from commands import * from config import conf from registrar import CommandRegistrar async def _on_ready(shards, shard, shard_id, num_shards): print(f'Shard {shard_id+1} connected with {len(shard.servers)} servers.') await shard.change_presence(game=disc...
Python
0
@@ -1125,55 +1125,8 @@ None - # yuck, I know, too sleepy to fix properly atm %0A%0A
8820ed624e586c2ea59a027f144b06457d16a680
Allow clients to specify UUID
programs/buck.py
programs/buck.py
#!/usr/bin/env python from __future__ import print_function import sys class ExitCode(object): """Python equivalent of com.facebook.buck.util.ExitCode""" FATAL_BOOTSTRAP = 11 if sys.version_info < (2, 7): import platform print(("Buck requires at least version 2.7 of Python, but you are using {}." ...
Python
0
@@ -3920,16 +3920,48 @@ ild_id = + os.environ.get('BUCK_BUILD_ID', str(uui @@ -3970,16 +3970,17 @@ uuid4()) +) %0A
ed5d70ef39d6303fdc2bc68e09a8d06c5b980e63
Fix typo in error message.
dml/dml.py
dml/dml.py
############################################################################### ## ## dml.py ## ## Python library providing common functionalities for building Data ## Mechanics platform components. ## ## Web: datamechanics.org ## Version: 0.0.11.0 ## ## import sys # To parse command line arguments. i...
Python
0.000007
@@ -1531,32 +1531,33 @@ hin an immediate + %22%5C%0A + %22su @@ -1840,16 +1840,17 @@ mmediate + %22%5C%0A
82bb0ba1f85f2277589eb8309903f38e22e342b7
Fix bug where arrays are sent as strings.
project/utils.py
project/utils.py
from flask import jsonify def mergeFrom(fromData, toData, keysToMerge, require=True): for key in keysToMerge: if key in fromData: toData[key] = fromData[key] elif require == True: raise Exception('Missing required parameter %s' % key) # gracefully handles errors with incomp...
Python
0
@@ -548,16 +548,28 @@ t, float +, list, dict %5D or val @@ -1775,8 +1775,9 @@ ot in b%5D +%0A
95f5ba9635c588115a2617ed3f2f82749e33a828
fix mavlink_shell.py: python3 compat for octal numbers
Tools/mavlink_shell.py
Tools/mavlink_shell.py
#!/usr/bin/env python """ Open a shell over MAVLink. @author: Beat Kueng (beat-kueng@gmx.net) """ from __future__ import print_function import sys, select import termios try: from pymavlink import mavutil import serial except: print("Failed to import pymavlink.") print("You may need to install it w...
Python
0.00013
@@ -6025,11 +6025,10 @@ == -033 +27 :%0A
84768d2d4998cde632b02dc37b6f4c0d105e3c3c
Replace `jax.xla.DeviceArray` private type with the new public type `jax.Array`.
benchmarks/pmap_benchmark.py
benchmarks/pmap_benchmark.py
# Copyright 2020 The JAX Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
Python
0.00104
@@ -2511,18 +2511,8 @@ jax. -xla.Device Arra
f6cf7f8590cc03cc0189c306d785e5c2dd7ccf85
Fix behavior of `builtin.type()` decorator and provide some explanatory comments
bfg9000/builtins/__init__.py
bfg9000/builtins/__init__.py
import functools import importlib import inspect import pkgutil import sys from itertools import chain from six import iteritems, itervalues, string_types from .. import exceptions from ..iterutils import iterate from ..objutils import memoize _all_builtins = {} @memoize def init(): # Import all the packages in...
Python
0
@@ -2642,32 +2642,284 @@ rgs, **kwargs):%0A + # Try to get the first argument to this function. If it's the%0A # output type, just return it immediately; otherwise, check if%0A # it's a valid input type and then call the function.%0A try:%0A ...
01c5b1b31914c7b4d94ec62daed5f2ae6c0742f0
check for http/https when getting hostname values
maraschino/tools.py
maraschino/tools.py
# -*- coding: utf-8 -*- """Util functions for different things. For example: format time or bytesize correct.""" from flask import request, Response from functools import wraps from jinja2.filters import FILTERS import os import maraschino from maraschino import app from maraschino.models import Setting from flask imp...
Python
0.000001
@@ -2556,16 +2556,271 @@ n None%0A%0A + #Strip http/https from hostnames%0A if key.endswith('_host') or key.endswith('_ip'):%0A if value.startswith('http://'):%0A return value%5B7:%5D%0A elif value.startswith('https://'):%0A return value%5B8:%5D%0A ...
4506edc4595f89a42eddb210a96eda0c1375694f
Clean up formatting, remove unused import
apps/storybase_geo/api.py
apps/storybase_geo/api.py
from django.conf.urls.defaults import url from django.core.exceptions import ObjectDoesNotExist from tastypie import fields, http from tastypie.authentication import Authentication from tastypie.authorization import ReadOnlyAuthorization from tastypie.constants import ALL, ALL_WITH_RELATIONS from tastypie.exceptions ...
Python
0.000001
@@ -323,20 +323,8 @@ port - BadRequest, Imm @@ -4758,17 +4758,24 @@ = False%0A -%09 + # Allow
04b0e9e2f8f8b40e33e13aa77e1766e126c3bb00
Refactor to use generic api views instead of class based
apps/userprofile/views.py
apps/userprofile/views.py
from django.http import HttpResponse from django.template import loader from django.shortcuts import get_object_or_404 from django.http import Http404 from .models import * from .serializers import * from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Res...
Python
0
@@ -116,40 +116,8 @@ 404%0A -from django.http import Http404%0A from @@ -192,245 +192,83 @@ ort -status%0Afrom rest_framework.decorators import api_view%0Afrom rest_framework.response import Response%0Afrom rest_framework.views import APIView%0A%0A%0Aclass OrganizationList(APIView):%0A def get(self, request, for...
033cf1c2d34c73cce84c4c12c7383188167bf9e5
version 2.1.54
targetcli/version.py
targetcli/version.py
''' This file is part of targetcli. Copyright (c) 2011-2013 by Datera, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applica...
Python
0
@@ -618,11 +618,11 @@ = '2.1.5 -3 +4 '%0A
3fe0f73d9c9ca177cefd61636f10be77aa1261d0
Remove bank information from form.
autoentrepreneur/forms.py
autoentrepreneur/forms.py
from django.forms import ModelForm from django import forms from django.utils.translation import ugettext_lazy as _ from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \ AUTOENTREPRENEUR_PAYMENT_OPTION class UserProfileForm(ModelForm): company_name = forms.CharField(required=False, max_...
Python
0
@@ -444,108 +444,8 @@ nce%0A - bank_information = forms.CharField(required=False, max_length=255, label=_('Bank information'))%0A
88aae903df9e6a7331617ff6732299fc23d44372
Add iceil, ifloor, and iround functions.
bionet/utils/numpy_extras.py
bionet/utils/numpy_extras.py
#!/usr/bin/env python """ Numpy Extras ============ This module contains various functions not currently included in numpy [1]_. - crand Generate complex uniformly distributed random values. - mdot Compute the matrix product of several matricies. - rank Estimate the number of linearly...
Python
0
@@ -197,16 +197,195 @@ values.%0A +- iceil Ceiling of the input returned as an integer.%0A- ifloor Floor of the input returned as an integer.%0A- iround Input rounded to the nearest integer%0A - mdot @@ -1267,16 +1267,1200 @@ *args)%0A%0A +def iceil(x):%0A %22%22%22%0A Return the ...
9b02edd10ad23bea77cead09543f4db58f95e4b9
Add some comments, and remove function that never need
bitmessage/bitmessagemain.py
bitmessage/bitmessagemain.py
# Copyright (c) 2012 Jonathan Warren # Copyright (c) 2012 The Bitmessage developers # Distributed under the MIT/X11 software license. See the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Right now, PyBitmessage only support connecting to stream 1. It doesn't # yet contain logic ...
Python
0
@@ -1349,16 +1349,46 @@ s = %7B%7D%0A%0A +#Initilise bitmessage library%0A def star @@ -3627,24 +3627,54 @@ ad.start()%0A%0A +# Shutdown bitmessage library%0A def stop():%0A @@ -3703,16 +3703,71 @@ down()%0A%0A +# Create a new address to send message and replace old%0A def gene @@ -4816,16 +4816,79 @@ waddr%0A%0...
a53db79e28875f04a5877a6a0d608d1744e1b7f8
update unit tests to reflect that QSOs in SV get extra observations regardless of redshift
py/desitarget/test/test_mtl.py
py/desitarget/test/test_mtl.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """Test desitarget.mtl. """ import os import unittest import numpy as np from astropy.table import Table, join from desitarget.targetmask import desi_mask as Mx from desitarget.sv1.sv1_targetmask import desi_mask as MxSV from desit...
Python
0
@@ -4197,32 +4197,243 @@ eys='TARGETID')%0A + pp = self.post_prio.copy()%0A nom = %5B0, 1, 0, 3, 1%5D%0A # ADM in SV, all quasars get all observations.%0A if prefix == %22SV1_%22:%0A pp%5B2%5D, nom%5B2%5D = pp%5B3%5D, nom%5B3%5D%0A self @@ -4470,3...
036e25f9d8fc446ebb9942120b364c883890907e
add AnomalyChooser class that let's you select from
py/nupic/algorithms/anomaly.py
py/nupic/algorithms/anomaly.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
Python
0
@@ -1026,16 +1026,207 @@ numpy%0A%0A%0A +class AnomalyChooser(Anomaly):%0A def computeAnomalyScore(self, activeColumns, prevPredictedColumns):%0A return CumulativeAnomaly.computeAnomalyScore(activeColumns, prevPredictedColumns) %0A%0A%0A %0Aclass A @@ -2866,24 +2866,32 @@ Columns %0A + score = super().com ...
0caf7c1ac8ea2a0fc9c2d7c46121fc48d830d855
update pymhex for new pycaffe interface
pymhex/load_mhex_into_caffe.py
pymhex/load_mhex_into_caffe.py
#! /usr/bin/python def load_mhex(caffe_prototxt, caffe_model, mhex_mat_file, save_file, load_mat1=True, load_mat2=True): """ load matrices dumped from matlab into Caffe network MHEX implemenatation in Caffe consists of two InnerProductLayer at bottom and top, and one SoftmaxLayer between them. The inner produ...
Python
0
@@ -655,16 +655,29 @@ fe_model +, caffe.TRAIN )%0A else @@ -712,16 +712,29 @@ prototxt +, caffe.TRAIN )%0A%0A # l
c8ad5e8fdc0fff5549c575abea9acbf11d903fe0
Add support for 3.19, and copy the uppercase style that is now used in the versions.json file.
pysc2/run_configs/platforms.py
pysc2/run_configs/platforms.py
# Copyright 2017 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 by applicable law or ...
Python
0
@@ -1049,38 +1049,38 @@ , %225 -bd7c31b +BD7C31B 44525 -dab46e64c +DAB46E64C 4602 -a81dc +A81DC 2%22), @@ -1107,40 +1107,40 @@ 7, %22 -dfd1f6607f2cf19cb4e1c996b +DFD1F6607F2CF19CB4E1C996B 2563 -d9b +D9B %22),%0A @@ -1167,39 +1167,39 @@ , %223 -f2fced +F2FCED 08798 -d83b873b +D83B873B 5543 -befa6c4b +BEFA6C4B ...
170ffc100f36f3676a32f4ea5a464dcb131b7f2f
Add docstrings for TestUtils class.
pysemantic/tests/test_utils.py
pysemantic/tests/test_utils.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2015 jaidev <jaidev@newton> # # Distributed under terms of the BSD 3-clause license. """ Tests for a the pysemantic.utils module. """ import unittest import os.path as op from pysemantic.utils import colnames, get_md5_checksum class Tes...
Python
0
@@ -506,32 +506,103 @@ colnames(self):%0A + %22%22%22Test if the column names are read correctly from a file.%22%22%22%0A ideal = @@ -664,16 +664,16 @@ Width',%0A - @@ -828,32 +828,138 @@ xtension(self):%0A + %22%22%22Test if the colnames function can infer the correct parser from t...
7c90da5ceb76241d516957f142507fccc51b7081
Update __init__.py
pythainlp/tokenize/__init__.py
pythainlp/tokenize/__init__.py
# -*- coding: utf-8 -*- """ Thai tokenizers """ import re import nltk from pythainlp.corpus import get_corpus, thai_syllables, thai_words from marisa_trie import Trie DEFAULT_DICT_TRIE = Trie(thai_words()) FROZEN_DICT_TRIE = Trie(get_corpus("words_th_frozen_201810.txt")) def word_tokenize(text, engine="newmm", whi...
Python
0.000072
@@ -3761,57 +3761,34 @@ s = -nltk.tokenize.WhitespaceTokenizer().tokenize(text +re.split(r' +', text, re.U )%0A @@ -3856,55 +3856,19 @@ s = -re.sub(r%22%5Cn+%7C%5Cs+%22, %22%7C%22, text.strip()) +text .split( -%22%7C%22 )%0A%0A
535497f5374d68a148443ba54ee74f66c44a6947
fix pep8 errors
acos_client/v21/admin.py
acos_client/v21/admin.py
import base class Admin(base.BaseV21): @property def administrator(self): return self.Administrator(self.client) class Administrator(base.BaseV21): def all(self, **kwargs): return self._get('system.admin.administrator.getAll', **kwargs) def get(self, name, **kwargs):...
Python
0.000031
@@ -6,16 +6,17 @@ t base%0A%0A +%0A class Ad @@ -1042,17 +1042,16 @@ e%22: name - %7D%0A
6d0a281c3056c03aa482aac5ec1dbc7c4a85fa23
Update version number.
tensorflow_gan/python/version.py
tensorflow_gan/python/version.py
# coding=utf-8 # Copyright 2019 The TensorFlow GAN Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
Python
0.000043
@@ -722,17 +722,17 @@ SION = ' -0 +1 '%0A_MINOR
41d366140d07e6b7723bacb6e61469c111b6ca61
Update inception model path Change: 171910161
tensorflow_serving/workspace.bzl
tensorflow_serving/workspace.bzl
# TensorFlow Serving external dependencies that can be loaded in WORKSPACE # files. load('@org_tensorflow//tensorflow:workspace.bzl', 'tf_workspace') # All TensorFlow Serving external dependencies. # workspace_dir is the absolute path to the TensorFlow Serving repo. If linked # as a submodule, it'll likely be '__work...
Python
0
@@ -398,24 +398,26 @@ sitory(%0A + name = %22ince @@ -434,16 +434,18 @@ l%22,%0A + path = %22 @@ -446,32 +446,41 @@ th = %22tf_models/ +research/ inception%22,%0A @@ -475,16 +475,18 @@ ption%22,%0A + buil @@ -505,16 +505,25 @@ _models/ +research/ inceptio @@ -663,24 +663,26 @@ e.bind(%0...
9120501aa20d2cb545e7ea3373a71d155a25d90a
置換関数は配列を受け取り、splitは呼び出し側にさせる
easiaar.py
easiaar.py
import sys def translate_words(sentence, dictionary, after_sep = ' '): translated = [] for word in sentence.split(): if word in dictionary: translated.append(dictionary[word]) else: translated.append(word) return after_sep.join(translated) dictionary = {} for line ...
Python
0
@@ -25,24 +25,21 @@ e_words( -sentence +words , dictio @@ -102,24 +102,13 @@ in -sentence.split() +words :%0A @@ -439,16 +439,24 @@ rds(line +.split() , dictio
e0cd3cdb8dd22c2cb2134865dd5ed4386b35a5f9
fix some empty op_def issues in old TF
tensorpack/tfutils/sesscreate.py
tensorpack/tfutils/sesscreate.py
# -*- coding: utf-8 -*- # File: sesscreate.py import tensorflow as tf from tensorflow.contrib.graph_editor import get_backward_walk_ops from ..tfutils.common import tfv1 from ..utils import logger from .common import get_default_sess_config __all__ = ['NewSessionCreator', 'ReuseSessionCreator', 'SessionCreatorAdapt...
Python
0.000003
@@ -1560,16 +1560,41 @@ if +x.op_def is not None and not x.op
55ca2485cc678bd0d0f8955c725faeda68e94429
copy fields and exports from model base classes
tbone/data/models.py
tbone/data/models.py
#!/usr/bin/env python # encoding: utf-8 from collections import OrderedDict from .fields import BaseField from functools import wraps class ModelMeta(type): '''Metaclass for Model''' @classmethod def __prepare__(mcl, name, bases): def export(func): func._export_method_ = True ...
Python
0
@@ -34,16 +34,42 @@ utf-8%0A%0A +from copy import deepcopy%0A from col @@ -96,16 +96,16 @@ redDict%0A - from .fi @@ -261,24 +261,112 @@ me, bases):%0A + ''' Adds the export decorator so member methods can be decorated for export '''%0A def @@ -759,16 +759,305 @@ Dict()%0A%0A + # get model...
b72722c0873d7b0aaeee995ee62576af16c1cf40
Update to reflect changes to ddesc
blaze/tests/test_datetime.py
blaze/tests/test_datetime.py
from __future__ import absolute_import, division, print_function import unittest from datetime import date, datetime import blaze from datashape import dshape from blaze.datadescriptor import dd_as_py class TestDate(unittest.TestCase): def test_create(self): a = blaze.array(date(2000, 1, 1)) sel...
Python
0
@@ -189,16 +189,19 @@ mport dd +esc _as_py%0A%0A @@ -375,32 +375,35 @@ f.assertEqual(dd +esc _as_py(a._data), @@ -395,21 +395,21 @@ as_py(a. -_data +ddesc ), date( @@ -559,32 +559,35 @@ f.assertEqual(dd +esc _as_py(a._data), @@ -571,37 +571,37 @@ l(ddesc_as_py(a. -_data +ddesc ),%0A @@ -799,24 +7...
7d6624f69a5d248d6f5c31f887b4a60e2b55535c
add export token header to html export format
couchexport/shortcuts.py
couchexport/shortcuts.py
import logging from zipfile import ZipFile from couchdbkit.ext.django.schema import Document from django.http import HttpResponse from StringIO import StringIO from unidecode import unidecode from couchforms.models import XFormInstance from django.core.cache import cache import hashlib def get_export_files(export_tag,...
Python
0.000001
@@ -2981,20 +2981,24 @@ re -turn +sponse = HttpRes @@ -3046,16 +3046,106 @@ metype)%0A + response%5B'X-CommCareHQ-Export-Token'%5D = checkpoint.get_id%0A return response%0A %0A%0A re
6eda8e47c39906ba75a25571b77029766e558c07
fix model loading in eval_lm
eval_lm.py
eval_lm.py
#!/usr/bin/env python3 -u # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import n...
Python
0.000001
@@ -929,18 +929,8 @@ mat( -', '.join( args @@ -936,17 +936,16 @@ s.path)) -) %0A mod @@ -996,16 +996,27 @@ rgs.path +.split(',') , datase
eb33e6393cb85217aeea5c6c3cc0c24ddc8ad7f3
Remove unnecessary lines
example.py
example.py
from os.path import exists import pickle import gzip from urllib.request import urlretrieve from sklearn.datasets import load_digits from sklearn.svm import LinearSVC from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from...
Python
0.999597
@@ -1254,79 +1254,8 @@ %5D%0A%0A%0A -# digits = load_digits()%0A# images = digits.images%0A# y = digits.target%0A%0A pcan
fbdb64feb90bc8a76d4e00485367dce655965b24
remove unused imports
test/client_tests.py
test/client_tests.py
import sygicmaps as c import responses import requests import requests_mock import unittest as ut import json import os class ClientTests(ut.TestCase): def __get_sample_response_json(self): sample_response_json = """ { "results": [ { "location": { ...
Python
0.000001
@@ -19,41 +19,8 @@ s c%0A -import responses%0Aimport requests%0A impo @@ -74,18 +74,8 @@ son%0A -import os%0A %0A%0Acl
612f458a0873d669092df8bb259a3c5787470747
Fix the example.
example.py
example.py
import numpy as np import matplotlib matplotlib.use("Qt5Agg") import matplotlib.pyplot as plt from MPLAnimator import Animator def naive_estimator(x, data, h): n = sum(1 for d in data if x-h/2 < d <= x+h/2) N = len(data) return n/(N*h) data = [0.5, 0.7, 0.8, 1.9, 2.4, 6.1, 6.2, 7.3] xs = np.arange(0, 8, 0...
Python
0.999994
@@ -1435,17 +1435,16 @@ 8.5)%0A%0A%0A -%0A a = Anim @@ -1477,22 +1477,18 @@ , setup_ -handle +cb =setup)%0A @@ -1516,14 +1516,10 @@ ame_ -handle +cb =fra
d1d59d57542a91445b29ff012265cdb38665c065
add example for text response property and allow passing keyword arguments.
brownant/pipeline/network.py
brownant/pipeline/network.py
from brownant.pipeline.base import PipelineProperty from brownant.exceptions import NotSupported class URLQueryProperty(PipelineProperty): """The query argument property. The usage is simple:: class MySite(Dinergate): item_id = URLQueryProperty(name="item_id", type=int) It equals to this...
Python
0
@@ -1828,16 +1828,498 @@ ource.%0A%0A + Getting this property is network I/O operation in the first time. The%0A http request implementations are all provided by :mod:%60requests%60.%0A%0A The usage example::%0A%0A class MySite(Dinergate):%0A foo_http = requests.Session()%0A foo_u...
56e647a6e3bac7185b645f75ece4059b56a4ec15
optimize code for import
config/conf.py
config/conf.py
import os import random from yaml import load config_path = os.path.join(os.path.dirname(__file__), 'spider.yaml') with open(config_path, encoding='utf-8') as f: cont = f.read() cf = load(cont) def get_db_args(): return cf.get('db') def get_redis_args(): return cf.get('redis') def get_timeout(): ...
Python
0.000022
@@ -17,16 +17,17 @@ random%0A +%0A from yam
50a23ea692456c49523c0345312b23e3ef11e914
Fix le class name.
Cogs/Boop.py
Cogs/Boop.py
import asyncio import discord import random from discord.ext import commands from Cogs import DisplayName from Cogs import Nullify def setup(bot): # Add the bot bot.add_cog(Drink(bot)) class Drink: # Init with the bot reference, and a reference to the settings var def __init__(self, bot): ...
Python
0.000081
@@ -205,21 +205,20 @@ %0D%0Aclass -Drink +Boop :%0D%0A%0D%0A%09# @@ -2594,18 +2594,34 @@ and -jump on it + use it as a bouncy castle ... @@ -2638,16 +2638,32 @@ amused.' +.format(memName) %5D%0D%0A%09%09%09ra
5c7036d164e53ced72c85656ef56f89c6a4b4de5
Fix fabfile paths
fabfile.py
fabfile.py
import os import pwd from fabric.api import cd, env, task, require, run, sudo, prefix, shell_env from fabric.contrib.files import exists, upload_template VIRTUALENV_DIR = 'env' CODE_DIR = 'mma-dexter' PROD_HOSTS = ['wazimap.co.za'] @task def prod(): env.deploy_type = 'prod' env.deploy_dir = '/home/mma/mma-de...
Python
0.000034
@@ -311,19 +311,8 @@ mma/ -mma-dexter/ '%0A @@ -331,12 +331,16 @@ = ' -mast +big-serv er'%0A @@ -576,16 +576,26 @@ loy_dir, + CODE_DIR, VIRTUAL @@ -1142,34 +1142,28 @@ s.path.join( -env.deploy +repo _dir, 'log') @@ -1280,34 +1280,28 @@ otate.d/' %25 -env.deploy +repo _dir)%0A%0A # @@ -1395,34 +1395,28...
94ae34672e8b0756b05639fe512ddf72e8770635
Add path
fabfile.py
fabfile.py
import base64 import json import os import zipfile from fabric.api import lcd from fabric.api import local from fabric.api import shell_env from fabric.api import task from fabric.contrib.console import confirm BASE_PATH = os.getcwd() LIB_PATH = os.path.join(BASE_PATH, 'lib') TEMP_DIR = os.path.join(BASE_PATH, 'tmp')...
Python
0.000008
@@ -162,16 +162,44 @@ rt task%0A +from fabric.api import path%0A from fab
b918ff2676bcbd1cc56d45218c124f93db6970d1
Update fabfile for motion classifier
fabfile.py
fabfile.py
from __future__ import with_statement from fabric.api import env from fabric.api import hide from fabric.api import run from fabric.api import local from fabric.api import sudo from fabric.api import task from fabric.api import abort from fabric.context_managers import cd import os import sys HOME_DIR = "cloudlet/ga...
Python
0
@@ -3645,24 +3645,343 @@ filelist)%0A%0A + # OCR (open source) %0A filelist = COMMON_FILES + %5BAPP_COMM_DIR%5D + %5B%22./src/app/activity_recognition/%22%5D%0A exclude_list = %5B%22./src/app/activity_recognition/proxy_old.py%22, %22./src/app/activity_recognition/proxy_oldold.py%22%5D%0A _...
2df5b967bf395932390960e248dffddc48834337
use rw:* supervisor group in fabfile
fabfile.py
fabfile.py
from fabric.api import local, prefix, cd, run, env, lcd import datetime env.hosts = ['orin.kylewm.com'] REMOTE_PATH = '/srv/www/kylewm.com/redwind' def backup(): backup_dir = '~/Backups/kylewm.com/{}/'.format( datetime.date.isoformat(datetime.date.today())) local('mkdir -p ' + backup_dir) local('...
Python
0
@@ -144,16 +144,17 @@ dwind'%0A%0A +%0A def back @@ -863,30 +863,11 @@ rt r -edwind redwind-qworker +w:* %22)%0A%0A
2796617224a2162b45e2ff9af26f2ba0e4c30940
fix fabfile format
fabfile.py
fabfile.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao' ''' Build release package. ''' import os, re from datetime import datetime from fabric.api import * env.user = 'root' env.hosts = ['www.liaoxuefeng.com'] db_user = 'www' db_password = 'www' _TAR_FILE = 'dist-itranswarp.tar.gz' _REMOTE_TMP...
Python
0.000041
@@ -1642,25 +1642,24 @@ )):%0A - run('tar -xz @@ -1719,25 +1719,24 @@ R):%0A - run('rm -f w @@ -1736,25 +1736,24 @@ rm -f www')%0A - run( @@ -1777,17 +1777,16 @@ newdir)%0A - @@ -1824,25 +1824,24 @@ w')%0A - run('chown - @@ -1909,33 +1909,32 @@ =True):%0A ...
a3c156c27975241abd65255556a56005e6ad44d7
Use system supervisorctl (on demo shop)
fabfile.py
fabfile.py
""" fabfile :copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited :license: BSD, see LICENSE for more details. """ import os import getpass from fabric.tasks import execute from fabric.api import sudo, cd, prefix, run, env from fabric.decorators import hosts # Forward the SSH agent so th...
Python
0
@@ -1346,32 +1346,24 @@ 'webshop')%0A%0A - sudo('bi @@ -1352,36 +1352,32 @@ op')%0A%0A sudo(' -bin/ supervisorctl re @@ -1887,24 +1887,16 @@ '_'))%0A%0A - sudo @@ -1897,20 +1897,16 @@ sudo(' -bin/ supervis
bcdb010fc639d00f6d786fb3fef2f1c99cd92828
fix handling of debug and simplify toolbar
factory.py
factory.py
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2011, 2012, 2013, 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at...
Python
0
@@ -967,26 +967,8 @@ ints -, resource_listdir %0A%0A#f @@ -7419,68 +7419,17 @@ if -'werkzeug-debugger' in app.config.get('CFG_DEVEL_TOOLS', %5B%5D) +app.debug :%0A
8cce8c5a5bfef818ef445704337fc3c9551d28ea
Remove superfluous print-stmt
calvin/runtime/north/calvinsys.py
calvin/runtime/north/calvinsys.py
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 Ericsson AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
Python
0.00105
@@ -7130,32 +7130,8 @@ %22%22%22%0A - print csobjects%0A
862c50b2617d1ac5aeda844d64e7d987181dfd98
Update parser.py
intelmq/bots/inputs/phishtank/parser.py
intelmq/bots/inputs/phishtank/parser.py
import StringIO, csv from intelmq.lib.bot import Bot, sys from intelmq.lib.event import Event class PhishTankParserBot(Bot): def process(self): report = self.receive_message() report = report.strip() if report: columns = ["__IGNORE__", "url", "description_url", "source_time", ...
Python
0.000001
@@ -364,16 +364,96 @@ target%22%5D + # ignore (__IGNORE__) fields specific to the source and other irrelevant fields %0A
29c422ea482b022bae07fcd389313152ef3d1c3c
Document Exception attributes, #15
bloop/exceptions.py
bloop/exceptions.py
CONSTRAINT_FAILURE = "Failed to meet expected condition during {}" NOT_MODIFIED = "Failed to modify some obects during {}" TABLE_MISMATCH = "Existing table for model {} does not match expected" UNBOUND = "Failed to {} unbound model. Did you forget to call engine.bind()?" class ConstraintViolation(Exception): """...
Python
0
@@ -313,17 +313,16 @@ %0A %22%22%22 - Raised w @@ -372,16 +372,138 @@ e/delete +.%0A%0A Attributes:%0A obj: The dict that was sent to dynamodb and failed some conditional%0A operation%0A%0A %22%22%22%0A @@ -656,37 +656,32 @@ eption):%0A %22%22%22 -%0A Raised when some @@ -7...
28d1875008dc1201e14391aac7724a52471866fa
add view funtion to browserlib
bokeh/browserlib.py
bokeh/browserlib.py
import webbrowser from . import settings def get_browser_controller(browser=None): browser = settings.browser(browser) if browser is not None: if browser == 'none': class DummyWebBrowser(object): def open(self, url, new=0, autoraise=True): pass ...
Python
0
@@ -1,12 +1,41 @@ +%0Afrom os.path import abspath%0A import webbr @@ -506,8 +506,813 @@ troller%0A +%0Adef view(filename, browser=None, new=False, autoraise=True):%0A %22%22%22 Opens a browser to view the file pointed to by this sessions.%0A%0A **new** can be None, %22tab%22, or %22window%22 to view the...
c8064d4fab988d42cb400bbe26965f3078522da4
Fix brightcove id extraction
youtube_dl/extractor/gameinformer.py
youtube_dl/extractor/gameinformer.py
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class GameInformerIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?gameinformer\.com/(?:[^/]+/)*(?P<id>.+)\.aspx' _TEST = { 'url': 'http://www.gameinformer.com/b/features/archive/2015/09/26/replay-animal-cro...
Python
0.000001
@@ -1003,16 +1003,59 @@ h_regex( +%0A %5Br'%3C%5B%5E%3E%5D+%5Cbid=%5B%22%5C'%5Dbc_(%5Cd+)', r%22getVid @@ -1079,17 +1079,30 @@ d=(%5Cd+)%22 -, +%5D,%0A webpage @@ -1151,16 +1151,29 @@ _result( +%0A self.BRI @@ -1226,16 +1226,28 @@ oveNew', +%0A brightc @@ -1250,12...
9374c9eb6aa94ac9cc9a10d07bd71c19c46c0ae9
Improve code quality
modules/rndc.py
modules/rndc.py
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio import socket class rndc: def __init__(self,host,port,algo,secret): self.err_msg = '' try: from isc.rndc import rndc as isc_rndc self.rndc = isc_rndc((host, int(port)), algo, secret) except ImportError:...
Python
0.000063
@@ -1623,104 +1623,8 @@ %5B1%5D%0A - elif 'boot time: ' in i:%0A data%5B'uptime'%5D = i.split('boot time: ')%5B1%5D%0A
1b600b118ea818d84bc9b27b7291c54ee9a798ae
fix invalid SPARQL s/nao:hasTag:prefLabel/nao:prefLabel/
tests/functional-tests/501-writeback-details.py
tests/functional-tests/501-writeback-details.py
#!/usr/bin/python # Copyright (C) 2011, Nokia (ivan.frade@nokia.com) # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ...
Python
0
@@ -3136,26 +3136,16 @@ o:hasTag -:prefLabel %22%5D,%0A
9207e5eccb91f43fab1477ac74e7cc7cdc350186
Fix syntax error
fluxghost/api/camera.py
fluxghost/api/camera.py
import logging from fluxclient.robot.camera import FluxCamera from fluxclient.utils.version import StrictVersion from .control_base import control_base_mixin CRITICAL_VERSION = StrictVersion("1.0") logger = logging.getLogger("API.CAMERA") """ Control printer Javascript Example: ws = new WebSocket("ws://127.0.0.1...
Python
0.000585
@@ -1007,63 +1007,8 @@ f):%0A - if self.remote_version %3E CRITICAL_VERSION:%0A @@ -1143,24 +1143,83 @@ fo(message)%0A + if self.remote_version %3E CRITICAL_VERSION:%0A @@ -1252,16 +1252,20 @@ aming':%0A + @@ -1306,32 +1306,36 @@ g()%0A + + ...
482f45b86066f6569faa90fab21d32b207f75d4d
Switch token/basic auth logging to INFO, to match login/logout logging.
awx/api/authentication.py
awx/api/authentication.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python import logging # Django from django.conf import settings from django.utils.encoding import smart_text # Django REST Framework from rest_framework import authentication # Django OAuth Toolkit from oauth2_provider.contrib.rest_framework import OAuth2A...
Python
0
@@ -718,37 +718,36 @@ logger. -debug +info (smart_text(u%22Us @@ -1550,13 +1550,12 @@ ger. -debug +info (sma
10303f45f348e3fb71a8be314fe793a8e2ea458d
remove unnecessary logging and rename test function (#352)
sovrin_client/test/cli/test_send_get_nym_validation.py
sovrin_client/test/cli/test_send_get_nym_validation.py
from binascii import hexlify import pytest from plenum.common.util import friendlyToRaw from sovrin_client.test.cli.constants import INVALID_SYNTAX from sovrin_common.roles import Roles from sovrin_client.test.cli.helper import createUuidIdentifier, addNym, \ createHalfKeyIdentifierAndAbbrevVerkey, createCryptony...
Python
0
@@ -1927,63 +1927,8 @@ =2)%0A - print(%22XXXXX%22)%0A print(trusteeCli.lastCmdOutput)%0A @@ -2134,63 +2134,8 @@ =2)%0A - print(%22XXXXX%22)%0A print(trusteeCli.lastCmdOutput)%0A %0A%0Ade
4c1ae5913b96bb9c201701fe330c9e8b97f43d41
revert makeaddin.py to default behavior of placing the result in the local directory instead of the directory above as its less confusing.
makeaddin.py
makeaddin.py
import os import re import zipfile current_path = os.path.dirname(os.path.abspath(__file__)) out_zip_name = os.path.join(current_path, "..", os.path.basename(current_path) + ".esriaddin") BACKUP_FILE_PATTERN = re.compile(".*_addin_[0-9]+[.]py$", re.IGNORECASE) def looks_like_a...
Python
0
@@ -140,13 +140,8 @@ th, -%22..%22, %0D%0A
ac93ea2b3d09df9529f8381a182756572ed3acbd
Separate filename from file object
explanatory_style.py
explanatory_style.py
import gate class EventAttributionUnit: def __init__(self, event, attribution): """event, attribution must be gate.Annotation objects """ self._event = event self._attribution = attribution for annotation in [self._event, self._attribution]...
Python
0.999478
@@ -4311,31 +4311,17 @@ for -annotation_file +f in args @@ -4353,33 +4353,37 @@ annotation -s +_file = gate.Annotati @@ -4389,16 +4389,45 @@ ionFile( +f)%0A annotations = annotati @@ -4433,17 +4433,16 @@ ion_file -) .iter_an
6abea9063bfb0fa0b2d398bcf41d341f2e09f694
replace psutil.pid() with psutil.process_iter() for safer execution (#7515)
tests/gold_tests/thread_config/check_threads.py
tests/gold_tests/thread_config/check_threads.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");...
Python
0
@@ -938,18 +938,16 @@ for p -id in psut @@ -954,12 +954,46 @@ il.p -ids( +rocess_iter(%5B'name', 'cwd', 'threads'%5D ):%0A%0A @@ -1222,40 +1222,8 @@ re.%0A - p = psutil.Process(pid)%0A
07c5e0c700af22c22cb12cef62a2b8f3f7f70030
bump version to next release alpha
advanced_filters/__init__.py
advanced_filters/__init__.py
__version__ = '1.0.1'
Python
0
@@ -12,11 +12,12 @@ = '1.0. -1 +2a '%0A
e33b8a804b5af0421376a236ec4c56d7743c13ff
Bump to version 0.60.4
riko/__init__.py
riko/__init__.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko ~~~~ Provides functions for analyzing and processing streams of structured data Examples: basic usage:: >>> from itertools import chain >>> from functools import partial >>> from riko.modules import itembuilder, strreplace ...
Python
0
@@ -1285,9 +1285,9 @@ .60. -3 +4 '%0A%0A_
212720ff677985f57a0f26e073df9bad6dc5c9c0
Add ClassifierBaseScoreType to score_types.__init__ (#281)
rampwf/score_types/__init__.py
rampwf/score_types/__init__.py
from .accuracy import Accuracy from .balanced_accuracy import BalancedAccuracy from .base import BaseScoreType from .brier_score import ( BrierScore, BrierSkillScore, BrierScoreReliability, BrierScoreResolution) from .clustering_efficiency import ClusteringEfficiency from .classification_error import Classification...
Python
0
@@ -319,16 +319,69 @@ onError%0A +from .classifier_base import ClassifierBaseScoreType%0A from .co @@ -1181,24 +1181,55 @@ tionError',%0A + 'ClassifierBaseScoreType',%0A 'Cluster
231fe04d13bd7f86445ab5163301ca04f1c54752
enable empty run list and empty attributes
chef_appmodule_installer/tasks.py
chef_appmodule_installer/tasks.py
#/******************************************************************************* # * Copyright (c) 2013 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...
Python
0.000001
@@ -1268,32 +1268,37 @@ f_deploy_runlist +=None , chef_attribute @@ -1290,32 +1290,37 @@ chef_attributes +=None , **kwargs):%0A @@ -1428,32 +1428,37 @@ undeploy_runlist +=None , chef_attribute @@ -1450,32 +1450,37 @@ chef_attributes +=None , **kwargs):%0A @@ -1588,16 +1588,32 @@ dify_id, + policy_servi...
7528de0432e7ce1b01ccdc7d71386fab288df80a
fix venue address
datafeeds/parsers/first_elasticsearch/first_elasticsearch_event_list_parser.py
datafeeds/parsers/first_elasticsearch/first_elasticsearch_event_list_parser.py
import datetime from consts.district_type import DistrictType from consts.event_type import EventType from helpers.event_helper import EventHelper from models.event import Event class FIRSTElasticSearchEventListParser(object): DATE_FORMAT_STR = "%Y-%m-%dT%H:%M:%S" TYPES_TO_SKIP = EventType.CMP_EVENT_TYPES.u...
Python
0.000001
@@ -1145,49 +1145,8 @@ ICT%0A - venue = event%5B'event_venue'%5D%0A @@ -1485,16 +1485,425 @@ onds=59) +%0A venue_address = event%5B'event_venue'%5D%0A if event%5B'event_address1'%5D:%0A venue_address += '%5Cn' + event%5B'event_address1'%5D%0A if event%5...
2c593edc972f547abf976625c0aab55d7b126a8d
Add missing function call
project/analytics/download_logs_content.py
project/analytics/download_logs_content.py
# -*- coding: utf-8 -*- """ Script will load log ids from the database and will download log content """ import bz2 import os import sqlite3 import requests import sys db_folder = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'db') db_file = '' def main(): should_continue = True while should_con...
Python
0.000226
@@ -262,24 +262,60 @@ def main():%0A + parse_command_line_arguments()%0A%0A should_c
b69cbd31b2a75e4bdd1592977a13bf5c80795a17
Fix objects.node.atoms.cmd
tendrl/node_agent/objects/node/atoms/cmd.py
tendrl/node_agent/objects/node/atoms/cmd.py
import logging from tendrl.node_agent.ansible_runner.ansible_module_runner \ import AnsibleExecutableGenerationFailed from tendrl.node_agent.ansible_runner.ansible_module_runner \ import AnsibleRunner LOG = logging.getLogger(__name__) ANSIBLE_MODULE_PATH = "core/commands/command.py" class Cmd(object): ...
Python
0.00024
@@ -12,686 +12,226 @@ ing%0A -%0Afrom tendrl.node_agent.ansible_runner.ansible_module_runner %5C%0A import AnsibleExecutableGenerationFailed%0Afrom tendrl.node_agent.ansible_runner.ansible_module_runner %5C%0A import AnsibleRunner%0A%0A%0ALOG = logging.getLogger(__name__)%0AANSIBLE_MODULE_PATH = %22core/commands...
e8f5a85ffd039c3c63045c0e06a41b98d98008d3
update package
var/spack/packages/ncurses/package.py
var/spack/packages/ncurses/package.py
from spack import * class Ncurses(Package): """The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, supports pads and color and multiple highlights and forms characters and function-key mapping, and has all the othe...
Python
0.000002
@@ -560,16 +560,144 @@ tar.gz') +%0A version('6.0', 'ee13d052e1ead260d7c28071f46eefb1',%0A url='http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz') %0A%0A de
ef3d882024f03093864e4bce114b98e36685b416
use register_admin_command to make all commands admin-only to prevent cluttering user help
hangupsbot/plugins/example_memory.py
hangupsbot/plugins/example_memory.py
""" example plugin that uses bot.user_memory_get and bot.user_memory_set """ """user memory""" def rememberthisforme(bot, event, *args): text = bot.user_memory_get(event.user.id_.chat_id, 'test_memory') if text is None: bot.user_memory_set(event.user.id_.chat_id, 'test_memory', ' '.join(args)) ...
Python
0
@@ -15,18 +15,37 @@ ugin - that uses +:%0A bot.user_memory_get%0A bot @@ -61,39 +61,426 @@ ory_ -get and bot.user_memory_set%0A%22%22%22 +set%0A bot.conversation_memory_get%0A bot.conversation_memory_set%0A%0Anote: all commands are admin-only to prevent clutter in normal user's /bot help%0A%22%22%22%0A%...
3b403b83435b7fa231adc8d06f7829635b40cf30
Add census and cd114 to ALLOWED_FIELDS
geocodio/client.py
geocodio/client.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import logging import requests from .data import Address, Location, LocationCollection from .exceptions import (GeocodioAuthError, GeocodioDataError, GeocodioServerError, GeocodioError) logger = logging.getLogger(__name__) ALLOWED_FIELDS = ['cd', 'c...
Python
0
@@ -318,16 +318,35 @@ 'cd13', + 'cd114', 'census', 'statel