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
e1d5cf8dd8c143cad0229b62e9aeb0c3b06ca3e7
Fix unittest assertion
driftbase/auth/tests/test_steam.py
driftbase/auth/tests/test_steam.py
import unittest import mock from json import loads, dumps import requests from werkzeug.exceptions import Unauthorized, ServiceUnavailable from driftbase.auth.steam import run_ticket_validation patcher = None def setUpModule(): original_get = requests.get def requests_get_mock(url, *args, **kw): ...
Python
0.000224
@@ -2580,16 +2580,66 @@ ion(%7B%7D)%0A + # The order of missing fields isn't fixed%0A @@ -2694,23 +2694,133 @@ lds: - +%22, context.exception.description)%0A self.assertIn(%22 ticket +%22 , +context.exception.description)%0A self.assertIn(%22 appid -. %22, c
17d12027929365e8ebcc69c32642068cc6208678
Decode stdout in shell.run_cmd
powerline/lib/shell.py
powerline/lib/shell.py
# vim:fileencoding=utf-8:noet from subprocess import Popen, PIPE def run_cmd(pl, cmd, stdin=None): try: p = Popen(cmd, stdout=PIPE, stdin=PIPE) except OSError as e: pl.exception('Could not execute command ({0}): {1}', e, cmd) return None else: stdout, err = p.communicate(stdin) return stdout.strip() de...
Python
0.999042
@@ -59,16 +59,76 @@ n, PIPE%0A +from locale import getlocale, getdefaultlocale, LC_MESSAGES%0A %0A%0Adef ru @@ -346,16 +346,126 @@ (stdin)%0A +%09%09encoding = getlocale(LC_MESSAGES)%5B1%5D or getdefaultlocale()%5B1%5D or 'utf-8'%0A%09%09stdout = stdout.decode(encoding)%0A %09return
fb47031a32f30e04762f73dcf51a4864353fb74c
Add TODO
predicate/predicate.py
predicate/predicate.py
import re from django.db.models.query_utils import Q LOOKUP_SEP = '__' QUERY_TERMS = set([ 'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in', 'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year', 'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex', ...
Python
0.000002
@@ -928,16 +928,144 @@ , obj):%0A + # TODO: This overrides Q's __contains__ method. It should only have%0A # the custom behavior for non-Node objects.%0A
12b806a0c68ceb146eed3b4a9406f36e9f930ba6
Fix bug with closing socket without creating it again.
rl-rc-car/sensor_client.py
rl-rc-car/sensor_client.py
""" This is used to gather our readings from the remote sensor server. http://ilab.cs.byu.edu/python/socket/echoclient.html """ import socket import numpy as np import time class SensorClient: def __init__(self, host='192.168.2.9', port=8888, size=1024): self.host = host self.port = port ...
Python
0
@@ -335,25 +335,48 @@ ze%0A%0A - self. +def get_readings(self):%0A s = sock @@ -425,50 +425,16 @@ AM)%0A -%0A -def get_readings(self):%0A self. + s.co @@ -482,21 +482,16 @@ dings = -self. s.recv(s @@ -508,21 +508,16 @@ -self. s.close(
3880093f70312d2e044fcabe06190329aa845c13
normalize action sampler
rlvision/exps/pg_16_exp.py
rlvision/exps/pg_16_exp.py
"""Policy Gradient for Grid 16x16. It's Keras 2! Author: Yuhuang Hu Email : duguyue100@gmail.com """ from __future__ import print_function import os import numpy as np from keras.models import Sequential from keras.layers import Dense, Flatten from keras.layers import Conv2D, AveragePooling2D from keras.layers impor...
Python
0.000004
@@ -2834,48 +2834,8 @@ ion%0A - aprob = aprob/np.sum(aprob)%0A @@ -3259,16 +3259,91 @@ n%5D = 0.%0A + action_sampler = action_sampler/np.sum(action_sampler)%0A
8dcb778c62c3c6722e2f6dabfd97f6f75c349e62
Set celery max tasks child to 1
celery_cgi.py
celery_cgi.py
import os import logging from celery import Celery from temp_config.set_environment import DeployEnv runtime_env = DeployEnv() runtime_env.load_deployment_environment() redis_server = os.environ.get('REDIS_HOSTNAME') redis_port = os.environ.get('REDIS_PORT') celery_tasks = [ 'hms_flask.modules.hms_controller', ...
Python
0.999855
@@ -726,24 +726,60 @@ ARTED=True,%0A + worker_max_tasks_per_child = 1,%0A worker_m
c82219ea0a651b01d7b9dd91286450e8ecab8fef
Make sure we clean up correctly after failed thrift connection
elasticsearch/connection/thrift.py
elasticsearch/connection/thrift.py
from __future__ import absolute_import import time try: from .esthrift import Rest from .esthrift.ttypes import Method, RestRequest from thrift.transport import TTransport, TSocket, TSSLSocket from thrift.protocol import TBinaryProtocol from thrift.Thrift import TException THRIFT_AVAILABLE = T...
Python
0
@@ -2106,16 +2106,39 @@ .time()%0A + tclient = None%0A @@ -2466,16 +2466,44 @@ inally:%0A + if tclient:%0A
3d6fcb5c5ef05224f0129caf58507b555d17f35d
Fix indentation error in Flask
episode-2/flask/src/translation.py
episode-2/flask/src/translation.py
# -*- coding: utf-8 -*- # Copyright 2016 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
Python
0.000002
@@ -1878,18 +1878,16 @@ etlang)%0A - theTra @@ -1902,18 +1902,16 @@ = None%0A - if tra @@ -1960,18 +1960,16 @@ n):%0A - theTrans @@ -2023,18 +2023,16 @@ ation'%5D%0A - return
4026d575cac94d98f8fa5467674020b18442359d
Update h-index.py
Python/h-index.py
Python/h-index.py
# Time: O(nlogn) # Space: O(1) # Given an array of citations (each citation is a non-negative integer) # of a researcher, write a function to compute the researcher's h-index. # # According to the definition of h-index on Wikipedia: # "A scientist has index h if h of his/her N papers have # at least h citations each...
Python
0.000002
@@ -1312,62 +1312,8 @@ %22%22%22%0A - sorted(citations, reverse=True)%0A h = 0%0A
8deb3e45511950cc1a5d317f79f30bf59ed4821a
Update Changedate
changedate.py
changedate.py
""" Calcular Data a partir de uma quantidade de minutos """ MINUTOSENTRADA = 4000 OPERADOR = "+" DATA_E, HORA_E = "31/12/2016 23:35".split(" ", 2) DIA_E, MES_E, ANO_E = DATA_E.split("/", 3) HR_E, MINU_E = HORA_E.split(":", 2) # transformar tudo em minutos # converter horas em minutos MIN_TOT_E = (int(HR_E) * 60) + in...
Python
0.000001
@@ -57,159 +57,257 @@ %22%22%22%0A -MINUTOSENTRADA = 4000%0AOPERADOR = %22+%22%0ADATA_E, HORA_E = %2231/12/2016 23:35%22.split(%22 %22, 2)%0ADIA_E, MES_E, ANO_E = DATA_E.split(%22/%22, 3)%0AHR_E, MINU_E = HORA_E +%0Adef alterar_data(data_ent, op, minutos_ent):%0A %22%22%22 Calcular nova data %22%22%22%0A spl_Dat...
174f0986900fbd56ed3b2af9ca3dacc0de1aa502
increase connect timeout for nodes and also added some logs to cli so that it can be asserted in sovrin client (#66)
plenum/config.py
plenum/config.py
import os import sys from collections import OrderedDict from plenum.common.txn import ClientBootStrategy from plenum.common.types import PLUGIN_TYPE_STATS_CONSUMER # Each entry in registry is (stack name, ((host, port), verkey, pubkey)) nodeReg = OrderedDict([ ('Alpha', ('127.0.0.1', 9701)), ('Beta', ('127.0...
Python
0.000002
@@ -2774,17 +2774,17 @@ else 1. -1 +4 %0A%0A# Afte
680d0ab93247b499b62c502b39ace6bdf9b19ea3
use the same type tag for all reference types
plic/Rapicorn.py
plic/Rapicorn.py
#!/usr/bin/env python # plic - Pluggable IDL Compiler -*-mode:python-*- # Copyright (C) 2008 Tim Janik # # This program 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 ver...
Python
0
@@ -2056,17 +2056,17 @@ : '___ -E +e ',%0A @@ -2092,17 +2092,17 @@ : '___ -Q +q ',%0A @@ -2128,17 +2128,17 @@ : '___ -R +r ',%0A @@ -2164,17 +2164,17 @@ E : '___ -C +c ',%0A @@ -2204,32 +2204,112 @@ e%5D%0A return s%0A + reference_types = (Decls.ENUM, Decls.SEQUENCE, Decls.RECORD,...
ed34c43b6ce270ada7d523ef07e9b2087d779cb9
remove explicit random.seed()
plugins/games.py
plugins/games.py
""" games.py: Create a bot that provides game functionality (dice, 8ball, etc). """ import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import random import urllib.request import urllib.error from xml.etree import ElementTree import utils from log import log import world ...
Python
0
@@ -3806,144 +3806,8 @@ l)%0A%0A -# loading%0Adef main(irc=None):%0A %22%22%22Main function, called during plugin loading at start.%22%22%22%0A%0A # seed the random%0A random.seed()%0A%0A def
62a2b5ab62a5c1080cdc30e3334cc62f4a51d6a9
Make job mode API update change.
eurekaclinical/analytics/client.py
eurekaclinical/analytics/client.py
from eurekaclinical import APISession, API, Struct, construct_api_session_context_manager class Job(Struct): def __init__(self): super(Job, self).__init__() self.sourceConfigId = None self.destinationId = None self.dateRangePhenotypeKey = None self.earliestDate = None ...
Python
0
@@ -433,26 +433,26 @@ elf. -updateData = False +jobMode = 'UPDATE' %0A
12223dfbc26b72c400b5436e53099ade27699086
fix #796
examples/ImageNetModels/alexnet.py
examples/ImageNetModels/alexnet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: alexnet.py import argparse import os import cv2 import numpy as np import tensorflow as tf from tensorpack import * from tensorpack.dataflow import imgaug from tensorpack.tfutils import argscope from tensorpack.utils.gpu import get_num_gpu from imagenet_utils im...
Python
0
@@ -3612,17 +3612,18 @@ ax(get_n -r +um _gpu(), @@ -4322,16 +4322,30 @@ %5B +(0, BASE_LR), (30, BAS
5294abf9253a077c0a23fe0e573174afd3728ac7
fix caching in test
corehq/ex-submodules/casexml/apps/stock/tests/test_logistics_consumption.py
corehq/ex-submodules/casexml/apps/stock/tests/test_logistics_consumption.py
import uuid from decimal import Decimal from django.test import TestCase from casexml.apps.case.models import CommCareCase from casexml.apps.stock.models import StockReport, StockTransaction from casexml.apps.stock.tests import ago from casexml.apps.stock import const from corehq.apps.commtrack.models import CommtrackC...
Python
0.000001
@@ -262,16 +262,93 @@ t const%0A +from corehq.apps.commtrack.consumption import should_exclude_invalid_periods%0A from cor @@ -2046,32 +2046,171 @@ all().delete()%0A%0A + def tearDown(self):%0A should_exclude_invalid_periods.clear(self.domain.name)%0A should_exclude_invalid_periods.clear(None)%0A%0A...
91076c30d16d27ecfe9a8c347a9bf74b9560c5ce
Send updated items to webhooks. (#1680)
pogom/webhook.py
pogom/webhook.py
#!/usr/bin/python # -*- coding: utf-8 -*- import logging import requests from .utils import get_args from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter log = logging.getLogger(__name__) def send_to_webhook(message_type, message): args = get_args() if not args.w...
Python
0
@@ -2427,17 +2427,23 @@ dent%5D = -1 +message %0A @@ -2630,13 +2630,47 @@ nt%5D -so it +in all branches so it%0A # upd @@ -2681,16 +2681,30 @@ the LFU + usage count.%0A %0A @@ -2718,176 +2718,414 @@ # -usage count. We just use i +If the objec t +h as -a count for now, can ...
11cc0c5f8aae526eddb372fbe339f649f2c654eb
Update pattern for inline comments to allow anything after '#'
poyo/patterns.py
poyo/patterns.py
# -*- coding: utf-8 -*- INDENT = r"(?P<indent>^ *)" VARIABLE = r"(?P<variable>.+):" VALUE = r"(?P<value>((?P<q2>['\"]).*?(?P=q2))|[^#]+?)" NEWLINE = r"$\n" BLANK = r" +" INLINE_COMMENT = r"( +#\w*)?" COMMENT = r"^ *#.*" + NEWLINE BLANK_LINE = r"^[ \t]*" + NEWLINE SECTION = INDENT + VARIABLE + INLINE_COMMENT + NEWLIN...
Python
0
@@ -191,10 +191,9 @@ ( +# -%5Cw +. *)?%22
0f9b5bdba841d707e236bb8ed8df5ba4aa7806c2
Allow a None value for os_config_path.
praw/settings.py
praw/settings.py
# This file is part of PRAW. # # PRAW is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any later # version. # # PRAW is distributed in the hope that it will ...
Python
0
@@ -1072,12 +1072,32 @@ el -se: +if 'HOME' in os.environ: # L @@ -1177,16 +1177,56 @@ onfig')%0A + else:%0A os_config_path = None%0A loca @@ -1263,32 +1263,33 @@ ir, 'praw.ini'), + %0A @@ -1293,67 +1293,110 @@ - os.path.join(os_config_path, 'praw.ini'),%0A +...
28c3f4e17a1f7a003d75353005cd96c854bd30d9
replace lb:no_nsfw
cogs/nekos.py
cogs/nekos.py
""" The MIT License (MIT) Copyright (c) 2018 tilda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
Python
0.002582
@@ -2150,19 +2150,16 @@ tting %22%5B -lb: no_nsfw%5D @@ -2250,11 +2250,8 @@ f '%5B -lb: no_n
a307b6a059e1da4fc415296016280e5149bbd061
Update radio.py
cogs/radio.py
cogs/radio.py
from .utils import config, checks, formats import discord from discord.ext import commands import discord.utils from .utils.api.pycopy import Copy import random, json, asyncio from urllib.parse import unquote class Radio: """The radio-bot related commands.""" def __init__(self, bot): self....
Python
0.000001
@@ -3972,16 +3972,21 @@ await +self. bot.say(
d84a4efcf880bb668b2721af3f4ce18220e8baab
Use np.genfromtext to handle missing values
xvistaprof/reader.py
xvistaprof/reader.py
#!/usr/bin/env python # encoding: utf-8 """ Reader for XVISTA .prof tables. """ import numpy as np from astropy.table import Table from astropy.io import registry def xvista_table_reader(filename): dt = [('R', np.float), ('SB', np.float), ('SB_err', np.float), ('ELL', np.float), ('PA', np.float), ('E...
Python
0.000022
@@ -267,26 +267,24 @@ ,%0A - ('ELL', np.f @@ -320,34 +320,32 @@ AG', np.float),%0A - ('ELLM @@ -396,34 +396,32 @@ XC', np.float),%0A - ('YC', @@ -483,18 +483,16 @@ - ('A2', n @@ -560,12 +560,15 @@ np. -load +genfrom txt( @@ -608,16 +608,84 @@ prows=15 +,%0A ...
0dde9454d05a6d5533454fbac8996c560d007c67
make a proper hook/task split in cython.
yaku/tools/cython.py
yaku/tools/cython.py
import os import sys from yaku.task_manager \ import \ extension, get_extension_hook from yaku.task \ import \ Task from yaku.compiled_fun \ import \ compile_fun from yaku.utils \ import \ ensure_dir, find_program import yaku.errors @extension(".pyx") def cython_task(se...
Python
0
@@ -295,16 +295,128 @@ %22.pyx%22)%0A +def cython_hook(self, node):%0A self.sources.append(node.change_ext(%22.c%22))%0A return cython_task(self, node)%0A%0A def cyth @@ -535,24 +535,25 @@ arget.name)%0A +%0A task = T
6e1544b0a6c9ad62b53e57102e84456041437443
Update triggerwatcher.py
st2common/st2common/services/triggerwatcher.py
st2common/st2common/services/triggerwatcher.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
@@ -3924,19 +3924,16 @@ %25s since -%5C't trigger
43a3278149f067bb26589b312c052a3117b62870
update status
Cogs/Remind.py
Cogs/Remind.py
import asyncio import discord import time import parsedatetime from datetime import datetime from operator import itemgetter from discord.ext import commands from Cogs import ReadableTime from Cogs import DisplayName from Cogs import Nullify # This is the Remind module. It sends a pm to a user after a spec...
Python
0.000001
@@ -1831,24 +1831,39 @@ status(self, + member_before, member):%0A%09%09 @@ -6257,28 +6257,29 @@ ge(ctx.message.channel, msg) +%0A
af96c316f485ebed2ad342aa2ea720d8b699f649
bump version
ydcommon/__init__.py
ydcommon/__init__.py
""" YD Technology common libraries """ VERSION = (0, 1, 1) __version__ = '.'.join((str(each) for each in VERSION[:4])) def get_version(): """ Returns shorter version (digit parts only) as string. """ version = '.'.join((str(each) for each in VERSION[:3])) if len(VERSION) > 3: version += ...
Python
0
@@ -50,17 +50,17 @@ (0, 1, -1 +2 )%0A%0A__ver
de48a47cf813177e824026a994a5a814f5cc1a2d
fix socket.TCP_KEEPIDLE error on Mac OS
routeros_api/api_socket.py
routeros_api/api_socket.py
import socket from routeros_api import exceptions try: import errno except ImportError: errno = None EINTR = getattr(errno, 'EINTR', 4) def get_socket(hostname, port, timeout=15.0): api_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) api_socket.settimeout(timeout) while True: tr...
Python
0
@@ -987,16 +987,60 @@ %22%22%22%0A + if hasattr(socket, %22SO_KEEPALIVE%22):%0A sock @@ -1094,16 +1094,60 @@ IVE, 1)%0A + if hasattr(socket, %22TCP_KEEPIDLE%22):%0A sock @@ -1211,24 +1211,69 @@ r_idle_sec)%0A + if hasattr(socket, %22TCP_KEEPINTVL%22):%0A sock.set @@ -1332,24 +...
b957a84ea368f681e4a37c3259305116447dc1c8
Fix incorrect test import.
statsmodels/tsa/statespace/tests/test_tools.py
statsmodels/tsa/statespace/tests/test_tools.py
""" Tests for tools Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np import pandas as pd from dismalpy.ssm import tools # from .results import results_sarimax from numpy.testing import ( assert_equal, assert_array_equal, assert_al...
Python
0
@@ -177,20 +177,34 @@ rom -dismalpy.ssm +statsmodels.tsa.statespace imp
85ac83b7e1ff6830e135b9f2c8643e00aaf93e99
Add comment
yunohost_firewall.py
yunohost_firewall.py
# -*- coding: utf-8 -*- import os import sys try: import miniupnpc except ImportError: sys.stderr.write('Error: Yunohost CLI Require miniupnpc lib\n') sys.exit(1) try: import yaml except ImportError: sys.stderr.write('Error: Yunohost CLI Require yaml lib\n') sys.stderr.write('apt-get install py...
Python
0
@@ -5558,24 +5558,122 @@ moveupnp():%0A + %22%22%22%0A Remove upnp cron%0A Keyword arguments:%0A None%0A Return%0A None%0A %22%22%22%0A%0A try:%0A @@ -5866,16 +5866,110 @@ _stop(): +%0A %22%22%22%0A Stop firewall%0A Keyword arguments:%0A None%0A Return%0A ...
d3f49e2d75106d9af23dcf961f8d16b45eee0c8c
Fix determining line numbers.
z80/_disassembler.py
z80/_disassembler.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Z80 CPU Emulator. # https://github.com/kosarev/z80 # # Copyright (C) 2017-2020 Ivan Kosarev. # ivan@kosarev.info # # Published under the MIT license. import bisect from ._error import Error class _SourcePos(object): def __init__(self, offset, source_fil...
Python
0.000039
@@ -1384,16 +1384,20 @@ e_no = i + + 1 %0A
5a31ed001626937772a30ab46b94fe2b4bb5cfb8
allow 2013 candidates
fecreader/summary_data/management/commands/add_candidates.py
fecreader/summary_data/management/commands/add_candidates.py
from django.core.management.base import BaseCommand, CommandError from ftpdata.models import Candidate from summary_data.models import Candidate_Overlay from summary_data.utils.overlay_utils import make_candidate_overlay_from_masterfile election_year = 2014 cycle = str(election_year) class Command(BaseCommand): ...
Python
0.000005
@@ -799,21 +799,16 @@ and_id, -cand_ election
f5b8611e785fc5e833d2b257dd05231893aa71b5
Fix our usage of the new WebHelpers API
fedoracommunity/mokshaapps/packages/controllers/downloads.py
fedoracommunity/mokshaapps/packages/controllers/downloads.py
# This file is part of Fedora Community. # Copyright (C) 2008-2010 Red Hat, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) ...
Python
0.00004
@@ -6375,31 +6375,27 @@ 'size': -number_to_human +format_byte _size(bu
0abb461f65bb21b9eb6347347852e3faf238475e
Add degenerated face test.
Core/Repair.py
Core/Repair.py
# -*- coding:utf-8 -*- # # External dependencies # from .Mesh import Mesh from numpy import array, isfinite, zeros # # Check several parameters of a given mesh # def CheckMesh( mesh ) : # Initialisation log_message = '' # Vertex number if len(mesh.vertices) < 3 : log_message += 'Not enough vertices\n' # ...
Python
0.000009
@@ -2237,16 +2237,20 @@ Remove +the isolated @@ -3314,16 +3314,274 @@ ors()%0A%0A%0A +#%0A# Remove the degenerated faces of a given mesh%0A#%0Adef RemoveDegeneratedFaces( mesh ) :%0A%09%09%0A%09tris = mesh.vertices%5B mesh.faces %5D%0A%09face_normals = cross( tris%5B::,1%5D - tris%5B::,0%5D , tris%5B::,2%5D - tr...
bf4a197618bf09a164f03a53cd6998bcd6ee8196
Fix function name
google/cloud/security/common/data_access/violation_format.py
google/cloud/security/common/data_access/violation_format.py
# Copyright 2017 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, s...
Python
0.999896
@@ -649,15 +649,8 @@ mat_ -policy_ viol
052062a3c267b56d9ee99dd772b34ecdf5b27961
add rmtag as alias for removetag
Source/Tagging.py
Source/Tagging.py
import jsonpickle import tabulate import BotpySE as bp # Our own little re wrapper libraryo import regex as re class Tag: def __init__(self, name, regex, user_id, user_name): normalized_regex = re.compile(regex).pattern self.name = name self.regex = normalized_regex self.user_id ...
Python
0
@@ -3365,32 +3365,45 @@ remove tag ...%22, + %22rmtag ...%22, %0A %22de
17b9ccbcf940c653c2ee0994eefec87ca2961b75
Fix extension scraper on Python 3.x
Release/Product/Python/PythonTools/ExtensionScraper.py
Release/Product/Python/PythonTools/ExtensionScraper.py
# ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution....
Python
0.000001
@@ -1483,12 +1483,44 @@ rror -, e: +:%0D%0A e = sys.exc_info()%5B1%5D %0D%0A
9780274756ef4bc2966a0f8290ca28bd3c1e8163
update dev version after 0.31.1 tag [skip ci]
py/desisim/_version.py
py/desisim/_version.py
__version__ = '0.31.1'
Python
0
@@ -14,10 +14,18 @@ '0.31.1 +.dev1940 '%0A
bc905d9d01060fdaff2765f64e810b4eb927820e
fix arcseciv typo
py/legacypipe/units.py
py/legacypipe/units.py
def get_units_for_columns(cols, bands=[], extras=None): deg = 'deg' degiv = '1/deg^2' arcsec = 'arcsec' arcseciv = '1/arcsec^2' flux = 'nanomaggy' fluxiv = '1/nanomaggy^2' pm = 'mas/yr' pmiv = '1/(mas/yr)^2' unitmap = dict( ra=deg, dec=deg, ra_ivar=degiv, dec_ivar=degiv, ...
Python
0.018115
@@ -372,33 +372,32 @@ pe_r_ivar=arcsec -_ iv)%0A unitmap. @@ -1157,17 +1157,16 @@ r=arcsec -_ iv, ddec @@ -1177,17 +1177,16 @@ r=arcsec -_ iv)%0A
edc13c1309d550a3acc5b833d0efedaf7be4045e
Fix several off-by-one errors in split_tex_string() and add regression tests.
pybtex/bibtex/utils.py
pybtex/bibtex/utils.py
# Copyright (C) 2007, 2008, 2009 Andrey Golovizin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program ...
Python
0
@@ -1598,20 +1598,150 @@ vel %3E 0. +%0A %3E%3E%3E split_tex_string('')%0A %5B%5D%0A %3E%3E%3E split_tex_string('a')%0A %5B'a'%5D%0A %3E%3E%3E split_tex_string('on a')%0A %5B'on', 'a'%5D%0A %22%22%22%0A - %0A bra @@ -1792,19 +1792,26 @@ %5B%5D%0A +string_l en -d = len(s @@ -1820,12 ...
d883d551f74bbfa0c0ee0db6b94aa98a3af41fca
Expanded NUMERIC_MISSING_VALUES to have 64 values
pybufrkit/constants.py
pybufrkit/constants.py
""" pybufrkit.constants ~~~~~~~~~~~~~~~~~~~ Various constants used in the module. """ from __future__ import absolute_import from __future__ import print_function import sys import os # Set the base directory accordingly for PyInstaller # noinspection PyUnresolvedReferences,PyProtectedMember BASE_DIR = sys._MEIPASS...
Python
0.999172
@@ -915,10 +915,10 @@ to -32 +64 %0ANUM @@ -970,10 +970,10 @@ nge( -33 +65 )%5D%0A%0A
4438b80d7e4fbbbb3ee097416ffa7c54e2c02fb4
Fix more instances of type -> isinstance
pyexperiment/Config.py
pyexperiment/Config.py
"""Provides an easy way to configure a python application. Basically implements a singleton configuration at module level. Basic usage: Load the (singleton) configuration with load, access the values like you would in a dictionary. Written by Peter Duerr. """ from __future__ import print_function from __future__ impo...
Python
0.000068
@@ -2634,19 +2634,29 @@ if -typ +not isinstanc e(result ) != @@ -2655,17 +2655,15 @@ sult -) != +, bool +) :%0A @@ -6815,11 +6815,17 @@ if -typ +isinstanc e(di @@ -6837,20 +6837,17 @@ ary%5Bkey%5D -) == +, configo @@ -6856,16 +6856,17 @@ .Section +) :%0A
52cc92a7b3c174af9eb287e3444f65718b1de35a
version bump
pykechain/__about__.py
pykechain/__about__.py
name = 'pykechain' description = 'KE-chain Python SDK' version = '3.0.0-rc14' author = 'KE-works BV' email = 'support+pykechain@ke-works.com'
Python
0.000001
@@ -70,13 +70,8 @@ .0.0 --rc14 '%0A%0Aa
5dfd10ac73a374797ed53d2318bdccd616036140
Add test for mismatching type variables on arguments or return values.
sagitta/test/test_arrow.py
sagitta/test/test_arrow.py
#!/usr/bin/env python # encoding: utf-8 # # pylint: disable=C0111,E0611,E1101,R0201 # C0111: Missing docstring # E0611: No name 'x' in module 'y' # E1101: Module 'x' has no 'y' member # R0201: Method could be a function import math import pytest from sagitta.arrow import arrow, signature, typed from sagitta.cat impor...
Python
0
@@ -2456,11 +2456,10 @@ # %3C- -- B + b ool @@ -2490,16 +2490,383 @@ t(1)%0A%0A + def test_mismatching_typevariables_raises(self):%0A with raises(StrictTypeError, 'Expected argument'):%0A asum = arrow(self.add, A, A, A)%0A asum(3, 4.0) # %3C- both should be of the same type%0A ...
a1dd37c9127501ad440c7777d14fb28b1b59b85b
Add list guests function
characters.py
characters.py
from adventurelib import Item, Bag class Man(Item): subject_pronoun = 'he' object_pronoun = 'him' class Woman(Item): subject_pronoun = 'she' object_pronoun = 'her' dr_black = the_victim = Man('Dr. Black', 'Dr Black', 'the victim') dr_black.def_name = 'the victim' dr_black.description = """\ Dr. Bl...
Python
0
@@ -27,16 +27,22 @@ tem, Bag +, when %0A%0A%0Aclass @@ -366,19 +366,23 @@ of -Tudor Close +Albermore Manor . Hi @@ -1385,24 +1385,22 @@ Plum'%0A%0A -everyone +guests = Bag(%5B @@ -1481,16 +1481,177 @@ um%0A%5D)%0A%0A%0A +@when('list guests')%0Adef list_rooms():%0A print(%22A nearby guest list for tonight'...
544cd6b962f8763cc11486a162ee3a86e019565f
fix typo (#5430)
python/mxnet/rnn/io.py
python/mxnet/rnn/io.py
# coding: utf-8 # pylint: disable=too-many-arguments, too-many-locals """Definition of various recurrent neural network cells.""" from __future__ import print_function import bisect import random import numpy as np from ..io import DataIter, DataBatch from .. import ndarray def encode_sentences(sentences, vocab=None...
Python
0.000054
@@ -1460,16 +1460,17 @@ %22Unknow +n token %25
4a4cdc839be140dc9486b2cffd8c065365a70404
Add /chatgroup tpahere to chatgroups help message
chatgroups.py
chatgroups.py
#pylint: disable = F0401 from helpers import * from basecommands import simplecommand from java.util.UUID import fromString as juuid from traceback import format_exc as trace groups = open_json_file("chatgroups", {}) cg_defaultkey = ":" cg_keys = open_json_file("chatgroup_keys", {}) cg_toggle_list = []...
Python
0
@@ -2358,16 +2358,60 @@ p key%22)%0A + msg(sender, %22&e/chatgroup tpahere%22)%0A %0A%0A@hook.
e2741bf38aef8014572feee2f9e8c3e1e10e5b67
Add message for `qisrc push` when pushing for review.
python/qisrc/review.py
python/qisrc/review.py
## Copyright (c) 2012 Aldebaran Robotics. All rights reserved. ## Use of this source code is governed by a BSD-style license that can be ## found in the COPYING file. """ Handling pushing changes to gerrit """ import os import re import sys import qibuild.log import urlparse from qibuild import ui import qisrc.git ...
Python
0
@@ -5761,32 +5761,86 @@ %0A if review:%0A + ui.info('Pushing code to gerrit for review.')%0A args.app
bb430cedf3cf92e4b165f58845bb451f025f6bff
print out -h by default
cihai/core.py
cihai/core.py
#!/usr/bin/env python # -*- coding: utf8 - *- """Cihai client object.""" from __future__ import (absolute_import, division, print_function, unicode_literals, with_statement) import argparse import logging import os import kaptan from appdirs import AppDirs from sqlalchemy import Table, create...
Python
0.000019
@@ -5824,16 +5824,95 @@ s(argv)%0A + if not args._config:%0A parser.print_help()%0A else:%0A @@ -5970,14 +5970,15 @@ lse -None%0A%0A +%7B%7D%0A
02ebf235704ea6c61969a20ff86717c796dd5e06
Fix typo: get_destination_queues should be get_queue
queue_util/consumer.py
queue_util/consumer.py
"""Listens to 1 (just one!) queue and consumes messages from it endlessly. We set up a consumer with two things: 1) The name of the source queue (`source_queue_name`) 2) A callable that will process The `handle_data` method must process the data. It can return nothing or a sequence of `queue_name, data` pairs. If it r...
Python
0.999999
@@ -2705,26 +2705,13 @@ get_ -destination_ queue -s (que
657696ce42d0e5da781ac5dbf8f635b7ca011b8a
sort choices in output of ck_choices.py
ck_choices.py
ck_choices.py
#!/usr/bin/env python """ makes modifications to the controlled vocabulary (implemented as ckanext-scheming "choices") HvW - 2016-06-07 """ from pprint import pprint import argparse import sys import json import os LOCAL_SCHEMA=("/usr/lib/ckan/default/src/ckanext-eaw_schema/ckanext/" + "eaw_schema/eaw_...
Python
0.999988
@@ -1831,16 +1831,23 @@ +sorted( %5Bc%5B'valu @@ -1873,16 +1873,17 @@ ices'%5D%5D) +) %0A
22ccb20e5f1637059b366da6e5fdf7e33f207e7a
improving the classifier
classifier.py
classifier.py
#! /usr/bin/env python # -*- coding: UTF-8 -*- """ Classifier ========== After Feature Extraction, that returns a data of the format [(filename, linenum, vote, sentence, feat1, feat2, ...)] """ from __future__ import division from optparse import OptionParser import json from pprint import pprint import random import...
Python
0.841188
@@ -411,16 +411,39 @@ xtractor +%0Afrom os import listdir %0A%0Adef ge @@ -554,16 +554,77 @@ tfile')%0A + optionparser.add_option('-d', '--dir', dest='directory')%0A %0A%0A (o @@ -683,25 +683,25 @@ option. -inputfile +directory :%0A @@ -794,16 +794,16 @@ url%22')%0A%0A - retu @@ -832,16 +832,42...
919d67e6f46d4f991cc5caa5893beebfe94e0d9e
Add hash mock
cli/crypto.py
cli/crypto.py
from ctypes import * import base64 import os def generate_hex_sstr(): publicKey64 = "Not implemente" privateKey64 = "Not implemente" return (publicKey64,privateKey64)
Python
0.000004
@@ -173,8 +173,51 @@ eKey64)%0A +%0Adef hash(msg):%0A return %22Not implemente%22
2e6485ea0d80426222d0cc84d1d4074d845cd6d1
disable kcov test on arm
tests/integration_tests/build/test_coverage.py
tests/integration_tests/build/test_coverage.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Tests pertaining to line/branch test coverage for the Firecracker code base. # TODO - Put the coverage in `s3://spec.firecracker` and update it automatically. target should be put in `s3://spec.firecra...
Python
0
@@ -2550,16 +2550,124 @@ ut(400)%0A +@pytest.mark.skipif(%0A platform.machine() != %22x86_64%22,%0A reason=%22unstable on aarch64 as of right now%22%0A)%0A def test
d262bcf59c9779a387e9f7d213030c958b85d891
fix sur les phrase
sara_flexbe_states/src/sara_flexbe_states/StoryboardSetStoryKey.py
sara_flexbe_states/src/sara_flexbe_states/StoryboardSetStoryKey.py
#!/usr/bin/env python from flexbe_core import EventState, Logger import rospy from vizbox.msg import Story class StoryboardSetStoryFromAction(EventState): """ set_story -- titre string the title -- actionList string[][] the steps <= done what's suppose to be written is written ...
Python
0.007946
@@ -1042,16 +1042,127 @@ erson%22:%0A + if action%5B1%5D == %22%22:%0A story.append(%22Find a person%22)%0A else%0A @@ -1195,32 +1195,32 @@ %22 + action%5B1%5D)%0A - elif @@ -1446,24 +1446,138 @@ == %22give%22:%0A + if actio...
2479537a63f12807d51d490e39b77c258f33c526
add django.contrib.sites to installed app for preventing warning message
trytalk/settings/default.py
trytalk/settings/default.py
""" Django settings for trytalk project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
Python
0
@@ -1044,16 +1044,41 @@ b.gis',%0A +%09'django.contrib.sites',%0A %09'rest_f
4b204727fbcfc6dba4fdd61a8f890e3a49c4bd7a
revert inhibiition of return since it breaks salt-run which is expecting the return. restore after fixing salt-run
salt/daemons/flo/worker.py
salt/daemons/flo/worker.py
# -*- coding: utf-8 -*- ''' The core behaviors used by minion and master ''' # pylint: disable=W0232 from __future__ import absolute_import # Import python libs import time import os import multiprocessing import logging from six.moves import range # Import salt libs import salt.daemons.masterapi from raet import ra...
Python
0.000063
@@ -599,16 +599,21 @@ RETURN = + %5B%5D # %5B'_retu
bad310a283d4d459464a2aff670fd596f5716fef
Use the daliuge-pbc PBC implementation on demand
sip/execution_control/processing_controller/scheduler/scheduler.py
sip/execution_control/processing_controller/scheduler/scheduler.py
# coding=utf-8 """Processing Block Scheduler. Implemented with a set of long running threads. """ import datetime import os import sys import time from threading import Thread, active_count import celery from celery.app.control import Inspect from sip_config_db.scheduling import ProcessingBlock, ProcessingBlockList ...
Python
0
@@ -745,16 +745,114 @@ g_block' +%0Aif os.getenv('USE_DLG', None):%0A execution_task_name = 'dlg_pbc.tasks.execute_processing_block' %0A%0Aclass
2a5b373b7efc7a6b1bf9fb93ad348cadae82ab56
Add test for min_sup
tests/test_evaluation/test_TopListEvaluator.py
tests/test_evaluation/test_TopListEvaluator.py
from unittest.mock import patch from nose.tools import raises, assert_equal from numpy.testing import assert_almost_equal import numpy as np from otdet.evaluation import TopListEvaluator class TestInit: def setUp(self): self.sample_result = [ [(5, True), (4, False), (3, True), (2, False), (1...
Python
0
@@ -1760,24 +1760,518 @@ e_result)%0A%0A%0A +class TestMinSup:%0A def setUp(self):%0A self.sample_result = %5B%0A %5B(5, True), (4, False), (3, True), (2, False), (1, False)%5D,%0A %5B(5, False), (4, True), (3, False), (2, True), (1, False)%5D%0A %5D%0A%0A def test_default(sel...
73873d47de67be9ab2b954c2a14c58fb3423fb3b
remove unused imports
txdarn/resources/support.py
txdarn/resources/support.py
import hashlib import datetime import functools import pkgutil from wsgiref.handlers import format_date_time import eliot from twisted.web import resource, template, http from twisted.python.constants import Names, ValueConstant from .. import encoding, compat from . import headers DEFAULT_CACHEABLE_POLICY = header...
Python
0.000001
@@ -59,54 +59,8 @@ util -%0Afrom wsgiref.handlers import format_date_time %0A%0Aim @@ -122,66 +122,8 @@ http -%0Afrom twisted.python.constants import Names, ValueConstant %0A%0Afr
a6cd85878c024e4248ca7b4135c7bf1199600772
Remove derp.
WebMirror/management/SpcnetTvManage.py
WebMirror/management/SpcnetTvManage.py
import calendar import datetime import json import os import os.path import shutil import traceback from concurrent.futures import ThreadPoolExecutor import urllib.error import urllib.parse from sqlalchemy import and_ from sqlalchemy import or_ import sqlalchemy.exc from sqlalchemy_continuum.utils import version_tab...
Python
0.000001
@@ -2811,24 +2811,29 @@ ery(ctbl +.c.id ) %5C%0A%09%09%09. where(ct @@ -2816,37 +2816,38 @@ tbl.c.id) %5C%0A%09%09%09. -wh +filt er -e (ctbl.c.netloc = @@ -2875,13 +2875,14 @@ %09%09%09. -wh +filt er -e (ctb @@ -3054,16 +3054,45 @@ /a%3E%25'))%0A +%09%09print(%22Query:%22)%0A%09%09print(q)%0A %09%09ids =
e83edfa7cd561e8fb4c700ff3cf18a684213dc62
Allow removal of q:lines
txircd/modules/cmd_qline.py
txircd/modules/cmd_qline.py
from twisted.words.protocols import irc from txircd.modbase import Command from txircd.utils import epoch, now, irc_lower, parse_duration, CaseInsensitiveDictionary, VALID_NICKNAME from fnmatch import fnmatch irc.RPL_STATSQLINE = "217" class QlineCommand(Command): def __init__(self): self.banList = CaseInsensitive...
Python
0.000021
@@ -953,16 +953,50 @@ reason)%0A +%09%09else:%0A%09%09%09del self.banList%5Bmask%5D%0A %09%0A%09def p
747013feb65b7c9621234a4f2c808b00f0e6787f
Fix config passing when master pillar is turned off
salt/transport/__init__.py
salt/transport/__init__.py
# -*- coding: utf-8 -*- ''' Encapsulate the different transports available to Salt. Currently this is only ZeroMQ. ''' import salt.payload import salt.auth class Channel(object): @staticmethod def factory(opts, **kwargs): # Default to ZeroMQ for now ttype = 'zeromq' if 'transport_...
Python
0
@@ -404,33 +404,37 @@ ype' in opts -%5B +.get( 'pillar' %5D%5B'master'%5D: @@ -421,26 +421,34 @@ 'pillar' -%5D%5B +, %7B%7D).get( 'master' %5D:%0A @@ -439,17 +439,21 @@ 'master' -%5D +, %7B%7D) :%0A
2159a35811cac75b0c68677fc41443aa8eac6e5b
Stop conn_join from overriding channel restrictions
txircd/modules/conn_join.py
txircd/modules/conn_join.py
from txircd.channel import IRCChannel from txircd.modbase import Module class Autojoin(Module): def joinOnConnect(self, user): if "client_join_on_connect" in self.ircd.servconfig: for channel in self.ircd.servconfig["client_join_on_connect"]: user.join(self.ircd.channels[channel...
Python
0
@@ -286,109 +286,45 @@ ser. -join(self.ircd.channels%5Bchannel%5D if channel in self.ircd.channels else IRCChannel(self.ircd +handleCommand(%22JOIN%22, None , +%5B channel -) +%5D )%0A
493e48ddb52889fcb282b7747e0f5a9c2b541005
Remove internal variables/properties with the reserved words
salt/utils/asynchronous.py
salt/utils/asynchronous.py
# -*- coding: utf-8 -*- ''' Helpers/utils for working with tornado async stuff ''' from __future__ import absolute_import, print_function, unicode_literals import tornado.ioloop import tornado.concurrent import contextlib from salt.utils import zeromq @contextlib.contextmanager def current_ioloop(io_loop): ''' ...
Python
0.000001
@@ -61,24 +61,31 @@ ornado async +hronous stuff%0A'''%0A%0A @@ -701,16 +701,23 @@ async +hronous = Async @@ -787,24 +787,31 @@ ture = async +hronous .async_metho @@ -1257,16 +1257,23 @@ lf.async +hronous = metho @@ -1461,16 +1461,23 @@ = 'async +hronous ':%0A @@ -1529,16 +1529,23 @@ lf.async +hron...
1891946c1d736abb103cff9af561356e551bbd6c
Make hello-world-bot write to a logfile different from the logger bot.
samples/hello-world-bot.py
samples/hello-world-bot.py
# Copyright (c) 2013 Alan McIntyre import decimal import time import btceapi import btcebot class RangeTrader(btcebot.TraderBase): ''' This is a simple trader that handles a single currency pair, selling all available inventory if price is above sell_price, buying with all available funds if price is...
Python
0.000004
@@ -3607,14 +3607,19 @@ en(%22 -logger +hello-world -bot
7d216557c039d482490ad518f4366d09b14af4c0
Convert log likelihood values from mnl_estimate to Python floats.
urbansim/urbanchoice/mnl.py
urbansim/urbanchoice/mnl.py
import numpy as np import pandas as pd import scipy.optimize import pmat from pmat import PMAT # right now MNL can only estimate location choice models, where every equation # is the same # it might be better to use stats models for a non-location choice problem # data should be column matrix of dimensions NUMVARS x...
Python
0.00001
@@ -5820,16 +5820,22 @@ l': +float( l0%5B0%5D%5B0%5D ,%0A @@ -5826,24 +5826,25 @@ oat(l0%5B0%5D%5B0%5D +) ,%0A 'c @@ -5860,16 +5860,22 @@ e': +float( l1%5B0%5D%5B0%5D ,%0A @@ -5870,16 +5870,17 @@ l1%5B0%5D%5B0%5D +) ,%0A @@ -5890,16 +5890,22 @@ ratio': +float( (1 - (l1 @@ -5917,16 +5917,...
142538049bd1bf8ae92c80060435965104ec54bb
Add ability to use the pattern ((args, kwargs), callable) when specifying schema
scrapi/base/transformer.py
scrapi/base/transformer.py
from __future__ import unicode_literals import abc import logging logger = logging.getLogger(__name__) class BaseTransformer(object): __metaclass__ = abc.ABCMeta def transform(self, doc): return self._transform(self.schema, doc) def _transform(self, schema, doc): transformed = {} ...
Python
0.000015
@@ -795,16 +795,124 @@ cs = %5B%5D%0A +%0A if isinstance(l%5B0%5D, tuple) and len(l) == 2:%0A return self._transform_arg_kwargs(l, doc)%0A%0A @@ -1125,16 +1125,750 @@ docs%5D)%0A%0A + def _transform_arg_kwargs(self, l, doc):%0A if len(l%5B0%5D) == 1:%0A if isinstance(l...
213bcd782db44a1765196914c70b6283be2e9032
Add support for detection of gzipped packet traces
util/decode_packet_trace.py
util/decode_packet_trace.py
#!/usr/bin/env python # Copyright (c) 2013-2014 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implement...
Python
0
@@ -2558,16 +2558,28 @@ 0000,0%0A%0A +import gzip%0A import p @@ -3487,24 +3487,465 @@ )%0A%0A try:%0A + # First see if this file is gzipped%0A try:%0A # Opening the file works even if it is not a gzip file%0A proto_in = gzip.open(sys.argv%5B1%5D, 'rb')%0A%0A # Force...
465c1c1c9d7c102b4d35eb8c228565dbf8d35910
simplify the code
util/remaining-gnu-error.py
util/remaining-gnu-error.py
#!/usr/bin/env python3 # This script lists the GNU failing tests by size # Just like with util/run-gnu-test.sh, we expect the gnu sources # to be in ../ import urllib.request import urllib import os import glob import json base = "../gnu/tests/" urllib.request.urlretrieve( "https://raw.githubusercontent.com/uutil...
Python
0.000677
@@ -389,110 +389,37 @@ )%0A%0At -est +ype s = -glob.glob(base + %22/*/*.sh%22)%0Atests_pl = glob.glob(base + %22/*/*.pl%22)%0Atests_xpl = glob.glob(base + +(%22/*/*.sh%22, %22/*/*.pl%22, %22/* @@ -427,24 +427,25 @@ *.xpl%22)%0A +%0A tests = tests + @@ -440,37 +440,72 @@ s = -tests + tests_pl + tests_xpl%0A ...
b2a4967e956c07831516d90411f16d9f46a62cfb
Update script for py3 and cross-platform TMPDIR access
scripts/avogadro-remote.py
scripts/avogadro-remote.py
#!/usr/bin/python import sys import json import time import socket import struct class Connection: def __init__(self, name = "avogadro"): # create socket self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) # connect self.sock.connect("/tmp/" + name) def se...
Python
0
@@ -12,16 +12,55 @@ python%0A%0A +from __future__ import print_function%0A%0A import s @@ -113,16 +113,32 @@ t struct +%0Aimport tempfile %0A%0Aclass @@ -347,15 +347,35 @@ ect( -%22/tmp/%22 +tempfile.gettempdir() + '/' + n @@ -548,16 +548,32 @@ dr + msg +.encode('ascii') %0A sel @@ -811,17 +811,17 @@ p...
0b038b8348de12eab4396cbae69095ff54407075
update SHEF soilm code to MV for ISUSM
scripts/isuag/isusm2rr5.py
scripts/isuag/isusm2rr5.py
"""Create the RR5 SHEF product that the Weather Bureau Desires Run from RUN_20_AFTER.sh """ import subprocess import datetime import os import unittest import tempfile import numpy as np from pyiem.util import get_dbconn from pyiem.tracker import loadqc def mt(prefix, tmpf, depth, q): """Properly encode a valu...
Python
0
@@ -135,24 +135,8 @@ os%0A -import unittest%0A impo @@ -1882,33 +1882,33 @@ mt(%22M -W +V %22, max(%5B0, 0 if @@ -1956,33 +1956,33 @@ mt(%22M -W +V %22, max(%5B0, 0 if @@ -2038,17 +2038,17 @@ mt(%22M -W +V %22, max(%5B @@ -2476,119 +2476,8 @@ )%0A%0A%0A -if __name__ == %22__main__%2...
3772b05552c16d82b8a8e5e634a0249047e230ed
use standard exclude patterns as overridable default in cystdlib.py
Tools/cystdlib.py
Tools/cystdlib.py
""" Highly experimental script that compiles the CPython standard library using Cython. Execute the script either in the CPython 'Lib' directory or pass the option '--current-python' to compile the standard library of the running Python interpreter. Pass '-j N' to get a parallel build with N processes. Usage example...
Python
0
@@ -2426,14 +2426,8 @@ s or - ()) + exc @@ -2439,16 +2439,17 @@ patterns +) + broke
5489fe0abc5dda3b6d41bee368cd0b9727459af3
Add search urls for projects
projects/urls.py
projects/urls.py
from django.conf.urls import patterns, url urlpatterns = patterns('projects.views', url(r'^add/$', 'add_project', name='add-project'), url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'), url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'), url(r'^archive...
Python
0
@@ -676,10 +676,467 @@ onth'),%0A + url(r'%5Esearch/user/(?P%3Csearched_creator%3E%5Cd*)/$', 'projects_by_creator', name='projects-by-creator'),%0A url(r'%5Esearch/status/(?P%3Csearched_status%3E.*)/$', 'projects_by_status', name='projects-by-status'),%0A url(r'%5Esearch/name/(?P%3Csearched_name%3E.*)/$', 'pr...
35b0af0fafb117e3cc613d3073602902fadb9c5c
Add daily-view to worker
server/worker/functions.py
server/worker/functions.py
import logging import time from django.db import connection from server.models import SensorValue, Threshold, Notification import functions logger = logging.getLogger('worker') def check_thresholds(): for threshold in Threshold.objects.all(): try: latest_sensorvalue = SensorValue.objects.fi...
Python
0.000001
@@ -1694,24 +1694,101 @@ hourly;''')%0A + cursor.execute('''REFRESH MATERIALIZED VIEW server_sensorvaluedaily;''')%0A cursor.e @@ -1957,20 +1957,16 @@ vg;''')%0A - %0A log @@ -2006,9 +2006,8 @@ views') -%0A
13bb0a7ea546fed050b68c73730384c168370ac3
Add typing for plogger.
ptest/plogger.py
ptest/plogger.py
import logging import sys from datetime import datetime from . import config class PConsole: def __init__(self, out): self.out = out def write(self, msg): self.out.write(str(msg)) def write_line(self, msg): self.out.write(str(msg) + "\n") pconsole = PConsole(sys.stdout) pconso...
Python
0
@@ -157,32 +157,37 @@ write(self, msg +: str ):%0A self. @@ -235,16 +235,21 @@ elf, msg +: str ):%0A @@ -425,32 +425,37 @@ debug(self, msg +: str , screenshot=Fal @@ -442,33 +442,41 @@ str, screenshot -= +: bool = False):%0A @@ -533,32 +533,37 @@ f info(self, msg +: str , screenshot=Fa...
3b5b3afbc66f60df45f0458ffdd0d37b9a7c50d0
Add homemade fast width/height reader for JPEG files
ptoolbox/tags.py
ptoolbox/tags.py
# -*- coding: utf-8 -*- from datetime import datetime TAG_WIDTH = 'EXIF ExifImageWidth' TAG_HEIGHT = 'EXIF ExifImageLength' TAG_DATETIME = 'Image DateTime' def parse_time(tags): tag = tags.get(TAG_DATETIME, None) if not tag: raise KeyError(TAG_DATETIME) return datetime.strptime(str(tag), "%Y:%m:%...
Python
0
@@ -18,16 +18,30 @@ -8 -*-%0A%0A +import struct%0A from dat @@ -166,16 +166,653 @@ eTime'%0A%0A +%0Adef jpeg_size(path):%0A %22%22%22Get image size.%0A Structure of JPEG file is:%0A ffd8 %5BffXX SSSS DD DD ...%5D %5BffYY SSSS DDDD ...%5D (S is 16bit size, D the data)%0A We look for the SOF0 header 0...
7a64ac255f53e85f888093daac83b3c0fabcf15e
Update ESPEC_tests.py
ESPEC_tests.py
ESPEC_tests.py
# -*- coding: utf-8 -*- """ESPEC_tests.py: Simple test routine for pyESPEC library __author__ = "Jason M. Battle" __copyright__ = "Copyright 2016, Jason M. Battle" __license__ = "MIT" __email__ = "jason.battle@gmail.com" """ from ESPEC import SH241 if __name__ == '__main__': test = SH241() tes...
Python
0
@@ -1522,16 +1522,22 @@ CloseChannel()%0D%0A + %0D%0A
d177977ed4da7168e1d04b5420e224bb3b75a4fc
Use StringIO from six & remove trailing space in test file
src/azure/cli/tests/test_commands.py
src/azure/cli/tests/test_commands.py
import os import sys import unittest import re import vcr import logging from six import add_metaclass try: import unittest.mock as mock except ImportError: import mock try: # Python 3 from io import StringIO except ImportError: # Python 2 from StringIO import StringIO from azure.cli.main imp...
Python
0
@@ -96,16 +96,26 @@ etaclass +, StringIO %0Atry:%0A @@ -186,126 +186,8 @@ ck%0A%0A -try:%0A # Python 3%0A from io import StringIO%0Aexcept ImportError:%0A # Python 2%0A from StringIO import StringIO%0A%0A from @@ -1743,24 +1743,16 @@ True%7D%5D;%0A - %0A @@ -1975,12 +1975,12 @@ ...
72d905e1e4098cf929213f59662c0c3090fd93cf
remove debug print
pyast/dump/js.py
pyast/dump/js.py
import json import pyast from collections import OrderedDict import sys if sys.version >= '3': basestring = str else: pass def _dump_node_name(node): return node.__class__.__name__.lower() def _dump_node(node, name=None, indent=0): if isinstance(node, basestring): return node elif isins...
Python
0.000008
@@ -920,24 +920,8 @@ st)%0A - print(json)%0A
c5b7db285508b14cd19c79b46ddbde8dfcc92acb
Update type mappings
pyathena/util.py
pyathena/util.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import functools import logging import threading import re import uuid import tenacity from past.builtins import xrange from tenacity import (after_log, retry_if_exception, stop_after_attempt, ...
Python
0
@@ -1976,16 +1976,71 @@ ESTAMP'%0A + elif col_type == 'timedelta':%0A return 'INT'%0A elif @@ -2494,16 +2494,80 @@ == ' -complex' +bytes':%0A return 'BINARY'%0A elif col_type in %5B'complex', 'time'%5D :%0A @@ -2594,15 +2594,11 @@ or(' -Complex +%7B0%7D dat @@ -2617,16 +2617,33 @@ ppor...
c46e472755c7b7dd450626e136f31a29ca9a5321
Fix a regression in accessing the username for the session.
rbtools/utils/users.py
rbtools/utils/users.py
from __future__ import unicode_literals import getpass import logging import sys from six.moves import input from rbtools.api.errors import AuthorizationError from rbtools.commands import CommandError def get_authenticated_session(api_client, api_root, auth_required=False): """Return an authenticated session. ...
Python
0.003157
@@ -1347,16 +1347,33 @@ n.user%0A%0A + return None%0A%0A %0Adef get @@ -1489,43 +1489,23 @@ +u se -ssion +r = get_ -authenticated_session +user (api @@ -1538,39 +1538,36 @@ quired)%0A%0A if +u se -ssion +r :%0A return @@ -1571,29 +1571,35 @@ urn +u se -ssion.links.user.titl +r.username%0...
73a6ad619448c3b3be44538e2f1853479208ac62
Remove vestiges of python2 prints in docstrings
pyee/__init__.py
pyee/__init__.py
# -*- coding: utf-8 -*- """ pyee supplies an ``EventEmitter`` object similar to the ``EventEmitter`` from Node.js. It supports both synchronous callbacks and asyncio coroutines. Example ------- :: In [1]: from pyee import EventEmitter In [2]: ee = EventEmitter() In [3]: @ee.on('event') ...: de...
Python
0.000005
@@ -353,17 +353,17 @@ print - +( 'BANG BA @@ -365,16 +365,17 @@ NG BANG' +) %0A
2beb589edc2f7b57be0d6a559e2f29471490bc91
FIX py2 support!
pyfaker/utils.py
pyfaker/utils.py
import re import random import os import json from string import Formatter class BaseFake(object): pass class CallFormatter(Formatter): def get_field(self, field_name, *args, **kwargs): obj, used_key = Formatter.get_field(self, field_name, *args, **kwargs) return obj(), used_key ''' class C...
Python
0
@@ -1262,16 +1262,20 @@ return +str( s.title( @@ -1292,16 +1292,17 @@ '_', '') +) # assu
cb4a35ac7ff107a99d5d637a193715776918597d
Fix dictionary merging for Python 3
kafka_influxdb/config/loader.py
kafka_influxdb/config/loader.py
from . import default_config import yaml import logging import argparse import collections import sys class ObjectView(object): def __init__(self, d): self.__dict__ = d def load_config(): """ Load settings from default config and optionally overwrite with config file and commandline paramete...
Python
0.000144
@@ -1516,17 +1516,17 @@ items() -+ +%7C new_val
960816cb708c6bd6b1de8aa9c29758e327784f13
kill an io_loop check
pyfire/server.py
pyfire/server.py
from datetime import datetime import errno import fcntl import os import socket import sys import traceback import threading import xml.etree.ElementTree as ET from zmq.eventloop import ioloop from tornado import iostream from pyfire import configuration as config from pyfire.errors import XMPPProtocolError from pyfi...
Python
0.000002
@@ -594,16 +594,44 @@ io_loop + or ioloop.IOLoop.instance() %0A @@ -3637,89 +3637,8 @@ ted%0A - if not self.io_loop:%0A self.io_loop = ioloop.IOLoop.instance()%0A
24d886b97e6ce1636e95f3c1bde7c889cf622a7c
Change string to byte conversion
pyglet/compat.py
pyglet/compat.py
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
Python
0.000358
@@ -2898,31 +2898,117 @@ -return s.encode(%22utf-8%22 +elif isinstance(s, str):%0A return bytes(ord(c) for c in s)%0A else:%0A return bytes(s )%0A
0419012e15fc2f68d90fcaaefda4cee8ea3ef8df
Make cookie loading a little more pythonic.
pyicloud/base.py
pyicloud/base.py
import uuid import hashlib import json import logging import pickle import requests import sys import tempfile import os from re import match from pyicloud.exceptions import PyiCloudFailedLoginException from pyicloud.services import ( FindMyiPhoneServiceManager, CalendarService, UbiquityService, Contac...
Python
0
@@ -3479,55 +3479,8 @@ e = -self.user.get('apple_id')%0A cookiefile = os.p @@ -3488,16 +3488,29 @@ th.join( +%0A self._co @@ -3524,16 +3524,28 @@ rectory, +%0A ''.join @@ -3561,41 +3561,92 @@ in -cookiefile if match(r'%5Cw', c)%5D))%0A +self.user.get('apple_id') if match(r'%5Cw...
adb0922e8f6b7f69b047c62407429ec33e025320
Delete additional "o" in "builder" object
litex_boards/targets/digilent_basys3.py
litex_boards/targets/digilent_basys3.py
#!/usr/bin/env python3 # # This file is part of LiteX-Boards. # # Copyright (c) 2020-2021 Xuanyu Hu <xuanyu.hu@whu.edu.cn> # SPDX-License-Identifier: BSD-2-Clause from migen import * from litex_boards.platforms import basys3 from litex.soc.cores.clock import * from litex.soc.integration.soc import SoCRegion from li...
Python
0
@@ -4512,17 +4512,16 @@ tstream( -o builder.
be3f26c6f3401290e1bee726f0977cab78bdd61c
Allow unset viewport in lg_earth::client
lg_earth/src/lg_earth/client.py
lg_earth/src/lg_earth/client.py
import os import shutil import threading import xml.etree.ElementTree as ET from xml.dom import minidom from tempfile import gettempdir as systmp import rospy from lg_common.msg import ApplicationState, WindowGeometry from lg_common import ManagedApplication, ManagedWindow from client_config import ClientConfig TOOLB...
Python
0.000001
@@ -425,16 +425,53 @@ metry()%0A + if geometry is not None:%0A @@ -499,16 +499,20 @@ _HEIGHT%0A +
cf644a17bd8c2abe436a37159bdf3eec7d2a358d
Remove premature optimization
luigi/tasks/quickgo/load_annotations.py
luigi/tasks/quickgo/load_annotations.py
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
Python
0.000015
@@ -1625,40 +1625,240 @@ -extensions = excluded.extensions +rna_id = excluded.rna_id,%0A qualifier = excluded.qualifier,%0A assigned_by = excluded.assigned_by,%0A extensions = excluded.extensions,%0A ontology_term_id = excluded.ontology_term_id,%0A evidence_code = excluded.evidence_code %0A;%0A$
625839a284085e92855b52aaa4abbf0f30d66bb2
pretty_output().header
qaamus/qaamus.py
qaamus/qaamus.py
import unittest import requests from bs4 import BeautifulSoup from ind_ara_parser import IndAraParser class Qaamus: def terjemah(self, layanan, query): """ Return terjemahan tergantung dengan **layanan** apa yang dia pilih, dan **query** apa yang dia pakai. Adapun *layanan* di [Qa...
Python
0.999995
@@ -97,16 +97,954 @@ arser%0A%0A%0A +class pretty_output(object):%0A def __init__(self, dict_obj):%0A self.dict_obj = dict_obj%0A%0A @property%0A def header(self):%0A return %22-= Arti dari %7Bind_utama%7D =-%22.format(%0A ind_utama=self.dict_obj.get(%22utama%22).get(%22ind%22))%0...
4a246381f04b13ed71e098bbeb019b6d1e19dc32
Update about.py
quantum/about.py
quantum/about.py
# -*- coding: utf-8 -*- # This file is part of Quantum. # # Copyright (c) 2017, Diego Nicolás Bernal-García # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribution...
Python
0
@@ -3988,17 +3988,17 @@ nal-Garc -i +%C3%AD a%22))%0A
23ab13f192b58f8b550aa2e16d5861e14535698a
Add slot fot empty_patch in cli pop command
quilt/cli/pop.py
quilt/cli/pop.py
# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80: # python-quilt - A Python implementation of the quilt patch system # # Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.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 ...
Python
0
@@ -1389,16 +1389,66 @@ applied) +%0A pop.empty_patch.connect(self.empty_patch) %0A%0A @@ -1837,28 +1837,137 @@ atch %25s%22 %25 patch.get_name()%0A +%0A def empty_patch(self, patch):%0A print %22Patch %25s appears to be empty, removing%22 %25 patch.get_name()%0A
8058430bc32b01d7026f0a80c40a83181adcb90f
handle utf-8 encodings
EsFormatter.py
EsFormatter.py
import sublime, sublime_plugin, subprocess, threading, json, re, platform, sys, os ON_WINDOWS = platform.system() is 'Windows' ST2 = sys.version_info < (3, 0) NODE = None if not ON_WINDOWS: # Extend Path to catch Node installed via HomeBrew os.environ['PATH'] += ':/usr/local/bin' class EsformatterCommand(sub...
Python
0.000002
@@ -857,32 +857,48 @@ Call(textContent +.encode('utf-8') , format_options @@ -1351,32 +1351,48 @@ Call(textContent +.encode('utf-8') , format_options @@ -5445,16 +5445,32 @@ stdout) +.decode('utf-8') %0A @@ -5546,17 +5546,8 @@ code -.encode() )%0A
2c386cc3e81caffd906b68a6d527bd8bdd1d5ae5
Replace nltk.model.NgramModel with nltk.ngrams
marmot/features/lm_feature_extractor.py
marmot/features/lm_feature_extractor.py
from nltk.model import NgramModel from marmot.features.feature_extractor import FeatureExtractor from marmot.util.simple_corpus import SimpleCorpus def check_lm_recursive(words, lm, low_order='left'): if len(words) < lm._n: return check_lm_recursive(words, lm._backoff, low_order=low_order) if tuple(words...
Python
0.999998
@@ -1,12 +1,52 @@ +from nltk import ngrams, word_tokenize%0A# from nltk.mo @@ -187,468 +187,8 @@ us%0A%0A -def check_lm_recursive(words, lm, low_order='left'):%0A if len(words) %3C lm._n:%0A return check_lm_recursive(words, lm._backoff, low_order=low_order) %0A%0A if tuple(words) in lm._ngrams:%0A return l...
e7885d37503888f0b42007622ef1af31f7302ebe
fix typo
corehq/apps/export/const.py
corehq/apps/export/const.py
""" Some of these constants correspond to constants set in corehq/apps/export/static/export/js/const.js so if changing a value, ensure that both places reflect the change """ from couchexport.deid import ( deid_ID, deid_date ) from corehq.apps.export.transforms import ( case_id_to_case_name, user_id_to_...
Python
0.999991
@@ -2635,10 +2635,10 @@ shou -d l +d be
7a5abe865ca66c3cc13d830f3d967217aca6db68
Improve listener organization
microcosm_postgres/encryption/models.py
microcosm_postgres/encryption/models.py
""" Encryption-related models. """ from typing import Sequence, Tuple from sqlalchemy import Column, LargeBinary, String from sqlalchemy.event import contains, listen, remove from sqlalchemy.dialects.postgresql import ARRAY from microcosm_postgres.encryption.encryptor import Encryptor def on_init(target: "Encrypta...
Python
0.000002
@@ -787,16 +787,17 @@ operty.%0A +%0A %22%22%22%0A @@ -3570,63 +3570,199 @@ # -remove any existing registrations for the same func +NB: we cannot use the before_insert listener in conjunction with a foreign key relationship%0A # for encrypted data; SQLAlchemy will warn about using 'related attribute se...
5d393ff5c007bafb731aaf703a5225081b99f69a
Align the add/remove URL with the filter URL
cotracker/cotracker/urls.py
cotracker/cotracker/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from checkouts.views import ( PilotList, PilotDetail, AirstripList, AirstripDetail, BaseList, BaseAttachedDetail, BaseUnattachedDetail, FilterFormView, CheckoutUpdat...
Python
0.00003
@@ -1453,22 +1453,30 @@ egex=r'%5E -update +checkouts/edit /$',%0A%09vi
a40ae461472559e2b8740ff1be0b1205254520a1
Add a manager to centralize webhook API calls
shopify/webhooks/models.py
shopify/webhooks/models.py
from __future__ import unicode_literals import logging import uuid from django.contrib.sites.models import Site from django.db import models from django.utils.encoding import python_2_unicode_compatible import requests from .utils import shopify_api logger = logging.getLogger(__name__) @python_2_unicode_compati...
Python
0.000001
@@ -288,16 +288,233 @@ me__)%0A%0A%0A +class WebhookManager(models.Manager):%0A def register(self):%0A for webhook in self.all():%0A webhook.register()%0A%0A def remove(self):%0A for webhook in self.all():%0A webhook.remove()%0A%0A%0A @python_ @@ -2049,16 +2049,48 @@ %0A ...
220f4f7d2d5e94760576cddb607478ef7345a901
add xtheme plugin to render only products which have discount
shuup/discounts/plugins.py
shuup/discounts/plugins.py
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from django import forms from django.db.models import Q from djang...
Python
0
@@ -3078,16 +3078,38 @@ counts%22) +%0A products = %5B%5D %0A%0A @@ -3570,48 +3570,8 @@ ers) -%0A else:%0A products = %5B%5D %0A%0A