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
f13c86833b5fb4c873e1242ab760fa701e3eac7d
Update cs251tk/student/markdownify/process_file.py
cs251tk/student/markdownify/process_file.py
cs251tk/student/markdownify/process_file.py
import os from collections import Iterable from cs251tk.common import run, flatten from .truncate import truncate from .cat import cat from .pipe import pipe def get_file(filename, results, options): file_status, file_contents = cat(filename) if file_status == 'success': _, last_edit, _ = run(['git',...
Python
0
@@ -1103,17 +1103,16 @@ d_fun.o%22 - '.format
21bbf9ec71c2d63f5c826dfdc3641927692cb202
test test
test.py
test.py
from flask import Flask import pytest def test_app(): app = Flask(__name__) app.testing = True @app.route("/") def hello(): return "Hello World!" # app.run() # this actually works here... client = app.test_client() response = client.get("/") assert response.status_code == 200 ...
Python
0.000037
@@ -220,16 +220,12 @@ -client = +with app @@ -238,17 +238,32 @@ client() -%0A + as client:%0A resp @@ -281,24 +281,28 @@ nt.get(%22/%22)%0A + assert r @@ -328,16 +328,20 @@ == 200%0A + asse @@ -375,16 +375,20 @@ World!%22%0A + prin @@ -410,17 +410,16 @@ ers%0A -%0A ...
727078f0d7105138310f0870f8ab3a751e0f72da
Fix linting issues in test runner
test.py
test.py
# Run all tests in this project import os import sys import unittest if __name__=="__main__": loader = unittest.TestLoader() tests = loader.discover(".", pattern="test_*.py") runner = unittest.TextTestRunner() runner.run(tests)
Python
0.000001
@@ -1,6 +1,8 @@ -# +%22%22%22%0A Run @@ -30,30 +30,14 @@ ject -%0A%0Aimport os%0Aimport sys +.%0A%22%22%22%0A %0Aimp @@ -65,10 +65,12 @@ me__ + == + %22__m
31e75472c9a4884f2b2e2c8d634a08d202d1e425
make network configuration optional
see/context/resources/network.py
see/context/resources/network.py
# Copyright 2015-2017 F-Secure # Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You may # obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -878,20 +878,30 @@ he User -must +can optionally specify @@ -2420,25 +2420,286 @@ r = count()%0A -%0A + xml_config = DEFAULT_NETWORK_XML%0A%0A if not %7B'configuration', 'dynamic_address'%7D & set(configuration.keys()):%0A raise RuntimeError(%0A %22Either configuration or dynamic_address...
9663012fd10b83d30d25b20c22ffafecc4cfaec0
Test that invalid parameters raise errors
test.py
test.py
import unittest from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen class RotorTestCase(unittest.TestCase): def test_rotor_encoding(self): rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q') self.assertEqual('E', rotor.encode('A')) def test_rotor_reverse_encoding(self): ...
Python
0.000005
@@ -1623,32 +1623,866 @@ r.encode('A'))%0A%0A + def test_invalid_parameters(self):%0A # I prefered to use a single test since both parameters hare equal%0A # restrictions, so probably both succeed (or fail) simultaneously%0A self.assertRaises(ValueError, Walzen,%0A wiri...
6761dc2da66ce1ac32d19f0d2395426aba7a7129
fix typo
test.py
test.py
#!/usr/bin/env python # coding: utf-8 # from wxbot import * import datetime superAdmin = { u'admin' # name of super users who want to get notify }; notifyGroupName = u"test群" cmdGroupName = u"test群" fowordMsg = u"%s 说:\n---------\n%s" fowordPic = u"%s 发来图片:" fowordVoice = u"%s 发来语音:" fowordFile = u"%s 发来文件:" fowo...
Python
0.999991
@@ -1017,38 +1017,35 @@ t %22CMD Group:%22, -notify +cmd GroupName.encode
26fc8789445c22f85467387bec7eeb6eccedc2c5
Stop before starting when restarting
synapse/app/synctl.py
synapse/app/synctl.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014 OpenMarket Ltd # # 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 req...
Python
0.00005
@@ -1683,27 +1683,26 @@ :%0A st -art +op ()%0A s @@ -1694,34 +1694,35 @@ top()%0A st -op +art ()%0A else:%0A
57362721b5e01ef7ad7a1ca84e493a24d577ab33
Increase VLC intf min ver to 0.1.9
syncplay/constants.py
syncplay/constants.py
#You might want to change these DEFAULT_PORT = 8999 OSD_DURATION = 3 OSD_WARNING_MESSAGE_DURATION = 15 MPC_OSD_POSITION = 2 #Right corner, 1 for left MPLAYER_OSD_LEVEL = 1 UI_TIME_FORMAT = "[%X] " CONFIG_NAMES = [".syncplay", "syncplay.ini"] #Syncplay searches first to last DEFAULT_CONFIG_NAME_WINDOWS = "syncpl...
Python
0
@@ -1988,17 +1988,17 @@ = %220.1. -7 +9 %22%0D%0AMPC_P
706ecc0d30217c2dd125def1cc5cb5445b010dfa
add a test
test.py
test.py
# -*- coding: utf-8 -*- import unittest from slugify import slugify class TestSlugification(unittest.TestCase): def test_extraneous_seperators(self): txt = "This is a test ---" r = slugify(txt) self.assertEqual(r, "this-is-a-test") txt = "___This is a test ---" r = slug...
Python
0.000109
@@ -4465,16 +4465,145 @@ -dog')%0A%0A + def test_html_entities(self):%0A txt = 'foo & bar'%0A r = slugify(txt)%0A self.assertEqual(r, 'foo-bar')%0A%0A %0Aif __na
58bfae71a37aed9be9e5139ba3a898c394613616
Remove non-unittest crap from ladder.py's __main__
ladder.py
ladder.py
#! /usr/bin/env python3 import unittest class Rank: def __init__(self, value): if int(value) == 0: raise ValueError('Rank values must be a nonzero integer') self.value = int(value) def __add__(self, other): # adding ranks is nonsensical return NotImplemented ...
Python
0
@@ -4940,113 +4940,8 @@ _':%0A - ladder = Ladder(%5BPlayer('Andrew', -1), Player('Walther', 5), Player('Milan', -6)%5D)%0A print(ladder)%0A
56476902b36ec8b9d7bfcaa3b8442eb51745d044
Set DISPLAY variable on prelaunched processes so the search UI pops up in the right place.
src/prelaunchd.py
src/prelaunchd.py
# Copyright 2011 Google 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 applicable law or agreed to in writing,...
Python
0
@@ -2197,16 +2197,113 @@ _port()%0A + env = %7B%7D%0A if display != 'cocoa' and display != 'terminal':%0A env%5B%22DISPLAY%22%5D = display%0A proc @@ -2516,16 +2516,54 @@ l_port)%5D +,%0A env=env )%0A se
eda693b2e248df3d8e999e9c22cd771d73523380
Add Indicator Reference to results framework lite API data
akvo/rest/serializers/indicator.py
akvo/rest/serializers/indicator.py
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from akvo.rest.serializers.indicator_p...
Python
0
@@ -670,32 +670,115 @@ ValueSerializer%0A +from akvo.rest.serializers.indicator_reference import IndicatorReferenceSerializer%0A from akvo.rest.s @@ -5012,32 +5012,121 @@ read_only=True)%0A + references = IndicatorReferenceSerializer(many=True, required=False, read_only=True)%0A parent_indic
6c02b743ad3859e05eeb980298e54acf3fbd9788
Add __len__ to FlagField (#3981)
allennlp/data/fields/flag_field.py
allennlp/data/fields/flag_field.py
from typing import Any, Dict, List from overrides import overrides from allennlp.data.fields.field import Field class FlagField(Field[Any]): """ A class representing a flag, which must be constant across all instances in a batch. This will be passed to a `forward` method as a single value of whatever ty...
Python
0.000013
@@ -904,16 +904,64 @@ lue%7D)%22%0A%0A + def __len__(self) -%3E int:%0A return 1%0A%0A @ove
3b83d97d507aa897c439e1c249d7919e203d2d0f
remove cruft
awsbigbrother/credential_report.py
awsbigbrother/credential_report.py
import configparser from .credential_client import CredentialClient import arrow from datetime import timedelta class CredentialReportRow(object): user = "unknown" arn = "unknown" password_active = "unknown" password_last_used = "unknown" password_last_rotated = "unknown" password_next_rotatio...
Python
0
@@ -1337,322 +1337,8 @@ f):%0A -# if self.__row.password_last_rotated != 'N/A':%0A# return CredentialCheckResponse('password_max_age', self._is_older_than_days(%0A# self.__row.password_last_rotated,%0A# self.__config.password_max_age%0A# ), self.__row.user).ge...
4c66010cf0cd4f763b362b6e84eb67d7ef1278b8
Make "near" group optional in regex
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jack Brewer # Copyright (c) 2015 Jack Brewer # # License: MIT """This module exports the Stylint plugin class.""" from SublimeLinter.lint import NodeLinter, util class Stylint(NodeLinter): """Provides an inte...
Python
0.999796
@@ -713,16 +713,17 @@ ne%3E%5Cd+): +? (?P%3Cnear @@ -727,16 +727,17 @@ ear%3E%5Cd+) +? %5Cs*%5Cw+%5Cs
7c34a4815f7b78f801f83928b1f6dd56ef842fdc
Fix a bug in adjusting the configuration when exploring
prediction/explorer.py
prediction/explorer.py
from . import support from . import tuner from .learner import Learner from .random import Random from .session import Session import json import numpy as np import os import threading class Agent: def __init__(self, session, semaphore, config): self.session = session self.semaphore = semaphore ...
Python
0.000003
@@ -5116,34 +5116,8 @@ e':%0A - value = 1 - value%0A @@ -5161,16 +5161,38 @@ options. +update(%7B%0A ' input_ke @@ -5194,26 +5194,30 @@ ut_keep_prob - = +': 1 - value%5B0%5D%0A @@ -5213,25 +5213,28 @@ value%5B0%5D -%0A +,%0A config.l @@ -5229,49 +5229,11 @@ -config.le...
ba2db7713d4fbb929c26bf9ce848b0f7b420809d
fix typo
bootmachine/settings_tests.py
bootmachine/settings_tests.py
import os """ CONFIGURATION MANAGEMENT """ # salt LOCAL_SALTSTATES_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "configuration", "states/") LOCAL_PILLARS_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "configuration...
Python
0.999991
@@ -51,20 +51,16 @@ t%0ALOCAL_ -SALT STATES_D
d776090df9a4525d2729aa086867de1cd67926fc
Patch up Holzworth driver.
src/auspex/instruments/holzworth.py
src/auspex/instruments/holzworth.py
# Copyright 2016 Raytheon BBN Technologies # # 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 from auspex.instruments.instrument import Instrum...
Python
0
@@ -809,16 +809,25 @@ %0A%0Aclass +Holzworth HS9000(I @@ -990,16 +990,21 @@ rce_name +=None , name=%22 @@ -1169,10 +1169,8 @@ ulti -64 .dll @@ -1304,199 +1304,465 @@ -# parse resource_name: expecting something like %22HS9004A-009-1%22%0A self.model, self.serial, self.chan = resource_name.split(%22-%...
6d4eb6ebfb03f974c2f6fb04992fc25e5a53ece9
Change docstring
src/psd2svg/rasterizer/batik_rasterizer.py
src/psd2svg/rasterizer/batik_rasterizer.py
# -*- coding: utf-8 -*- """ Batik-based rasterizer module. Download the latest batik rasterizer to use the module. Note Ubuntu 16.04LTS package is broken and does not work. Prerequisite: wget http://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&\ filename=xmlgraphics/batik/binaries/batik-bin-1.9.tar...
Python
0.000002
@@ -317,16 +317,49 @@ .tar.gz%0A + tar xzf batik-bin-1.9.tar.gz%0A expo @@ -387,23 +387,16 @@ -bin-1.9 -.tar.gz %0A%0ADeb pa
b8ac65a810a08e11a2f429db08e8b0d4d00651d6
Add ALLOW_HOSTS in production settings
src/biocloud/settings/production.py
src/biocloud/settings/production.py
# In production set the environment variable like this: # DJANGO_SETTINGS_MODULE=my_proj.settings.production from .base import * # NOQA import logging.config # For security and performance reasons, DEBUG is turned off DEBUG = False # Must mention ALLOWED_HOSTS in production! # ALLOWED_HOSTS = [] # Ca...
Python
0
@@ -286,18 +286,16 @@ uction!%0A -# ALLOWED_ @@ -303,16 +303,29 @@ OSTS = %5B +'172.16.0.66' %5D%0A%0A%0A# Ca
73f49b5603802ccce3a9c4db0ee0b2eaa4bf0e7f
Update startup script (lyli.py)
lyli.py
lyli.py
#!flask/bin/python import logging from os import fork import werkzeug.serving from app import app pid = fork() if pid > 0: print('PID: %d' % pid) exit(0) elif pid < 0: print('Could not fork: %d' % pid) exit(1) # we are behind a proxy. log the ip of the end-user, not the proxy. # this will also work ...
Python
0
@@ -30,28 +30,8 @@ ging -%0Afrom os import fork %0A%0Aim @@ -77,136 +77,21 @@ app%0A -%0Apid = fork()%0Aif pid %3E 0:%0A print('PID: %25d' %25 pid)%0A exit(0)%0Aelif pid %3C 0:%0A print('Could not fork: %25d' %25 pid)%0A exit(1) +import config %0A%0A# @@ -445,16 +445,37 @@ ge)s')%0A%0A +if config.debu...
531ada2164f4c184d298110e518415233419bd9f
Update poisson_2d_square_0.py
demo/poisson_2d_square_0.py
demo/poisson_2d_square_0.py
# # Solve -laplace(u) = f in (-1, 1)^2 with T(u) = 0 [1] # from sympy import symbols, integrate from lega.shen_basis import mass_matrix, stiffness_matrix, load_vector from lega.legendre_basis import ForwardLegendreTransformation as FLT import scipy.linalg as la import numpy as np def get_rhs(u): ''' Verif...
Python
0.000003
@@ -2126,16 +2126,95 @@ o shen%0A%0A + #TODO: should add symbolic as well, just here and only for comparison!%0A
897f6962bf595ea9862c5f0bf46ced926e5f4dd6
Fix continuous function graphing for scalar functions
demo_continuous_function.py
demo_continuous_function.py
# Learn a continuous function from inspect import signature # Use custom implementation: # from Jacobian_Chain import * from Jacobian_Chain import * # Use Tensorflow wrapper: # from Tensorflow_Wrapper import * import numpy as np np.set_printoptions(suppress=True) class Continuous: def __init__(self, funct, d...
Python
0.00001
@@ -330,15 +330,12 @@ nge= -(-1, 1) +None ):%0A @@ -569,16 +569,233 @@ n(funct) +%0A%0A if self._size_input == 1 and self._size_output == 1:%0A candidates = self._funct%5B0%5D(np.linspace(*self._domain%5B0%5D, num=100))%0A self._range = %5B%5Bmin(candidates), max(candidates)...
8a74b2f49314f780864f39d04ddaea4695633c21
Add support for feed deltas
src/crawler/lib/headers_handling.py
src/crawler/lib/headers_handling.py
from datetime import timedelta, timezone import dateutil import logging import re from bootstrap import conf from lib.utils import to_hash, utc_now logger = logging.getLogger(__name__) MAX_AGE_RE = re.compile('max-age=([0-9]+)') RFC_1123_FORMAT = '%a, %d %b %Y %X %Z' def rfc_1123_utc(time_obj=None, delta=None): ...
Python
0
@@ -2860,16 +2860,118 @@ 'etag'%5D%0A + if 'If-Modified-Since' in headers or 'If-None-Match' in headers:%0A headers%5B'A-IM'%5D = 'feed'%0A logg
1b996bf797b5e1a0203054f11001771ede309b23
remove dead code
scrapi/harvesters/smithsonian.py
scrapi/harvesters/smithsonian.py
''' Harvester for the Smithsonian Digital Repository for the SHARE project Example API call: http://repository.si.edu/oai/request?verb=ListRecords&metadataPrefix=oai_dc ''' from __future__ import unicode_literals import re from scrapi.base import helpers from scrapi.base import OAIHarvester class SiHarvester(OAIHa...
Python
0.999454
@@ -778,393 +778,4 @@ rue%0A -%0A%0Adef get_doi_from_identifier(identifiers):%0A doi_re = re.compile(r'10%5C.%5CS*%5C/%5CS*')%0A identifiers = %5Bidentifiers%5D if not isinstance(identifiers, list) else identifiers%0A for identifier in identifiers:%0A try:%0A found_doi = doi_re.search(identi...
36070fdc617875527221b756a27bcee08220633e
add negate op to CoefficientArray class
python_module/sirius/coefficient_array.py
python_module/sirius/coefficient_array.py
import numpy as np class CoefficientArray: def __init__(self, dtype=np.complex, ctype=np.matrix): """ dtype -- number type ctype -- container type (default np.matrix) """ self.dtype = dtype self.ctype = ctype self._data = {} def __getitem__(self, key): ...
Python
0.000009
@@ -1751,32 +1751,215 @@ return out%0A%0A + def __neg__(self):%0A %22%22%22%0A%0A %22%22%22%0A out = type(self)(dtype=self.dtype)%0A for key, val in self._data.items():%0A out%5Bkey%5D = -val%0A return out%0A%0A def abs(self @@ -2271,17 +2271,19 @@ add__(-1 -*...
554bb0319fb6af5e1a989598adb187148bac362d
Fix extra argument for checking completion status
lava-submit-tests.py
lava-submit-tests.py
#!/usr/bin/python import json import os import sys import time import xmlrpclib # Parse the results bundle to see the run-tests testcase # of the lttng-kernel-tests passed successfully def check_job_test_case_status(server, job): bundle_sha = server.scheduler.job_status(str(job))['bundle_sha1'] bundle = serv...
Python
0.000023
@@ -5401,21 +5401,8 @@ obid -, 'run-tests' ):%0A
3c28a101b9c353973a7516c710134405ba55baca
Use an alternative for the locale.RADIXCHAR if this one doesn't exist
bin/report/render/rml2pdf/utils.py
bin/report/render/rml2pdf/utils.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
Python
0.000003
@@ -1869,16 +1869,30 @@ rt tools +%0Aimport locale %0A%0A_regex @@ -5030,16 +5030,290 @@ f size:%0A + if size.find('.') == -1:%0A decimal_point = '.'%0A try:%0A decimal_point = locale.RADIXCHAR%0A except:%0A decimal_point = locale.localeconv()%5B'...
1b7e68c3bdfc2f43f754cc39e1f2f80bfa5bee80
Add validate_log_translations flake8 check
designate/hacking/checks.py
designate/hacking/checks.py
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@hp.com> # # 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/L...
Python
0.000002
@@ -653,16 +653,29 @@ ort re%0A%0A +import pep8%0A%0A %0Amutable @@ -747,24 +747,134 @@ .+=%5C%5B%5C%5D)%22)%0A%0A +log_translation = re.compile(%0A r%22(.)*LOG%5C.(audit%7Cerror%7Cinfo%7Cwarn%7Cwarning%7Ccritical%7Cexception)%5C(%5Cs*('%7C%5C%22)%22)%0A%0A %0Adef mutable @@ -905,16 +905,31 @@ al_line, + physic...
ec9bd84c7487ef0d3fead1641c5132f2f269b5bc
Use absolute path for the result of glob.
lbuild/repository.py
lbuild/repository.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2015, Fabian Greif # All Rights Reserved. # # The file is part of the lbuild project and is released under the # 2-clause BSD license. See the file `LICENSE.txt` for the full license # governing this code. import os import glob from .exception import Bl...
Python
0
@@ -1336,24 +1336,16 @@ = None%0A - %0A @@ -1909,16 +1909,32 @@ ttern = +os.path.abspath( self._re @@ -1944,24 +1944,25 @@ ate(pattern) +) %0A ret @@ -2195,24 +2195,16 @@ odules)%0A - %0A @@ -3967,12 +3967,13 @@ ned%22 %25 name) +%0A
85d69a7dd1c29f9b9bca7b5a9e6b1319caf07c6b
Fix missing tpu variable in benchmark_args_tf.py (#13968)
src/transformers/benchmark/benchmark_args_tf.py
src/transformers/benchmark/benchmark_args_tf.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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.a...
Python
0.000024
@@ -2741,32 +2741,51 @@ sterResolver%22%5D:%0A + tpu = None%0A if self.
1aba70b4b035637662625e42cada702a00f73e17
Add support for getitem and contains in listing
lendingclub2/loan.py
lendingclub2/loan.py
# Filename: loan.py """ LendingClub2 Loan Module """ # Standard libraries import json # lendingclub2 from lendingclub2 import requests from lendingclub2.config import API_VERSION, DNS, ENDPOINTS from lendingclub2.error import LCError from lendingclub2.response import Response # Constants LISTING_VERSION = '1.2' ...
Python
0
@@ -1902,24 +1902,633 @@ s = list()%0A%0A + def __add__(self, other):%0A %22%22%22%0A Add two listings together%0A%0A :param other: instance of lendingclub2.loan.Listing%0A :returns: instance of lendingclub2.loan.Listing%0A %22%22%22%0A new_listing = Listing()%0A new...
54115d8ecd90da614a24bb910939001b37acd246
Test pairwise combinations
transmutagen/tests/test_origen.py
transmutagen/tests/test_origen.py
import os import numpy as np DATA_DIR = os.path.abspath(os.path.join(__file__, os.path.pardir, os.path.pardir, os.path.pardir, 'docker', 'data')) def load_data(datafile): with open(datafile) as f: return eval(f.read(), {'array': np.array}) def test_data(): for datafile in os.listdir(DATA_DIR): ...
Python
0.000009
@@ -7,27 +7,103 @@ os%0A -%0Aimport numpy as np +from itertools import combinations%0A%0Aimport numpy as np%0A%0Afrom ..tape9utils import origen_to_name %0A%0ADA @@ -460,29 +460,365 @@ -assert 'table_4' in data +tape9, time, nuc, phi = datafile.split()%5B0%5D%0A%0A assert 'table_4' in data%0A ass...
c809f4f286bbec3b4cb1ebbff96c23256dd176e8
Change PowerVM version to an int
nova_powervm/virt/powervm/host.py
nova_powervm/virt/powervm/host.py
# Copyright 2014 IBM Corp. # # 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 a...
Python
0.000001
@@ -908,10 +908,10 @@ = '7 -. 1 +0 '%0A%0A#
aa262ba141290ba04beb2ec4866b1bad1ea85db2
Fix applying nan mask to specified mask.
turbustat/cube_tools/sim_cubes.py
turbustat/cube_tools/sim_cubes.py
''' Wrapper on spectral_cube for simulated datasets ''' import numpy as np import spectral_cube as SpectralCube try: from signal_id import Noise except ImportError: prefix = "/srv/astro/erickoch/" # Adjust if you're not me! execfile(prefix + "Dropbox/code_development/signal-id/noise.py") class SimCub...
Python
0
@@ -356,32 +356,43 @@ cube, beam=None, + mask=None, method=%22MAD%22, c @@ -575,32 +575,58 @@ method=method)%0A%0A + self.mask = mask%0A%0A def add_nois @@ -929,24 +929,105 @@ ask=None):%0A%0A + # Update mask%0A if mask is not None:%0A self.mask = mask%0A%0A # Cr @@ -1...
89560fd773d833a049824bfa8a7ccf4ce301bed4
remove utils.push_dir
build/fbcode_builder/utils.py
build/fbcode_builder/utils.py
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals 'Miscellaneous utility functions.' import itertools import logging import os import shutil import subprocess import sys from contextlib import cont...
Python
0
@@ -888,149 +888,8 @@ )%0A%0A%0A -@contextmanager%0Adef push_dir(d):%0A old_dir = os.getcwd()%0A os.chdir(d)%0A try:%0A yield d%0A finally:%0A os.chdir(old_dir)%0A%0A%0A def
287757680b96957ba3e7f9db179896f85790ea69
use cleditor instead of cleditor.min.
addons/web/__openerp__.py
addons/web/__openerp__.py
{ "name" : "web", "category": "Hidden", "description": """ OpenERP Web core module. This module provides the core of the OpenERP web client. """, "depends" : [], 'auto_install': True, 'post_load' : 'wsgi_postload', 'js' : [ "static/lib/datejs/globaliza...
Python
0
@@ -1508,20 +1508,16 @@ leditor. -min. js%22,%0A
96afeb6bdbefe1dceee9913f02cbd0c963764769
fix style
lexos/application.py
lexos/application.py
import json import os import re import time from flask import Flask, request, render_template from jinja2 import evalcontextfilter from markupsafe import Markup, escape import lexos.helpers.constants from lexos.helpers.exceptions import LexosException from lexos.interfaces.base_interface import base_view from lexos.i...
Python
0.000001
@@ -4125,22 +4125,23 @@ frontend +. %0A -f +F or all t @@ -4221,16 +4221,17 @@ 00) page +. %0A %22%22%22 @@ -4501,16 +4501,17 @@ html%22)%0A%0A +%0A if __nam
78ff5c0968e4867b550b4cb6dab70885e7119d11
Use revert instead of reset, bloom-patch remove
bloom/commands/patch/remove_cmd.py
bloom/commands/patch/remove_cmd.py
from __future__ import print_function import sys from argparse import ArgumentParser from bloom.util import add_global_arguments from bloom.util import execute_command from bloom.util import handle_global_arguments from bloom.logging import log_prefix from bloom.logging import error from bloom.logging import debug fr...
Python
0
@@ -47,43 +47,23 @@ sys%0A -from argparse import -ArgumentP +argp arse -r %0A%0Afr @@ -75,163 +75,53 @@ oom. -util import add_global_arguments%0Afrom bloom.util import execute_command%0Afrom bloom.util import handle_global_arguments%0Afrom bloom.logging import log_prefix +commands.patch.common import get_patch_c...
5ad4191fae2b7e84e24d9646f21e3af7057d32e9
Replace deprecated `DataFrame.from_csv` with `pandas.read_csv`
scripts/extract_subjects.py
scripts/extract_subjects.py
from __future__ import print_function import argparse import yaml from mimic3benchmark.mimic3csv import * from mimic3benchmark.preprocessing import add_hcup_ccs_2015_groups, make_phenotype_label_matrix import mimic3benchmark.util as util parser = argparse.ArgumentParser(description='Extract per-subject data from MIM...
Python
0.000071
@@ -197,22 +197,20 @@ _matrix%0A -import +from mimic3b @@ -227,15 +227,16 @@ til -as util +import * %0A%0Apa @@ -1603,39 +1603,8 @@ %5D)%0A%0A -print(stays.ICUSTAY_ID.dtype)%0A%0A stay @@ -3357,16 +3357,63 @@ CT_ID')%0A + args.event_tables = %5Bargs.event_tables%5B0%5D%5D%0A prin @@ -3450,16 +3450,56 @...
4e418e6168425173c3e6ed44299864d52da286ee
fix var reference in gutenberg_filter
scripts/gutenberg_filter.py
scripts/gutenberg_filter.py
import os import re class GutenbergIndexFilter(object): # Extensions excluded from rsync of both ftp and cached/generated content EXCLUDED_EXT = ['.zip', '.wav', '.mp3', '.ogg', '.iso', '.ISO', '.rar', '.mpeg', '.m4b'] # Additional extensions excluded from cached/generated files CACHE_EXCLUDED_EXT = ['...
Python
0
@@ -2307,16 +2307,21 @@ not in +self. CACHE_EX
8a5e49876eae4f2d9bc8ced2fa2e2be0d24ddd68
rollback to 1.7.0 release
scripts/imgtool/__init__.py
scripts/imgtool/__init__.py
# Copyright 2017-2020 Linaro Limited # # SPDX-License-Identifier: Apache-2.0 # # 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 requ...
Python
0
@@ -642,11 +642,9 @@ %221. -8 +7 .0 -a1 %22%0A
e3f53b37a276680bd12806ed14d09065d35d583e
Debug logs
dataactcore/scripts/agency_move_s3_files.py
dataactcore/scripts/agency_move_s3_files.py
import boto3 import logging import argparse from dataactcore.config import CONFIG_BROKER from dataactcore.logging import configure_logging from dataactvalidator.health_check import create_app logger = logging.getLogger(__name__) def move_published_agency_files(old_code, new_code): """ Given the provided old an...
Python
0.000001
@@ -1399,32 +1399,243 @@ e, new_code, 1)%0A + logger.info('CERIFIED_BUCKET: %7B%7D'.format(CONFIG_BROKER%5B'certified_bucket'%5D))%0A logger.info('OLD FILE PATH: %7B%7D'.format(old_file_path))%0A logger.info('NEW FILE PATH: %7B%7D'.format(new_file_path))%0A s3.Objec @@ -2362,32 +2362,243 ...
3308cbeb8c7af7a1c759fc4150a462fb35d12fae
Move writing of the possibly highlihgted texts into PlainStatusText baseclass
src/robot/output/monitor.py
src/robot/output/monitor.py
# Copyright 2008-2010 Nokia Siemens Networks Oyj # # 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...
Python
0
@@ -1954,33 +1954,8 @@ -message = '%5B %25s %5D %25s' %25 ( self @@ -1982,77 +1982,30 @@ vel) -, msg.message)%0A self._write(message, stream=sys.__stderr__ +.write_msg(msg.message )%0A%0A @@ -2970,32 +2970,8 @@ - self._write(' %7C %25s %7C' %25 sel @@ -2992,16 +2992,30 @@ (status) +.write_...
ac3697fbb5202437d8285cacaba89dbaba30de69
fix refactoring error
util.py
util.py
import logging A_THRU_H = 'ABCDEFGH' # pre-compute an array mapping to algebraic notation NUMERICAL_TO_ALGEBRAIC = ["{}{}".format(l, n) for n in range(8, 0, -1) for l in A_THRU_H] # pre-compute a dict mapping to the index ALGEBRAIC_TO_NUMERICAL = {a:n for n, a in enumerate(NUMERICAL_TO_ALGEBRAIC)} TOP_LEFT_SQUARE =...
Python
0.000005
@@ -475,16 +475,24 @@ return +numeric_ index%0A%0Ad
ae6bb29262421bcdb9f28bed8fce99517fa4ecc1
Update tests.
st2common/tests/unit/test_content_utils.py
st2common/tests/unit/test_content_utils.py
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
Python
0
@@ -2092,32 +2092,43 @@ e_paths = '/opt/ +path2:/opt/ path1'%0A r @@ -2206,16 +2206,30 @@ system', + '/opt/path2', '/opt/p
4d19774cc47e1ec1bacc9eeb18b146fac2476493
Fix display of exectuted command
src/stratuslab/BaseSystem.py
src/stratuslab/BaseSystem.py
import os import shutil import subprocess class BaseSystem(object): def updatePackageManager(self): pass def installPackages(self, packages): pass def installNodePackages(self, packages): pass def installFrontendDependencies(self): self.updatePackageManager() ...
Python
0.000002
@@ -4850,24 +4850,33 @@ Message( +' '.join( command) %0A %09pr @@ -4863,24 +4863,25 @@ oin(command) +) %0A %09proces
65524f41729d1ddcda9ecb66947b85119c80cd18
format util.py
util.py
util.py
#!/usr/bin/env python import couchdb, sys from oaipmh.client import Client from oaipmh.common import Identify, Metadata, Header from oaipmh.metadata import MetadataRegistry, oai_dc_reader , MetadataReader def get_database(url,name): try: couch = couchdb.Server(url) db = couch[name] return d...
Python
0.000009
@@ -518,16 +518,17 @@ turn db%0A +%0A def get_ @@ -1104,24 +1104,25 @@ %0A +%0A def save_fil @@ -1375,16 +1375,17 @@ %5D = doc%0A +%0A def sync @@ -1593,16 +1593,17 @@ te) %0A +%0A def inde @@ -1670,17 +1670,16 @@ format): -%0A %0A @@ -1752,67 +1752,6 @@ mat) -%0A #sync_files(main_url...
58412bf4ac5adb78c82060c259803c745c52f861
Bump version
stock_request_picking_type/__manifest__.py
stock_request_picking_type/__manifest__.py
# Copyright 2019 Open Source Integrators # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). { 'name': 'Stock Request Picking Type', 'summary': 'Add Stock Requests to the Inventory App', 'version': '12.0.1.0.0', 'license': 'LGPL-3', 'website': 'https://github.com/stock-logistics-w...
Python
0
@@ -230,17 +230,17 @@ '12.0.1. -0 +1 .0',%0A
d7527625bbe4ef8804ee907789df87908b4a02c1
Add logging to production configuration
ember_django/backend/settings.py
ember_django/backend/settings.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Django settings for ember_django project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ ''' # SECURITY WARNING: do...
Python
0.000001
@@ -801,17 +801,16 @@ = %5B'*', - %5D%0A%0A%0A# Ap @@ -3824,28 +3824,515 @@ th.join(BASE_DIR, 'static')%0A + LOGGING = %7B%0A 'version': 1,%0A 'disable_existing_loggers': False,%0A 'handlers': %7B%0A 'file': %7B%0A 'level': 'DEBUG',%0A 'class': 'logg...
bc6512080bd67413a3136e171be2cc1479254caf
Change startup experiment.
enactiveagents/EnactiveAgents.py
enactiveagents/EnactiveAgents.py
""" Entry module of the application. """ import sys import pygame from appstate import AppState import settings import events from view import view from view import agentevents from controller import controller import experiment.basic import webserver class HeartBeat(events.EventListener): """ Class implement...
Python
0
@@ -2511,20 +2511,14 @@ asic -Coexsistence +Vision Expe
9d2f25c2a262a992c79ea5a224c5abc616dd4cb8
remove space.
lib/acli/__init__.py
lib/acli/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ usage: acli [--version] [--help] <command> [<args>...] options: -h, --help help The most common commands are: account Get account info ec2 Manage ec2 instances elb Manage elb instances ami Manage amis a...
Python
0.000413
@@ -113,17 +113,16 @@ s%3E...%5D%0A%0A -%0A options:
f887c7c5fc0be7e86ebddb28b6d785878ae88121
Add projects to locals in projects_archive
projects/views.py
projects/views.py
from django.contrib.auth.decorators import login_required, permission_required from django.shortcuts import render, get_object_or_404, redirect from .models import Project from .forms import ProjectForm, RestrictedProjectForm @login_required def add_project(request): data = request.POST if request.POST else Non...
Python
0
@@ -1891,24 +1891,61 @@ 'rejected')%0A + projects = Project.objects.all()%0A return r
608f667f8d3a9faa8fc41777b2006c325afff61c
Fix var names.
vote.py
vote.py
import enki import json e = enki.Enki('key', 'http://localhost:5001', 'translations') e.get_all() tasks = [] for t in e.tasks: options = [] i = 0 for k in e.task_runs_df[t.id]['msgid'].keys(): option = dict(task_run_id=None, msgid=None) option['task_run_id'] = k option['msgid'] ...
Python
0.000002
@@ -190,18 +190,19 @@ id%5D%5B'msg -id +str '%5D.keys( @@ -247,18 +247,19 @@ one, msg -id +str =None)%0A @@ -310,18 +310,19 @@ ion%5B'msg -id +str '%5D = e.t @@ -343,18 +343,19 @@ id%5D%5B'msg -id +str '%5D%5Bk%5D%0A @@ -398,18 +398,19 @@ nfo%5B'msg -id +str _options
a8681015902101192caeaff6c755069d406f3d0e
Support NonNode << Node, limit scope in conf_load.
conf.py
conf.py
""" Pyconf DSL for generating JSON or Protobuf configuration. """ class Node(object): def __init__(self, value): self._value = value def execute(self): def _unwrap(item): if isinstance(item, Node): return item.execute() else: return item if isinstance(self._value, dict): ...
Python
0
@@ -2387,16 +2387,255 @@ right)%0A%0A + def __rlshift__(self, left):%0A right = self._value%0A if right is None:%0A right = %7B%7D%0A if not isinstance(right, dict):%0A raise TypeError('Cannot extend node with non-dict data %25s' %25 (type(right),))%0A return left(**right)%0A%0A conf = N @@ -27...
755583d69aa6b1145495ef857fb0f139fa6e7e01
Remove useless print
src/vf2symbols/vf2symbols.py
src/vf2symbols/vf2symbols.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000045
@@ -4882,30 +4882,8 @@ vg)%0A - print(output)%0A
3171a05dd7a4c4478d1dfe5023390e5bf7213ac8
Improve mergeuser command (#424)
standup/status/management/commands/mergeuser.py
standup/status/management/commands/mergeuser.py
from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from standup.status.models import StandupUser User = get_user_model() class Command(BaseCommand): help = 'Merge two user accounts' def add_arguments(self, parser): parser.add_argument('--keep', type=...
Python
0.000001
@@ -298,16 +298,29 @@ rgument( +%0A '--keep' @@ -321,32 +321,119 @@ -keep', type=int +,%0A help='the id of the user record to keep and merge all data into'%0A )%0A parser @@ -446,16 +446,29 @@ rgument( +%0A '--delet @@ -483,91 +483,541 @@ =int -)%0A parser...
dbf02b991fb2011992085019933ed9885af34733
support requesting the html by revision
wiki.py
wiki.py
#!/usr/bin/env python3 import hmac import os.path as path from base64 import b64encode from hashlib import sha256 from os import urandom import pygit2 as git import scrypt import sqlalchemy as sql from bottle import get, post, response, request, run, static_file from docutils.core import publish_file RST_MIME = "tex...
Python
0
@@ -296,16 +296,32 @@ ish_file +, publish_string %0A%0ARST_MI @@ -1903,16 +1903,125 @@ ername%0A%0A +def get_page_revision(filename, revision):%0A return repo%5Brepo%5Brevision%5D.tree%5Bfilename + %22.rst%22%5D.oid%5D.data%0A%0A @get('/p @@ -2300,34 +2300,33 @@ return -repo%5Brepo%5B +get_page_ revision %5...
2f1f9830dc0b87a411022f2b41fdbe3e0b483d4d
Add a comment [skip CI]
svir/dialogs/load_hmaps_as_layer_dialog.py
svir/dialogs/load_hmaps_as_layer_dialog.py
# -*- coding: utf-8 -*- # /*************************************************************************** # Irmt # A QGIS plugin # OpenQuake Integrated Risk Modelling Toolkit # ------------------- # begin : 2013-10-24 # copyright ...
Python
0
@@ -5161,16 +5161,84 @@ mt-poe%22%0A + # self.dataset contains data for the chosen rlz or stat%0A
5347040b86f02a0abec4da5c3060b094908bb9b5
Simplify argument handling logic.
wpcr.py
wpcr.py
#!/usr/bin/python import numpy import scipy.signal tau = numpy.pi * 2 max_samples = 1000000 debug = False # determine the clock frequency # input: magnitude spectrum of clock signal (numpy array) # output: FFT bin number of clock frequency def find_clock_frequency(spectrum): maxima = scipy.signal.argrelextrema(s...
Python
0.000013
@@ -2731,28 +2731,20 @@ rgv) %3E 1 -:%0A if + and sys.arg @@ -2752,74 +2752,16 @@ %5B1%5D -= +! = '-':%0A - samples = read_from_stdin()%0A else:%0A
3478bf108ce6992239c638e6e662a6e53204ae46
Update wsgi.py for port
wsgi.py
wsgi.py
from app import create_app application = create_app() if __name__ == '__main__': application.run()
Python
0
@@ -84,21 +84,91 @@ -application.run( +port = int(os.environ.get('PORT', 5000))%0A application.run(host='0.0.0.0', port=port )
6d643c1f4fca74e66513d0461fc358bb1dd21349
add method to parse out [xml-handlers] section in process.cfg
lib/config_parser.py
lib/config_parser.py
from ConfigParser import ConfigParser defaults = {'parse': 'defaultparse', 'clean': 'True', 'consolidate': 'True', 'datadir': '/data/patentdata/patents/2013', 'dataregex': 'ipg\d{6}.xml', 'years': None, 'downloaddir' : None} def extract_process_o...
Python
0
@@ -1798,8 +1798,1002 @@ _config%0A +%0Adef get_year_list(yearstring):%0A %22%22%22%0A Given a %5Byearstring%5D of forms%0A year1%0A year1-year2%0A year1,year2,year3%0A year1-year2,year3-year4%0A Expands into a list of year integers, and returns%0A %22%22%22%0A years = %5B%5D%0A for subse...
cf0f7f129bb54c70f60e19e2ec9d82a67f430aaf
replace urllib2 to requests lib
coti.py
coti.py
#!/usr/bin/python import json import urllib2 from bs4 import BeautifulSoup from datetime import datetime def chaco(): try: soup = BeautifulSoup( urllib2.urlopen('http://www.cambioschaco.com.py/php/imprimir_.php').read(), "html.parser") compra = soup.find_all('tr')[3].contents[5].strin...
Python
0.000205
@@ -37,16 +37,32 @@ urllib2 +%0Aimport requests %0A%0Afrom b @@ -177,39 +177,36 @@ -urllib2.urlopen +requests.get ('http://www @@ -244,24 +244,33 @@ ir_.php' -).read() +, timeout=8).text , %22html. @@ -444,35 +444,43 @@ %0A except -urllib2.URL +requests.Connection Error:%0A @@ -600,39 +60...
4d5cc0dfc6f9f460cfc54dfebf2061428ae2ee97
implement a removing of gitlab's objects
crud.py
crud.py
''' generic CRUD oparations for the gitlab's objects ''' import http class Crud(): def __init__(self, path): self.path = path ''' get an object by system's name and id ''' def byId(self, sysNam, id): return http.get(sysNam, '%s/%d' % (self.path, id)) ''' add a new instance of an object ''' def add(self...
Python
0.999861
@@ -374,8 +374,133 @@ , data)%0A +%0A%09'''%0A%09delete an instcnce by id%0A%09'''%0A%09def delete(self, sysNam, id):%0A%09%09return http.delete(sysNam, '%25s/%25d' %25 (self.path, id))%0A%0A
ace9fc7bb2bcb0e3f9f1be9bd03fcfd69698d6c3
Save the current data after a keyboard interrrupt.
main.py
main.py
import json import os.path import re from urllib.robotparser import RobotFileParser import requests from requests_toolbelt import user_agent ROOT_URL = "http://en.wikipedia.org/wiki/" ROBOTS_URL = "http://en.wikipedia.org/robots.txt" USERAGENT = user_agent("Wikigraph", "0.0.1") BLACK_LIST = [ "Main_Page" ] cla...
Python
0
@@ -30,16 +30,41 @@ port re%0A +import signal%0Aimport sys%0A from url @@ -783,70 +783,387 @@ ass -LinkGetter(object):%0A%0A _page_nodes = %5B%5D%0A _page_links = %5B%5D +MetaLinkGetter(type):%0A%0A def __init__(cls, name, bases, d):%0A type.__init__(cls, name, bases, d)%0A signal.signal(sign...
baa81fb776af4b6811bf434a75f808f0aeae056b
fix load watering-topic from config
main.py
main.py
import argparse import json import logging import logging.config import os import paho.mqtt.client as mqtt import yaml from services.data_service import DataService from services.watering_service import WateringService from services.config_service import ConfigService def load_args(): # setup commandline argume...
Python
0.000001
@@ -2808,16 +2808,17 @@ g%5B'topic +s '%5D%5B'wate
b694436d4d8b6ee0b4b4a8078e0b34f779b17751
Set a nice app-icon
main.py
main.py
# -*- coding: utf-8 -*- # Copyright (c) 2014, Andreas Pakulat <apaku@gmx.de> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright n...
Python
0
@@ -1723,16 +1723,104 @@ Tray%22)%0A + QtGui.QApplication.setWindowIcon(QtGui.QIcon(%22:///images/jenkinstray_success.png%22))%0A QtGu
2fa02183eba3d9a50487b891ddebfe013ac1854b
clean sql statement formatting
lib/geocode_setup.py
lib/geocode_setup.py
# sets up the geocoding databases def geocode_db_initialize(conn): conn.executescript(""" PRAGMA CACHE_SIZE=20000; ATTACH DATABASE 'assignee.sqlite3' AS assignees; ATTACH DATABASE 'inventor.sqlite3' AS inventors; ATTACH DATABASE 'loctbl' AS loc; """) # TODO: Ensure this...
Python
0.000021
@@ -693,16 +693,26 @@ HAR(10), +%0A State @@ -755,16 +755,28 @@ CHAR(2), +%0A Zipcode @@ -845,16 +845,27 @@ HAR(10), +%0A NState @@ -951,32 +951,33 @@ ntry,Zipcode));%0A +%0A DROP IND @@ -5473,24 +5473,27 @@ Val FLOAT, +%0A Cn @@ -5528,23 +5528,29 @@ ...
c5b7cf7cdd8a91162441a17f9d0b70db197249c0
make main runnable
main.py
main.py
from collaborator.http_server.http_server import entryPoint if __name__ == '__main__': entryPoint()
Python
0.000063
@@ -1,8 +1,30 @@ +#!/usr/bin/env python3 %0Afrom co
0dce5a6524ebc5020991ab301cd0b080ad27ddf6
Fix self prefix
main.py
main.py
#!/usr/bin/env python3 import asyncio from datetime import datetime import logging import lzma from pathlib import Path import os import sys import tarfile from discord.ext.commands import when_mentioned_or import yaml from bot import BeattieBot try: import uvloop except ImportError: pass else: asyncio.s...
Python
0.999974
@@ -597,32 +597,33 @@ %0A prefixes = +%5B config%5B'self_pre @@ -627,16 +627,17 @@ prefix'%5D +%5D %0A tok
08650ad083e9ca4790ea627e8ab0ae670f7ef60b
Add merge function to rd_models (#3464)
angr/knowledge_plugins/key_definitions/rd_model.py
angr/knowledge_plugins/key_definitions/rd_model.py
from typing import Dict, Tuple, Set, Optional, TYPE_CHECKING from .uses import Uses from .live_definitions import LiveDefinitions if TYPE_CHECKING: from angr.knowledge_plugins.key_definitions.definition import Definition # TODO: Make ReachingDefinitionsModel serializable class ReachingDefinitionsModel: def ...
Python
0
@@ -305,16 +305,113 @@ sModel:%0A + %22%22%22%0A Models the definitions, uses, and memory of a ReachingDefinitionState object%0A %22%22%22%0A def @@ -1183,8 +1183,491 @@ urn new%0A +%0A def merge(self, model: 'ReachingDefinitionsModel'):%0A for k, v in model.observed_results.items():%0A ...
9eeae893b8e777fa5f50733e6580b731a00a5170
kill useless plugin registration logic
tenderloin/listeners/message.py
tenderloin/listeners/message.py
import json import logging import time import zmq from collections import defaultdict from zmq.eventloop import zmqstream from tenderloin.listeners import plugin_data PLUGIN_TIMEOUT = 300 class PluginData(object): def __init__(self, name, uuid, fqdn, tags, data): self.name = name self.uuid = uu...
Python
0
@@ -804,265 +804,8 @@ t)%0A%0A - def find(self, f, seq):%0A %22%22%22Return first item in sequence where f(item) == True.%22%22%22%0A %22%22%22h/t http://tomayko.com/writings/cleanest-python-find-in-list-function%22%22%22%0A for item in seq:%0A if f(item):%0A return it...
44537a6496b1b67511ea7008418b6d1a7a30fdf4
move the resolve cache into TLS
claripy/result.py
claripy/result.py
import copy import collections import weakref import threading class Result(object): def __init__(self, satness, model=None, approximation=False, backend_model=None): self.sat = satness self.model = model if model is not None else { } self._tls = threading.local() self._tls.backend...
Python
0.000001
@@ -493,28 +493,133 @@ e = %7B %7D%0A +%0A - self +@property%0A def resolve_cache(self):%0A if not hasattr(self._tls, 'resolve_cache'):%0A self._tls .resolve @@ -677,16 +677,55 @@ tionary) +%0A return self._tls.resolve_cache %0A%0A @p @@ -1146,32 +1146,191 @@ self.max_cache)...
200ea76309c361c6df534f2b0f6e615866f9e85b
Modify rpr formatting
tcconfig/_iptables.py
tcconfig/_iptables.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import re import dataproperty from dataproperty.type import IntegerTypeChecker from subprocrunner import SubprocessRunner from ._common import sanitize_network from ._split_line_list import split...
Python
0.000001
@@ -1253,31 +1253,32 @@ str_list. -app +ext end( +%5B %0A @@ -1296,127 +1296,230 @@ %7B:s%7D -, src=%7B:s%7D, dst=%7B:s%7D, mark-id=%7B:d%7D%22.format(%0A self.protocol, self.source, self.destination, self.mark_id) +%22.format(self.protocol),%0A %22src=%7B:s%7D%22.format(self...
05f829c2e1116d0b4fdc2711981c3c3f3c0c0665
add bucket prefix support
directupload/backends/s3.py
directupload/backends/s3.py
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from urllib import quote_plus from datetime import datetime from datetime import timedelta import base64 import hmac import hashlib import os from base import BaseUploadBackend, _set_default_if_none, json # AWS Options ACCESS_KEY...
Python
0.000001
@@ -958,16 +958,137 @@ 0 HOURS%0A +BUCKET_PREFIX = getattr(settings, 'AWS_MEDIA_STORAGE_BUCKET_PREFIX', getattr(settings, 'AWS_BUCKET_PREFIX', None))%0A %0A%0Aclass @@ -2952,32 +2952,158 @@ list()%0A %0A + path = self.options%5B'folder'%5D%0A if BUCKET_PREFIX:%0A path = os.path...
ecdf23c53c34a3773e2ca10be2c445c01381a7b0
on 64 bits python array.array("L").itemsize is 8
classification.py
classification.py
from feature_extraction import FEATURE_DATATYPE import numpy import cv2 CLASS_DATATYPE= numpy.uint16 CLASS_SIZE= 1 CLASSES_DIRECTION= 0 #vertical - a classes COLUMN BLANK_CLASS= chr(35) #marks unclassified elements def classes_to_numpy( classes ): '''given a list of unicode chars, transforms ...
Python
0.999988
@@ -567,16 +567,56 @@ 00%5Cx00'%0A + assert array.array(%22I%22).itemsize==4%0A int_ @@ -638,17 +638,17 @@ array( %22 -L +I %22, %22%22.jo
76648057b18055afc3724769aa9240eb477e4533
Handle HJSON decode exception
main.py
main.py
"""Usage: chronicler [-c CHRONICLE] The Chronicler remembers… Options: -c, --chronicle CHRONICLE chronicle file to use [default: chronicle.txt] """ from docopt import docopt import hjson if __name__ == '__main__': options = docopt(__doc__) try: chronicle = open(options['--chronicle']) exc...
Python
0.000003
@@ -154,20 +154,8 @@ %22%22%22%0A -from docopt impo @@ -164,16 +164,16 @@ docopt%0A + import h @@ -219,16 +219,23 @@ tions = +docopt. docopt(_ @@ -449,16 +449,22 @@ except +hjson. HjsonDec @@ -467,24 +467,29 @@ nDecodeError + as e :%0A pr @@ -527,24 +527,99 @@ ciphered.%22)%0A + print(%22L...
e80dce758a17c304fd938dda62f0a5e2e7d7bcec
change 1
main.py
main.py
import webapp2 import jinja2 import requests import os import sys import time import logging import urllib2 import json import re from operator import itemgetter from datetime import datetime from google.appengine.ext import db from webapp2_extras import sessions from google.appengine.api import mail template_dir =...
Python
0.000005
@@ -297,16 +297,29 @@ t mail%0A%0A +#demo change1 %0A%0Atempla
db6203757d145923813c06b62ddf3739bac79991
Update __init__.py
tendrl/commons/objects/cluster/__init__.py
tendrl/commons/objects/cluster/__init__.py
from tendrl.commons import objects class Cluster(objects.BaseObject): def __init__(self, integration_id=None, public_network=None, cluster_network=None, node_configuration=None, conf_overrides=None, node_identifier=None, sync_status=None, last_sync=None, *args, *...
Python
0.000002
@@ -304,16 +304,34 @@ nc=None, + is_managed=False, *args, @@ -752,16 +752,53 @@ st_sync%0A + self.is_managed = is_managed%0A
81943166d5b8c2606c1506bb1b6567fd0ce82282
update check_dimension and webm supports
main.py
main.py
import os import logging from glob import glob import youtube_dl from telegram.ext import Updater, MessageHandler, Filters logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) updater = Updater(token='TOKEN') # put here the b...
Python
0
@@ -116,16 +116,54 @@ Filters +%0Afrom vid_utils import check_dimension %0A%0Aloggin @@ -242,14 +242,9 @@ )s', -%0A%09%09%09%09%09 + leve @@ -485,19 +485,109 @@ b('*.mp4 -'): +*') + glob('*.webm*'): # with glob it isn't possible to check multiple extension in one regex %0A @@ -772,68 +772,221 @@ .mp4 -'...
255d6d990a3de88a03b591c574aa82373287e490
make initial connection handle connection error and reconnects with original params
tcelery/connection.py
tcelery/connection.py
from __future__ import absolute_import try: from urlparse import urlparse except ImportError: # py3k from urllib.parse import urlparse from functools import partial from itertools import cycle from datetime import timedelta import pika import logging from pika.adapters.tornado_connection import TornadoConne...
Python
0
@@ -775,16 +775,83 @@ l = url%0A + if options is not None:%0A self.options = options%0A @@ -1042,32 +1042,37 @@ l.port%0A%0A +self. options = option @@ -1061,24 +1061,29 @@ f.options = +self. options or %7B @@ -1088,24 +1088,29 @@ %7B%7D%0A +self. options = di @@ -11...
d25f860c56e4e51203574ee8da4297c7aaa6195a
Bump version to 0.1.3
td_biblio/__init__.py
td_biblio/__init__.py
"""TailorDev Biblio Scientific bibliography management with Django. """ __version__ = '0.1.2'
Python
0.000001
@@ -90,7 +90,7 @@ 0.1. -2 +3 '%0A
8d63ed96de0aa29cf709d28b1ad57385fcca3de2
Fix for depends on (#44)
tdi_python/tdiInfo.py
tdi_python/tdiInfo.py
# # Copyright(c) 2021 Intel Corporation. # # 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 w...
Python
0
@@ -4437,20 +4437,8 @@ info -_hdl, tbl_id , de
c749e5e4c47a9a63dc0e44bbc8df3b103dc1db7c
update to screen manager
main.py
main.py
''' # Author: Aaron Gruneklee, Michael Asquith # Created: 2014.12.08 # Last Modified: 2014.12.19 this is the main controler class it is responsible for displaying the 3 views and controls the 5 input buttons. ''' from kivy import require from kivy.app import App from kivy.uix.widget import Widget from k...
Python
0
@@ -1331,20 +1331,275 @@ -pass +self.current_view = ScreenManager()%0A self.pv = ProgrammerView(name='pv')%0A self.current_view.add_widget(pv)%0A self.rv = RunScreen(name='rv')%0A self.current_view.add_widget(rv)%0A self.current_view.current = 'pv'%0A%0A self.add %0A...
f06f81251d7c8d1a12e88d54c1856756979edb7d
Fix tests for Django 1.5
django_socketio/example_project/settings.py
django_socketio/example_project/settings.py
import os, sys PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) if PROJECT_ROOT not in sys.path: sys.path.insert(0, PROJECT_ROOT) full_path = lambda *parts: os.path.join(PROJECT_ROOT, *parts) example_path = full_path("..", "..") if example_path not in sys.path: sys.path.append(example_path) DEBUG = T...
Python
0.00001
@@ -1071,16 +1071,17 @@ lates%22)%0A +# LOGIN_UR
b20614673a122bbc6940f9103275dcf84e3f298f
check if article exists in wallabag before adding
main.py
main.py
import asyncio import logging import sys from time import mktime from urllib.parse import urljoin import aiohttp import feedparser import yaml from raven import Client from wallabag_api.wallabag import Wallabag import github_stars logger = logging.getLogger() logger.handlers = [] formatter = logging.Formatter('%(asc...
Python
0
@@ -1624,16 +1624,17 @@ ta=%7Burl: + url%7D)%0A%0A%0A @@ -3394,32 +3394,275 @@ = article.title%0A + url = urljoin(site%5B%22url%22%5D, article.link)%0A exists = await wall.entries_exists(url)%0A print(exists,url)%0A if exists%5B%22exists%22%5D:%0A logger.in...
3fbbba8dae5c97cedf414eea8a39482c01a269e6
Add `debug=True` to avoid restarting the server after each change
main.py
main.py
import io import json import logging import os import pdb import traceback from logging import config from functools import wraps from flask import ( Flask, render_template, request, send_file, send_from_directory, ) app = Flask(__name__) config.fileConfig('logger.conf') logger = logging.getLo...
Python
0.000003
@@ -946,10 +946,22 @@ ort=5152 +, debug=True )%0A
4bd4281f85649468c7e8b6f1c3abaad5ec2a8c1e
Set first column to display in outputting functions
main.py
main.py
import Library import IOHelper import argparse import sys from tabulate import tabulate wordgensettings = {} formrules = {} def add(): '''Interface for addWord().''' meaning = input("Enter meaning in English: ") word = input("Enter word in conlang: ") form = input("Enter part of speech (verb/noun/ot...
Python
0.000001
@@ -1343,16 +1343,27 @@ d(output +, %22conlang%22 )%0A%0A%0Adef @@ -2844,32 +2844,43 @@ outputWord(word +, %22english%22 )%0A pr @@ -2939,32 +2939,43 @@ outputWord(word +, %22conlang%22 )%0A pr @@ -3910,24 +3910,35 @@ putWord(word +, %22conlang%22 )%0A ac
466eabcb57c590dce1342710c8ae331899046417
Simplify postwork
main.py
main.py
import csv import importlib import logging import operator import os import time import sys from functools import reduce from datetime import datetime from dev.logger import logger_setup from helpers.config import Config from helpers.data_saver import DataSaver from helpers.module_loader import ModuleLoader def ini...
Python
0.000006
@@ -2291,194 +2291,8 @@ ')%0A%0A - # load post-worker%0A need_post = Config.get('APP_NEED_POST', '')%0A if need_post == 'True':%0A d_post_work = loader.get('do_post_work')%0A else:%0A d_post_work = None%0A%0A @@ -2633,33 +2633,39 @@ if -need_post and d_post_work +Config.get('APP_NEED...
ce9f5f4072c38f8b31f0d8c01228caede4ff5897
disable int export
main.py
main.py
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from modules.utils import export_obj from modules.utils import load_obj from modules.utils import random_unit_vec from modules.utils import get_surface_edges PROCS = 4 NMAX = int(10e6) ITT = int(10e9) OPT_ITT = 1 NEARL = 0.003 H = NEAR...
Python
0
@@ -2452,11 +2452,12 @@ ity= -Tru +Fals e)%0A%0A
40b102b00f86bd375bbdab86bdec62f85496f601
Add proper logging
main.py
main.py
#!/usr/bin/env python import RPi.GPIO as GPIO import datetime import requests import settings import time import threading class Pin(object): URL = settings.API_URL + settings.NAME + '/' def post(self, data): data['api_key'] = settings.API_KEY r = requests.post(self.URL + self.relativ...
Python
0.000013
@@ -51,24 +51,39 @@ rt datetime%0A +import logging%0A import reque @@ -86,16 +86,16 @@ equests%0A - import s @@ -228,16 +228,142 @@ data):%0A + logging.debug('Ready to send a POST request for %7Burl%7D with data %7Bdata%7D'.format(url=self.relative_url, data=data))%0A @@ -488,86 +488,91 @@ ...
ccceeb75740b0b39a7c43a09dbf684651803f12a
Remove some leftover debug statements
pdns_cassandra/pdns_cassandra.py
pdns_cassandra/pdns_cassandra.py
''' Cassandra remote backend for PowerDNS ''' __author__ = 'Ruben Kerkhof <ruben@tilaa.com>' __license__ = 'MIT' __version__ = '0.0.1' import os import cassandra.cluster import cassandra.query from flask import Flask, jsonify, abort, request app = Flask(__name__) @app.errorhandler(404) def return_404(error): ...
Python
0.000004
@@ -581,46 +581,8 @@ ''%0A%0A - app.logger.debug(request.headers)%0A @@ -1551,57 +1551,8 @@ '''%0A - result = 1%0A return jsonify(result=result)%0A @@ -1841,16 +1841,50 @@ ,%0A )%0A + return jsonify(result=result)%0A %0A%0A@app.r
a658b1268f8a2a31d3a5cb56ab0b12f8290d474c
Add functions to calculate cluster statistics averages over many realizations
percolation/analysis/clusters.py
percolation/analysis/clusters.py
import numpy as np # % Single value % # def cluster_densities(count, L): return count/(L*L) def percolating_cluster_mass(size, percolated): idx_percolated = np.where(percolated > 0)[0] if idx_percolated.size == 0: return 0 return np.average(size[idx_percolated], weights=percolated[idx_percola...
Python
0
@@ -1111,28 +1111,549 @@ ist(size, percolated)/(L*L)%0A +%0A%0A# %25 Averaged values over many realizations %25 #%0Adef percolating_cluster_mass_average(size, percolated, p_percolation):%0A return percolating_cluster_mass_list(size, percolated) * p_percolation%0A%0A%0Adef percolating_cluster_density_average(size, p...
eb446496cf625dc99fea2f15cf04d29bcde57453
Add an explicit gc call in the combiner script (#5658)
hail/python/scripts/run_combiner.py
hail/python/scripts/run_combiner.py
"""A high level script for running the hail gVCF combiner/joint caller""" import argparse import time import sys import uuid import hail as hl from hail.experimental import vcf_combiner as comb MAX_COMBINER_LENGTH = 100 DEFAULT_REF = 'GRCh38' def chunks(seq, size): return (seq[pos:pos + size] for pos in range(0...
Python
0
@@ -422,24 +422,38 @@ ite=False):%0A + import gc%0A # make t @@ -1389,24 +1389,93 @@ ER_LENGTH)%5D%0A + gc.collect() # need to try to free memory on the master%0A comb
544b8efd33cc99f37f108fb87a603c6c9d8901c2
Rename variable "map_header_library" into "header_to_library_map"
header_toolkit_dependency_walker.py
header_toolkit_dependency_walker.py
#!/usr/bin/python def extract_headers_directly_included(cpp_source_file, header_pattern): """Given a CPP source file, list all directly included headers matching the given pattern.""" import re, fnmatch header_pattern_as_regex = fnmatch.translate(header_pattern).replace("\Z(?ms)", "") matches = [] lines = op...
Python
0.000261
@@ -3134,34 +3134,37 @@ n)%0A %0A -map_ header_ +to_ library +_map = gener @@ -3300,34 +3300,37 @@ %25 (len( -map_ header_ +to_ library +_map .keys()) @@ -4106,34 +4106,37 @@ ader in -map_ header_ +to_ library +_map :%0A @@ -4211,34 +4211,37 @@ header, -map_ header_ +to_ library +_map %5Bhe...
c1855da6ebcccf44c24dca7a25949f33c84fe668
Add the physcial_device info to the UI
server/arsenalweb/views/nodes.py
server/arsenalweb/views/nodes.py
'''Arsenal nodes UI.''' # Copyright 2015 CityGrid Media, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
Python
0
@@ -1344,20 +1344,21 @@ LOG. -info +debug ('Gettin @@ -1620,16 +1620,16 @@ ame'%5D)%0A%0A - LOG. @@ -1693,24 +1693,403 @@ rfaces'%5D))%0A%0A + # We need all the info about the physcial_device for display in the UI.%0A if node%5B'physical_device'%5D:%0A LOG.debug('Getting physical_device: %7B0%...
74ab963a424592299005f41a4d557ce9c7c2be4c
make board string representation GTP conform
Board.py
Board.py
"""Class to purely handle everything that concerns the board""" from typing import Tuple, List import numpy as np # from scipy import ndimage """Just to adjust the internal representation of color at a single location, instead of all over the code ;) Just in case. Maybe something else as -1 and 1 could be interesting,...
Python
0.000496
@@ -3365,21 +3365,150 @@ -rows = %5Bchr(i +cols = list(range(b.shape%5B1%5D))%0A rows = %5Bstr(self.shape%5B0%5D - i) for i in rows%5D%0A cols = %5Bchr(i + ord('a')) if i %3C 8 else chr(i + 1 + o @@ -3517,35 +3517,35 @@ ('a')) for i in -row +col s%5D%0A cols @@ -3543,46 +3543,100 @@ ...
1941d34e5cecf33090e73665034a8196b220e690
Mask more password fields by default
horizon/middleware/operation_log.py
horizon/middleware/operation_log.py
# Copyright 2016 NEC Corporation. # # 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 a...
Python
0
@@ -2217,16 +2217,148 @@ /api/'%5D%0A + _default_mask_fields = %5B'password', 'current_password',%0A 'new_password', 'confirm_password'%5D%0A @@ -2490,20 +2490,28 @@ s%22, -%5B'password'%5D +_default_mask_fields )%0A
6dac96b5be82c0aa4005045c65820d7e95f330c1
Remove lightning layer from patterns which already have obvious button effects
pier14/opc-client/soma_client.py
pier14/opc-client/soma_client.py
#!/usr/bin/env python from model import SomaModel from renderer import Renderer from controller import AnimationController from effectlayer import * from effects.color_cycle import * from effects.random_phase import * from effects.random_blink_cycle import * from effects.chase import AxonChaseLayer from effects.colorwa...
Python
0
@@ -2481,33 +2481,8 @@ 1),%0A - Lightning(),%0A @@ -2607,33 +2607,8 @@ )),%0A - Lightning(),%0A
7119c07b422f823f40939691fa84f0c2581ae70d
Fix the REST module name.
test/unit/helpers/test_qiprofile_helper.py
test/unit/helpers/test_qiprofile_helper.py
import datetime import pytz from nose.tools import (assert_is_none) from qipipe.helpers.qiprofile_helper import QIProfile from qiprofile.models import Project from test import project from test.helpers.logging_helper import logger SUBJECT = 'Breast099' """The test subject.""" SESSION = 'Session01' """The test sessio...
Python
0.000003
@@ -130,16 +130,21 @@ iprofile +_rest .models