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
ba83df5099879576db2f074cb2b046bbad3a482c
fix identation issue after auto format
insert_ts_reference.py
insert_ts_reference.py
import sublime, sublime_plugin, os.path class InsertTsReferenceCommand(sublime_plugin.TextCommand): def run(self, edit): comment_template = '/// <reference path="$PATH$" />' view = self.view references_file_name = sublime.load_settings('InsertTsReference').get('references_file_name', 'references.ts'); ...
Python
0.000001
@@ -121,16 +121,18 @@ t):%0A + comment_ @@ -176,24 +176,26 @@ H$%22 /%3E'%0A + view = self. @@ -199,16 +199,18 @@ lf.view%0A + refe @@ -321,16 +321,18 @@ ');%0A + + if view @@ -344,16 +344,18 @@ t None:%0A + loc @@ -453,16 +453,18 @@ ')%0A + + if local @@ -544,16 +544,...
ba9e33c17e91d48124834faaf13af954f11b22d8
fix publishing path bug
tarbell_config.py
tarbell_config.py
# -*- coding: utf-8 -*- """ Tarbell project configuration """ # Short project name NAME = "geografiadedolor" # Descriptive title of project TITLE = "Geografia de dolor" # Google spreadsheet key SPREADSHEET_KEY = "1_Duj8Upko57n-AXHFQCa_vy3zaJx19hjvnwPuX5otJo" # Exclude these files from publication EXCLUDES = ["*.md...
Python
0.000001
@@ -2442,78 +2442,8 @@ ')%0A%0A - if not os.path.exists(root_path):%0A os.makedirs(root_path)%0A%0A @@ -2562,31 +2562,148 @@ th, -'%7B0%7D.html'.format(slug) +slug)%0A if not os.path.exists(page_path):%0A os.makedirs(page_path)%0A index_path = os.path.join(page_path, 'index.h...
d77f81c1b2272f79203b5b50ee8b3975dfb8f258
Revert to simple render_template for now.
hxl_proxy.py
hxl_proxy.py
from urllib2 import urlopen import sys from flask import Flask, Response, request, render_template, url_for, stream_with_context from hxl.parser import HXLReader, genHXL, genJSON, genHTML from hxl.filters import parse_tags, fix_tag from hxl.filters.count import HXLCountFilter from hxl.filters.norm import HXLNormFilter ...
Python
0
@@ -2673,43 +2673,14 @@ urn -Response(stream_with_context(stream +render _tem @@ -2709,15 +2709,12 @@ ame= -'XXXXX' +name , so @@ -2725,18 +2725,16 @@ =source) -)) %0A els
4c892a5bc034e404db7a56a8c8d524ff6c5abdbc
Add coordinates
tarrasch/board.py
tarrasch/board.py
import json import random import cPickle from chess import Board, SQUARES_180 from .database import singleton as db class TarraschNoBoardException(Exception): pass class TarraschBoard(Board): """An augmented Board from python-chess which also knows how to do useful things like persist itself, build itse...
Python
0.998461
@@ -3410,16 +3410,21 @@ rd/?s=s& +cm=o& p=%7B%7D#%7B%7D'
a9ab7965b925c0ed3997c5eed7924cf1d088c231
Improve Log
app/Torweb.py
app/Torweb.py
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio import tornado import tornado.httpserver import tornado.ioloop import tornado.web import tornado.netutil import tornado.process import platform import tornado.options from Log import Log from db import DB from db import Redis from handler.page import Page...
Python
0.000001
@@ -229,28 +229,8 @@ ons%0A -from Log import Log%0A from @@ -243,16 +243,16 @@ port DB%0A + from db @@ -598,32 +598,33 @@ %E5%8F%B0%E6%97%A5%E5%BF%97%E9%AB%98%E4%BA%AE%E8%BE%93%E5%87%BA%0A +# tornado.options. @@ -1212,58 +1212,8 @@ .1'%0A - _log = Log()%0A self.log = _log.info%0A @@ ...
a6a74ceadf855bdb47fd4962f955af73017c7e26
Add docstring for writers API
app/api/writers.py
app/api/writers.py
# Core from app.api import api from flask import json, abort from flask.ext.cors import cross_origin from urllib import parse # Models from app.models.writer import Writer @cross_origin() @api.route('/writers', methods=['GET']) def get_writers_names(): """ :return: Return a list of all writers names """ ...
Python
0
@@ -233,25 +233,24 @@ f get_writer -s _names():%0A @@ -263,33 +263,79 @@ -:r +R eturn -: Return a list of + all writer names existing in the database%0A :return: JSON with all @@ -337,25 +337,24 @@ h all writer -s names%0A %22 @@ -741,32 +741,173 @@ t_writer(name):%0A + %22%22%22%0A Return ...
5e94d5e04171155198fb40f35f04cd8dea99b5f0
Fix bug in cataloging that would enter files with -1 when cataloging failed.
task/checkFile.py
task/checkFile.py
#!/usr/bin/env python import os,re,pprint,subprocess,sys,datetime,MySQLdb Db = MySQLdb.connect(read_default_file="/etc/my.cnf",read_default_group="mysql",db="Bambu") Cursor = Db.cursor() usage = "\n usage: checkFile.py <file> \n" #==================================================================================...
Python
0
@@ -1573,24 +1573,52 @@ .split('/')%0A + if 'crab_' in file:%0A dataset @@ -1629,16 +1629,20 @@ -3%5D%0A + + version @@ -1653,16 +1653,20 @@ -4%5D%0A + + mitcfg = @@ -1671,16 +1671,97 @@ = f%5B-5%5D +%0A else:%0A dataset = f%5B-2%5D%0A version = f%5B-3%5D%0A ...
522b197500bffb748dc2daf3bf0ea448b3094af7
Add another missing heroku config variable
example_config.py
example_config.py
""" File to easily switch between configurations between production and development, etc. """ import os # You must set each of these in your heroku environment with the heroku # config:set command. See README.md for more information. HEROKU_ENV_REQUIREMENTS = ('HEROKU', 'SECRET_KEY', 'GITHUB_CLIENT_ID', ...
Python
0.000001
@@ -359,16 +359,70 @@ ASE_URL' +,%0A 'SQLALCHEMY_DATABASE_URI' )%0A%0A%0Aclas
33b67fa61dd6e45c510dc22a39e5373479500cae
Add outsys() that prints to console while a script is running
akvo/scripts/cordaid/__init__.py
akvo/scripts/cordaid/__init__.py
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. import datetime import os import sys ...
Python
0.000007
@@ -1307,16 +1307,43 @@ = 'NL-1' +,%0A OTHERS_ORG_ID = 1653, %0A)%0A%0A# co @@ -1588,19 +1588,21 @@ al))%0A%0A# +%22 me. +%22 isn't s @@ -2495,17 +2495,84 @@ UBDIR)%0A%0A -%0A +def outsys(txt):%0A sys.stdout.write(txt)%0A sys.stdout.flush()%0A%0A# base_log @@ -3142,16 +3142,34 @@ mn_names +, to_conso...
9329265c00753f93d02aeea28778ec4dcf321310
Update sock_conn_test.py
apps/sock/sock_conn_test.py
apps/sock/sock_conn_test.py
#!/usr/bin/python import socket import os import sys import struct import time ETYPE_VALUE_MAX = 8000 def main(): SERVER_ADDR = "125.7.128.41" SERVER_PORT = 8283 print " try connecting .... " sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM ) ret_conn = sock.connect( ( SERVER_ADDR, SERVER_PORT ) ) ...
Python
0.000004
@@ -141,10 +141,10 @@ 128. -41 +xx %22%0A%09S
90345202c207fc428e594ff51c0e1cee26119887
Add docs for f9ccf06c5cac6901ce5585658b575f8ec2a995ce
lala/util.py
lala/util.py
"""Helpers to be used with plugins""" import lala.pluginmanager from types import FunctionType from inspect import getargspec from re import compile _BOT = None class command(object): """ Decorator to register a command. The name of the command is the `__name__` attribute of the decorated function. ...
Python
0.000002
@@ -1373,16 +1373,209 @@ rred(s). +%0A%0A .. versionchanged:: 0.5%0A The third argument received by a command function used to include the%0A name of the command itself. Since version 0.5 this is no longer the case. %0A %22%22%22
50acc40a9ca41bda276fabbbc779ee21eb917c6f
Fix name.
security_monkey/watchers/custom/password_policy.py
security_monkey/watchers/custom/password_policy.py
# Copyright 2015 Netflix, 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...
Python
0.000011
@@ -2958,20 +2958,46 @@ ame= +'%7B%7D - Password Policy'.format( account -.name +) %0A
7532ed68d6f6977d87d63d3b92751b780c6e4bab
Validate active virtualenv on exec
sublime_virtualenv.py
sublime_virtualenv.py
import logging import os.path import shlex import shutil import sublime import sublime_plugin import Default as sublime_default from . import virtualenv_lib as virtualenv logger = logging.getLogger(__name__) SETTINGS = "Virtualenv.sublime-settings" def settings(): return sublime.load_settings(SETTINGS) d...
Python
0.000001
@@ -2080,178 +2080,449 @@ -postactivate = virtualenv.activate(venv)%0A kwargs%5B'path'%5D = postactivate%5B'path'%5D%0A kwargs%5B'env'%5D = dict(kwargs.get('env', %7B%7D), **postactivate%5B'env'%5D)%0A +if venv:%0A if not virtualenv.is_valid(venv):%0A self.set_virtualenv(No...
52841517a575ba7df354b809cb23bc2851c9fcd4
Remove carriage returns from the output
exec_proc.py
exec_proc.py
#!/usr/bin/env python # Copyright 2014 Boundary, 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 o...
Python
0.000153
@@ -1090,51 +1090,8 @@ rns%0A - command = self.command.strip('%5Cr')%0A @@ -1113,16 +1113,21 @@ x.split( +self. command) @@ -1272,16 +1272,42 @@ icate()%0A + o = o.strip('%5Cr')%0A
cb31b795a816acd3b52952649a3fd628bd70ae10
Update runner
source/build.py
source/build.py
#!/usr/bin/env python
Python
0.000002
@@ -15,8 +15,976 @@ python%0A +%0Afrom utils import stream%0Afrom utils import preprocessor%0Afrom utils import vader%0Afrom utils import select%0Afrom utils import sort%0A%0A%0Aclass DBBuilder:%0A def __init__(self, config_path):%0A self.stream_api = stream.StreamAPI(config_path)%0A self.tweet_strea...
a18b9604b78ef6f52ff38a92924eb70545bc7785
Remove useless print
Tweet2Rss.py
Tweet2Rss.py
#!/usr/bin/env python3 import urllib.request from urllib.error import HTTPError import cherrypy from bs4 import BeautifulSoup from jinja2 import Template import re """ Prototype of the web app """ __author__ = "Eric \"Fistons\"" __copyright__ = "Copyright 2016" __license__ = "MIT License" __version__ = "1.0-SNAPSHO...
Python
0.000045
@@ -2202,30 +2202,8 @@ ages -%0A print(images) %0A%0A
21fad559f02c3eee41de736636cefc97027184dc
Fix type hint for display_name in common
app/common.py
app/common.py
import random import string from discord.ext.commands import Context rand = random.SystemRandom() def display_name(ctx: Context) -> string: return ctx.message.author.nick or ctx.message.author.name
Python
0
@@ -10,22 +10,8 @@ ndom -%0Aimport string %0A%0Afr @@ -122,11 +122,8 @@ str -ing :%0A
f6f6ff80a1ac052eb327d8d6dd237c288ad30b1d
Tag v0.2.0
indexdigest/__init__.py
indexdigest/__init__.py
""" index_digest Python module """ VERSION = '0.1.0'
Python
0
@@ -45,9 +45,9 @@ '0. -1 +2 .0'%0A
4bc02e26c66ca22107c1ef53cbea730db85e3221
improve splitBySection to handle more inputs
functions.py
functions.py
import unittest import praw import httplib import re from itertools import groupby def getLiquipediaEvents(): conn = httplib.HTTPConnection('wiki.teamliquid.net') conn.connect() request = conn.putrequest('GET','/starcraft2/api.php?format=txt&action=query&titles=Liquipedia:Tournament_News&prop=revisions&rvprop=co...
Python
0
@@ -1572,96 +1572,205 @@ :%0A -return %5Blist(group) for k, group in groupby(lines, lambda x: isSectionLine(x)) if not k%5D +sections = %5B%5D%0A section = %5B%5D%0A for line in lines:%0A if isSectionLine(line):%0A sections.append(section)%0A section = %5B%5D%0A section.append(line)%0A sections.ap...
a0cfa7b79b97f02d90f23dd612e57491765ab1cf
Fix #386 (too many file handlers)
south/logger.py
south/logger.py
import sys import logging from django.conf import settings class NullHandler(logging.Handler): def emit(self, record): pass h = NullHandler() _logger = logging.getLogger("south") _logger.addHandler(h) _logger.setLevel(logging.DEBUG) # TODO: Add a log formatter? def get_logger(): debug_on = getattr(s...
Python
0
@@ -53,16 +53,57 @@ ttings%0A%0A +# Create a dummy handler to use for now.%0A class Nu @@ -176,27 +176,8 @@ ss%0A%0A -h = NullHandler()%0A%0A _log @@ -228,17 +228,29 @@ Handler( -h +NullHandler() )%0A_logge @@ -279,55 +279,96 @@ UG)%0A -# TODO: Add a log formatter?%0A%0Adef get_logger(): +%0Adef get_logger():%0A...
90bc2ad8cec10616e72f75c98727847f4c1fd350
Fix typo in test_stream_error_pm_to_bot_owner comment.
zerver/webhooks/helloworld/tests.py
zerver/webhooks/helloworld/tests.py
# -*- coding: utf-8 -*- from django.conf import settings from zerver.lib.test_classes import WebhookTestCase from zerver.models import get_system_bot class HelloWorldHookTests(WebhookTestCase): STREAM_NAME = 'test' URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}&stream={stream}" PM_URL_TEM...
Python
0.000001
@@ -2106,10 +2106,10 @@ te t -a h +a t th
b7376a09d4698351940b61c71d85186ddb1d2b21
Send proper exception when getting person with null id
zou/app/services/persons_service.py
zou/app/services/persons_service.py
import slugify from sqlalchemy.exc import StatementError from flask_jwt_extended import get_jwt_identity from zou.app.models.person import Person from zou.app.utils import fields from zou.app.services.exception import PersonNotFoundException def get_persons(): """ Return all person stored in database. ...
Python
0
@@ -632,32 +632,99 @@ record.%0A %22%22%22%0A + if person_id is None:%0A raise PersonNotFoundException()%0A%0A try:%0A
69fc5b4608ea6da566dac7aba87312fe9c27c717
Update saliency_interpreter.py (#4286)
allennlp/interpret/saliency_interpreters/saliency_interpreter.py
allennlp/interpret/saliency_interpreters/saliency_interpreter.py
from allennlp.common import Registrable from allennlp.common.util import JsonDict from allennlp.predictors import Predictor class SaliencyInterpreter(Registrable): """ A `SaliencyInterpreter` interprets an AllenNLP Predictor's outputs by assigning a saliency score to each input token. """ def __i...
Python
0
@@ -510,142 +510,44 @@ nds -a modification to the input text that would change the model's%0A prediction in some desired manner (e.g., an adversarial attack) +saliency values for each input token .%0A%0A
5ab0c1c1323b2b12a19ef58de4c03236db84644d
Remove old views and replace with new PasswordResetConfirmView
cellcounter/accounts/urls.py
cellcounter/accounts/urls.py
from django.conf.urls import patterns, url from cellcounter.accounts import views urlpatterns = patterns('', url('^new/$', views.RegistrationView.as_view(), name='register'), url('^(?P<pk>[0-9]+)/$', views.UserDetailView.as_view(), name='user-detail'), url('^(?P<pk>[0-9]+)/delete/$', views.UserDeleteView....
Python
0
@@ -532,98 +532,8 @@ '),%0A - url('%5Epassword/reset/done/$', views.password_reset_done, name='password-reset-done'),%0A @@ -626,193 +626,48 @@ -'django.contrib.auth. views. -p +P assword -_r +R eset -_c +C onfirm -', %7B%0A 'template_name': 'accounts/reset_confirm.html',%0A 'p...
b8dbcf7b7a686109dd937ffbc73dcbaeb20a9d3b
Bring back a comment about coding parser behavior
aspen/resources/__init__.py
aspen/resources/__init__.py
""" aspen.resources +++++++++++++++ Aspen uses resources to model HTTP resources. Here is the class hierarchy: Resource Logic Pages Content Pages +-- DynamicResource ----------------------------- | +-- NegotiatedResource 2 1 or m...
Python
0
@@ -2412,16 +2412,172 @@ is -None and +not None:%0A # If we found a match in the first line, skip the second. This%0A # matches Python's observed behavior.%0A pass%0A elif pot @@ -2836,34 +2836,29 @@ -fulltext + +line = line.split @@ -2917,26 +2917,8 @@ ng)%...
d913afd26ca817efe6b0630f9d5fdb49a0cc4284
Update utils.py
gem/utils.py
gem/utils.py
from django.utils.http import urlencode from django.conf import settings def provider_logout_url(request): """ This function is used to construct a logout URL that can be used to log the user out of the Identity Provider (Authentication Service). :param request: :return: """ site = re...
Python
0.000001
@@ -509,17 +509,16 @@ ite.oidc -_ settings
f0acf5023db56e8011a6872f230514a69ec9f311
Use new MainApplication Tk class.
extractor.py
extractor.py
import extractor.ui.mainapplication as ui import Tkinter as tk def main(): root = tk.Tk() root.title('SNES Wolfenstein 3D Extractor') root.minsize(400, 100) ui.MainApplication(root).pack(side="top", fill="both", expand=True) root.mainloop() main()
Python
0
@@ -69,16 +69,18 @@ main():%0A +## root @@ -90,16 +90,18 @@ tk.Tk()%0A +## root @@ -140,16 +140,18 @@ actor')%0A +## root @@ -169,16 +169,18 @@ 0, 100)%0A +## ui.M @@ -243,16 +243,18 @@ d=True)%0A +## root @@ -264,16 +264,52 @@ inloop() +%0A ui.MainApplication().mainloop() %0A%0Amain(...
cc7cd9accce7aa53f1bff9416c341a01f615dd35
Remove CSV from supported formats
ckanext/officedocs/plugin.py
ckanext/officedocs/plugin.py
import ckan.lib.helpers as h import ckan.plugins as p import ckan.plugins.toolkit as tk from six.moves.urllib.parse import quote_plus class OfficeDocsPlugin(p.SingletonPlugin): p.implements(p.IConfigurer) p.implements(p.IResourceView) def update_config(self, config_): tk.add_template_directory(c...
Python
0.000001
@@ -993,15 +993,8 @@ LS%22, - %22CSV%22, %0A
aed4c22faff1f4b2db13c6717ca8fe97db9448ac
Fix spec_version generation
spec_version.py
spec_version.py
#~autogen ../python/templates/python_spec_version spec_version = "spec: 0.9.3-pre-r1, kernel: v3.16.7-ckt10-4-ev3dev-ev3" #~autogen
Python
0
@@ -7,35 +7,8 @@ gen -../python/templates/python_ spec @@ -49,17 +49,17 @@ .3-pre-r -1 +2 , kernel @@ -76,11 +76,11 @@ ckt1 -0-4 +6-7 -ev3
bdd46649193f5c962368431669c554709c4620b8
Add missing license information
fasm2bels.py
fasm2bels.py
import os import subprocess import edalize from toolchain import Toolchain from symbiflow import VPR, NextpnrXilinx from utils import Timed, get_vivado_max_freq, which class VPRFasm2Bels(VPR): """This class is used to generate the VPR -> Fasm2bels flow. fasm2bels is a tool that, given a bitstream, can repr...
Python
0
@@ -1,12 +1,287 @@ +#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A#%0A# Copyright (C) 2020 The SymbiFlow Authors.%0A#%0A# Use of this source code is governed by a ISC-style%0A# license that can be found in the LICENSE file or at%0A# https://opensource.org/licenses/ISC%0A#%0A# SPDX-License-Identifier: ISC%0A%0A i...
9a01060d68b491bc84bb3958afeb0781ffb278bc
fix test
tests/server/blueprints/cases/test_cases_controllers.py
tests/server/blueprints/cases/test_cases_controllers.py
import copy from flask import Flask from scout.server.blueprints.cases.controllers import (case, cases, case_report_content) def test_cases(adapter, case_obj, institute_obj): # GIVEN a non prioritized case case = case_obj assert not case['status'] == 'prioritized' adapter.case_collection.insert_one(...
Python
0.000002
@@ -238,20 +238,16 @@ assert -not case%5B'st @@ -257,27 +257,24 @@ s'%5D == ' -prioritized +inactive '%0A ad @@ -495,64 +495,8 @@ 2)%0A%0A - assert adapter.case_collection.find().count() == 2%0A%0A @@ -914,17 +914,27 @@ ert -len(data) +data%5B'found_cases'%5D ==
fde18f54087dcf79b8a1ff0c36cc6214ce366386
Update P04_updateProduce fixed AttributeError by changing depreciated method
books/AutomateTheBoringStuffWithPython/Chapter12/P04_updateProduce.py
books/AutomateTheBoringStuffWithPython/Chapter12/P04_updateProduce.py
#! python3 # P04_updateProduce.py - Corrects costs in produce sales spreadsheet. # # Note: # - The produceSales.xlsx workbook can be downloaded from # https://nostarch.com/automatestuff/ import openpyxl wb = openpyxl.load_workbook("produceSales.xlsx") sheet = wb.get_sheet_by_name("Sheet") # The produce types and t...
Python
0
@@ -511,25 +511,15 @@ eet. -get_highest +max _row -() ):
e242dd991b99c3d18c83a86f5c29063517015ece
Fix "`path` is not defined" warning
generator.py
generator.py
#!/usr/bin/env python3 from os import listdir from os.path import isfile, isdir, join import argparse import subprocess import sys NOTHING_TO_BE_DONE = 0 NEED_UPDATE = 1 FAILURE = 2 DEFAULT_GIR_DIRECTORY = 'gir-files' DEFAULT_GIR_PATH = './gir/target/release/gir' def run_command(command, folder=None): if fold...
Python
0.000009
@@ -4156,36 +4156,50 @@ ting...%22.format( -path +conf.gir_directory ))%0A retur @@ -4424,32 +4424,41 @@ ting...%22.format( +conf.gir_ path))%0A r
4f6640ad2c33f0db3f2c6d40aa9a07d28710bda6
fix channel name
software/control/fall_detect_demo/fall_detector.py
software/control/fall_detect_demo/fall_detector.py
from __future__ import division import lcm import os import sys sys.path.append(os.path.expanduser('~/drc/software/build/lib/python2.7/dist-packages')) import drc m = lcm.LCM() class FallDetector: def __init__(self): self.decay_rate = 0.2 self.zmp_error = 0 self.last_t = None def hand...
Python
0.000003
@@ -822,16 +822,27 @@ scribe(%22 +CONTROLLER_ ZMP_STAT
572febfdc4e9467f2836bb35e41c2d0fa2b90943
Update models.py
app/models.py
app/models.py
""" Definition of models. """ from django.db import models from django.contrib.auth.models import User class Shop(models.Model): shopName = models.TextField() # название магазина class ShopTag(models.Model): shop = models.ForeignKey(Shop) tag = models.TextField() # тег к конкретному магазину class D...
Python
0
@@ -2286,16 +2286,66 @@ %D1%82%D1%87%D0%B5%D1%81%D1%82%D0%B2%D0%BE%0A + birthday = models.DateField() # %D0%B4%D0%B5%D0%BD%D1%8C %D1%80%D0%BE%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D1%8F%0A depa
9cbd550ef20536e35efce8909c54426e423de64e
call fibonacci_iterative
fibonacci.py
fibonacci.py
#!/usr/bin/env python3 import logging_util class Fibonacci: """ https://en.wikipedia.org/wiki/Fibonacci_number Uses memoization to store previous results in a dictionary and reduce execution time https://en.wikipedia.org/wiki/Memoization """ def __init__(self): self.logger = logging...
Python
0.000032
@@ -2724,10 +2724,51 @@ acci(10) +%0A result = fib.fibonacci_iterative(10) %0A%0A
31071fb6ca4e894dc42aefe7218c722f4f0c0e26
Update file.
get_names.py
get_names.py
class Get_names: def __init__(self): import os import sys directorio_actual = os.getcwd() print directorio_actual from time import sleep sleep(5) os.chdir(directorio_actual + '/TLEs') print os.getcwd() sleep(5) print sys.argv[1] sleep(5) abrir_tle = open(sys.argv[1], 'r') lista...
Python
0
@@ -1395,19 +1395,19 @@ results/ -pyo +PyO rbital') @@ -1536,17 +1536,16 @@ rbitron%0A -# %09%09os.chd @@ -1566,17 +1566,16 @@ script)%0A -# %09%09os.chd @@ -1599,24 +1599,32 @@ ipt + '/ +results/ Orbitron /Output' @@ -1619,22 +1619,14 @@ tron -/Output ')%0A%09%09%0A -# %09%09cr @@ -1664,17 +1664,16 @@ ', ...
6613cbe83fcd998f0ef4da8cb6d76e56e45bb4b1
Check requests.get for exceptions
gh_status.py
gh_status.py
#!/usr/bin/env python ''' File: gh_status.py Author: Carno <carnophage at dobramama dot pl> Description: Simple command line snippet to check GitHub status page ''' from __future__ import print_function import sys try: import requests except ImportError: print('Missing module: requests.') sys.exit(3) G...
Python
0
@@ -458,32 +458,49 @@ __init__(self):%0A + try:%0A api_requ @@ -536,42 +536,8 @@ API) - # FIXME: exceptions!%0A try: %0A @@ -742,25 +742,25 @@ o get github - +: status api %5B @@ -1145,24 +1145,41 @@ b status%22%22%22%0A + try:%0A stat @@ -1223,32 +1223,123 @@ %...
0f7c5e02bc11a937b5c3f5867903e0b1c8c233de
fix pipe errors
king/controller.py
king/controller.py
import apscheduler, os, redis, string, subprocess from datetime import timedelta from multiprocessing import Pool from plumbum import SshMachine from rpyc.utils.factory import ssh_connect from utilities import distance, threaded_map process_pool_size = 60 FNULL = open(os.devnull, 'w') all_dns = redis.Redis(connection...
Python
0.000005
@@ -253,38 +253,8 @@ = 60 -%0AFNULL = open(os.devnull, 'w') %0A%0Aal @@ -938,34 +938,17 @@ ept -(AssertionError, EOFError) +Exception , e: @@ -1054,34 +1054,17 @@ ept -(AssertionError, EOFError) +Exception , e: @@ -1583,23 +1583,37 @@ -print 'Restart' +FNULL = open(os.devnull, 'w') %0A @@ -1795,16 +17...
0e26b11b9cc8c8c246755c5986a401947f6a724e
Handle messages with multiple issue keys
atlas/api/webhook.py
atlas/api/webhook.py
#!/usr/bin/env python import re import os import logging import textwrap from flask import request, Response, current_app, abort, request, jsonify from webargs import fields from webargs.flaskparser import use_args from jira import JIRA, JIRAError from atlas.api import api_v1_blueprint as bp log = logging.getLogger...
Python
0
@@ -1134,21 +1134,26 @@ ()%0A%0A -match +issue_keys = jira_ @@ -1163,14 +1163,15 @@ _re. -search +findall (arg @@ -1192,49 +1192,19 @@ if -match:%0A issue_key = match.group(0) +issue_keys: %0A @@ -1258,16 +1258,19 @@ ssue key +(s) : %25s',%0A @@ -1304,16 +1304,26 @@ name'%5D, +', '.join( is...
98ee4e6a25bf82ac32c2f89f17278993a14bcfba
create / drop LDAP in tests
examples/tests.py
examples/tests.py
# -*- coding: utf-8 -*- # # django-ldapdb # Copyright (C) 2009-2010 Bolloré telecom # See AUTHORS file for a full list of contributors. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either...
Python
0.000001
@@ -772,16 +772,29 @@ s/%3E.%0A#%0A%0A +import ldap%0A%0A from dja @@ -819,16 +819,46 @@ stCase%0A%0A +from ldapdb import connection%0A from exa @@ -898,16 +898,721 @@ pGroup%0A%0A +class BaseTestCase(TestCase):%0A def setUp(self):%0A cursor = connection._cursor()%0A for base in %5BLdapGroup.base_...
8c838ff39b4349524a57f8fd3d73e9e71763fbbd
Remove `block` column from asset content when…
kpi/model_utils.py
kpi/model_utils.py
# coding: utf-8 import contextlib import copy import re from collections import defaultdict from django.apps import apps from taggit.models import Tag, TaggedItem ''' This circular import will bite you if you don't import kpi.models before importing kpi.model_utils: File "kpi/model_utils.py", line 6, in <module> ...
Python
0
@@ -1647,19 +1647,19 @@ e = row. -get +pop ('block'
7ff6af22f4cd5ad64c20e4af0c8076e786f38572
add registry for extensions
kuyruk/__init__.py
kuyruk/__init__.py
from __future__ import absolute_import import atexit import logging from threading import RLock from contextlib import contextmanager, closing import amqp from kuyruk import exceptions, importer from kuyruk.task import Task from kuyruk.config import Config from kuyruk.worker import Worker __version__ = '2.0.2' __all...
Python
0.000001
@@ -1494,16 +1494,45 @@ config%0A + self.extensions = %7B%7D%0A
5e53f1e86fc7c4f1c7b42479684ac393c997ce52
Fix exit code of unittest.
client/test/test-unrealcv.py
client/test/test-unrealcv.py
# TODO: Test robustness, test speed import unittest, time, sys from common_conf import * from test_server import EchoServer, MessageServer import argparse import threading from test_server import TestMessageServer from test_client import TestClientWithDummyServer from test_commands import TestCommands from test_realist...
Python
0.000001
@@ -910,16 +910,26 @@ es)%0A +ret = not unittest @@ -973,9 +973,42 @@ ite_obj) +.wasSucessful()%0A sys.exit(ret) %0A
93125a4154e29234aa99ea0e55296a1eb2cd8382
Fix 3-table join
sqltxt/query.py
sqltxt/query.py
import itertools from ordered_set import OrderedSet from column import ColumnName, AmbiguousColumnNameError, UnknownColumnNameError from table import Table from joins import join_tables from plan import plan from expression import get_cnf_conditions import logging LOG = logging.getLogger(__name__) def stage_columns...
Python
0.000004
@@ -8116,33 +8116,32 @@ tables%5B -: -1%5D,%0A
8aca952c1c1e2668df58a0844896267f7e69b8f6
remove assert
compressor/cli.py
compressor/cli.py
""" Compressor CLI (command-line interface) module. Exposes the entry point to the program for executing as command line. """ import argparse import sys from compressor.constants import VERSION from compressor.lib import compress_file, extract_file def argument_parser() -> argparse.ArgumentParser: """Create the ...
Python
0
@@ -2102,77 +2102,8 @@ %22%22%22%0A - assert extract is not compress, %22Cannot both extract & compress%22%0A
0d7354aad97c3b0832c69ad8104686e614eb2aec
improve code readability
git-blame.py
git-blame.py
import sublime import sublime_plugin import os import functools import subprocess from subprocess import check_output as shell stylesheet = ''' <style> div.blame-arrow { border-top: 0.4rem solid transparent; border-left: 0.5rem solid color(var(--bluish) blend(var(--background) 30%))...
Python
0.001398
@@ -1201,15 +1201,27 @@ '''%0A + %3Cbody%3E%0A + %7Bsty @@ -1229,16 +1229,24 @@ esheet%7D%0A + %3Cdiv cla @@ -1269,16 +1269,24 @@ %3E%3C/div%3E%0A + %3Cdiv cla @@ -1297,16 +1297,28 @@ blame%22%3E%0A + %3Cspan cl @@ -1332,16 +1332,32 @@ ssage%22%3E%0A + ...
67089d0f248bfb35f6bb272b81377d4a797e7221
Set admin contact
workout_manager/settings.py
workout_manager/settings.py
# Django settings for workout_manager project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME':...
Python
0
@@ -97,47 +97,44 @@ -# ('Your Name', 'your_email@example.com +('Roland Geider', 'roland@geider.net '),%0A
75b8f0ec2a1f3c6468153180c70eabc4ecff642a
fix flake8
files/api.py
files/api.py
#!/usr/bin/python ## from http://nullsecure.org/building-your-own-passivedns-feed/ import requests import json import sys indicator = sys.argv[1] url = "http://localhost:8081/dns/" r = requests.get(url+indicator) j = json.loads(r.text) print "+------------------------+------------------------+--------+------...
Python
0
@@ -11,17 +11,16 @@ /python%0A -# # from h @@ -91,18 +91,16 @@ requests - %0Aimport @@ -103,18 +103,16 @@ ort json - %0Aimport @@ -208,18 +208,16 @@ dicator) - %0Aj = jso @@ -234,25 +234,25 @@ text)%0A%0Aprint - +( %22+---------- @@ -339,25 +339,24 @@ ------+%22 - +) %0Aprint - +( %22%7C ...
6b013924b4b9f2e8f6c7696e5b52b758d17a340b
document how to customize
inheritance/__main__.py
inheritance/__main__.py
import argparse import re import itertools as it from collections import defaultdict from .pyeval import Family from .evalfam import EvalFamily from geneimpacts import Effect def main(args): p = argparse.ArgumentParser() p.add_argument("--inheritance_model", choices=("comp_het", "auto_dom", "auto_rec", "de_n...
Python
0
@@ -3223,14 +3223,120 @@ -if res +# matched the inheritance model.%0A if res: # can add custom logic here, e.g. and v.call_rate %3E 0.9 :%0A
e4caa80cc6b6ee2b9c031a7d743d61b4830f2a7e
put typing_extensions.get_types() behind python version guard
git/types.py
git/types.py
# -*- coding: utf-8 -*- # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php import os import sys from typing import (Callable, Dict, NoReturn, Tuple, Union, Any, Iterator, # noqa: F401 NamedTuple, TYPE_CHECKING, get_ar...
Python
0.000001
@@ -310,18 +310,8 @@ ING, - get_args, Typ @@ -437,32 +437,42 @@ edDict, Protocol +, get_args # noqa: F401%0Ae @@ -560,16 +560,26 @@ Protocol +, get_args # noqa
cbafa4d7bb457b0eedf91ba400389a86f15f63db
Make VisitError inherit from LarkError
lark/exceptions.py
lark/exceptions.py
from .utils import STRING_TYPE ###{standalone class LarkError(Exception): pass class GrammarError(LarkError): pass class ParseError(LarkError): pass class LexError(LarkError): pass class UnexpectedInput(LarkError): pos_in_stream = None def get_context(self, text, span=40): pos = se...
Python
0
@@ -2955,33 +2955,33 @@ VisitError( -Exception +LarkError ):%0A def _
cb28aa3a0272bdcd2db94d2d25468458420a544a
Revise to bool is_carry
lc0066_plus_one.py
lc0066_plus_one.py
"""Leetcode 66. Plus One Easy URL: https://leetcode.com/problems/plus-one/ Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant digit is at the head of the list, and each element in the array contain a single digit. Yo...
Python
0.999996
@@ -845,24 +845,21 @@ f total -overflow +carry .%0A @@ -872,24 +872,24 @@ -overflow +is_carry = False @@ -1061,24 +1061,21 @@ or when -overflow +carry .%0A @@ -1083,24 +1083,24 @@ if -overflow +is_carry or i == @@ -1116,17 +1116,16 @@ ts) - 1: - %0A @@ -1267,24 +1267,24 ...
4b1c356a27adc68e62d801986e67ef60336685db
add and configure infernal dependency (#14502)
var/spack/repos/builtin/packages/trnascan-se/package.py
var/spack/repos/builtin/packages/trnascan-se/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class TrnascanSe(AutotoolsPackage): """Seaching for tRNA genes in genomic sequence""" homep...
Python
0
@@ -530,8 +530,270 @@ 8100c')%0A +%0A depends_on('infernal@1.1.2', type='run', when='@2.0.0')%0A%0A def patch(self):%0A filter_file('infernal_dir: %7Bbin_dir%7D',%0A 'infernal_dir: %25s' %25 self.spec%5B'infernal'%5D.prefix.bin,%0A 'tRNAscan-SE.conf.src', string=True)...
9e8d302937342cf248c572050f7236fa9546e46d
Add additional markdown plugin hook
lektor/markdown.py
lektor/markdown.py
import threading from weakref import ref as weakref import mistune from markupsafe import Markup, escape from lektor._compat import PY2 from lektor.context import get_ctx from werkzeug.urls import url_parse _markdown_cache = threading.local() class ImprovedRenderer(mistune.Renderer): def link(self, link, tit...
Python
0
@@ -1800,24 +1800,111 @@ _renderer()%0A + env.plugin_controller.emit('markdown-lexer-config', config=cfg, renderer=renderer)%0A return m
3a26c641d1c3988123babbeb56b978b449fa6c98
Update pipeline.py
intelmq/lib/pipeline.py
intelmq/lib/pipeline.py
import redis import time class Pipeline(): def __init__(self, host="127.0.0.1", port="6379", db=2): self.host = host self.port = port self.db = db self.redis = redis.Redis( host = self.host, port = int(self.port), ...
Python
0.000002
@@ -1101,46 +1101,115 @@ -while True:%0A try:%0A +if self.redis.llen(self.internal_queue) %3E 0:%0A return self.redis.lindex(self.internal_queue, -1)%0A @@ -1288,78 +1288,8 @@ 0)%0A - except redis.TimeoutError:%0A self.connect()%0A @@ -1542,32...
227be653c21a703d8ed0864d23573c25dd3859ce
bump repo version
omegaconf/version.py
omegaconf/version.py
import sys # pragma: no cover __version__ = "2.0.0rc18" msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer. You have the following options: 1. Upgrade to Python 3.6 or newer. This is highly recommended. new features will not be added to OmegaConf 1.4. 2. Continue using OmegaConf 1.4: You...
Python
0
@@ -52,9 +52,9 @@ 0rc1 -8 +9 %22%0A%0Am
ce9da309294f2520f297980d80773160f050e8bf
Add __all__ in exceptions module.
yubico/yubico_exceptions.py
yubico/yubico_exceptions.py
class YubicoError(Exception): """ Base class for Yubico related exceptions. """ pass class StatusCodeError(YubicoError): def __init__(self, status_code): self.status_code = status_code def __str__(self): return ('Yubico server returned the following status code: %s' % ...
Python
0.000001
@@ -1,12 +1,132 @@ +__all___ = %5B%0A 'YubicoError',%0A 'StatusCodeError',%0A 'InvalidClientIdError',%0A 'SignatureVerificationError'%0A%5D%0A%0A%0A class Yubico
b20320301eb311bb1345061a8b74ac63495051b1
Add trailing slash to /docs/api/ url pattern. This provides more flexibility for end users in that they can choose to navigate to /docs/api or /docs/api/ successfully. Without the trailing slash in the url pattern, /docs/api/ returns a 404.
tastydocs/urls.py
tastydocs/urls.py
from django.conf.urls.defaults import patterns from views import doc urlpatterns = patterns( '', (r'^api$', doc), (r'^example/(?P<resource_name>\w+)/', 'tastydocs.views.example_data'), )
Python
0
@@ -106,16 +106,17 @@ (r'%5Eapi +/ $', doc)
0773012f48ea21d4ff9b30c22e2bfe7366572ab4
add profiling output to tcurl
tchannel/tcurl.py
tchannel/tcurl.py
from __future__ import absolute_import import argparse import itertools import logging import sys import tornado.ioloop from .tornado import TChannel log = logging.getLogger('tchannel') @tornado.gen.coroutine def multi_tcurl(hostports, headers, bodies): client = TChannel() futures = [ tcurl(clie...
Python
0.000002
@@ -49,16 +49,32 @@ rgparse%0A +import cProfile%0A import i @@ -104,19 +104,45 @@ %0Aimport -sys +pstats%0Aimport sys%0Aimport time %0A%0Aimport @@ -293,16 +293,31 @@ , bodies +, profile=False ):%0A c @@ -502,31 +502,495 @@ -results = yield futures +start = time.time()%0A%0A profiler = cProfile.Profi...
3efc1cc38647312261059e415bc36b29db3571b0
fix unicode xml parsing
telemeta/cache.py
telemeta/cache.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2006-2010 Guillaume Pellerin, Parisson SARL # This software is a computer program whose purpose is to stream audio # and video data through icecast2 servers. # This software is governed by the CeCILL license under French law and # abiding by the rules of dis...
Python
0.000128
@@ -4536,19 +4536,23 @@ value', -str +unicode (value))
5c28838bcf5e9dcc2dee350233c3ecea753022b8
fix doc
lib/python/dxpy/bindings/dxgtable_functions.py
lib/python/dxpy/bindings/dxgtable_functions.py
""" Opening and Creating ******************** The following functions allow opening an existing remote table (read-only) and creating new remote tables (write-only). All these methods return a remote table handler. """ from dxpy.bindings import * def open_dxgtable(dxid, **kwargs): ''' :param dxid: table ID...
Python
0.000001
@@ -2160,16 +2160,30 @@ index = +dxpy.DXGTable. genomic_
3542d9433091b7875ce59534aed48e237fab947e
Handle single column data
librisxl-tools/scripts/get_marc_usage_stats.py
librisxl-tools/scripts/get_marc_usage_stats.py
from __future__ import print_function import json import sys from collections import defaultdict, OrderedDict args = sys.argv[1:] stats_dest = args.pop(0) marctype = args.pop(0) if args else 'bib' def parse_record(line): tab1 = line.index('\t') try: data = line[tab1:line.index('\t', tab1 + 1)].repla...
Python
0.000309
@@ -215,16 +215,27 @@ ord(line +, lineno=-1 ):%0A t @@ -241,29 +241,28 @@ tab1 = line. +f ind -ex ('%5Ct')%0A t @@ -321,30 +321,30 @@ 1)%5D -.replace('%5C%5C%5C%5C', '%5C%5C') + if tab1 %3E 0 else line %0A @@ -411,24 +411,44 @@ r in:%22, data +, %22at line:%22, lineno )%0A ra @@ -2007,16 +2007...
6f5df9830482e8b9ffcf810dcc14131d349c219e
update api config
apps/api/config.py
apps/api/config.py
from __future__ import unicode_literals from django.apps import AppConfig class AppConfig(AppConfig): name = 'app' verbose_name = 'Api Application' def ready(self): from .signals import create_api_key
Python
0
@@ -112,17 +112,17 @@ me = 'ap -p +i '%0A ve
4c94da43060f0c5a3dd59102c1499bc9c947a9d9
Update mail_mail.py
mail_sendgrid_mass_mailing/models/mail_mail.py
mail_sendgrid_mass_mailing/models/mail_mail.py
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __openerp__.p...
Python
0.000002
@@ -1061,16 +1061,42 @@ g_emails +.filtered('mail_stats_id') :%0A
9656e5c6612d35283cef245fd11904503f329f71
Check for supported database type in config file
dh_syncserver/config.py
dh_syncserver/config.py
# denyhosts sync server # Copyright (C) 2015 Jan-Pascal van Best <janpascal@vanbest.org> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, o...
Python
0
@@ -807,16 +807,27 @@ logging +%0Aimport sys %0A%0Adef _g @@ -2022,16 +2022,152 @@ lite3%22)%0A + if dbtype not in %5B%22sqlite3%22,%22MySQLdb%22%5D:%0A print(%22Database type %7B%7D not supported, exiting%22.format(dbtype))%0A sys.exit()%0A%0A dbpa
4de94f9e0835e4651e6148a02d464fb96a8c7270
Version bump to 1.1.0.
discogs_cli/__init__.py
discogs_cli/__init__.py
# -*- coding: utf-8 -*- __version__ = '1.0.0'
Python
0
@@ -34,13 +34,13 @@ __ = '1. -0 +1 .0'%0A
71d951ae4d76703bd2f566e002293e5dc622918c
Update apps.py
django_sharding/apps.py
django_sharding/apps.py
from django.apps import AppConfig, apps from django.conf import settings from django.contrib.auth import get_user_model from django.db import models from django.dispatch import receiver from django_sharding_library.routing_read_strategies import PrimaryOnlyRoutingStrategy from django_sharding_library.sharding_function...
Python
0.000001
@@ -394,16 +394,23 @@ import +create_ save_sha @@ -2952,16 +2952,23 @@ =model)( +create_ save_sha @@ -2977,16 +2977,27 @@ _handler +(self.name) )%0A%0A d
682f45ffd222dc582ee770a0326c962540657c68
Fix an error in __unicode__
django_twilio/models.py
django_twilio/models.py
# -*- coding: utf-8 -*- from django.db import models from phonenumber_field.modelfields import PhoneNumberField class Caller(models.Model): """A caller is defined uniquely by their phone number. :param bool blacklisted: Designates whether the caller can use our services. :param char phone_number...
Python
0.999998
@@ -537,14 +537,14 @@ -return +name = str @@ -566,52 +566,91 @@ ber) - + ' (blacklisted)' if self.blacklisted else '' +%0A if self.blacklisted:%0A name += ' (blacklisted)'%0A return name %0A
a7007f697c923c934e5b6cc4676bef9481b59eb4
Change default behaviour when a new user is created. Now their attributes are filled this first time
djangosaml2/backends.py
djangosaml2/backends.py
# Copyright (C) 2010-2011 Yaco Sistemas (http://www.yaco.es) # Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.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 # # ...
Python
0
@@ -2812,16 +2812,33 @@ ser -unmodifi +with his attributes updat ed.%0A @@ -2856,36 +2856,85 @@ %0A return -user +self.update_user(user, attributes, attribute_mapping) %0A%0A def update
54acb757fd7c52292eee47813676d865e55fe935
remove git
test/17/test17.py
test/17/test17.py
"""ShutIt module. See http://shutit.tk """ from shutit_module import ShutItModule class test17(ShutItModule): def build(self, shutit): # Some useful API calls for reference. See shutit's docs for more info and options: # # ISSUING BASH COMMANDS # shutit.send(send,expect=<default>) - Send a command, wait f...
Python
0.000015
@@ -3515,32 +3515,8 @@ get%0A -%09%09shutit.install('git')%0A %09%09re
59972f8c6c12040736bd7e3f9416efed393d331a
fix can't exit gDasH while openning SessionTabs fix shell session no output when call shell.stdin.readline is blocking
lib/shell.py
lib/shell.py
__author__ = 'Sean Yu' '''created @2015/10/12''' import unittest import os import sys import time import subprocess, signal if os.name =='nt': pass#import win32api def handler_ctrl_c(sig, func=None): return True def signal_handler(signal, frame): time.sleep(1) print 'Ctrl+C received in wrapper.py' #signal...
Python
0
@@ -2847,16 +2847,17 @@ ad_len= +( self.max @@ -2874,16 +2874,19 @@ len(cmd) +)/2 %0A @@ -2898,16 +2898,29 @@ pad = ' +'*pad_len+'%5Cb '*pad_le
0534a96d7872ec13b14d084c62454c4cdfa711ed
fix breakage ("TypeError: cannot use a string pattern on a bytes-like object")
src/livestreamer/plugins/livecodingtv.py
src/livestreamer/plugins/livecodingtv.py
import re from livestreamer.plugin import Plugin from livestreamer.stream import RTMPStream, HTTPStream from livestreamer.plugin.api import http _vod_re = re.compile('\"(http(s)?://.*\.mp4\?t=.*)\"') _rtmp_re = re.compile('rtmp://[^"]+/(?P<channel>\w+)+[^/"]+') _url_re = re.compile('http(s)?://(?:\w+.)?\livecoding\.t...
Python
0
@@ -529,32 +529,48 @@ arch(res.content +.decode('utf-8') )%0A if mat @@ -838,16 +838,32 @@ .content +.decode('utf-8') )%0A
dedc9729660bbf8963077ae0bf03785372863e77
switch from background_queue to malt_generation_queue
corehq/apps/data_analytics/tasks.py
corehq/apps/data_analytics/tasks.py
import datetime from django.conf import settings from celery.schedules import crontab from celery.task import periodic_task, task from celery.utils.log import get_task_logger from dimagi.utils.dates import DateSpan from corehq.apps.data_analytics.gir_generator import GIRTableGenerator from corehq.apps.data_analytic...
Python
0.000003
@@ -630,34 +630,39 @@ task(queue=' -background +malt_generation _queue', run @@ -1320,34 +1320,39 @@ task(queue=' -background +malt_generation _queue', run @@ -2582,34 +2582,39 @@ task(queue=' -background +malt_generation _queue')%0Adef
a264227ea82155f79becc45b24d9a1985a3ed4be
Append last commit
cpol_processing/processing/phase.py
cpol_processing/processing/phase.py
""" Codes for correcting the differential phase and estimating KDP. @title: phase @author: Valentin Louf <valentin.louf@monash.edu> @institutions: Monash University and the Australian Bureau of Meteorology @date: 20/11/2017 .. autosummary:: :toctree: generated/ check_phidp fix_phidp_from_kdp phidp_br...
Python
0
@@ -4987,763 +4987,4 @@ p_gg -%0A%0A%0Adef unfold_raw_phidp(radar, phi_name=%22PHIDP%22, refl_field='DBZ', ncp_field='NCP', rhv_field='RHOHV'):%0A %22%22%22%0A Unfold raw PHIDP%0A%0A Parameters:%0A ===========%0A radar:%0A Py-ART radar structure.%0A gatefilter:%0A Gate filter.%0A phi...
aadf177df60fa9cf1470732edf8ea9cab6eef79e
Remove commented fixture code
subscription/tests.py
subscription/tests.py
""" Tests for Subscription Application """ from tastypie.test import ResourceTestCase from django.contrib.auth.models import User class SubscriptionResourceTest(ResourceTestCase): # fixtures = ['test_subscription.json'] def setUp(self): super(SubscriptionResourceTest, self).setUp() # Create...
Python
0
@@ -179,52 +179,8 @@ se): -%0A # fixtures = %5B'test_subscription.json'%5D %0A%0A
07556d5cb011c16bc0d73f2e2dca753481b390a4
add supplement product and ingredient comp
supplements/models.py
supplements/models.py
from django.db import models from betterself.mixins import BaseTimeModel class Ingredient(BaseTimeModel): # if some ingredient is longer than 300 characters, prob shouldn't take it. name = models.CharField(max_length=300) user_generated = models.BooleanField(default=False) half_life_minutes = models....
Python
0
@@ -359,9 +359,890 @@ True)%0A%0A%0A +class MeasurementUnit(BaseTimeModel):%0A name = models.CharField(max_length=100) # 'milligram'%0A short_name = models.CharField(max_length=100) # 'ml'%0A is_liquid = models.BooleanField(default=False)%0A%0A%0Aclass IngredientComposition(BaseTimeModel):%0A %22%22%22%0...
c1a07cbe7d7ed6c1fa5e4321e46c1cb63dba54ba
remove redundant import alias
mistral/tests/unit/api/test_cors_middleware.py
mistral/tests/unit/api/test_cors_middleware.py
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Python
0.000031
@@ -692,15 +692,8 @@ cfg - as cfg %0Afro
d5738d63394300cac94f8128bc9c508a2e804b97
do some misc. cleanup in markdownify
lib/markdownify.py
lib/markdownify.py
#!/usr/bin/env python3 import sys import os from textwrap import indent from .flatten import flatten from .run import run_command, run_file def indent4(string): return indent(string, ' ') def markdownify(hw_number, username, spec, output_type=None, to=None): cwd = os.getcwd() results = [] for f...
Python
0.999451
@@ -378,58 +378,45 @@ -path = cwd + '/' + filename%0A with open(path +with open(os.path.join(cwd, filename) , 'w @@ -681,44 +681,8 @@ s%5D%0A%0A - file_loc = cwd + '/' + file%0A @@ -1181,38 +1181,17 @@ ' %25 -( file -),%0A +name, ind @@ -2133,17 +2133,25 @@ spec -...
c1a31e1d402e15751ac8df621b8c8bc83b160361
fix logging
lib/python/main.py
lib/python/main.py
#!coding:utf-8 import go_GPIO import time import gpsnavi import logging import datetime import math class Main(object): def __init__(self, groundalt=0, gpsport=None, gpsbaudrate=38400, maxalt=80, goal=[[141.24966333333333, 43.13460166666667],[141.24322166666667, 43.123041666666666]], ratio=30.0, rate=20): ...
Python
0.000002
@@ -86,20 +86,8 @@ ime%0A -import math%0A %0A%0Acl @@ -231,16 +231,17 @@ 666667%5D, + %5B141.243 @@ -297,16 +297,191 @@ te=20):%0A + logging.basicConfig(format='%25(asctime)s %25(message)s', filename=%22botti%22+str(time.strftime('%25H-%25M-%25S', datetime.datetime.now().timetuple()))+'.log', level=logging...
2199c8e2429d72408b924b74b5db294874371c6e
Remove extra line
docker/localsettings.py
docker/localsettings.py
####### Configuration for CommCareHQ Running in docker ####### import os DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'commcarehq', 'USER': 'commcarehq', 'PASSWORD': 'commcarehq', 'HOST': 'postgres', 'PORT': '5432', ...
Python
0.000067
@@ -2260,18 +2260,16 @@ house'%0A%0A -%0A%0A # See CI
046ffb6edcf660879681926dd9a0b0c5774ef4e8
Use a new classification instead of input and output
openfisca_france_indirect_taxation/__init__.py
openfisca_france_indirect_taxation/__init__.py
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify # it ...
Python
0.688692
@@ -1689,32 +1689,33 @@ nario%0A%0A from +. model import inp @@ -1715,86 +1715,13 @@ ort -input_variables # noqa analysis:ignore%0A from model import output_variables +model #
082464c30dc34a7b36cd4763c324af55a8ed31e5
Fix a typo in comment
03-sendTextFromFileToChat.py
03-sendTextFromFileToChat.py
# We have to import the minecraft api module to do anything in the minecraft world from mcpi.minecraft import * # We have to import sys module to get the command line arguments import sys if __name__ == "__main__": """ First thing you do is create a connection to minecraft This is like dialling a phone...
Python
0.999949
@@ -1341,16 +1341,20 @@ this op +ens up the t
e9bf339261636647a2af096d8cf45c2ee6cf202f
use emacs report style
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Dmitry Tsoy # Copyright (c) 2013 Dmitry Tsoy # # License: MIT # """This module exports the Phpcs plugin class.""" from SublimeLinter.lint import Linter class Phpcs(Linter): """Provides an interface to phpcs.""...
Python
0.000001
@@ -389,18 +389,13 @@ ort= -checkstyle +emacs ', ' @@ -424,29 +424,15 @@ ex = - (%0A r' +%5E .* -line=%22 +: (?P%3C @@ -440,164 +440,93 @@ ine%3E -%5Cd+)%22 '%0A r'column=%22(?P%3Ccol%3E%5Cd+)%22 '%0A r'severity=%22(?:(?P%3Cerror%3Eerror)%7C(?P%3Cwarning%3Ewarning))%22 '%0A r'message...
50a860a9286e03a3deb6b93161cf351d80d3f2ce
Fix pep257
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jon Surrell # Copyright (c) 2014 Jon Surrell # # License: MIT # """This module exports the Govet plugin class.""" from SublimeLinter.lint import Linter, util class Govet(Linter): """Provides an interface to go...
Python
0.000001
@@ -509,16 +509,59 @@ STDERR%0A%0A + %22%22%22Let the linter higlight column 0%22%22%22%0A def
c187d3c39fece75144d4e7c0b04994dca0098190
Use original LD_LIBRARY_PATH when shelling out to credential stores
compose/cli/docker_client.py
compose/cli/docker_client.py
from __future__ import absolute_import from __future__ import unicode_literals import logging import os.path import ssl from docker import APIClient from docker.errors import TLSParameterError from docker.tls import TLSConfig from docker.utils import kwargs_from_env from docker.utils.config import home_dir from ..co...
Python
0
@@ -3981,16 +3981,317 @@ gent()%0A%0A + # Workaround for%0A # https://pyinstaller.readthedocs.io/en/v3.3.1/runtime-information.html#ld-library-path-libpath-considerations%0A if 'LD_LIBRARY_PATH_ORIG' in environment:%0A kwargs%5B'credstore_env'%5D = %7B%0A 'LD_LIBRARY_PATH': environment.get('...
704eac3d96a7d0efbb7eb83124fa1f8533538402
test anonymous class method_missing behavior
tests/objects/test_classobject.py
tests/objects/test_classobject.py
import pytest class TestClassObject(object): def test_name(self, space): space.execute("Class") def test_to_s(self, space): w_res = space.execute("return 1.class.to_s") assert space.str_w(w_res) == "Fixnum" w_res = space.execute("return 1.class.class.to_s") assert spac...
Python
0.000001
@@ -7,16 +7,50 @@ pytest%0A +from ..base import BaseTopazTest%0A%0A %0Aclass T @@ -64,21 +64,28 @@ sObject( -objec +BaseTopazTes t):%0A @@ -989,32 +989,252 @@ is space.w_nil%0A%0A + def test_anon_class_method_missing_raises(self, space):%0A with self.raises(space, %22NoMethodError%22):%0A ...
0ea00d932ef16aad3cb2fdbacedd30181c786778
increase timeout of autotest
tests/pkg_libcose/tests/01-run.py
tests/pkg_libcose/tests/01-run.py
#!/usr/bin/env python3 # Copyright (C) 2017 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys from testrunner import run def testfunc(child): boar...
Python
0
@@ -284,16 +284,136 @@ t run%0A%0A%0A +# on real hardware, this test application can take several minutes to%0A# complete (~4min on microbit)%0AHW_TIMEOUT = 300%0A%0A%0A def test @@ -517,11 +517,18 @@ t = -120 +HW_TIMEOUT if
177a599b47498c2b8eee1460c0946869186b4472
rename method
tests/sync_app_unittests_local.py
tests/sync_app_unittests_local.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Unit tests for sync_app """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import hashlib import unittest CURDIR = os.path.abspath(os.curdir) os.sys.path.ap...
Python
0.000007
@@ -1523,38 +1523,32 @@ t.fill_file_list -_local (directory=TEST_ @@ -2191,38 +2191,32 @@ t.fill_file_list -_local (directory=TEST_ @@ -3075,22 +3075,16 @@ ile_list -_local (directo
6025db45a779ddc1dd2ac9559fa50f28cadbb193
Clean up how we handle file suffix.
autoapi/extension.py
autoapi/extension.py
# -*- coding: utf-8 -*- """ Sphinx Auto-API Top-level Extension. This extension allows you to automagically generate API documentation from your project. """ import os import shutil from sphinx.util.console import darkgreen, bold from sphinx.addnodes import toctree from sphinx.errors import ExtensionError from .back...
Python
0
@@ -2137,24 +2137,301 @@ _type, %5B%5D)%0A%0A + if '.rst' in app.config.source_suffix:%0A out_suffix = '.rst'%0A elif '.txt' in app.config.source_suffix:%0A out_suffix = '.txt'%0A else:%0A # Fallback to first suffix listed%0A out_suffix = app.config.source_suffix%5B0%5D%0A%0A # ...
7a2d901f1519f94a3d4405966e5e102a40dff3ac
Remove non-needed unique constraint on privacy agreements
sponsorship_compassion/models/privacy_statement.py
sponsorship_compassion/models/privacy_statement.py
############################################################################## # # Copyright (C) 2018 Compassion CH (http://www.compassion.ch) # @author: Stephane Eicher <seicher@compassion.ch> # # The licence is in the file __manifest__.py # ####################################################################...
Python
0.000003
@@ -1686,229 +1686,8 @@ ent%22 -%0A _sql_constraints = %5B%0A (%0A %22unique_privacy_agreement%22,%0A %22unique(partner_id,privacy_statement_id)%22,%0A %22This partner has already accepted this privacy %22 %22statement%22,%0A )%0A %5D %0A%0A
444ce71f2ca92a535270ac34d7201e81de002af5
fix tests
tests/unit-tests/messages_test.py
tests/unit-tests/messages_test.py
from teamcity.messages import TeamcityServiceMessages from datetime import datetime class StreamStub(object): def __init__(self): self.observed_output = '' def write(self, msg): self.observed_output += msg fixed_date = datetime(2000, 11, 2, 10, 23, 1, 556789) def test_no_properties(): ...
Python
0.000001
@@ -227,16 +227,51 @@ += msg%0A%0A + def flush(self):%0A pass%0A%0A fixed_da
6885b6332b78cd1d6d3b164e3c744dbe8f58a929
Add blank string if argument is None
dodotable/util.py
dodotable/util.py
# -*- coding: utf-8 -*- """:mod:`dodotable.util` --- utility ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import codecs import re import sys import numbers import six from jinja2 import Environment, PackageLoader __all__ = ( 'camel_to_underscore', 'render', '_get_data', 'string_literal', ) #: (:class:`_sre.S...
Python
1
@@ -2030,16 +2030,59 @@ str(x)%0A + elif x is None:%0A x = ''%0A
73f6b92f08abf2791f2101b0e8d8f6b6eb45ac9c
add global configuration, d?config alias (cfg)
dog/ext/config.py
dog/ext/config.py
import logging from discord.ext import commands from dog import Cog log = logging.getLogger(__name__) class Config(Cog): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.permitted_keys = [ 'woof_command_enabled', 'unmute_announce', 'm...
Python
0
@@ -403,16 +403,1034 @@ s.group( +aliases=%5B'gcfg'%5D)%0A @commands.is_owner()%0A async def global_config(self, ctx):%0A %22%22%22 Manages global configuration for the bot. %22%22%22%0A%0A @global_config.command(name='set')%0A async def global_config_set(self, ctx, name: str, value: str='on'):%0A ...
bdcf668cd0fdfba6d1e6f90ae3b94a6d83f47c74
reword member
dog/ext/modlog.py
dog/ext/modlog.py
import discord from discord.ext import commands from dog import Cog, utils, checks class Modlog(Cog): def _make_modlog_embed(self, **kwargs): embed = discord.Embed(**kwargs) embed.set_footer(text=utils.now()) return embed def _member_repr(self, member): return f'{member.mention...
Python
0.000001
@@ -1061,37 +1061,37 @@ add_field(name=' -Membe +Autho r', value=self._
8fc2cd8c18bb8b94cff43d70bdb891d9963076b8
Add test for __dict__ attribute on functions.
refcycle/test/test_annotations.py
refcycle/test/test_annotations.py
# Copyright 2013 Mark Dickinson # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0
@@ -3209,32 +3209,247 @@ ompleteness(f)%0A%0A + def test_annotate_function_attributes(self):%0A def f():%0A pass%0A f.extra_attribute = %5B1, 2, 3%5D%0A self.check_description(f, f.__dict__, %22__dict__%22)%0A self.check_completeness(f)%0A%0A def test_ann
b4e6cdbf7eb8cab80352d6058fe370b386e38928
remove uuid from test
tests/webserver/test_webserver.py
tests/webserver/test_webserver.py
import autonetkit import os import autonetkit.load.graphml as graphml import shutil automated = True # whether to open ksdiff, log to file... if __name__ == "__main__": automated = False dirname, filename = os.path.split(os.path.abspath(__file__)) parent_dir = os.path.abspath(os.path.join(dirname, os.pardir)) an...
Python
0.000001
@@ -588,41 +588,8 @@ nm)%0A -anm%5B'phy'%5D.data.uuid = %22my_uuid%22%0A %0A%0A%0At
074e26d48683a8ff9061d67a5c82ab99f649c7b2
Add a passive drift_init_extension() to tenancy module to quiet down warning message
drift/core/extensions/tenancy.py
drift/core/extensions/tenancy.py
# -*- coding: utf-8 -*- """ drift - Tenancy logic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Figure out which tenant is in play """ from __future__ import absolute_import import os import logging import socket import warnings from flask import request, has_request_context from werkzeug.local import Local...
Python
0
@@ -357,16 +357,68 @@ me__)%0A%0A%0A +def drift_init_extension(app, **kwargs):%0A pass%0A%0A%0A def get_
db390164b0407e203e1a765d6324deb821d7a416
Add pkl argument and fix config file name.
apps/scrub.py
apps/scrub.py
""" Create item database. """ import logging import os import re import pydarkstar.logutils import pydarkstar.scrubbing.ffxiah import pydarkstar.itemlist import pydarkstar.options import pydarkstar.common class Options(pydarkstar.options.Options): """ Reads options from config file, then from command line. ...
Python
0
@@ -394,20 +394,16 @@ g='scrub -bing .yaml', @@ -423,16 +423,16 @@ _doc__)%0A + @@ -772,32 +772,83 @@ # redownload%0A + self.pkl = False # save pkl files%0A self.thr @@ -1816,20 +1816,16 @@ # scrub -bing paramet @@ -1925,16 +1925,107 @@ ratch')%0A + self.add_argume...
cedc38f0e8576b86bc09d3d4d5eba8fb0c979d0b
add more color
ascii_topo.py
ascii_topo.py
#!/usr/bin/env python3 # -*- coding: utf8 -*- from __future__ import print_function import json # By John-Lin colors = [ '\033[94m', '\033[92m', '\033[93m', '\033[91m' ] end_color = '\033[0m' num_colors = len(colors) def print_topo(switches=[], links=[], hosts=[]): tlinks = [] thosts = [] ...
Python
0
@@ -131,9 +131,25 @@ 33%5B9 -4 +0m',%0A '%5C033%5B91 m',%0A @@ -191,19 +191,52 @@ '%5C033%5B9 -1m' +4m',%0A '%5C033%5B95m',%0A '%5C033%5B96m', %0A%5D%0Aend_c