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
8717fd790a2c3e15597b1088d64cad448d6a1704
Raise an exception to kill the deploy if we can't connect to a host when trying to get a fact from it.
pyinfra/api/host.py
pyinfra/api/host.py
# pyinfra # File: pyinfra/api/host.py # Desc: thin class that represents a target host in pyinfra from __future__ import unicode_literals import click from .attrs import wrap_attr_data from .connectors import EXECUTION_CONNECTORS from .facts import get_fact, is_fact class HostFacts(object): def __init__(self, ...
Python
0
@@ -226,16 +226,53 @@ NECTORS%0A +from .exceptions import PyinfraError%0A from .fa @@ -300,16 +300,16 @@ is_fact%0A - %0A%0Aclass @@ -596,32 +596,45 @@ onnected%0A + connection = self.host.conne @@ -673,16 +673,323 @@ t=key)%0A%0A + # If we can't connect - fail immediately as we specifically need...
63bf6eede5fe3b9c5e9e4f5548b8e3b3032df50d
remove telegram username requirement
commands/cmd_lastfm.py
commands/cmd_lastfm.py
import pylast from lib.command import Command from lib.utils import escape_telegram_html SET_STRINGS = [ '-s', '-set', '--set', 'set' ] class LastFMCommand(Command): name = 'lastfm' aliases = ['np', 'nowplaying'] description = 'Post your currently playing song.' has_database = True def run(s...
Python
0.000002
@@ -524,166 +524,8 @@ rn%0A%0A - if not message.from_user.username:%0A self.reply(message, 'You do not have a Telegram username I can use with last.fm!')%0A return%0A%0A
740a06df7e92ff53c9b5a66c06f97476193b8799
add an example for the marker usage
micropsi_core/tests/test_node.py
micropsi_core/tests/test_node.py
#!/usr/local/bin/python # -*- coding: utf-8 -*- """ Tests for node, nodefunction and the like """ from micropsi_core.nodenet.node import Nodetype from micropsi_core.nodenet.nodefunctions import concept from micropsi_core import runtime as micropsi def test_nodetype_function_definition_overwrites_default_function_na...
Python
0.000002
@@ -188,16 +188,26 @@ s import + register, concept @@ -253,17 +253,606 @@ icropsi%0A -%0A +import pytest%0A%0A%0A@pytest.mark.engine(%22theano_engine%22)%0Adef test_nodetype_function_definition_overwrites_default_function_name_theano(fixed_nodenet):%0A nodenet = micropsi.get_nodenet(fixed_nodenet)%0A nodetype...
3a61b480285c5a7d0f99ae91fbd278679444c0c3
add some comments
tornadis/pool.py
tornadis/pool.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of tornadis library released under the MIT license. # See the LICENSE file for more information. import tornado.gen import toro import functools from collections import deque from tornadis.client import Client from tornadis.utils import ContextManage...
Python
0
@@ -378,113 +378,345 @@ t):%0A -%0A -max_size = None%0A client_kwargs = None%0A read_callback = None%0A __sem = None%0A +%22%22%22High level object to deal with a pool of redis clients%0A%0A Attributes:%0A client_kwargs (dict): Client constructor arguments%0A __sem (toro.Semaphore): Sem...
51814e57103e75deaec11af81d85d13ed80ec594
Bump version number to 0.2
fuel/version.py
fuel/version.py
version = '0.1.1'
Python
0.000518
@@ -10,9 +10,9 @@ '0. -1.1 +2.0 '%0A
d6a0ce5a1fe3d659ecbbe05e5178df663ccd3933
fix edge cases with the dictionary search
pyscp_bot/search.py
pyscp_bot/search.py
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import googleapiclient.discovery as googleapi import wikipedia import warnings import requests import bs4 from . impo...
Python
0.000032
@@ -3342,111 +3342,376 @@ el -se:%0A output.append('%7B%7D. %7B%7D'.format(idx, line.text.strip().lstrip('%C2%B0')))%0A idx += 1 +if 'entry' in line%5B'class'%5D:%0A text = line.find(class_='definition').text.strip().lstrip('%C2%B0')%0A output.append('%7B%7D. %7B%7D'.forma...
4932b035648a1d8674e73796afba7b2d68b309dc
Implement registration timeouts and pinging for servers
txircd/server.py
txircd/server.py
from twisted.internet.defer import Deferred from twisted.words.protocols.irc import IRC class IRCServer(IRC): def __init__(self, ircd, ip): self.ircd = ircd self.serverID = None self.name = None self.ip = ip self.remoteServers = {} self.nextClosest = self.ircd.server...
Python
0
@@ -1,20 +1,57 @@ +from twisted.internet import reactor%0A from twisted.interne @@ -74,16 +74,62 @@ eferred%0A +from twisted.internet.task import LoopingCall%0A from twi @@ -482,57 +482,200 @@ -# TODO: ping%0A # TODO: registration timeout +self._pinger = LoopingCall(self._ping)%0A self._registrat...
6b45a9b00be12b2ce69736c21759e7deb1075a66
Add a server connect action
txircd/server.py
txircd/server.py
from twisted.internet import reactor from twisted.internet.defer import Deferred from twisted.internet.task import LoopingCall from twisted.words.protocols.irc import IRC class IRCServer(IRC): def __init__(self, ircd, ip): self.ircd = ircd self.serverID = None self.name = None self....
Python
0.000001
@@ -2989,16 +2989,75 @@ serverID +%0A self.ircd.runActionStandard(%22serverconnect%22, self) %0A%0Aclass
72ce164a461987f7b9d35ac9a2b3a36386b7f8c9
Add possibility of passing priority for adding an observer
ui/Interactor.py
ui/Interactor.py
""" Interactor This class can be used to simply managing callback resources. Callbacks are often used by interactors with vtk and callbacks are hard to keep track of. Use multiple inheritance to inherit from this class to get access to the convenience methods. Observers for vtk events can be added through AddObserver...
Python
0
@@ -614,16 +614,31 @@ Function +, priority=None ):%0A%09%09%22%22%22 @@ -813,16 +813,121 @@ s = %5B%5D%0A%0A +%09%09if priority is not None:%0A%09%09%09callback = obj.AddObserver(eventName, callbackFunction, priority)%0A%09%09else:%0A%09 %09%09callba
101d96ae4edb1d7d7b81abed5555e37203dc0553
Removed unnecessary method.
umpa/_packets.py
umpa/_packets.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008 Adriano Monteiro Marques. # # Author: Bartosz SKOWRON <getxsick at gmail dot com> # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Softwa...
Python
0.99952
@@ -3373,168 +3373,8 @@ ()%0A%0A - def print_protocols(self):%0A %22%22%22%0A Print all included protocols into the packet.%0A %22%22%22%0A for p in self.protos:%0A print p%0A%0A
5132e2e8e3038a433ad332d19ff180f2dd45ae67
Fix Flake8 being annoying
cogs/utils/checks.py
cogs/utils/checks.py
import discord from discord.ext import commands # noinspection PyUnresolvedReferences import __main__ def owner_check(ctx): return str(ctx.message.author.id) in __main__.liara.owners def is_owner(): return commands.check(owner_check) def is_bot_account(): def predicate(ctx): return ctx.bot.use...
Python
0
@@ -3882,16 +3882,17 @@ icate)%0A%0A +%0A # deal w
85c3277f7ce86c6e67282a3123a5fb5331322de5
Increase the dataIO delay for mutables
cogs/utils/dataIO.py
cogs/utils/dataIO.py
import json import threading import time # noinspection PyUnresolvedReferences import __main__ import dill class RedisDict(dict): def __init__(self, key, redis, pubsub_namespace='liara'): super().__init__() self.key = key self.redis = redis self.die = False self._ready = t...
Python
0.000001
@@ -2211,17 +2211,16 @@ sleep(0. -0 1)%0A%0A
5fc75cda8c56145ee803943f018420620db186db
add history command
pytify/commander.py
pytify/commander.py
from __future__ import absolute_import, unicode_literals class Commander(): def __init__(self, Pytifylib): self.pytify = Pytifylib def parse(self, command): if command[0] != '/': return '' command = command.replace('/', '') return command def commands(self):...
Python
0.000006
@@ -586,16 +586,67 @@ : 'stop' +,%0A 'history': 'last five search results' %0A @@ -1581,16 +1581,91 @@ stop()%0A%0A + elif command == 'history':%0A self.pytify.print_history()%0A %0A
fb9e6ebae7334de102ff88ce2aacb53601557150
change to hashed ID for shard key
src/time_inserts.py
src/time_inserts.py
# -*- encoding: utf-8 -*- # # Copyright © 2013 Rackspace Hosting # # Author: Thomas Maddox <thomas.maddox@rackspace.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.ap...
Python
0.000001
@@ -1416,17 +1416,24 @@ %7B'_id': -1 +%22hashed%22 %7D)%0A
23950fc5fd665f6ad1887cf83b5439aa86b25024
Add steering error to status, switch sign of steering error.
collision_control.py
collision_control.py
from random import random from math import pi from utils import wrap_radians class CollisionController: def __init__(self, state, controls, speed_control): self.vstate = state self.controls = controls self.speed_control = speed_control self.auto_steer = True self.target_he...
Python
0
@@ -466,16 +466,52 @@ p = 1.0%0A +%0A self.last_steer_error = 0%0A%0A %0A de @@ -2327,80 +2327,136 @@ elf. -controls.set_steer(self.Kp*(wrap_radians(heading - self.target_heading)) +last_steer_error = wrap_radians(self.target_heading - heading)%0A self.controls.set_steer(self.Kp*self.last_steer...
ec6da2c989fc80dff69432ca43f81c0e1334b995
Work around Python 2.4 exception hierarchy problem
pyxb/exceptions_.py
pyxb/exceptions_.py
# Copyright 2009, Peter A. Bigot # # 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 ...
Python
0.000005
@@ -1659,52 +1659,206 @@ -super(SchemaUniquenessError, self).__init__( +# Prior to 2.5, exceptions did not inherit from object, and%0A # super could not be used.%0A #super(SchemaUniquenessError, self).__init__(*args, **kw)%0A PyXBException.__init__(self, *arg
2370c601f087e0d342287c400654a9ceab22c504
Add function to send email from a template
radar/radar/mail.py
radar/radar/mail.py
import smtplib from email.mime.text import MIMEText, MIMEMultipart from flask import current_app COMMA_SPACE = ', ' def send_email(to_addresses, subject, message_plain, message_html=None, from_address=None): if from_address is None: from_address = current_app.config.get('FROM_ADDRESS', 'bot@radar.nhs.uk...
Python
0.000001
@@ -1015,8 +1015,437 @@ tring()%0A +%0A%0Adef send_email_from_template(to_addresses, subject, template_name, context, from_address=None):%0A template_path_plain = 'email/%25s.txt' %25 template_name%0A template_path_html = 'email/%25s.html' %25 template_name%0A%0A message_plain = render_template(template_path_...
281cf28a3eb64442957ce76d5681c4fba9c66d23
Update corpus docstring (no need to fit dictionary first).
glove/corpus.py
glove/corpus.py
# Cooccurrence matrix construction tools # for fitting the GloVe model. try: # Python 2 compat import cPickle as pickle except ImportError: import pickle from .corpus_cython import construct_cooccurrence_matrix class Corpus(object): """ Class for constructing a cooccurrence matrix from a cor...
Python
0
@@ -559,53 +559,8 @@ . %0A%0A - You must call fit_dictionary first.%0A%0A
7919ee8374b3f3d15d45ee04f50c1de82f91b19d
Implement authentication and added resources
gooee/client.py
gooee/client.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from platform import platform import requests from .compat import json from .exceptions import ( IllegalHttpMethod, ) from . import __version__ from .utils import ( format_path, GOOEE_API_URL ) class Gooee(object): """Gooee HTTP client ...
Python
0
@@ -130,16 +130,49 @@ rt json%0A +from .decorators import resource%0A from .ex @@ -432,21 +432,8 @@ elf, - oauth_token, api @@ -475,74 +475,318 @@ elf. -oauth_token = oauth_token%0A self.api_base_url = api_base_url +api_base_url = api_base_url%0A self.auth_token = ''%0A%0A def authenticate(self, ...
5ae3172898b65c3a63c85cecb4355ccf8cb34e54
raise error if no file is provided
rasa_core/config.py
rasa_core/config.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from typing import Optional, Text, Dict, Any, List from rasa_core import utils from rasa_core.policies import PolicyEnsemble def load(config_file): # type: (Option...
Python
0.000001
@@ -569,17 +569,40 @@ %22%22%22%0A -%0A + if config_file:%0A conf @@ -644,16 +644,88 @@ ig_file) +%0A else:%0A raise ValueError(%22You have to provide a config file%22) %0A%0A re
55c52e7a20ac24e65f6d741b761f5c532a2365c5
Fix for python 2.6 support on datetime.total_seconds method
ratelim/__init__.py
ratelim/__init__.py
from __future__ import print_function import time import datetime from decorator import decorator __author__ = "Antonio Lima" __author_email__ = "anto87@gmail.com" __license__ = "MIT" __copyright__ = "Copyright (c) 2013-2014 Antonio Lima" class greedy(object): def __init__(self, max_calls, time_interval): ...
Python
0.000002
@@ -236,16 +236,294 @@ Lima%22%0A%0A +def total_seconds(dt):%0A # Keep backward compatibility with Python 2.6 which doesn't have%0A # this method%0A if hasattr(dt, 'total_seconds'):%0A return dt.total_seconds()%0A else:%0A return (dt.microseconds + (dt.seconds + dt.days * 24 * 3600) * 10**6)...
d593d3d8f8487cdc933c088a83b632b4baaf8e8a
add fsType to config.file
rbh_quota/config.py
rbh_quota/config.py
#!/usr/bin/env python import ConfigParser import socket from os.path import expanduser Config = ConfigParser.ConfigParser() Config.read(expanduser('~/.rbh-quota.ini')) try: db_host = Config.get('rbh-quota_api', 'db_host') except: db_host = '' try: db_user = Config.get('rbh-quota_api', 'db_user') except: ...
Python
0.000001
@@ -477,24 +477,105 @@ db = ''%0A%0A +try:%0A fsType = Config.get('rbh-quota_api', 'fsType')%0Aexcept:%0A fsType = ''%0A%0A try:%0A ale
2b724f32ecd311ce526b433ec81399c7a8e8e202
Update settings.py
gui/settings.py
gui/settings.py
Python
0.000001
@@ -1 +1,220 @@ %0A +%22%22%22%0ADit is het bestand voor het aanpassen van instellingen scherm voor de Agenda-App%0AHet heeft een aantal functies en dezen staat beschreven in de drive.%0A%0A%3CLICENSE%3E%0A%3CCOPYRIGHT NOTICE%3E%0A%3CDEVELOPER%3E%0A%3CVERSION and DATE%3E%0A%22%22%22%0A
5a5d2e4c88e938431be8e2d082cbbf8f4a830df2
Make RunProxy independent of Run
guild/remote.py
guild/remote.py
# Copyright 2017-2018 TensorHub, 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 writ...
Python
0
@@ -694,40 +694,8 @@ pref -%0Afrom guild import run as runlib %0A%0Acl @@ -1602,18 +1602,14 @@ oxy( -runlib.Run +object ):%0A%0A @@ -1651,204 +1651,680 @@ s -uper(RunProxy, self).__init__(data%5B%22id%22%5D, data%5B%22run_dir%22%5D)%0A self._data = data%0A self.opref = opref.OpRef.from_run(self)%0...
4a4fcd362865bb8ae0d23f9232e9e2e4c3cef0a0
Add error check for body
src/poliastro/twobody/mean_elements.py
src/poliastro/twobody/mean_elements.py
import erfa from astropy import units as u from astropy.coordinates.solar_system import PLAN94_BODY_NAME_TO_PLANET_INDEX from ..constants import J2000 from ..frames import Planes from .states import RVState from poliastro.bodies import Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune SOLAR_SYSTEM_B...
Python
0
@@ -115,16 +115,66 @@ _INDEX%0A%0A +from poliastro.bodies import SOLAR_SYSTEM_BODIES%0A%0A from ..c @@ -256,196 +256,8 @@ te%0A%0A -from poliastro.bodies import Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune%0A%0ASOLAR_SYSTEM_BODIES = %5BSun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, ...
394479a9babc1c43c12acd1cd7394f0bef223eb9
fix baseline calculation
moin-rst-latex/moin_rst_latex.py
moin-rst-latex/moin_rst_latex.py
""" Many things copied from Johannes Berg's `MoinMoin Latex support`_ .. `MoinMoin Latex support`: http://johannes.sipsolutions.net/Projects/new-moinmoin-latex """ import subprocess, os, sys, shutil, tempfile, resource, md5 import Image OUT_PATH = "/var/www-pub/root/pTSc0V/testwiki/math" OUT_URI_BASE = "http://192...
Python
0.000004
@@ -2379,18 +2379,16 @@ fset = y --1 %0A @@ -2480,16 +2480,32 @@ ixel((x, + img.size%5B1%5D-1 - baselin @@ -5040,32 +5040,46 @@ try:%0A uri +, baseline_off = latex_to_uri( @@ -5093,16 +5093,36 @@ ' %25 text +, with_baseline=True )%0A @@ -5161,16 +5161,93 @@ uri=uri +,%0A ...
06d9c54dc06db2ea7d2315bd2705fc55d06587a5
Add function numeric typed weekday to string typed weekday.
helper/korea.py
helper/korea.py
# # dp for Tornado # YoungYong Park (youngyongpark@gmail.com) # 2014.10.23 # from __future__ import absolute_import from engine.helper import Helper as dpHelper class KoreaHelper(dpHelper): def readable_phone_number(self, number, separator='-'): number = str(self.helper.numeric.extract_numbers(number)...
Python
0.000565
@@ -1230,12 +1230,369 @@ eturn number +%0A%0A def weekday(self, w, short=False, isoweekday=True):%0A weekdays = %7B%0A 0: '%EC%9B%94',%0A 1: '%ED%99%94',%0A 2: '%EC%88%98',%0A 3: '%EB%AA%A9',%0A 4: '%EA%B8%88',%0A 5: '%ED%86%A0',%0A ...
e9b2b13be524ee7178f6df88be4a93a7f0c4130d
move CifParser import
mpcontribs/io/archieml/mpfile.py
mpcontribs/io/archieml/mpfile.py
from __future__ import unicode_literals, print_function import six, archieml, warnings, textwrap from mpcontribs.config import mp_level01_titles, symprec, replacements from mpcontribs.io.core.mpfile import MPFileCore from mpcontribs.io.core.recdict import RecursiveDict from mpcontribs.io.core.utils import nest_dict, no...
Python
0.000001
@@ -3413,54 +3413,8 @@ ure%0A - from pymatgen.io.cif import CifWriter%0A @@ -4084,24 +4084,78 @@ Structure):%0A + from pymatgen.io.cif import CifWriter%0A
addb5337bff43888d500f2782778b26a1e976581
Bump version number to 0.2.10
ncbi_genome_download/__init__.py
ncbi_genome_download/__init__.py
"""Download genome files from the NCBI""" from .config import ( SUPPORTED_TAXONOMIC_GROUPS, NgdConfig ) from .core import ( args_download, download, argument_parser, ) __version__ = '0.2.9' __all__ = [ 'download', 'args_download', 'SUPPORTED_TAXONOMIC_GROUPS', 'NgdConfig', 'argu...
Python
0
@@ -205,9 +205,10 @@ 0.2. -9 +10 '%0A__
e9bd4dc3285922ce1333b41b9eb2d97164b64257
Update views to send proper responses
nightreads/user_manager/views.py
nightreads/user_manager/views.py
from django.views.generic import View from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from django.utils.decorators import method_decorator from .forms import SubscribeForm, UnsubscribeForm, ConfirmEmailForm from . import user_service class SubscribeView(View): form_class...
Python
0
@@ -1069,20 +1069,28 @@ (%7B's -uccess': key +tatus': 'Email sent' %7D)%0A @@ -1123,30 +1123,94 @@ onse(%7B's -uccess': False +tatus': 'No tags updated'%7D)%0A return JsonResponse(%7B'errors': form.errors %7D)%0A%0A%0Acla @@ -1705,24 +1705,239 @@ e(%7B' -success': +error': 'User Not Found'%7D)%0A ...
913c4186f2447cbd9714d9324cb0094e9af447ce
Delete the source after the library has been built
nuitka/distutils/bdist_nuitka.py
nuitka/distutils/bdist_nuitka.py
# Copyright 2017, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
Python
0.000001
@@ -3264,168 +3264,8 @@ ne%0A%0A - if command == %22install%22:%0A # Delete the source copy of the module%0A shutil.rmtree(os.path.join(self.build_lib, self.main_package))%0A%0A @@ -3660,16 +3660,143 @@ _lib))%0A%0A + # Delete the source copy of the module%0A s...
9980c5defc34eb125ba5f2b39f0d9a67e6490269
add regex conditional for n s e w
nyctext/neighborhoods/regexps.py
nyctext/neighborhoods/regexps.py
import re from throughways import names as throughway_names def make_neighorbood_regex(lHoods, city): hoods = '|'.join(lHoods) hoods = '(%s)' % hoods # Don't match if neighborhood is followed # by a thoroughfare name names = throughway_names[1:-1] # remove parens names = '(%s|%s)' % (names,...
Python
0.999622
@@ -301,16 +301,38 @@ '(%25s%7C%25s +%7Cnorth%7Csouth%7Ceast%7Cwest )' %25 (na
525c8786648a981076cc4238616cde69cb10010c
add TextArea docstring
htmlgen/form.py
htmlgen/form.py
import datetime import re from htmlgen.attribute import (html_attribute, boolean_html_attribute, int_html_attribute, float_html_attribute) from htmlgen.block import Division from htmlgen.element import Element, VoidElement _ENC_TYPE_URL_ENCODED = "application/x-www-form-urlencoded" _EN...
Python
0.000001
@@ -6093,24 +6093,168 @@ (Element):%0A%0A + %22%22%22An HTML %3Ctextarea%3E element.%0A%0A %3E%3E%3E area = TextArea(%22element-name%22)%0A %3E%3E%3E area.append(%22Initial text area content.%22)%0A%0A %22%22%22%0A%0A def __in
502704618855d7c940de151a62ce824c8e2e883a
Test commit
htpc/updater.py
htpc/updater.py
""" Update HTPC-Manager from Github. Either through git command or tarball. Original code by Mikie (https://github.com/Mikie-Ghost/) """ import os import sys from threading import Thread import urllib2 import shutil import platform import subprocess import re from json import loads import cherrypy import htpc import lo...
Python
0
@@ -335,16 +335,17 @@ Updater: + %0A %22%22%22
18d7eb789e48206ecba1b262368c347f0d6d1bb0
Specify the day step
exp/clusterexp/CitationIterGenerator.py
exp/clusterexp/CitationIterGenerator.py
import datetime import numpy import logging from apgl.util.PathDefaults import PathDefaults from apgl.graph.DictGraph import DictGraph from apgl.graph import SparseGraph, VertexList from exp.sandbox.GraphIterators import IncreasingSubgraphListIterator from apgl.util.SparseUtils import SparseUtils class CitationIter...
Python
0.99928
@@ -555,18 +555,39 @@ ize=None -): +, dayStep=30):%0A %0A @@ -4151,21 +4151,26 @@ elf. -month +day Step = -1 +dayStep %0A @@ -4373,25 +4373,16 @@ %22%22%22%0A - %0A @@ -4525,34 +4525,8 @@ %0A - daysInMonth = 30 %0A @@ -4595,30 +4595,16 @@ )), -daysInMont...
2a9aa441c85d9d1da5e39135719526021be406ca
Add crawler_logger
statbot/__main__.py
statbot/__main__.py
# # __main__.py # # statbot - Store Discord records for later analysis # Copyright (c) 2017 Ammon Smith # # statbot is available free of charge under the terms of the MIT # License. You are free to redistribute and/or modify it under those # terms. It is distributed in the hopes that it will be useful, but # WITHOUT AN...
Python
0.00013
@@ -2276,32 +2276,48 @@ r, event_logger, + crawler_logger, sql_logger%5D%0A @@ -2431,19 +2431,25 @@ ' -main': main +discord': discord _log @@ -2466,33 +2466,27 @@ ' -discord': discord +main': main _logger, @@ -2513,32 +2513,71 @@ : event_logger,%0A + 'crawler': crawler_logger,%0A ...
36870cf44bebb09f0c700870f87e64d2d36200a9
improve python package error message
Tools/px_generate_uorb_topic_headers.py
Tools/px_generate_uorb_topic_headers.py
#!/usr/bin/env python ############################################################################# # # Copyright (C) 2013-2015 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
Python
0.000001
@@ -2025,21 +2025,36 @@ int( -%22P +'''%0ARequired python p ackage - empy +s not @@ -2064,18 +2064,46 @@ stalled. - P +%0A%0AOn a Debian/Ubuntu syystem p lease ru @@ -2103,18 +2103,21 @@ ease run +:%0A%0A -' sudo apt @@ -2132,187 +2132,168 @@ tall -%22%0A %22 python-empy' on a Debian/Ubuntu sy...
31ae945c8d7d885dc019eaf7bb4e8c2dc4619dfc
Remove unneeded 'output_file' variable
experiments/delft3d-ps-1/run_delft3d.py
experiments/delft3d-ps-1/run_delft3d.py
#! /usr/bin/env python # Brokers communication between Delft3D and Dakota through files. # Mark Piper (mark.piper@colorado.edu) import sys import os import shutil from subprocess import call, check_output import time def job_is_running(job_id): ''' Returns True if the PBS job with the given id is running. ...
Python
0.00007
@@ -683,41 +683,8 @@ ed'%0A - output_file = 'trim-WLD.dat'%0A @@ -2096,19 +2096,18 @@ matlab_c -all +md = '-r %22 @@ -2198,19 +2198,18 @@ matlab_c -all +md %5D)%0A p
e880aaa34fee44e1da1b9c3d7109c1fe500e9d04
add version number
ibu/__init__.py
ibu/__init__.py
__version__ = '0.0.2'
Python
0.000007
@@ -15,8 +15,39 @@ '0.0.2'%0A +docs_url = 'http://github.com'%0A
9e413e02961975f36a134d601b3629c668a16fe9
Use processes with celery and threads with multiprocessing
openquake/commands/with_tiles.py
openquake/commands/with_tiles.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2017 GEM Foundation # # OpenQuake 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, o...
Python
0.000002
@@ -778,16 +778,26 @@ ivision%0A +import os%0A from ope @@ -1260,16 +1260,33 @@ ni, slc) +%0A for slc @@ -1313,25 +1313,16 @@ _slices( -%0A num_site @@ -1339,16 +1339,209 @@ es)%5D%0A + if os.environ.get('OQ_DISTRIBUTE') == 'celery':%0A Starmap = parallel.Processmap # celery p...
d254c38f10ebf1fd19b6d2c5f443727864f05cd9
fix default value for resource filters.
restkit/resource.py
restkit/resource.py
# -*- coding: utf-8 - # # This file is part of restkit released under the MIT license. # See the NOTICE for more information. """ restkit.resource ~~~~~~~~~~~~~~~~ This module provide a common interface for all HTTP request. """ import urlparse from restkit.errors import ResourceNotFound, Unauthorized, RequestFa...
Python
0
@@ -1648,13 +1648,15 @@ ers' -, +) or %5B%5D -) %0A
1ca6c23f6fce8f052890547890ab326e796e1cd4
update database info
utils/dbutils.py
utils/dbutils.py
import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'models')) #print(sys.path) from mysql_python import MysqlPython from models.User import User from models.Customer import Customer import MySQLdb from DBUtils.PooledDB import PooledDB import hashlib import time g_dbPool ...
Python
0
@@ -346,25 +346,21 @@ st=' -thinkman-wang.com +123.59.78.245 ', u @@ -368,16 +368,13 @@ er=' -thinkman +notes ', p @@ -384,16 +384,15 @@ wd=' -Ab123456 +welc0me ', d
b2bab632d3eac82b910d65e37fc78d8a0a3c2209
set up active scanning
utils/scanner.py
utils/scanner.py
""" Test utility to create a Bluetooth LE scan table. """ import sys import argparse from bgasync import api from bgasync.twisted.protocol import BluegigaProtocol from twisted.internet.serialport import SerialPort from twisted.internet.defer import inlineCallbacks from twisted.internet.task import deferLater from twi...
Python
0
@@ -995,32 +995,288 @@ se.result != 0:%0A + print(%22Error setting scan parameters: %7B%7D%22.format(api.get_error_code_string(response.result)))%0A%0A response = yield protocol.send_command(api.command_gap_discover(mode=api.gap_discover_mode.discover_observation.value))%0A if response.result != 0:%0A ...
e1e463e946ac25d2088b388767492009200d1a54
Fix logger singletons not being separated by class
rmake/lib/logger.py
rmake/lib/logger.py
# # Copyright (c) SAS Institute 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 w...
Python
0
@@ -1258,20 +1258,23 @@ if -not hasattr( +'_dict' not in self @@ -1287,18 +1287,17 @@ ss__ -, ' +._ _dict -') +__ :%0A
8a5b0c70164c7bc76d8825d77654f2804b9529e6
Fix typo
resync/source_description.py
resync/source_description.py
"""ResourceSync Description object A ResourceSync Description enumerates the Capability Lists offered by a Source. Since a Source has one Capability List per set of resources that it distinguishes, the ResourceSync Description will enumerate as many Capability Lists as the Source has distinct sets of resources. Th...
Python
0.999999
@@ -520,16 +520,17 @@ document +s .%0A%22%22%22%0A%0Ai
035e7edc66d6d6b2b396d5871dc28618c0a2d22e
add variation.snp.rmdup()
variation/snp.py
variation/snp.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Analyze SNPs in resequencing panels. """ import sys import logging from jcvi.formats.fasta import Fasta from jcvi.apps.base import OptionParser, ActionDispatcher, debug, sh debug() def main(): actions = ( ('frommaf', 'convert to four-column tabular for...
Python
0.000003
@@ -402,73 +402,993 @@ - )%0A p = ActionDispatcher(actions)%0A p.dispatch(globals()) +('rmdup', 'remove PCR duplicates from BAM files'),%0A ('freebayes', 'call snps using freebayes'),%0A )%0A p = ActionDispatcher(actions)%0A p.dispatch(globals())%0A%0A%0Adef rmdup(args):%0A %22...
8d2ffbb17ce5dac6ae8abdf3c612e3348027090d
Add PUBLIC_IPS to consolidate socket logic
IPython/utils/localinterfaces.py
IPython/utils/localinterfaces.py
"""Simple utility for building a list of local IPs using the socket module. This module defines two constants: LOCALHOST : The loopback interface, or the first interface that points to this machine. It will *almost* always be '127.0.0.1' LOCAL_IPS : A list of IP addresses, loopback first, that point to t...
Python
0
@@ -325,16 +325,153 @@ machine. +%0A%0APUBLIC_IPS : A list of public IP addresses that point to this machine.%0A Use these to tell remote clients where to find you. %0A%22%22%22%0A#-- @@ -1314,34 +1314,46 @@ ss%0A%0A -try:%0A LOCAL_IPS.extend( +PUBLIC_IPS = %5B%5D%0Atry:%0A PUBLIC_IPS = sock @@ -...
0473ba4bb1592c480f5741839fbf1dad59dd0403
Print stats for researcher and department in tests
statistics/tests.py
statistics/tests.py
# Dissemin: open access policy enforcement tool # Copyright (C) 2014 Antonin Delpeuch # # 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 2 # of the License, or (at your opti...
Python
0
@@ -1406,17 +1406,17 @@ h(self.r -3 +2 , increm @@ -1563,30 +1563,267 @@ def -test_researcher(self): +printStats(self, stats):%0A print %22OA: %25d%22 %25 stats.num_oa%0A print %22OK: %25d%22 %25 stats.num_ok%0A print %22COULDBE: %25d%22 %25 stats.num_couldbe%0A print %22TOT: %25d%22 %25...
bb1e5e0a85f8d8a5751025f34c00bf7d6c990ec2
fix minor bug
parlai/agents/ir_baseline/ir_baseline.py
parlai/agents/ir_baseline/ir_baseline.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # Simple IR baselines. # ...
Python
0
@@ -2362,21 +2362,8 @@ y, d -ebug=False, d icti @@ -2363,32 +2363,45 @@ , dictionary=Non +e, debug=Fals e):%0A if not d
bfdcc8bb36fba26baed28e2846a7ae193154a12b
fix the method to validate invoice
partner_slow_payer/models/res_partner.py
partner_slow_payer/models/res_partner.py
# -*- coding: utf-8 -*- # © 2016 ClearCorp # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api from datetime import date from openerp.exceptions import Warning class ResPartner(models.Model): _inherit = 'res.partner' slow_payer = fields.Boolean('Slow...
Python
0.000245
@@ -1291,106 +1291,126 @@ -return self.write(%7B'state': 'open'%7D)%0A else:%0A return self.write(%7B'state': 'open'%7D +super(AccountInvoice, self).invoice_validate()%0A else:%0A super(AccountInvoice, self).invoice_validate( )%0A%0A%0A
11b7a0b6cd53a8d7ab13bbc7ed8f8177fb2ff5de
Fix imports issue.
perses/annihilation/alchemical_engine.py
perses/annihilation/alchemical_engine.py
""" This is a template for code that creates alchemical eliminations for NCMC switching between compounds or residues. """ from simtk import openmm, unit import alchemy import logging class AlchemicalEliminationEngine(object): """ This class is the template for generating systems with the appropriate atoms alch...
Python
0
@@ -661,24 +661,42 @@ ses.rjmc +.topology_proposal import topology @@ -687,26 +687,25 @@ import -t +T opology -_p +P roposal%0A @@ -876,34 +876,16 @@ posal = -topology_proposal. Topology
56784f9f819c6206d994bab0ebc27a802ab586e0
Fix crash on non existent shebang
igcommit/git.py
igcommit/git.py
"""igcommit - Git routines Copyright (c) 2016, InnoGames GmbH """ from subprocess import check_output, CalledProcessError, Popen, PIPE from igcommit.utils import get_exe_path git_exe_path = get_exe_path('git') class CommitList(list): """Routines on a list of sequential commits""" ref_path = None def ...
Python
0.000074
@@ -6220,16 +6220,68 @@ one, 2)%0A + if not shebang_split:%0A return ''%0A
a6abbb71d69ef9ddd617b1cd88ad6ab467d6aca6
Fix indendation error on transfer
file_transfer/datamover/transporters.py
file_transfer/datamover/transporters.py
import os from datetime import datetime from .connectors import FTPConnector, LocalConnector from .s3enram import S3EnramHandler class Porter: def __init__(self): """""" self.transferred = [] self.stalled = [] def transfer(self): raise 'Not implemented' def log_transfe...
Python
0.000001
@@ -3393,36 +3393,32 @@ e)%0A%0A - upload_succes = @@ -3499,36 +3499,32 @@ - overwrite=overwr @@ -3520,36 +3520,32 @@ rite=overwrite)%0A - self @@ -3592,20 +3592,16 @@ erbose)%0A -
63b2ed03b843d4eec0d15231d1b8d612a1df5a10
use f-strings to help serialize int metadata (fix #63)
conllu/serializer.py
conllu/serializer.py
import typing as T from conllu.exceptions import ParseException if T.TYPE_CHECKING: from conllu.models import TokenList def serialize_field(field: T.Any) -> str: if field is None: return '_' if isinstance(field, dict): fields = [] for key, value in field.items(): if ...
Python
0
@@ -1006,34 +1006,28 @@ e = +f %22# -%22 + key + %22 = %22 + +%7Bkey%7D = %7B value +%7D%22 %0A @@ -1068,18 +1068,18 @@ e = +f %22# -%22 + +%7B key +%7D%22 %0A
c6b9db6842f5c1929fd67e13647fe81b9242b328
return blob count
connectedComponents.py
connectedComponents.py
import cv2 try: #OpenCV 2.4 from cv2 import SimpleBlobDetector as SimpleBlobDetector except ImportError: #OpenCV 3 from cv2 import SimpleBlobDetector_create as SimpleBlobDetector def doblob(morphed,blobdet,img): """ img: can be RGB (MxNx3) or gray (MxN) http://docs.opencv.org/master/modules/feature...
Python
0.999691
@@ -991,16 +991,21 @@ rn final +,nkey %0A%0Adef se
021230bb5284de0fa5454df5f933e38b3539acd4
add devilvery trip list
salesmonkey/delivery/rest.py
salesmonkey/delivery/rest.py
import logging from werkzeug.exceptions import ( NotFound ) from flask_apispec import ( marshal_with, MethodResource, use_kwargs ) from erpnext_client.documents import ( ERPDeliveryTrip, ERPContact, ERPAddress ) from erpnext_client.schemas import ( ERPDeliveryTripSchema, ERPDeliv...
Python
0.000001
@@ -847,34 +847,467 @@ =True)%0A%0A -class DeliveryTrip +%0A@marshal_with(ERPDeliveryTripSchema(many=True))%0Aclass DeliveryTripList(MethodResource):%0A %22%22%22%0A List available Delivery Trip List%0A %22%22%22%0A @cache.memoize(timeout=10)%0A def get(self):%0A try:%0A trip_list = er...
07dbef52c17fdb30d9339b9abffb964e7e63e4f4
Change the error message for SIG and SIGS in authenticate()
plenum/common/messages/client_request.py
plenum/common/messages/client_request.py
from plenum import PLUGIN_CLIENT_REQUEST_FIELDS from plenum.common.constants import NODE_IP, NODE_PORT, CLIENT_IP, \ CLIENT_PORT, ALIAS, SERVICES, TXN_TYPE, DATA, \ TARGET_NYM, VERKEY, ROLE, NODE, NYM, GET_TXN, VALIDATOR, BLS_KEY, \ OPERATION_SCHEMA_IS_STRICT, BLS_KEY_PROOF from plenum.common.messages.field...
Python
0
@@ -5633,37 +5633,63 @@ ' -Missing +Request must not contains both +fields %22 signatures a @@ -5686,31 +5686,33 @@ gnatures +%22 and -identifier +%22signature%22 ')%0A
a93fc1d9455cc520f2cdef819205b13640677355
Add import errno (#3)
sandstone_spawner/spawner.py
sandstone_spawner/spawner.py
from jupyterhub.spawner import LocalProcessSpawner from jupyterhub.utils import random_port from subprocess import Popen from tornado import gen import pipes import shutil import os # This is the path to the sandstone-jupyterhub script APP_PATH = os.environ.get('SANDSTONE_APP_PATH') SANDSTONE_SETTINGS = os.environ....
Python
0.000019
@@ -176,16 +176,29 @@ port os%0A +import errno%0A %0A%0A%0A# Thi
2ec8a428585918836e0da1aac2fe60e6f5c68f5d
Fix action log
actionlog/signals.py
actionlog/signals.py
from django.contrib.auth.signals import user_logged_in, user_logged_out from django.dispatch import receiver from actionlog.models import LogEntry from clubadm.signals import member_enrolled, member_unenrolled, user_banned, user_unbanned, giftee_mailed, santa_mailed, gift_sent, gift_received @receiver(user_logged_in...
Python
0.000006
@@ -2690,39 +2690,39 @@ %0A%0A@receiver(gift -ee_mail +_receiv ed, dispatch_uid @@ -3015,33 +3015,29 @@ eceiver(gift -ee_mailed +_sent , dispatch_u
6c696ef8c373783b43636ce448a350f3d997057d
Use pk
actistream/models.py
actistream/models.py
from __future__ import absolute_import from collections import defaultdict from django.conf import settings from django.db import models from django.db.models import Q, F from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext_lazy as _ from django.contrib.contenttypes.fiel...
Python
0
@@ -1508,18 +1508,18 @@ _object. -id +pk )%0A @@ -1836,18 +1836,18 @@ =target. -id +pk )%0A @@ -2893,18 +2893,18 @@ ict(%5B(o. -id +pk , o) for
cb83b9ba16f66c1e00a73e5f472e6a0c26239b00
add some comments about poi-neary variables
geotweet/mapreduce/poi_nearby_tweets.py
geotweet/mapreduce/poi_nearby_tweets.py
import sys import os import re from mrjob.job import MRJob from mrjob.step import MRStep from mrjob.protocol import JSONProtocol, JSONValueProtocol, RawValueProtocol from pymongo.errors import ServerSelectionTimeoutError try: # when running on EMR the geotweet package will be installed with pip from geotweet....
Python
0
@@ -864,27 +864,60 @@ eet%22 -%0AMIN_WORD_COUNT = 2 + # MongoDB database name %0AMET @@ -977,53 +977,200 @@ MILE -%0APOI_DISTANCE = 100%0AMONGO_TIMEOUT = 30 * 1000 + # distace from metro area to include tweet%0APOI_DISTANCE = 100 # meter search radius from d...
85c1f90a6e46e76ab3a59580a2a1620d849a987f
Change namespaces
Mobiles_Stadtgedaechtnis/urls.py
Mobiles_Stadtgedaechtnis/urls.py
from django.conf.urls import patterns, include, url import stadtgedaechtnis.admin import settings js_info_dict = { 'packages': ('stadtgedaechtnis',), } urlpatterns = patterns('', url(r'^', include('stadtgedaechtnis.urls', namespace="stadtgedaechtnis")), url(r'^', include('stadtgedaechtnis_frontend.urls',...
Python
0.000002
@@ -65,24 +65,32 @@ tgedaechtnis +_backend .admin%0Aimpor @@ -152,16 +152,24 @@ aechtnis +_backend ',),%0A%7D%0A%0A @@ -234,16 +234,24 @@ aechtnis +_backend .urls', @@ -277,16 +277,24 @@ aechtnis +_backend %22)),%0A @@ -431,16 +431,24 @@ aechtnis +_backend .admin.s
38e358b3cd9c758376fa3dc579bc5fda2614e8fb
add python function to write cef
contrib/python/cefp.py
contrib/python/cefp.py
#!/usr/bin/env python from __future__ import print_function """ LICENSE - see LICENSE file in the root of this repository The parse_cef function accepts a string of cef key value pairs and returns a dictionary of those pairs. POSSIBLE FUTURE ENHANCEMENTS ------------------- - Detect date formatted strings and automa...
Python
0.000035
@@ -2453,16 +2453,1072 @@ line))%0A%0A +def item_as_cef(item):%0A HEADER_KEYS = %5B%22devicevendor%22, %22deviceproduct%22, %22deviceversion%22,%0A %22signatureid%22, %22name%22, %22severity%22%5D%0A header = %5B%22%22 for _ in HEADER_KEYS%5D%0A extension = %7B%7D%0A for key,value in item...
a0b4f997b2f0d29a99a3b95e247169b9b0222b7a
Bump boto version
packages/pegasus-worker/setup.py
packages/pegasus-worker/setup.py
import os import subprocess from setuptools import find_packages, setup src_dir = os.path.dirname(__file__) home_dir = os.path.abspath(os.path.join(src_dir, "../..")) install_requires = [ "six>=1.9.0", "boto==2.48.0", "globus-sdk==1.4.1", ] # # Utility function to read the pegasus Version.in file # def...
Python
0
@@ -216,17 +216,17 @@ oto==2.4 -8 +9 .0%22,%0A
9c47a28c86d9bc09a55789de76af23b7319c0367
fix the complex valued sparse frobenius norm implementation
scipy/sparse/linalg/_norm.py
scipy/sparse/linalg/_norm.py
import numpy as np from scipy.sparse import issparse from numpy.core import ( array, asarray, zeros, empty, empty_like, transpose, intc, single, double, csingle, cdouble, inexact, complexfloating, newaxis, ravel, all, Inf, dot, add, multiply, sqrt, maximum, fastCopyAndTranspose, sum, isfinite, size, fi...
Python
0
@@ -2710,16 +2710,20 @@ %0A 6%0A%0A + %22%22%22%0A @@ -2929,84 +2929,88 @@ p.is -complexobj(x):%0A sqnorm = dot(x.real, x.real) + dot(x.imag, x.imag +subdtype(x.dtype, np.complexfloating):%0A sqnorm = abs(x).power(2).sum( )%0A @@ -4150,99 +4150,8 @@ ,0%5D%0A - elif ord in ...
4b372b46e99413f85dba63311753b7baa8b60ff7
Update test_code_style.py
_unittests/ut_module/test_code_style.py
_unittests/ut_module/test_code_style.py
""" @brief test log(time=1000s) """ import sys import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.pycode import check_pep8, ExtTestCase try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.pat...
Python
0.000004
@@ -499,11 +499,34 @@ urn -Tru +%22data_bikes.py%22 not in nam e%0A%0A%0A
a548c0532dc7ae743305c004a6027a85b3ca95ba
Add the option to set a specific storage field for a cv
superdesk/vocabularies/vocabularies.py
superdesk/vocabularies/vocabularies.py
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import logg...
Python
0.000001
@@ -1429,32 +1429,224 @@ an',%0A %7D,%0A + 'schema_field': %7B%0A 'type': 'string',%0A 'required': False,%0A 'nullable': True%0A %7D,%0A 'dependent': %7B%0A 'type': 'boolean',%0A %7D,%0A 'service
83f56db640dd22a40693a31826b6c89de3adf9a1
Fix bug
run-instance-set.py
run-instance-set.py
#!/usr/bin/env python import sys, os, getopt, glob, os.path, signal, tempfile opts, args = getopt.getopt( sys.argv[1:], 'p:' ) solver = args[0] set_list = args[1] execution_list = args[2:] if len( opts ) == 1: print '# Percentatge = ' + opts[0][1] percentatge = int( opts[0][1] ) else: percentatge = 100 t...
Python
0.000001
@@ -1452,16 +1452,23 @@ -c-5' ) +.read() %0A%0Aprint
66a425599e2b88336cf78f64c8ad04a88045ad1c
Improve docs
scripts/3-create-database.py
scripts/3-create-database.py
"""Creates an SQLite database detailing all the K2 target pixel files. TODO ---- * Add an index to the sqlite table? """ import glob import logging import sqlite3 import pandas as pd log = logging.getLogger(__name__) log.setLevel("INFO") CSV_FILENAME = "../k2-target-pixel-files.csv" SQLITE_FILENAME = "../k2-targe...
Python
0.000002
@@ -1,17 +1,23 @@ %22%22%22 -Creates +Export a CSV an +d SQL @@ -73,55 +73,8 @@ les. -%0A%0ATODO%0A----%0A* Add an index to the sqlite table? %0A%22%22%22 @@ -138,17 +138,16 @@ as pd%0A%0A -%0A log = lo @@ -194,16 +194,34 @@ INFO%22)%0A%0A +# Output filenames %0ACSV_FIL
e2047e168241c8fc046d2bccb68c791f2751c182
add a _scale to all current potentials for which this makes sense
galpy/potential_src/BurkertPotential.py
galpy/potential_src/BurkertPotential.py
############################################################################### # BurkertPotential.py: Potential with a Burkert density ############################################################################### import numpy from scipy import special, integrate from Potential import Potential class BurkertPotenti...
Python
0.000338
@@ -1151,16 +1151,44 @@ elf.a=a%0A + self._scale= self.a%0A
4312ec242f4e55694bf4389d8334f825676abacd
fix paster index command usage hint
adhocracy/lib/cli.py
adhocracy/lib/cli.py
import itertools import os import paste.script import paste.fixture import paste.registry import paste.deploy.config from paste.deploy import loadapp from paste.script.command import Command from adhocracy import model from adhocracy.lib import search class AdhocracyCommand(Command): parser = Command.standard_p...
Python
0.000001
@@ -6281,16 +6281,31 @@ ex ( -ALL%7CDROP +INDEX%7CDROP%7CDROP_ALL%7CALL ) %5B%3C
03010bf06021743d501aa8c0bc36229daa10b2ac
Rename and fix Remove All
Orange/canvas/report/owreport.py
Orange/canvas/report/owreport.py
import os import pkg_resources from PyQt4.QtCore import Qt from PyQt4.QtGui import (QApplication, QDialog, QPrinter, QIcon, QPrintDialog, QFileDialog, QMenu) from Orange.widgets import gui from Orange.widgets.widget import OWWidget from Orange.widgets.settings import Setting from Orange.canvas....
Python
0
@@ -1960,18 +1960,13 @@ on(%22 -Remove All +Clear %22, s @@ -3663,32 +3663,73 @@ not n_widgets:%0A + self.report_view.setHtml(%22%22)%0A retu
6048b6dbdad05e6837dea462af58959d7ab0f422
Unify the handling of containers and container ids in the metadata.
runtime/metadata.py
runtime/metadata.py
import docker import json from peewee import (Model, SqliteDatabase, ForeignKeyField, CharField, OperationalError, sort_models_topologically, DoesNotExist) from functools import wraps GANTRY_METADATA_FILE = '.gantry_metadata' cached_metadata = None db = SqliteDatabase(GANTRY_METADATA_FILE) cla...
Python
0.000858
@@ -1817,19 +1817,16 @@ ontainer -_id ):%0A %22%22%22 @@ -1886,32 +1886,39 @@ %22%22%22%0A container +_record = _upsertContai @@ -1932,27 +1932,24 @@ rd(container -_id )%0A return c @@ -1948,32 +1948,39 @@ return container +_record .component and c @@ -1979,32 +1979,39 @@ nt and container +_record .compo...
4a37cd5dde97d58da43fd664b807362e67a38eeb
bump version
conveyor/__init__.py
conveyor/__init__.py
__version__ = "0.1.dev17"
Python
0
@@ -20,7 +20,7 @@ dev1 -7 +8 %22%0A
8735395144a5a6cc182caf02c26eb5e74a47e830
Fix Rova using strings as timestamp (#61201)
homeassistant/components/rova/sensor.py
homeassistant/components/rova/sensor.py
"""Support for Rova garbage calendar.""" from __future__ import annotations from datetime import datetime, timedelta import logging from requests.exceptions import ConnectTimeout, HTTPError from rova.rova import Rova import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, Sens...
Python
0.000424
@@ -3501,20 +3501,8 @@ date -.isoformat() %0A%0A%0Ac
cceaa088cb18b23be8b0a148cb4bc5da8d960d42
Update toon to use CoordinatorEntity (#39441)
homeassistant/components/toon/models.py
homeassistant/components/toon/models.py
"""DataUpdate Coordinator, and base Entity and Device models for Toon.""" import logging from typing import Any, Dict, Optional from homeassistant.helpers.entity import Entity from .const import DOMAIN from .coordinator import ToonDataUpdateCoordinator _LOGGER = logging.getLogger(__name__) class ToonEntity(Entity)...
Python
0
@@ -153,22 +153,45 @@ ers. -entity import +update_coordinator import Coordinator Enti @@ -329,16 +329,27 @@ nEntity( +Coordinator Entity): @@ -604,32 +604,70 @@ Toon entity.%22%22%22%0A + super().__init__(coordinator)%0A self._en @@ -780,47 +780,8 @@ None -%0A self.coordinator = coordinato...
74244fd07d57aac1cf812b119ea1819c1173a7de
Remove import for missing function 'read_lattice'
phyutil/phylib/settings/flame.py
phyutil/phylib/settings/flame.py
# encoding: UTF-8 """Library for reading device settings from FLAME imput file (test.lat).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import re import os import logging from collections import OrderedDict i...
Python
0.000002
@@ -377,63 +377,8 @@ gs%0A%0A -from phyutil.phylib.lattice.flame import read_lattice%0A%0A from
a67bf7d52027ece08038f4af2b35d40c16ede9bb
update python file with threading
Python_lib/webapp/hello_flask.py
Python_lib/webapp/hello_flask.py
from flask import Flask, render_template, request, escape, session from vsearch import search4letters # import mysql.connector from DBcm import UseDatabase, ConnectionError, CredentialsError, SQLError from checker import check_logged_in app = Flask(__name__) dbconfig = {'host': '127.0.0.1', 'user': 'vsear...
Python
0.000001
@@ -60,16 +60,63 @@ session%0A +from flask import copy_current_request_context%0A from vse @@ -142,16 +142,45 @@ letters%0A +from threading import Thread%0A # import @@ -956,16 +956,50 @@ html':%0A%0A + @copy_current_request_context%0A def @@ -1792,16 +1792,36 @@ y:%0A + t = Thread(target = log_re...
92fd9c7f824273c9ab17ec575c7742075ad7202e
remove doc string patching
aiomysql/__init__.py
aiomysql/__init__.py
""" Tornado-MySQL: A pure-Python MySQL client library for Tornado. Copyright (c) 2010, 2013-2014 PyMySQL contributors 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, includin...
Python
0.000001
@@ -2977,264 +2977,8 @@ n%0A%0A%0A -from . import connections as _orig_conn%0A%0Aif _orig_conn.Connection.__init__.__doc__ is not None:%0A connect.__doc__ = _orig_conn.Connection.__init__.__doc__ + (%22%22%22%0ASee connections.Connection.__init__() for information about defaults.%0A%22%22%22)%0Adel _orig_conn%0A%0A...
73e382d8aadc132bc69013750534507d54b137d6
Use ssl.TLS_v1 since 1.2 is not availabe on stable
core/tormailbackend.py
core/tormailbackend.py
''' This module provides TorEmailBackend, a backend to send mail through a SMTPS server available through TOR. ''' import os import time import random import socket import smtplib import ssl import socks # You need package python-socksipy from django.conf import settings from django.core.mail.backends.smtp import Email...
Python
0.000002
@@ -2180,10 +2180,8 @@ LSv1 -_2 ,%0A
034eff7b918658345a3a5e824f707b0fea6d193b
Comment out assert JBrowse dir in jbrowse_util. Causing headaches.
genome_designer/scripts/jbrowse_util.py
genome_designer/scripts/jbrowse_util.py
""" Utility methods for creating JBrowse config files to allow data to be viewed using JBrowse. """ import json import os import subprocess from main.models import Dataset from main.models import get_dataset_with_type from main.models import ReferenceGenome from settings import JBROWSE_BIN_PATH from settings import J...
Python
0
@@ -383,16 +383,61 @@ _ROOT%0A%0A%0A +# TODO: Figure out better place to put this.%0A # JBrows @@ -516,16 +516,18 @@ e info.%0A +# assert o @@ -570,16 +570,18 @@ ATH), (%0A +# @@ -632,16 +632,18 @@ it.%22 %25%0A +#
20bc3ad07de296fa960dc68d0e3d2a580fcd55da
Add another way to open source files, that works on 3.1
coverage/backward.py
coverage/backward.py
"""Add things to old Pythons so I can pretend they are newer.""" # This file does lots of tricky stuff, so disable a bunch of lintisms. # pylint: disable=F0401,W0611,W0622 # F0401: Unable to import blah # W0611: Unused import blah # W0622: Redefining built-in blah import os, sys # Python 2.3 doesn't have `set` try: ...
Python
0.000001
@@ -1925,33 +1925,24 @@ urce files.%0A -try:%0A import token @@ -1945,16 +1945,21 @@ okenize%0A +try:%0A open @@ -2025,32 +2025,123 @@ AttributeError:%0A + try:%0A detect_encoding = tokenize.detect_encoding%0A except AttributeError:%0A def open_sou @@ -2160,16 +2160,20 @@ + ...
6e56d16541b3815353121c7dacca0e65629e1724
Modify __virtual__ to return error messages
salt/modules/npm.py
salt/modules/npm.py
# -*- coding: utf-8 -*- ''' Manage and query NPM packages. ''' from __future__ import absolute_import # Import python libs import json import logging import distutils.version # pylint: disable=import-error,no-name-in-module # Import salt libs import salt.utils from salt.exceptions import CommandExecutionError log ...
Python
0.000002
@@ -518,22 +518,31 @@ '''%0A -return +try:%0A if salt.ut @@ -569,16 +569,301 @@ not None + and _check_valid_version():%0A return True%0A else:%0A return (False, 'npm execution module could not be loaded '%0A 'because the npm binary could not be locat...
2fab26a2ae3fc3bb76b63d4744accf40fc5db4d6
Add support for --version.
akaudit/clidriver.py
akaudit/clidriver.py
#!/usr/bin/env python # Copyright 2015 Chris Fordham # # 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
@@ -621,16 +621,31 @@ rgparse%0A +import akaudit%0A from aka @@ -915,17 +915,17 @@ , help=' -L +l og level @@ -977,17 +977,17 @@ , help=' -I +i nteracti @@ -1056,16 +1056,117 @@ _true%22)%0A +%09parser.add_argument('-v', '--version', action=%22version%22, version='%25(prog)s ' + akaudit.__version__)%0A %09args ...
80ac5c70ffd7d075500f1a3e8508f30cb2f460fe
fix typo
werobot/robot.py
werobot/robot.py
# -*- coding: utf-8 -*- import inspect import hashlib from bottle import Bottle, request, response, abort from .parser import parse_user_msg from .reply import create_reply from . import errors #from .settings import settings settings = None __all__ = ['BaseRoBot', 'WeRoBot'] def fallback_handler(message, exc): ...
Python
0.999991
@@ -3326,16 +3326,17 @@ type %22%25 +s %22' %25 mes
7ed418fffeaf9285cc559062c71093633df989b0
remove hack on archive view.
aldryn_news/views.py
aldryn_news/views.py
# -*- coding: utf-8 -*- import datetime from django.views.generic.dates import ArchiveIndexView from django.views.generic.detail import DetailView from django.views.generic.list import ListView from django.shortcuts import get_object_or_404 from django.http import Http404 from aldryn_news import request_news_identifi...
Python
0
@@ -681,24 +681,41 @@ ndexView):%0A%0A + model = News%0A date_fie @@ -739,16 +739,16 @@ _start'%0A - allo @@ -835,16 +835,16 @@ t.html'%0A + date @@ -871,356 +871,8 @@ h'%0A%0A - @property%0A def uses_datetime_field(self):%0A %22%22%22Return False.%0A%0A This is a nasty, nasty ...
3e957e939fa1ab4a003202c250f5895c2da04312
use default host
wheniwork/dao.py
wheniwork/dao.py
from os.path import abspath, dirname, join from restclients_core.dao import DAO class WhenIWork_DAO(DAO): def service_name(self): return 'wheniwork' def service_mock_paths(self): return [abspath(join(dirname(__file__), "resources"))]
Python
0.000001
@@ -255,8 +255,130 @@ ces%22))%5D%0A +%0A def get_default_service_setting(self, key):%0A if %22HOST%22 == key:%0A return 'https://api.wheniwork.com'%0A
5b4055db403ea5719991928d209f7ab67741768c
Allow SmartOS to use the smf module
salt/modules/smf.py
salt/modules/smf.py
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) ''' __func_alias__ = { 'reload_': 'reload' } def __virtual__(): ''' Only work on systems which default to SMF ''' # Don't let this work on Solaris 9 since SMF doesn'...
Python
0
@@ -366,16 +366,35 @@ laris',%0A + 'SmartOS',%0A ))%0A
40b5b95c451a1119f73469439f8bbc4a9265ee6d
Use iter_entities in graph generator
aleph/logic/graph.py
aleph/logic/graph.py
from pprint import pprint # noqa import hashlib import logging from elasticsearch.helpers import scan from followthemoney import model from aleph.core import es, connect_redis from aleph.index.core import entities_index from aleph.index.util import unpack_result from aleph import settings log = logging.getLogger(__...
Python
0.000001
@@ -1,38 +1,4 @@ -from pprint import pprint # noqa%0A impo @@ -27,47 +27,41 @@ ing%0A -%0A from -elasticsearch.helpers import scan +pprint import pprint # noqa %0Afro @@ -118,25 +118,20 @@ ort -es, connect_redis +settings, kv %0Afro @@ -148,305 +148,110 @@ dex. -core import entities_index%0Afrom aleph.index....
69b50cbe9816bf5c4cd8c405d28d75cd31e3c0ae
Fix alignak_home for windows
alignak_app/utils.py
alignak_app/utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2016: # Matthieu Estrada, ttamalfor@gmail.com # # This file is part of (AlignakApp). # # (AlignakApp) 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 Sof...
Python
0
@@ -2067,24 +2067,58 @@ ron%5B'HOME'%5D%0A + alignak_home += '/.local'%0A elif 'wi @@ -2184,24 +2184,79 @@ ERPROFILE'%5D%0A + alignak_home += '%5C%5CAppData%5C%5CRoaming%5C%5CPython%5C%5C'%0A else:%0A @@ -2312,47 +2312,41 @@ HOME - or maybe you are connected as ROOT.')%0A +.')%0A%0A # Pr...
e3bf1e265a96fc438a33ae3c0f7f8030096c5bde
Save "nothing found" results too.
crawler/collector.py
crawler/collector.py
#!/usr/bin/env python3 # chameleon-crawler # # Copyright 2015 ghostwords. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from time import sleep from .utils import ...
Python
0
@@ -929,32 +929,355 @@ result.items():%0A + if not page_data%5B'domains'%5D:%0A # nothing found%0A with db:%0A db%5B'result'%5D.insert(dict(%0A crawl_id=crawl_id,%0A crawl_url=crawl_url,%0A ...
d2789458582cc64a7e5a600915f5a06de2f245f1
Normalize user command docstring quotation mark type
Discord/cogs/user.py
Discord/cogs/user.py
import discord from discord.ext import commands from typing import Optional from utilities import checks async def setup(bot): await bot.add_cog(User(bot)) class User(commands.Cog): def __init__(self, bot): self.bot = bot async def cog_check(self, ctx): return await checks.not_forbi...
Python
0.000003
@@ -530,35 +530,35 @@ , ctx):%0A -''' +%22%22%22 %0A User%0A @@ -602,35 +602,35 @@ ommands%0A -''' +%22%22%22 %0A await c
c635a8bd409dcd985352c821410949c39620dcbb
Fix 0016
Drake-Z/0016/0016.py
Drake-Z/0016/0016.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- '''第 0015 题: 纯文本文件 city.txt为城市信息, 里面的内容(包括花括号)如下所示: { "1" : "上海", "2" : "北京", "3" : "成都" } 请将上述内容写到 city.xls 文件中。''' __author__ = 'Drake-Z' import os import re from collections import OrderedDict import xlwt def shuju(data, re1, re2): c = OrderedDict([]...
Python
0.000192
@@ -53,9 +53,9 @@ 001 -5 +6 %E9%A2%98%EF%BC%9A @@ -64,21 +64,19 @@ %E6%9C%AC%E6%96%87%E4%BB%B6 -city.txt%E4%B8%BA%E5%9F%8E%E5%B8%82%E4%BF%A1%E6%81%AF +numbers.txt , %E9%87%8C%E9%9D%A2 @@ -85,9 +85,9 @@ %E5%AE%B9%EF%BC%88%E5%8C%85%E6%8B%AC -%E8%8A%B1 +%E6%96%B9 %E6%8B%AC%E5%8F%B7%EF%BC%89%E5%A6%82 @@ -95,58 +9...
dd38751a775cdbf5a006dd4fd3ce1ed335d94549
use x0 = '00C'
SimPEG/Examples/Mesh_Plot_Cyl.py
SimPEG/Examples/Mesh_Plot_Cyl.py
import numpy as np import matplotlib.pyplot as plt from SimPEG import Mesh, Utils, Maps # Set a nice colormap! plt.set_cmap(plt.get_cmap('viridis')) def run(plotIt=True): """ Plot Mirrored Cylindrically Symmetric Model =========================================== Here, we demonstrate plot...
Python
0.998998
@@ -756,37 +756,14 @@ , x0 - = np.r_%5B0., 0., -h.sum()/2.%5D +='00C' )%0A%0A
a8788cf2195f873eaac96b5422cea54d467a15dc
Update poll-sensors.py
cron/poll-sensors.py
cron/poll-sensors.py
#!/usr/bin/env python import MySQLdb import datetime import urllib2 import os servername = "localhost" username = "pi" password = "password" dbname = "pi_heating_db" ################################################ sql = "UPDATE sensors SET value='666' WHERE id='2';" cnx = MySQLdb.connect(host=servername, user=use...
Python
0
@@ -344,24 +344,45 @@ db=dbname)%0A +cnx.autocommit(True)%0A cursorwrite
4b0dce64ccac8b8658e49e0ff36714872158a428
Add missing re.UNICODE flag to re.compile call
anchorhub/builtin/github/cstrategies.py
anchorhub/builtin/github/cstrategies.py
""" Concrete CollectorStrategy classes for the GitHub built-in module """ import re from anchorhub.collector import CollectorStrategy class MarkdownATXCollectorStrategy(CollectorStrategy): """ Concrete collector strategy used to parse ATX style headers that have AnchorHub tags specified ATX style he...
Python
0.000001
@@ -786,69 +786,8 @@ %22%22%22%0A - super(MarkdownATXCollectorStrategy, self).__init__()%0A @@ -971,16 +971,28 @@ _pattern +, re.UNICODE )%0A%0A d
baaf1dbfb52604545e2b08afd151d4190bf2346f
add kwarg to do extra correction
cpv/stouffer_liptak.py
cpv/stouffer_liptak.py
import numpy as np from scipy.stats import norm, chisqprob from numpy.linalg import cholesky as chol from numpy.linalg.linalg import LinAlgError qnorm = norm.ppf pnorm = norm.cdf def stouffer_liptak(pvals, sigma=None): """ The stouffer_liptak correction. >>> stouffer_liptak([0.1, 0.2, 0.8, 0.12, 0.011]) ...
Python
0
@@ -211,16 +211,34 @@ gma=None +, correction=False ):%0A %22 @@ -1299,28 +1299,47 @@ _method%0A -%22%22%22%0A + if correction:%0A deno @@ -1380,24 +1380,28 @@ ())%0A + + Cp = qvals.s @@ -1421,22 +1421,31 @@ -else +if not correction :%0A -%22%22%22%0A
552f7aeef6529a2b7aa575c90d0bfc00eee4fa74
Fix forbidden response
wsgi_kerberos.py
wsgi_kerberos.py
''' WSGI Kerberos Authentication Middleware Add Kerberos/GSSAPI Negotiate Authentication support to any WSGI Application ''' import kerberos import logging import os import socket LOG = logging.getLogger(__name__) LOG.addHandler(logging.NullHandler()) def _consume_request(environ): ''' Consume and discard a...
Python
0.00004
@@ -7762,16 +7762,25 @@ rbidden( +environ, start_re
e9c290643f5d98279bcc6f786b9e1a0cf67db383
complete txt to hdf5
analisys/txt2hdf5.py
analisys/txt2hdf5.py
######################################################################### # Developed in the framework of INDIGO project, # # Author: Mario David <mariojmdavid@gmail.com> ######################################################################### import os import h5py import numpy as np if __name__ == '__main__': ...
Python
0
@@ -1941,16 +1941,19 @@ f +raw = open( @@ -2022,16 +2022,19 @@ float(f +raw .readlin @@ -2439,17 +2439,17 @@ grp -2 +1 = f.cre @@ -2467,10 +2467,586 @@ rp_name) +%0A npres = np.arange(10)%0A for n in lrunsG:%0A tr_file = root_dir + os.se...
d333ab6b561388af0c238be3d09db185c316b2c2
Remove validation from model itself
cspreports/models.py
cspreports/models.py
# STANDARD LIB from __future__ import unicode_literals import json from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils.translation impor...
Python
0
@@ -4253,417 +4253,8 @@ rt%0A%0A - def full_clean(self):%0A super(CSPReport, self).full_clean()%0A for field_name in REQUIRED_FIELDS:%0A django_field_name = field_name.replace(%22-%22, %22_%22)%0A if getattr(self, django_field_name) is None:%0A raise ValidationErro...