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
68802180ac5c7d02a20d88879b583fbcdc7f4059
Add BinauralSepsm to __init__
pambox/speech/__init__.py
pambox/speech/__init__.py
""" The :mod:`pambox.speech` module gather speech intelligibility models. """ from __future__ import absolute_import from .sepsm import Sepsm from .mrsepsm import MrSepsm from .sii import Sii from .material import Material from .experiment import Experiment __all__ = [ 'Sepsm', 'MrSepsm', 'Sii', 'Mate...
Python
0.000014
@@ -111,16 +111,57 @@ import%0A%0A +from .binauralsepsm import BinauralSepsm%0A from .se @@ -306,16 +306,37 @@ l__ = %5B%0A + 'BinauralSepsm',%0A 'Sep
7c37d4f95897ddbc061ec0a84185a19899b85b89
Update shebang to use /usr/bin/env.
compile_for_dist.py
compile_for_dist.py
#!/ms/dist/python/PROJ/core/2.5.2-1/bin/python # ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # Copyright (C) 2008 Morgan Stanley # # This module is part of Aquilon """Add /ms/dist to traceback of files compiled in /ms/dev.""" import sys import py_compile import re ...
Python
0
@@ -1,50 +1,28 @@ #!/ -ms/dist/python/PROJ/core/2.5.2-1 +usr /bin/ +env python +2.6 %0A# e
0f848402257faac3a807cdfe90cc505e2ae39129
Fix typo
src/onedrivesdk/model/async_operation_status.py
src/onedrivesdk/model/async_operation_status.py
# -*- coding: utf-8 -*- ''' # Copyright (c) 2015 Microsoft Corporation # # 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 us...
Python
0.999999
@@ -1432,16 +1432,19 @@ op_dict +is not None
70245c78a7f4a036b439b0dc1e784c58d468233e
Bump ptpython version
pw_console/py/setup.py
pw_console/py/setup.py
# Copyright 2021 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
0.00001
@@ -1289,156 +1289,25 @@ -# Required features are not yet in https://pypi.org/project/ptpython/%0A 'ptpython @ git+https://github.com/prompt-toolkit/ptpython.git@b74af76 +'ptpython%3E=3.0.18 ',%0A
57f97291dbb389d833fc3e99da54cb888d3b006e
possible solution to #791
shop/search/views.py
shop/search/views.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from rest_framework.mixins import ListModelMixin from rest_framework.renderers import BrowsableAPIRenderer from rest_framework.settings import api_settings from drf_haystack.generics import HaystackGenericAPIView from shop.c...
Python
0.999101
@@ -3069,16 +3069,132 @@ rSet%60.%0A%0A + :param pagination_class: A pagination class inheriting from :class:%60rest_framework.pagination.BasePagination%60.%0A%0A :par @@ -3272,32 +3272,32 @@ eryset returned%0A - by Hayst @@ -4083,32 +4083,77 @@ apper.as_view()%0A + pagination_class = ProductList...
e0c7016b4da6f4f90b97addd0404ef4bf9af75e4
revert a temporary bugfix from PR #2626
test/integrationtests/voight_kampff/features/environment.py
test/integrationtests/voight_kampff/features/environment.py
# Copyright 2020 Mycroft AI 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 writin...
Python
0
@@ -2973,270 +2973,8 @@ 1)%0A%0A - # Temporary bugfix - First test to run sometimes fails%0A # Sleeping to see if something isn't finished setting up when tests start%0A # More info in Jira Ticket MYC-370%0A # TODO - remove and fix properly dependant on if failures continue%0A sleep(10)%0A%0A
754733ede343ecb67be67008803aa6b6654e3d23
Fix typos in warsawgtfs.py
warsawgtfs.py
warsawgtfs.py
from argparse import ArgumentParser from datetime import datetime from time import time from static import ConversionOpts, make_multiple, make_single, setup_logging ASCII_ART = """ . . . ,---.--.--,---.,---. | | |,---.,---.,---.,---.. . .| _. | |__. `---. | | |,---|| `---.,---|| | || |...
Python
0.999999
@@ -160,16 +160,41 @@ ogging%0A%0A +# cSpell: words remerge%0A%0A ASCII_AR @@ -602,28 +602,16 @@ help=%22 -wheteher to add metr @@ -755,20 +755,8 @@ lp=%22 -wheteher to gene
625757f77a30495ed8b442c6d686eba17c8bfe78
Change Search from exact match to keywords
pyBuchaktion/mixins.py
pyBuchaktion/mixins.py
from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.views.generic import View from django.views.generic.base import ContextMixin from django.utils.cache import add_never_cache_headers from django.http import HttpResponseRedirect from pyTUID.mixins import TUI...
Python
0
@@ -1267,32 +1267,74 @@ n data.items():%0A + for val in value.split():%0A kwar @@ -1367,12 +1367,14 @@ val -ue %7D%0A + @@ -1414,25 +1414,24 @@ r(**kwargs)%0A -%0A retu
a86dfd5335a9dc764de4f6e75c03621373831448
Fix ParametricAttention layer (#457)
thinc/layers/parametricattention.py
thinc/layers/parametricattention.py
from typing import Tuple, Callable, Optional from ..model import Model from ..config import registry from ..types import Ragged from ..util import get_width InT = Ragged OutT = Ragged @registry.layers("ParametricAttention.v1") def ParametricAttention(nO: Optional[int] = None) -> Model[InT, OutT]: """Weight inp...
Python
0
@@ -618,32 +618,34 @@ .ops, Q, Xr.data +Xd , Xr.lengths)%0A @@ -712,16 +712,18 @@ Xr.data +Xd , Xr.len @@ -809,16 +809,18 @@ dYr.data +Xd )%0A @@ -1095,36 +1095,16 @@ = None%0A) - -%3E Model%5BInT, OutT%5D :%0A if @@ -1104,17 +1104,17 @@ %0A if -Y +X is not @@ -1161,80 +1161,215 @@ dth( -Y....
fb3cd2f1096ff8e7fa2a377c3a531f3e00168a0f
Add a 404 handler
application.py
application.py
from flask import Flask from flask import redirect from flask import request import csv # example of old url # http://collectionsonline.nmsi.ac.uk/detail.php?type=related&kv=66468&t=objects application = Flask(__name__) courl = 'https://collection.sciencemuseum.org.uk' lookup = {} # load mapping table into a di...
Python
0.000003
@@ -1088,16 +1088,95 @@ courl)%0A%0A +@application.errorhandler(404)%0Adef not_found(error):%0A return redirect(courl)%0A%0A if __nam
12a5b4402bbcb62291bcb5ecc6ac8817b88dd72c
Fix typos
tip/algorithms/sorting/mergesort.py
tip/algorithms/sorting/mergesort.py
""" Merge Sort The Merge Sort is a recursive sort of order n*log(n). It is notable for having a worst case and average complexity of O(n*log(n)), and a best case complexity of O(n) (for pre-sorted input). The basic idea is to split the collection into smaller groups by halving it until the groups only have one elemen...
Python
0.999999
@@ -1,12 +1,11 @@ %22%22%22 - Merge So @@ -6,16 +6,28 @@ rge Sort + Algorithm.%0A %0AThe Mer
555fd7946e9bf3d938e9f2e585b0cc4802f075f5
Update MFA doc link
pyathena/connection.py
pyathena/connection.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import logging import os import time from boto3.session import Session from future.utils import iteritems from pyathena.async_pandas_cursor import AsyncPandasCursor from pyathena.converter import DefaultPandasTypeConverter, DefaultTypeC...
Python
0
@@ -3767,16 +3767,17 @@ # http +s ://boto3 @@ -3781,25 +3781,42 @@ to3. -readthedocs.io/en +amazonaws.com/v1/documentation/api /lat @@ -3826,28 +3826,26 @@ /guide/c -onfiguration +redentials .html#as
3bc8fd1a02358a8647bcee11e652ee5aec0bdf97
Add informative BadHostKeyException
paramiko/ssh_exception.py
paramiko/ssh_exception.py
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
Python
0
@@ -3381,16 +3381,46 @@ __(self, +%0A 'Host k @@ -3454,21 +3454,195 @@ atch -!' %25 hostname + : got %25s expected %25s' %25 (%0A hostname,%0A got_key.get_base64(),%0A expected_key.get_bas...
94ccaafd0368ee6a5d3358ddb7d492ea73fceb79
Handle when a patchset doesn't exist instead of printing a stack trace.
apply_issue.py
apply_issue.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Applies an issue from Rietveld. """ import logging import optparse import os import sys import breakpad # pylint: disable=W06...
Python
0.000035
@@ -273,16 +273,31 @@ port sys +%0Aimport urllib2 %0A%0Aimport @@ -1522,16 +1522,130 @@ -issue') +%0A options.server = options.server.rstrip('/')%0A if not options.server:%0A parser.error('Require a valid server') %0A%0A # TO @@ -2025,16 +2025,25 @@ atch.')%0A + try:%0A patchs @@ -2094,16 +2094,274 @@ ...
122d35b4562b18e60e13354d14d19c4772769180
Add --no-commit option to apply_issue for use with git on the bots.
apply_issue.py
apply_issue.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Applies an issue from Rietveld. """ import getpass import logging import optparse import os import subprocess import sys import...
Python
0.000006
@@ -1758,16 +1758,131 @@ erver')%0A + parser.add_option('--no-commit', action='store_true',%0A help='Do not try to commit patch to SCM (git only)')%0A option @@ -4536,24 +4536,127 @@ l_dir)%0A if +options.no_commit or scm_type is None:%0A scm_obj = checkout.RawCheckout(full_dir, None, None)%0A elif s...
10bcbc32e4a0c20d3a2ec6c85dbd7f92f5aea52d
fix fetching undelivered messages to user
chat/query.py
chat/query.py
"""Message related query sets""" from django.db.models.query import QuerySet class MessageQuerySet(QuerySet): """Message query set""" def undelivered(self, to): """Fetch only undelivered messages""" queryset = self.filter(deliveries__delivered_at__isnull=True) if to is not None: ...
Python
0.000001
@@ -223,181 +223,233 @@ -queryset = self.filter(deliveries__delivered_at__isnull=True)%0A if to is not None:%0A queryset = queryset.filter(deliveries__receiver=to)%0A return queryset +if to is not None:%0A return self.filter(deliveries__receiver=to,%0A ...
4bd6c570eeebee87bec301140be3a4b1c8bddd19
add AutoReload class
karlooper/autoreload/__init__.py
karlooper/autoreload/__init__.py
# -*-coding:utf-8-*-
Python
0
@@ -14,8 +14,153 @@ tf-8-*-%0A +%0A%0Aclass AutoReload(object):%0A def __init__(self, **kwargs):%0A pass%0A%0A def __check(self):%0A pass%0A%0A def run(self):%0A pass%0A
31dc859781abd1b0949efd6f1e838738ef5f1593
Remove unnecessary line breaks
chatserver.py
chatserver.py
from twisted.internet.protocol import Factory from twisted.protocols.basic import LineReceiver from twisted.internet import reactor import threading import chatroom class Chat(LineReceiver): lock = threading.Lock() rooms = {} MAXLEN_NAME = 64 def __init__(self, users): self.users = users ...
Python
0.000102
@@ -2830,34 +2830,32 @@ += %22end of list. -%5Cn %22%0A self.s @@ -3932,18 +3932,16 @@ of list. -%5Cn %22%0A @@ -4144,26 +4144,24 @@ the chat: %7B%7D -%5Cn %22.format(sel
4f1b16facd4e209a2185caf6f8cfd82583abf247
Fix NameError for class Election
server_ui/views.py
server_ui/views.py
""" server_ui specific views """ from helios.models import * from helios_auth.security import * from view_utils import * import helios.views import helios from helios.crypto import utils as cryptoutils from helios_auth.security import * from helios.security import can_create_election from django.core.urlresolvers im...
Python
0.000001
@@ -616,16 +616,30 @@ tions = +helios.models. Election @@ -654,16 +654,16 @@ tured()%0A - %0A use @@ -767,24 +767,38 @@ inistered = +helios.models. Election.get @@ -902,16 +902,16 @@ f user:%0A - elec @@ -924,16 +924,30 @@ voted = +helios.models. Election
4db43166543ea8bc47f7eeeb5228540c7b865e35
define sday, year, and month for stub entries
scripts/ingestors/harry/fill_month.py
scripts/ingestors/harry/fill_month.py
import psycopg2 import datetime import sys from pyiem.network import Table as NetworkTable PGCONN = psycopg2.connect(database='coop', host='iemdb') cursor = PGCONN.cursor() def main(): """ Go Main Go """ year = int(sys.argv[1]) month = int(sys.argv[2]) sts = datetime.datetime(year, month, 1) ets =...
Python
0.000001
@@ -894,16 +894,51 @@ ion, day +, year,%0A month, sday )%0A @@ -958,16 +958,28 @@ UES (%25s, + %25s, %25s, %25s, %25s)%22%22%22, @@ -988,16 +988,103 @@ sid, now +, now.year,%0A now.month, now.strftime(%22%25m%25d%22) ))%0A
f3b0cefab30a9b9cb78c05054afa96eac5f66565
add some prints
build_index.py
build_index.py
import sys import py PACKAGES = [ 'netifaces', ] class IndexBuilder(object): def __init__(self, wheeldir, outdir): self.wheeldir = py.path.local(wheeldir) self.outdir = py.path.local(outdir) self.packages = [] def copy_wheels(self): for whl in self.wheeldir.visit('*.whl')...
Python
0.000001
@@ -19,41 +19,8 @@ py%0A%0A -PACKAGES = %5B%0A 'netifaces',%0A%5D%0A%0A clas @@ -282,16 +282,68 @@ .whl'):%0A + print 'Collecting wheel:', whl.basename%0A @@ -582,35 +582,146 @@ (d)%0A -%0A def build_index(self): + else:%0A print ' already exists, skipping'%0A...
dc030799b5c0d9cfa629f70440219da06c299668
fix get_branch issue
gitbundler/gitcmd.py
gitbundler/gitcmd.py
#! /usr/bin/env python #coding=utf-8 import os, sys from subprocess import Popen, PIPE class GitCmd(object): def __init__(self, name, path): self.name = name self.path = path self.branch = "master" def _exec(self, cmd, console=True): cmd = 'git %s' % str(c...
Python
0
@@ -1445,21 +1445,29 @@ -print +branch_list = stdout. @@ -1482,32 +1482,38 @@ trip()%0D%0A +print branch_list = st @@ -1511,32 +1511,43 @@ list - = stdout.read().strip() +%0D%0A branch_list = branch_list .spl
918daeb8f26d0e96b002c2497308dd4cdabbd701
Clean up sign
tests/chainer_tests/functions_tests/math_tests/test_sign.py
tests/chainer_tests/functions_tests/math_tests/test_sign.py
import unittest import numpy import chainer from chainer import cuda import chainer.functions as F from chainer import gradient_check from chainer import testing from chainer.testing import attr class UnaryFunctionsTestBase(unittest.TestCase): @property def no_grads(self): return (False,) def ...
Python
0.000002
@@ -2211,17 +2211,11 @@ m(-1 -0.0, 10.0 +, 1 , se
231a58846c7c4c6fe782ac1a98f4cbf7860cdd86
add missing import ChessPiece
chess_util.py
chess_util.py
""" contains some chess-related utility functions """ import random from cmd_util import input_int def format_board(board, row_count, col_count): """ convert a `board` into string than can be shown in console board: a dict { (row_num, col_num) => piece_symbol } row_count: number of rows col_coun...
Python
0.000092
@@ -93,16 +93,46 @@ put_int%0A +from pieces import ChessPiece%0A %0A%0Adef fo
675ad4ce3baff98980126e67db970067bfdd73cb
Fix unicorn heroku bug
application.py
application.py
from app import app import os port = int(os.environ.get('PORT', 8000)) app.run(host='0.0.0.0',port=port, debug=False)
Python
0.000194
@@ -65,16 +65,48 @@ 8000))%0A +%0Aif __name__ == '__main__':%0A app.run( @@ -141,11 +141,16 @@ bug= -False +debug_flag )%0A
3b67827ff5a81559e521a2ab9f837baccf67386c
Update Mpu6050.py
service/Mpu6050.py
service/Mpu6050.py
# start the service mpu6050 = Runtime.start("mpu6050","Mpu6050")
Python
0
@@ -1,23 +1,104 @@ -# start the service +webgui = Runtime.createAndStart(%22WebGui%22,%22WebGui%22)%0Araspi = Runtime.createAndStart(%22RasPi%22,%22RasPi%22)%0A# %0Ampu @@ -116,16 +116,25 @@ ime. -s +createAndS tart(%22 -m +M pu60 @@ -147,8 +147,163 @@ pu6050%22) +%0Ampu6050.setController(raspi,%221%22,%220x68%22)...
682dcc775a02222aa9c08784490dfee908891159
Add parameter to hide down networks
bumblebee/modules/traffic.py
bumblebee/modules/traffic.py
# pylint: disable=C0111,R0903 """Displays network IO for interfaces. Parameters: * traffic.exclude: Comma-separated list of interface prefixes to exclude (defaults to "lo,virbr,docker,vboxnet,veth") * traffic.states: Comma-separated list of states to show (prefix with "^" to invert - i.e. ^down -> show all de...
Python
0
@@ -2613,16 +2613,116 @@ e = %22up%22 +%0A elif bumblebee.util.asbool(self.parameter(%22hide_down%22, True)):%0A continue %0A%0A
99820d14a1b083b5aee651da8773ac7b720e6aa5
Improve JSON response handling
application.py
application.py
import hashlib import json import sqlite3 from flask import Flask from flask import Markup from flask import g from flask import render_template from random import SystemRandom choice = SystemRandom().choice app = Flask(__name__) @app.context_processor def set_buster(): with open('last-commit.txt') as f: ...
Python
0.000021
@@ -12,20 +12,8 @@ lib%0A -import json%0A impo @@ -93,16 +93,42 @@ mport g%0A +from flask import jsonify%0A from fla @@ -1471,32 +1471,114 @@ re -turn json.dumps(phrases) +sponse = jsonify(phrases)%0A response.headers%5B'Cache-Control'%5D = 'no-store, no-cache'%0A return response %0A%0A%0A@ @@ -1806,31 +1...
55e9fffdda66bc52ce8ee393843c586fb0564bda
update version to 1.0.6
web-server.py
web-server.py
# -*- coding: utf-8 -*- import json import uniout import parse import function from flask import Flask, render_template, request, session from flask_cors import * __version__ = "1.0.4" app = Flask(__name__) app.config['SESSION_COOKIE_HTTPONLY'] = False app.secret_key = "This is Secret Key" origins = "http://local...
Python
0
@@ -181,9 +181,9 @@ 1.0. -4 +6 %22%0A%0A%0A
7a3d6e41c5579bbbe5a229964d9354b9468d100b
Change definition of TP and FP
src/new_evalute.py
src/new_evalute.py
import numpy as np # import matplotlib.pyplot as plt from utils.datasets import DataManager from utils.datasets import get_class_names from utils.inference import predict from utils.preprocessing import load_image from utils.preprocessing import preprocess_images from utils.boxes import create_prior_boxes from utils.b...
Python
0
@@ -3953,32 +3953,156 @@ _probabilities)%0A + if ((max_iou %3E iou_threshold) and%0A (predicted_sample_arg == ground_truth_class_arg)):%0A @@ -4132,16 +4132,56 @@ _score)%0A + labels.append(True)%0A @@ -4255,33 +4255,33 @@ cted_sampl...
209c69304189211fd66982bc4145ca558f58aacf
check x_min < x_max, y_min < y_max
tests/datasets_tests/test_voc/test_voc_detection_dataset.py
tests/datasets_tests/test_voc/test_voc_detection_dataset.py
import unittest import numpy as np from chainer import testing from chainer.testing import condition from chainer.testing import attr from chainercv.datasets import voc_detection_label_names from chainercv.datasets import VOCDetectionDataset def _create_paramters(): split_years = testing.product({ 'spl...
Python
0.000119
@@ -1308,16 +1308,44 @@ out%5B:3%5D +%0A C, H, W = img.shape %0A%0A @@ -1462,58 +1462,9 @@ ual( -img.shape%5B0%5D, 3)%0A self.assertEqual(img.ndim +C , 3) @@ -1738,16 +1738,138 @@ e%5B1%5D, 4) +%0A np.testing.assert_array_less(bbox%5B:, 0%5D, bbox%5B:, 2%5D)%0A np.testing.assert_...
696b997a88a3175e191f0808b9639faf93139d84
a circumflex must be a circumflex
Lib/glyphNameFormatter/rangeProcessors/spacing_modifier_letters.py
Lib/glyphNameFormatter/rangeProcessors/spacing_modifier_letters.py
def process(self): self.replace("MODIFIER") #self.replace("LETTER SMALL CAPITAL INVERTED R", "Rsmallinvertedsupmod") self.edit("COLON", "colon") self.edit("TRIANGULAR", "triangular") self.edit("RING", "ring") self.edit("DEPARTING TONE MARK", "tone") self.edit("TONE MARK", "tone") self...
Python
0.999978
@@ -13,16 +13,86 @@ (self):%0A + if self.has(%22MODIFIER LETTER CIRCUMFLEX ACCENT%22):%0A return%0A%0A self @@ -118,16 +118,17 @@ )%0A%0A # + self.rep @@ -1343,16 +1343,40 @@ press()%0A + self.scriptTag = %22%22%0A %0A%0Aif __n @@ -1491,12 +1491,13 @@ r Letters%22)%0A +%0A
fa341c1d8c1320df41c70f677dba2a01a3c28c10
Update models.py
web/models.py
web/models.py
from django.db import models # Game definitions """ ATTRIBUTES: Strength Vitality Dexterity Charisma Intelligence Wisdom """ """ ELEMENTS: Physical Spell Shadow Arcane Lightning Poison Fire Ice Psychic Chaos """ """ SLOTS: Head Neck Ch...
Python
0.000001
@@ -807,17 +807,17 @@ BUTES = -%7B +%5B 'Strengt @@ -883,17 +883,17 @@ isdom', -%7D +%5D %0A ELE @@ -900,17 +900,17 @@ MENTS = -%7B +%5B 'Physica @@ -1000,17 +1000,17 @@ Chaos', -%7D +%5D %0A MOD @@ -1341,9 +1341,9 @@ S = -%7B +%5B 'Non @@ -1393,9 +1393,9 @@ el', -%7D +%5D %0A
3155104dc72cd4c4951395219e6aae201bca4e52
Remove an extra line
services/yammer.py
services/yammer.py
import foauth.providers class Yammer(foauth.providers.OAuth2): # General info about the provider provider_url = 'https://www.yammer.com/' docs_url = 'https://developer.yammer.com/api/' # URLs to interact with the API authorize_url = 'https://www.yammer.com/dialog/oauth' access_token_url = 'ht...
Python
0.016576
@@ -653,9 +653,8 @@ rn data%0A -%0A
580ce797b5b534426b9f8903755b4181bfdb3668
Check if chat ID file exists before reading
argosd/bots.py
argosd/bots.py
"""This module contains functionality related to bots. TelegramBot: A bot to interact with a user on Telegram. """ import logging from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from argosd import settings from argosd.threading import Threaded class TelegramBot(Threaded): """A bot tha...
Python
0
@@ -109,16 +109,26 @@ am.%0A%22%22%22%0A +import os%0A import l @@ -869,24 +869,75 @@ t_id = None%0A + if os.path.isfile(self._chat_id_file):%0A with @@ -968,32 +968,36 @@ , 'r') as file:%0A + chat
dcd47caff62026c6ec39fefcaf7b4c104e58cd5d
Add max_length to slugfields.
src/niwi/models.py
src/niwi/models.py
# -*- coding: utf-8 -*- from django.db import models from django.conf import settings from django.template.defaultfilters import slugify from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from niwi.utils import get_url_data from niwi.forms import LEXER_CHOICES f...
Python
0
@@ -943,32 +943,48 @@ odels.SlugField( +max_length=100, unique=True, db_ @@ -1933,32 +1933,48 @@ odels.SlugField( +max_length=100, unique=True, db_ @@ -3099,16 +3099,32 @@ ugField( +max_length=100, unique=T
8674a8ae44f285ab7ee753822d879bdffca3864d
make tagging optional
paste_organizer/models.py
paste_organizer/models.py
from datetime import datetime from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from tagging.fields import TagField class Pastebin(models.Model): """ Online service where your paste is hosted """ pastebin_name = models.CharF...
Python
0.000002
@@ -152,16 +152,25 @@ zy as _%0A +try:%0A from tag @@ -196,16 +196,44 @@ TagField +%0Aexcept:%0A TagField = None %0A%0Aclass @@ -1220,16 +1220,37 @@ gth=25)%0A + if TagField:%0A tags @@ -1783,8 +1783,9 @@ aste_id) +%0A
45cd278b2f293d1305d9576ec7a420494ced8b26
use size for ids query
application.py
application.py
__author__ = 'amandeep' import json from flask import request from flask import Response from functools import wraps from flask import Flask from elasticsearch_manager import ElasticSearchManager from dig_bulk_folders import BulkFolders import ConfigParser application = Flask(__name__) phone_field = 'hasFeatureColl...
Python
0.000053
@@ -4548,16 +4548,97 @@ ds_query +%0A (es_request%5B'ids'%5D), len (es_requ @@ -4648,22 +4648,16 @@ %5B'ids'%5D) -, None ))%0A
17966e7513b19f8ac187b8f508cfe1ef026fd4f2
Add more info to errors in kaggle_secrets. (#546)
patches/kaggle_secrets.py
patches/kaggle_secrets.py
"""UserSecret client classes. This library adds support for communicating with the UserSecrets service, currently used for retrieving an access token for supported integrations (ie. BigQuery). """ import json import os import urllib.request from urllib.error import HTTPError from typing import Tuple, Optional from dat...
Python
0
@@ -2015,32 +2015,33 @@ +f 'Unexpected resp @@ -2054,32 +2054,59 @@ rom the service. + Response: %7Bresponse_json%7D. ')%0A @@ -3135,16 +3135,17 @@ +f 'Unexpec @@ -3174,16 +3174,42 @@ service. + Response: %7Bresponse_json%7D ')%0A
c81375d4635e12e82422c8a132202f2a0524ba60
clean up callback stub classes
conary/callbacks.py
conary/callbacks.py
#!/usr/bin/python # # Copyright (c) 2005 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.o...
Python
0
@@ -738,32 +738,91 @@ :%0A pass%0A%0A + def sendingChangeset(self, sent, total):%0A pass%0A%0A def setRate( @@ -1273,139 +1273,30 @@ def -setCurrentRate(self, rate):%0A pass%0A%0A def buildingChangeset(self):%0A pass%0A%0A def sendingChangeset(self, sent, total +buildingChan...
23fad454caf9d587d248f6b6881057dffe5beb47
fix typo in strongly connected graph alg, support adding edges to non-existant nodes (the nodes just appear as needed)
conary/lib/graph.py
conary/lib/graph.py
# # Copyright (c) 2006 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licen...
Python
0
@@ -2453,24 +2453,34 @@ dges -%5B +.setdefault( nodeId -%5D = +, set() +) %0A @@ -2732,17 +2732,35 @@ dges -%5BfromIdx%5D +.setdefault(fromIdx, set()) .add @@ -5339,25 +5339,25 @@ %5D, finishes%5B -b +a %5B0%5D%5D)%0A%0A
b4ec32812ca4ebfeac064d6e89023f986e3a1e42
Add a default value if ok_status is set to falsey
gocd/api/response.py
gocd/api/response.py
import json # TODO: Test this class explicitly, the implicit testing we got now works but it doesn't define the behavior. class Response(object): """A nicely wrapped HTTP Response This class will be instantiated from API calls and is not intended to be used in any other way. Special handling of the ...
Python
0.000075
@@ -1713,32 +1713,39 @@ atus = ok_status + or 200 %0A%0A @property%0A
1cbe401e62b2f5d7fee815a3516ee6ea0ecfac75
Bump version to v0.7.0.3
gocd_cli/__init__.py
gocd_cli/__init__.py
__import__('pkg_resources').declare_namespace(__name__) __version__ = '0.7.0.2'
Python
0
@@ -75,7 +75,7 @@ 7.0. -2 +3 '%0A
b5abccb1dc733522df19d56e0906890531a700d3
Set all fields on input object types
graphene/types/inputobjecttype.py
graphene/types/inputobjecttype.py
from collections import OrderedDict from .base import BaseOptions, BaseType from .inputfield import InputField from .unmountedtype import UnmountedType from .utils import yank_fields_from_attrs # For static type checking with Mypy MYPY = False if MYPY: from typing import Dict, Callable # NOQA class InputObjec...
Python
0.000003
@@ -627,23 +627,16 @@ for key -, value in self @@ -640,12 +640,24 @@ elf. -item +_meta.fields.key s(): @@ -688,21 +688,35 @@ f, key, -value +self.get(key, None) )%0A%0A d
646cdaf1d75cf68b6c8c7f81474f80278ec2b31b
Update comment on source of broadcast logic
pyharmony/discovery.py
pyharmony/discovery.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Python port of JavaScript Harmony discovery here: # https://github.com/swissmanu/harmonyhubjs-discover import socket import time import threading import logging UDP_IP = '0.0.0.0' PORT_TO_ANNOUNCE = 61991 logger = logging.getLogger(__name__) class Discovery: de...
Python
0
@@ -437,16 +437,130 @@ ork%22%22%22%0A%0A + # Format of broadcast ported from @swissmanu%0A # https://github.com/swissmanu/harmonyhubjs-discover%0A
3ef154fe39ab68ab4b4e178edb60edddbf5c15b7
Add (gontend-assuming) get_display_url() to Event
gore/models/event.py
gore/models/event.py
import json from django.db import models from django.utils import timezone from django.utils.encoding import force_text from django.utils.timezone import now def determine_type(body): type = 'unknown' if 'exception' in body: type = 'exception' if 'sentry.interfaces.Message' in body: type ...
Python
0.000001
@@ -153,16 +153,60 @@ rt now%0A%0A +from gentry.utils import make_absolute_uri%0A%0A %0Adef det @@ -1718,8 +1718,109 @@ f.data)%0A +%0A def get_display_url(self):%0A return make_absolute_uri('/#/event/%7Bid%7D'.format(id=self.id))%0A
683e995e8be98e0c20b3530fd6729b519ac61eae
Add help
webhookapp.py
webhookapp.py
# import Flask from flask import Flask, request # import custom-made modules import sparkmessage import argparse import prettytable import oscontroller # Create an instance of Flask app = Flask(__name__) TOKEN = "" CON = {} # Index page will trigger index() function @app.route('/') def index(): return 'Hello Wor...
Python
0.000001
@@ -218,16 +218,252 @@ CON = %7B%7D +%0AHELP = %22%22%22%0Ahelp show this message%0Aserver create %3Cname%3E create server%0Aserver list list active servers%0Aflavor list list flavors%0Aimage list list image%0Avolume list list volumes%0A%22%22%22 %0A%0A# Inde...
d60aa60c38d16ae745e336a7cd016bb2fd044b4a
test if the working dir exists
ass2m/ass2m.py
ass2m/ass2m.py
# -*- coding: utf-8 -*- # Copyright(C) 2011 Romain Bignon, Laurent Bachelier # # 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, version 3 of the License. # # This program is distributed in the ...
Python
0.000009
@@ -1017,16 +1017,37 @@ else:%0A + try:%0A @@ -1144,16 +1144,20 @@ + path = o @@ -1177,16 +1177,82 @@ e(path)%0A + except OSError:%0A raise NotWorkingDir()%0A
5cdecf73f4cbc014577cd242c248933b980cb671
Fix a small typo (#166)
gmt/helpers/utils.py
gmt/helpers/utils.py
""" Utilities and common tasks for wrapping the GMT modules. """ import sys import shutil import subprocess import webbrowser from contextlib import contextmanager from ..exceptions import GMTInvalidInput def data_kind(data, x, y): """ Check what kind of data is provided to a module. Possible types: ...
Python
0.999852
@@ -441,17 +441,17 @@ None%60%60 i -s +f not use
90e8cbd23783d516cdea7676fbbfcab2e2664f8c
fix bug
noir/app/web_server.py
noir/app/web_server.py
import os import logging import multiprocessing as mp import asyncio import uvloop import importlib import functools from urllib.parse import urlparse, parse_qsl from aiohttp import web import noir.util as util from noir.router.service_router import service_router logger = logging.getLogger() class ServerConfig: ...
Python
0.000001
@@ -208,62 +208,8 @@ util -%0Afrom noir.router.service_router import service_router %0A%0Alo @@ -1557,24 +1557,83 @@ , request):%0A + from noir.router.service_router import service_router%0A%0A (parse_r
2d141bcf4137d26d333e3f31fcaff9f9b6c8dc2e
fix vector functions not taking any arguments
siuba/dply/vector.py
siuba/dply/vector.py
import pandas as pd import numpy as np from functools import singledispatch from ..siu import Symbolic, create_sym_call,Call def register_symbolic(f): # TODO: don't use singledispatch if it has already been done f = singledispatch(f) @f.register(Symbolic) def _dispatch_symbol(__data, *args, **kwargs):...
Python
0.000004
@@ -2201,19 +2201,20 @@ ef near( +x ):%0A - NotI @@ -2283,16 +2283,17 @@ def nth( +x ):%0A N @@ -2366,16 +2366,17 @@ f first( +x ):%0A N @@ -2436,24 +2436,24 @@ er_symbolic%0A - def last():%0A @@ -2449,16 +2449,17 @@ ef last( +x ):%0A N
9fb7de1bd5e0a697f44008c324ecacf283f8e4eb
Fix for time format
granjaRaces/items.py
granjaRaces/items.py
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy from scrapy.loader.processors import MapCompose, TakeFirst def intCheckDQ(str): if 'DQ' in str: return 99 return int(str) def strTimeToFloat(str): ...
Python
0.000001
@@ -316,22 +316,8 @@ r):%0A -%09retValue = 0%0A %09str @@ -361,16 +361,16 @@ format%0A + %09if '.' @@ -427,16 +427,31 @@ :21.801%0A +%09%09retValue = 0%0A %09%09valTim @@ -475,20 +475,16 @@ )%0A%09%09size -Time = len(v @@ -519,16 +519,8 @@ size -Time - 1 ):%0A%09 @@ -570,17 +570,28 @@ valTime%5B -i +size ...
acb512a4a74f118c5e09ddb508549aed896ae1dd
Fix dynamic split
tests/examples/customnode/views.py
tests/examples/customnode/views.py
from django.views import generic from django.http import HttpResponseRedirect from viewflow.views import task from . import models class DecisionView(task.TaskViewMixin, generic.CreateView): model = models.Decision fields = ['decision'] def form_valid(self, form): self.object = form.save(commit...
Python
0.000034
@@ -479,16 +479,48 @@ n.done() +%0A self.message_complete() %0A%0A
6aa8db30afba817ff9b5653480d6f735f09d9c3a
Add players, match_valid to Ladder
ladder.py
ladder.py
#! /usr/bin/env python3 class Player: def __init__(self, name, rank): self.name = name self.rank = rank def __repr__(self): return '<{:s}(name={:s}, rank={:d})>'.format(self.__class__.__name__, self.name, self.rank) def __str__(self): rank_str = '' if self.rank ...
Python
0
@@ -246,17 +246,16 @@ .rank)%0A%0A -%0A def @@ -426,25 +426,24 @@ (self.rank)%0A -%0A retu @@ -824,16 +824,229 @@ string%0A%0A + def players(self):%0A return set(self.standings)%0A%0A def match_valid(self, player_one, player_two):%0A if not %7Bplayer_one, player_two%7D %3C self.pla...
51fca346cceffb3a67bacbbec04166f49c6448a0
Update get_arxiv_corpus.py
tools/gensimple/get_arxiv_corpus.py
tools/gensimple/get_arxiv_corpus.py
# Freija Descamps <freija@gmail.com> July 2016 # modified to download arxiv corpus import os import wget URL = 'https://dl.dropboxusercontent.com/u/99220436/recontent-data/arXiv1314/' CORPUS_NAME = 'arx' MMFILE = CORPUS_NAME + '.mm' DICTFILE = CORPUS_NAME + '_wordids.txt' SIMMATRIX = CORPUS_NAME + '-lsi.index' LSIM...
Python
0
@@ -173,15 +173,9 @@ a/ar -Xiv1314 +x /'%0A%0A @@ -1068,8 +1068,9 @@ main() +%0A
744b789707d78f216cfb3e1db5c77c9da6962582
add option to turn lamps off at request from Glenn
lamper.py
lamper.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests import os import sys global url #url = '' url = os.environ['LAMPER_URL'] global universe universe = '1' def web_post(url, payload): r = requests.post( url, data=payload, headers={'Content-Type': 'application/x-www-form-urlen...
Python
0
@@ -1218,24 +1218,94 @@ colors = %7B%0A + 'off': %7B%0A 0: 0, # alle andre blir tomme%0A %7D,%0A 'red @@ -2368,32 +2368,37 @@ %0A print(' +off, yellow, green or @@ -2481,16 +2481,21 @@ print(' +off, yellow,
c10b7cb1e8d284f3d09559167751cd43c51d83dd
revert accidental changes to PRESUBMIT.py
tools/memory_inspector/PRESUBMIT.py
tools/memory_inspector/PRESUBMIT.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Top-level presubmit script for memory_inspector. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmit...
Python
0.000001
@@ -344,17 +344,16 @@ %22%0A%0A%0Adef -_ CommonCh @@ -1145,1215 +1145,8 @@ t%0A%0A%0A -def _CheckPrebuiltsAreUploaded(input_api, output_api):%0A import sys%0A import urllib2%0A old_sys_path = sys.path%0A try:%0A sys.path.append(input_api.os_path.join(input_api.PresubmitLocalPath()))%0A from memory_inspect...
08c6ce960f3d96cebd0ea964827550f70232321b
fix setup for new directory structure
host/setup.py
host/setup.py
#!/usr/bin/env python from distutils.core import setup f = open('VERSION', 'r') basil_version = f.readline().strip() f.close() setup( name='Basil', version=basil_version, package_dir={'basil': '', 'basil.HL': 'HL', 'basil.RL': 'RL', 'basil.TL': 'TL', 'basil.UL': 'UL', 'basil.utils': 'utils'}, pack...
Python
0
@@ -193,147 +193,11 @@ kage -_dir=%7B'basil': '', 'basil.HL': 'HL', 'basil.RL': 'RL', 'basil.TL': 'TL', 'basil.UL': 'UL', 'basil.utils': 'utils'%7D,%0A packages=%5B'basil', +s=%5B 'bas @@ -269,28 +269,8 @@ '%5D,%0A - #packages=%5B''%5D,%0A @@ -282,16 +282,23 @@ iption=' +Basil: SILAB mo @@ -458,16 +4...
5a5c25d507540598f989086f6e9cfb7ec815f51c
Rename sdk/redistributable_bin/osx32 to sdk/redistributable_bin/osx
godotsteam/config.py
godotsteam/config.py
def can_build(env, platform): return platform=="x11" or platform=="windows" or platform=="osx" def configure(env): env.Append(CPPPATH=["#modules/godotsteam/sdk/public/"]) # If compiling Linux if env["platform"]== "x11": env.Append(LIBS=["steam_api"]) env.Append(RPATH=["."]) if env["bits"]=="32": env.Appe...
Python
0.000044
@@ -1354,14 +1354,12 @@ _bin/osx -32 '%5D)%0A
cd07f1801f76b8481f2485f92dafb63bf3359c43
add filter sim
run_scripts/filter_sim_json.py
run_scripts/filter_sim_json.py
#encoding=utf-8 import sys if sys.version_info[0] == 2: reload(sys) sys.setdefaultencoding("utf-8") import os import codecs import json import click @click.command() @click.argument("json_path", "json path from get_q2q_sim.py, every cell contain source, predict, score") @click.argument("save_path", "store filter...
Python
0
@@ -653,16 +653,98 @@ (data):%0A + if i %25 100000 == 0:%0A print(%22finished %7B%5D%22.format(i/len(data)))%0A try:%0A if c @@ -774,16 +774,18 @@ eshold:%0A + s @@ -864,16 +864,18 @@ %22%0A + fout.wri @@ -880,16 +880,70 @@ rite(s)%0A + except KeyError:%0A print(cell)%0A...
caec3ea0bb901103a228fd767c32ca90d5632210
Remove mention of `core` from `print_columnized()`-docstring.
shcol/highlevel.py
shcol/highlevel.py
# -*- coding: utf-8 -*- # Copyright (c) 2013-2015, Sebastian Linke # Released under the Simplified BSD license # (see LICENSE file for details). """ Highlevel functions to support some cases where columnizing can be useful. """ from __future__ import print_function from . import config, core, helpers __all__ = ['p...
Python
0
@@ -1007,21 +1007,16 @@ e. See %60 -core. columniz
1abeef7014481083da23caf0324dfbc0e05ceece
fix view
wechat_app.py
wechat_app.py
import io from flask import Flask, request, send_file from flask_redis import Redis from wechat_sdk import WechatConf, WechatBasic import wechat_message_handler app = Flask(__name__) app.config.from_envvar('MY_WECHAT_APP_SETTINGS') redis = Redis(app) wechat_conf = WechatConf( token=app.config['WX_TOKEN'], a...
Python
0.000001
@@ -889,16 +889,21 @@ redis +_conn = app.c @@ -958,16 +958,21 @@ = redis +_conn .get(app
8aa18646a49f1b20198ae7b1892a8e2f4c9d66df
add 'limit', 'offset' and 'page_no' URL parameters
sheer/sheer_api.py
sheer/sheer_api.py
import json import re import os.path from paste.request import parse_formvars from webob import Request, Response from sheer.query import Query class SheerAPI(object): def __init__(self, path, permalink_map): self.site_root = path self.start_response = None self.api_version = None ...
Python
0.00005
@@ -3288,16 +3288,39 @@ = 'from' + or item%5B0%5D == 'offset' :%0A @@ -3391,128 +3391,439 @@ == ' -fields':%0A self.fields = item%5B1%5D.split(',')%0A else:%0A self.args%5Bitem%5B0%5D%5D = item%5B1%5D +limit':%0A self.args%5B'size'%5D = item%5B1%5D%0A ...
1e026ac477f1deb98da28ed5dbe51ebbf4146816
Use repr instead of backticks
src/Mod/Material/Material.py
src/Mod/Material/Material.py
#*************************************************************************** #* * #* Copyright (c) 2013-2015 - Juergen Riegel <FreeCAD@juergen-riegel.net> * #* * #* This pr...
Python
0
@@ -3886,11 +3886,15 @@ int -%60k%60 +repr(k) + %22 @@ -3900,17 +3900,21 @@ %22 : %22 + -%60 +repr( kv_map%5Bk @@ -3918,9 +3918,9 @@ p%5Bk%5D -%60 +) %0A
854d4246fc559de85379bf8ff6df42c456ee1592
simplify migration from pre-ids
sheetsite/chain.py
sheetsite/chain.py
import daff import os from sheetsite.ids import process_ids from sheetsite.site import Site from sheetsite.source import read_source from sheetsite.destination import write_destination import shutil def apply_chain(site, path): if not(os.path.exists(path)): os.makedirs(path) source = site['source'] ...
Python
0.003573
@@ -888,32 +888,72 @@ prev_raw_file)%0A + if os.path.exists(id_file):%0A shutil.c
df5dd28f19a6e82164ecda9278cd73dfef78f048
Use strict template rendering.
sherry/__init__.py
sherry/__init__.py
from flask import Flask app = Flask(__name__) app.config.from_object('sherry.default_settings') import sherry.views
Python
0
@@ -1,12 +1,26 @@ +import jinja2%0A from flask i @@ -30,16 +30,46 @@ rt Flask +%0Afrom sherry import converters %0A%0Aapp = @@ -133,16 +133,121 @@ ttings') +%0Aapp.url_map.converters%5B'mac'%5D = converters.MacConverter%0Aapp.jinja_env.undefined = jinja2.StrictUndefined %0A%0Aimport
61fc451eb16829392f2d982951205542f0ee99be
allow to use redis as storage
pifpaf/drivers/gnocchi.py
pifpaf/drivers/gnocchi.py
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
Python
0
@@ -4441,32 +4441,164 @@ ,%0A %7D%0A + elif storage_driver == %22redis%22:%0A storage_config = %7B%0A %22redis_url%22: self.storage_url,%0A %7D%0A elif sto
62c18241f0da960c44210445a850a834a181e6cd
Add support for Django >=1.6, which dropped django.conf.urls.defaults
shibboleth/urls.py
shibboleth/urls.py
from django.conf.urls.defaults import * from views import ShibbolethView, ShibbolethLogoutView, ShibbolethLoginView urlpatterns = patterns('', url(r'^login/$', ShibbolethLoginView.as_view(), name='login'), url(r'^logout/$', ShibbolethLogoutView.as_view(), name='logout'), url(r'^$', ShibbolethView....
Python
0
@@ -1,12 +1,203 @@ +from distutils.version import StrictVersion%0D%0Aimport django%0D%0Aif StrictVersion(django.get_version()) %3E= StrictVersion('1.6'):%0D%0A from django.conf.urls import patterns, url, include%0D%0Aelse:%0D%0A from django.
35a07403a6421e5f2a4fbdd1ea0cd11627d52cce
Add option to force all prefs into a single container
cloudprefs.py
cloudprefs.py
"""Cloud Preferences API""" # Copyright 2013 Trey Tabner # # 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 la...
Python
0.000001
@@ -929,16 +929,95 @@ name%22)%0A +define(%22collection%22, default=None, help=%22Force preferences to one collection%22)%0A %0A%0Aclass @@ -1307,16 +1307,124 @@ er-Id')%0A + if options.collection:%0A self.collection = database%5Boptions.collection%5D%0A else:%0A
28adc5bd5d51fac404d7e8ae6de2d67c5dbc1a5f
Bump version.
shield/_version.py
shield/_version.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division __version_info__ = (0, 2, 1) __version__ = '.'.join(map(str, __version_info__))
Python
0
@@ -115,9 +115,9 @@ 2, -1 +2 )%0A__
b5e569983cf67f52808865ec2f3373333109e564
Update caffe.py
wigs/caffe.py
wigs/caffe.py
class caffe(Wig): git_uri = 'https://github.com/BVLC/caffe' config_access = ['PATH_TO_NVCC', 'PATH_TO_CUDNN_SO', 'PATH_TO_MATLAB'] dependencies = ['boost', 'protobuf', 'glog', 'gflags', 'hdf5', 'snappy'] optional_dependencies = ['openblas', 'leveldb', 'lmdb', 'opencv'] supported_features = ['openblas', 'python', '...
Python
0.000001
@@ -1886,16 +1886,115 @@ _SO'))%5D%0A +%09%09self.include_dirs += %5Bos.path.join(os.path.dirname(self.cfg('PATH_TO_CUDNN_SO')), '../include')%5D%0A %09%09self.c
17ddd05e35f7cff90530cdb2df0c4971b97e7302
Update logging to log async functions properly
cmcb/utils.py
cmcb/utils.py
import sys from functools import wraps, _make_key import redis def logging(*triggers, out=sys.stdout): """Will log function if all triggers are True""" log = min(triggers) # will be False if any trigger is false def wrapper(function): @wraps(function) def wrapped_function(*args, **kwarg...
Python
0
@@ -4,16 +4,31 @@ ort sys%0A +import inspect%0A from fun @@ -324,32 +324,79 @@ rgs, **kwargs):%0A + result = function(*args, **kwargs)%0A if l @@ -425,19 +425,8 @@ int( -'calling', func @@ -453,16 +453,24 @@ kwargs, + result, file=ou @@ -478,39 +478,239 @@ )%0A re -sult = ...
89af9edbfd9651e93c910b19e6c77bfd0b91394a
Update d.py
at/abc126/d.py
at/abc126/d.py
read = input n = int(read()) v = [[] for i in range(n+1)] # 邻接 used = [0 for i in range(n+1)] # 节点 1~n def add(f,t,w): v[f].append((t, w)) for i in range(n-1): f,t,w = map(int, read().split()) add(f,t,w) add(t,f,w) # 从1出发,贪心即可,1画1,理论不会有回环 # def dfs(f, s, fa=-1): # if s % 2 == 0: # used[f] =...
Python
0.000001
@@ -1,12 +1,27 @@ +# %E4%BA%8C%E5%88%86%E5%9B%BE%E6%9F%93%E8%89%B2%EF%BC%8C%E6%9C%AC%E9%A2%98%E4%B8%AD%E5%9B%BE%E6%98%AF%E6%A0%91%0A read = input
ff77fd14081b7828e9ba6a60b5d9b3e0580d2b54
use call instead of run to make python2 compatible
lab7/paradigm/play_tag_movie_new.py
lab7/paradigm/play_tag_movie_new.py
# from kivy.app import App # from kivy.uix.video import Video import sys import time from pylsl import StreamInfo, StreamOutlet import subprocess try: input = raw_input except NameError: pass info = StreamInfo('Ganglion_EEG', 'Markers', 1, 0.0, 'int32', 'marker') outlet = StreamOutlet(info) i...
Python
0
@@ -541,11 +541,12 @@ ess. -run +call (%5B'm
8772d9c688410feabe5e87f85e4b31bb87052e19
Raise exception rather than manually exiting.
cmdoysters.py
cmdoysters.py
#! /usr/bin/env python3 from __future__ import print_function import json import os import glob import sys import argparse import string class QueryInfo: pass def tokenize(text): """Strip punctuation from free text sentences and split into tokens.""" table = {ord(punc): None for punc in string.punctuati...
Python
0
@@ -1200,35 +1200,29 @@ -sys.exit(1) +raise %0A%0A if @@ -2238,35 +2238,29 @@ -sys.exit(1) +raise %0A%0A
40a18d111952a6bac82c240a008d6f423b5e6838
Use unicode literals
salt/utils/decorators/state.py
salt/utils/decorators/state.py
# -*- coding: utf-8 -*- ''' Decorators for salt.state :codeauthor: :email:`Bo Maryniuk (bo@suse.de)` ''' from __future__ import absolute_import from salt.exceptions import SaltException def state_output_check(func): ''' Checks for specific types in the state output. Raises an Exception in case particula...
Python
0.003092
@@ -138,16 +138,34 @@ e_import +, unicode_literals %0Afrom sa
b2ce9b22d7ac8f96145d9506be4040ec4287e402
clean up a debug message
shtoom/app/base.py
shtoom/app/base.py
from twisted.python import log STATE_NONE = 0x0 STATE_SENDING = 0x1 STATE_RECEIVING = 0x2 STATE_BOTH = 0x3 STATE_DONE = 0x4 class BaseApplication: """ Base class for all applications. """ __cookieCount = 0 _NATMapping = True def __init__(self, prefs=None): #self._options = _dummy() ...
Python
0.000168
@@ -2528,20 +2528,24 @@ ing sip -( +using %25r -) %22%25(mappe
cd2312b23ed9d26902ba7285045df300770642bf
Add a sys.exit call to the child process in the daemon portion of the server. Can't be too careful
pythinclient/server.py
pythinclient/server.py
__author__ = 'Alek Ratzloff <alekratz@gmail.com>' import abc from socket import socket from os.path import exists from os import fork from threading import Thread class ThinServer: __metaclass__ = abc.ABCMeta def __init__(self, port, host='127.0.0.1', recv_size=1024, is_daemon=False, lockfile="/tmp/pythincl...
Python
0.000002
@@ -55,16 +55,27 @@ ort abc%0A +import sys%0A from soc @@ -1795,16 +1795,44 @@ _loop()%0A + sys.exit(0)%0A
b4e147578e6499bf7557736dfa90800ce0a6425e
Fix config file paths
simple/commands.py
simple/commands.py
from collections import namedtuple import sqlite3 import random import os import pathlib import shutil from flask.ext.script import Manager, prompt_bool from flask import Flask import dateutil.parser import simple from simple import bing_images DEFAULT_APP = Flask("simple") try: from simple.app import app exce...
Python
0.000004
@@ -2340,16 +2340,26 @@ , %22logs%22 +, %22static%22 ):%0A @@ -2453,24 +2453,25 @@ ory.mkdir()%0A +%0A print(%22D @@ -4012,16 +4012,21 @@ mplate(%22 +conf/ nginx.ji @@ -4398,16 +4398,21 @@ mplate(%22 +conf/ supervis
602f042caeb2ceb437e124792597bd2cec7aca4f
Remove the statement in coverage tests which left the test database.
src/test_extensions/testrunners/codecoverage.py
src/test_extensions/testrunners/codecoverage.py
import coverage import os, sys from inspect import getmembers, ismodule from django.conf import settings from django.test.simple import run_tests as django_test_runner from django.db.models import get_app, get_apps from django.utils.functional import curry from nodatabase import run_tests as nodatabase_run_tests def...
Python
0
@@ -5169,116 +5169,8 @@ se:%0A - from django.db import connection%0A connection.creation.destroy_test_db = lambda *a, **k: None%0A
6889cdb24cfd6e8f134c46ee28f32b5574c288c5
Fix typo causing syntaxerror... again
src/orderbook.py
src/orderbook.py
import datetime from crypto import get_public_bytestring offers = [] trades = [] message_id = 0 def create_ask(price, quantity, timeout): message = create_msg(options={ 'type': 'ask', 'price': price, 'quantity': quantity, 'timeout': timeout }) offers.append(message) ...
Python
0.000003
@@ -1035,17 +1035,17 @@ cipient' -, +: recipie
f8a721108a593c2ae277641ec3ebe315749070bd
Check array data types.
avena/xcor2.py
avena/xcor2.py
#!/usr/bin/env python """Cross-correlation of image arrays.""" import numpy from numpy import fft from . import filter, image, np, tile _DETREND_FACTOR = 0.10 def _detrend_filter(array): m, n = array.shape r = int(numpy.sqrt(m * n) * _DETREND_FACTOR) f = filter._high_pass_filter((m, n), r) numpy...
Python
0
@@ -1253,16 +1253,56 @@ ays.%22%22%22%0A + assert array1.dtype == array2.dtype%0A z = @@ -1328,16 +1328,36 @@ hape%5B:2%5D +, dtype=array1.dtype )%0A ch
6ee14089b193c7e179fc2a0472644f5684d8bef4
Update this test again to ensure it's trapping the expected exception (DistutilsError) and ensuring that it captures the expected error messages.
setuptools/tests/test_packageindex.py
setuptools/tests/test_packageindex.py
"""Package Index Tests """ import sys import unittest import urllib2 import pkg_resources import httplib import distutils.errors import setuptools.package_index from server import IndexServer class TestPackageIndex(unittest.TestCase): def test_bad_url_bad_port(self): index = setuptools.package_index.Packa...
Python
0.000001
@@ -1810,32 +1810,126 @@ e_scheme(self):%0A + %22%22%22%0A A bad URL with a double scheme should raise a DistutilsError.%0A %22%22%22%0A index = @@ -2219,22 +2219,28 @@ -# Python 2.7.3 +msg = unicode(error) %0A @@ -2252,194 +2252,113 @@ -self. assert -_('getaddrinfo fail...
9e03c98c3c890b65d497be17eb05648fcd6a355a
Set id on start
aws_startup.py
aws_startup.py
import argparse import urlparse import os import ConfigParser import subprocess from requests import Session cur_dir = os.path.dirname(__file__) parser = argparse.ArgumentParser(description='------ AWS Startup Script ------') parser.add_argument('api_dest', type=str, help='Destination to database') params = parser.par...
Python
0.000003
@@ -103,16 +103,102 @@ ession%0A%0A +ZONE_TO_ID = %7B%0A 'eu-west-1a': 'a',%0A 'eu-west-1b': 'b',%0A 'eu-west-1c': 'c'%0A%7D%0A%0A cur_dir @@ -1309,16 +1309,105 @@ eturl()) +%0A if zone in ZONE_TO_ID:%0A config.set('app:api', 'id', ZONE_TO_ID%5Bzone%5D) %0A%0A
c039e4a2e322ee4e0a173f164be598dc630d3579
fix ProxyError inheritance
libmproxy/proxy/primitives.py
libmproxy/proxy/primitives.py
from __future__ import absolute_import class ProxyError(Exception): def __init__(self, code, msg, headers=None): self.code, self.msg, self.headers = code, msg, headers def __str__(self): return "ProxyError(%s, %s)" % (self.code, self.msg) class ConnectionTypeChange(Exception): """ Ge...
Python
0.000001
@@ -33,16 +33,17 @@ import%0A%0A +%0A class Pr @@ -85,34 +85,38 @@ __(self, code, m -sg +essage , headers=None): @@ -129,146 +129,102 @@ s -elf.code, self.msg, self.headers = code, msg, headers%0A%0A def __str__(self):%0A return %22ProxyError(%25s, %25s)%22 %25 (self.code, self.msg)%0A +uper(ProxyErro...
ff492e1acb78f43677c926b231a04da7ac1012b4
use full path of library insted of the relative path, when import a module.
libqtile/widget/quick_exit.py
libqtile/widget/quick_exit.py
# Copyright (c) 2019, Shunsuke Mie # # 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, publish, distr...
Python
0
@@ -1120,17 +1120,31 @@ o%0A%0Afrom -. +libqtile.widget import @@ -1157,10 +1157,16 @@ rom -.. +libqtile imp
a40f96ba76657ee1180089447ce6f35d99c00e3d
fix python dependance
l10n_it_account/__openerp__.py
l10n_it_account/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2013 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
Python
0.000005
@@ -1228,16 +1228,39 @@ partner +, and fiscal code check %0A- Check @@ -2362,10 +2362,86 @@ ': True%0A + 'external_dependencies': %7B%0A 'python': %5B'codicefiscale'%5D,%0A %7D%0A%0A%0A %7D%0A
289d9d811a6c4edb94c69d95f478cdfe2de364b7
Add DEFAULT_AUTOLOAD
labmanager/rlms/ext/virtual.py
labmanager/rlms/ext/virtual.py
# -*-*- encoding: utf-8 -*-*- # # gateway4labs is free software: you can redistribute it and/or modify # it under the terms of the BSD 2-Clause License # gateway4labs is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A P...
Python
0.000012
@@ -1540,24 +1540,53 @@ BaseRLMS):%0A%0A + DEFAULT_AUTOLOAD = True%0A%0A def __in
f04667fc229e8b9be2567b9687a6cc5ec5980ab1
remove TL from master component __init__
landlab/components/__init__.py
landlab/components/__init__.py
from .craters import CratersComponent from .chi_index import ChiFinder from .diffusion import LinearDiffuser from .fire_generator import FireGenerator from .flexure import Flexure from .flow_accum import AccumFlow from .flow_routing import FlowRouter, DepressionFinderAndRouter from .glacier_thin_ice_model import Glacie...
Python
0
@@ -857,70 +857,8 @@ der%0A -from .transport_limited_fluvial import TransportLimitedEroder%0A from @@ -1434,32 +1434,8 @@ - TransportLimitedEroder, Ste
85afc6bdae871d9ffe90a50b7b7232938e6f6beb
bump revision number
gunicorn/__init__.py
gunicorn/__init__.py
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. version_info = (0, 7, 0) __version__ = ".".join(map(str, version_info))
Python
0.000001
@@ -144,17 +144,17 @@ (0, 7, -0 +1 )%0A__vers
88d8e9ce14fe94edd4b0b2116b086464ba457c78
use proper kwargs...
cogs/music.py
cogs/music.py
import discord from discord.ext import commands from utils import aiohttp_wrap as aw class MusicInfo: """A cog for retrieving music information (not playing it)""" URL = 'http://ws.audioscrobbler.com/2.0/' LOGO_URL = 'https://www.last.fm/static/images/lastfm_logo_facebook.1b63d4451dcc.png' NO_RESULT...
Python
0
@@ -2499,20 +2499,21 @@ List', -text +value ='%5Cn'.jo
4e385215e5dc931cee561172309ff0155b9805f2
Update TL.py
collect/TL.py
collect/TL.py
# printで表示する状態情報は半角6文字以内にすること import os import time import datetime import hashlib import urllib import sqlite3 import tweepy as tp import detector import oauth class StreamListener(tp.StreamListener): def __init__(self, api): """コンストラクタ""" self.api = api # 保存先 self.old_date = date...
Python
0.000001
@@ -5467,18 +5467,16 @@ - # print(%22
2f3b9007c077e26f30aa4ac75a2dbf24949f05ca
enhance models relationships
club/models.py
club/models.py
# -*- coding: utf-8 -*- from django.contrib.auth.models import AbstractBaseUser, BaseUserManager from django.db import models USER_ROLES = ( ('A', 'Admin'), ('M', 'Moderator'), ('D', 'Default'), ) ADMIN_USER = 'A' MOD_USER = 'M' COMMON_USER = 'D' class UserManager(BaseUserManager): def create_user(...
Python
0
@@ -2083,24 +2083,86 @@ w_add=True)%0A + creator = models.ForeignKey(User, related_name=%22stories%22)%0A closed = @@ -2223,16 +2223,16 @@ losed')%0A - publ @@ -2750,99 +2750,125 @@ -users = models.ManyToManyField(User, through='UsersRelSegments', verbose_name='Related user +author = models.Foreign...
e918ef8240f0f532d10ee3694816b0c9899d3f30
add tag property to DomainRecord
linode_api4/objects/domain.py
linode_api4/objects/domain.py
from __future__ import absolute_import from linode_api4.errors import UnexpectedResponseError from linode_api4.objects import Base, DerivedBase, Property class DomainRecord(DerivedBase): api_endpoint = "/domains/{domain_id}/records/{id}" derived_url_path = "records" parent_id_name = "domain_id" prop...
Python
0
@@ -809,24 +809,63 @@ able=True),%0A + 'tag': Property(mutable=True),%0A %7D%0A%0A%0Aclas
3f9cb658d1b3070534b00e32316284b92748b3e9
Use roots_approx_equal
cxroots/tests/test_simplerootfinding.py
cxroots/tests/test_simplerootfinding.py
import unittest import numpy as np from scipy import pi from cxroots import Circle, Rectangle, PolarRect from cxroots.tests.SetsApproxEqual import sets_approx_equal class TestRootfindingPolynomial(unittest.TestCase): def setUp(self): self.roots = roots = [-1.234, 0, 1+1j, 1-1j, 2.345] self.f = lambda z: (z-roo...
Python
0.000005
@@ -122,12 +122,8 @@ sts. -Sets Appr @@ -137,18 +137,19 @@ import -se +roo ts_appro @@ -282,16 +282,52 @@ 2.345%5D%0A +%09%09self.multiplicities = %5B1,1,1,1,1%5D%0A %09%09self.f @@ -885,38 +885,27 @@ :%0A%09%09 -approxRoots, multiplicities = +roots_approx_equal( self @@ -938,52 +938,43 @@ .df) -%0A%09%09s...
e30a74fdcb9f297d299f37b5bbf75f4de2409a60
Truncate request errors at 200 bytes not 100.
dashboard/dashboard/services/request.py
dashboard/dashboard/services/request.py
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function from __future__ import division from __future__ import absolute_import import httplib import httplib2 import json impo...
Python
0.000001
@@ -3505,25 +3505,25 @@ r(content%5B0: -1 +2 00%5D)),%0A @@ -3717,17 +3717,17 @@ ntent%5B0: -1 +2 00%5D)), c
fa772e8a4abe0e9fba10720a0ebaadb8d240dbde
allow reading only first n rows in amazon data
polara/datasets/amazon.py
polara/datasets/amazon.py
from ast import literal_eval import gzip import pandas as pd def parse_meta(path): with gzip.open(path, 'rt') as gz: for line in gz: yield literal_eval(line) def get_amazon_data(path=None, meta_path=None): res = [] if path: data = pd.read_csv(path, header=None, ...
Python
0.000001
@@ -224,16 +224,28 @@ ath=None +, nrows=None ):%0A r @@ -450,16 +450,56 @@ rating'%5D +,%0A nrows=nrows )%0A @@ -597,16 +597,29 @@ ta_path) +, nrows=nrows )%0A
dd65ea98f7fa00394a302ac0e5e0bc32b6298277
Set base
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Baptiste JAMIN # Copyright (c) 2016 Baptiste JAMIN # # License: MIT # """This module exports the 42Norminette plugin class.""" import shlex from SublimeLinter.lint import Linter, persist import sublime import os imp...
Python
0.000001
@@ -795,16 +795,47 @@ '''%0A + %0A line_col_base = (1, 0) %0A mul
c545b2cac93e18be11efeacad28bb0d7e0d4bef8
Reposition W293
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Aparajita Fishman # Copyright (c) 2013-2014 Aparajita Fishman # Copyright (c) 2015-2016 The SublimeLinter Community # # License: MIT # """This module exports the Flake8 plugin linter class.""" from SublimeLinter.li...
Python
0.000001
@@ -1999,17 +1999,27 @@ ol, m, v -v +irtual_view ):%0A @@ -2069,17 +2069,27 @@ ode -== +in ( 'W291' +, 'W293') :%0A @@ -2102,38 +2102,56 @@ -start, end = vv.full_line(line +txt = virtual_view.select_line(line).rstrip('%5Cn' )%0A @@ -2183,23 +2183,16 @@ ol, +l en -d - start - 1 +(txt) )%0A%0A ...
38896abcd046c8564a4563c9d34418c962d025a4
Revert "Preserve tmpdirs global across reloads"
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Fred Callaway # Copyright (c) 2015 Fred Callaway # Copyright (c) 2017 FichteFoll <fichtefoll2@googlemail.com> # # License: MIT # """This module exports the Mypy plugin class.""" import logging import os import shuti...
Python
0
@@ -713,47 +713,8 @@ ir.%0A -try:%0A tmpdirs%0Aexcept NameError:%0A tmpd