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
74b8ca3a3e07139545049e6c9a9fb054208473be
fix import_csv command
munge/cli.py
munge/cli.py
import argparse import os.path import config import importers import sa_util def import_module(args): for module in args.module: m = getattr(importers, module) m.importer(verbose=args.verbose) view_summaries(args) sa_util.swap_tables(verbose=args.verbose) def view_summaries(args, just_v...
Python
0.000439
@@ -71,16 +71,32 @@ sa_util%0A +import csv_util%0A %0A%0Adef im @@ -1712,21 +1712,16 @@ -from csv_util imp @@ -1720,29 +1720,9 @@ util - import dump_all%0A +. dump @@ -2393,26 +2393,27 @@ lename)%0A -sa +csv _util.import
e35d791a25c1297e5f6477955da075cf66375e35
Fix addr2line output parsing wrt ':'
src/untrusted/crash_dump/decode_dump.py
src/untrusted/crash_dump/decode_dump.py
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility to decode a crash dump generated by untrusted_crash_dump.[ch] Currently this produces a simple stack trace. """ impor...
Python
0.000118
@@ -4040,16 +4040,17 @@ 2 + 1%5D. +r split(':
85f7b462490fec31c26d8c27bc86d547ae032d91
Version 0.1.1
wordpress2puput/__init__.py
wordpress2puput/__init__.py
# -*- coding: utf-8 -*- __author__ = 'David Valera' __email__ = 'david.valera.martinez@gmail.com' __version__ = '0.1'
Python
0.000001
@@ -109,10 +109,12 @@ _ = '0.1 +.1 '%0A
5edf75129189fc37ce24ff338821b726b0a7c28a
Revert 2c1ee5f..1620020
Lesson_3_Problem_Set/05-Fixing_Name/name.py
Lesson_3_Problem_Set/05-Fixing_Name/name.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ In this problem set you work with cities infobox data, audit it, come up with a cleaning idea and then clean it up. In the previous quiz you recognized that the "name" value can be an array (or list in Python terms). It would make it easier to process and query the dat...
Python
0
@@ -856,132 +856,24 @@ -if name == %22NULL%22 or name == %22%22:%0A return %5B%5D%0A else:%0A return name.replace('%7B', '').replace('%7D','').split('%7C') +# YOUR CODE HERE %0A%0A
f3702a0f248d4cd1fef3a9ed2e1716b9ed8511a1
allow one value in range filter
django_filters/filters.py
django_filters/filters.py
from __future__ import absolute_import from __future__ import unicode_literals from datetime import timedelta from django import forms from django.db.models import Q from django.db.models.sql.constants import QUERY_TERMS from django.utils import six from django.utils.timezone import now from django.utils.translation...
Python
0.000001
@@ -4149,33 +4149,32 @@ q -%7C = Q(**%7B'%25s__gt'%25 @@ -4236,25 +4236,25 @@ q -%7C +& = Q(**%7B'%25s__
c91beca414a5216a3fd5f8f5ef1c1643f0aea2f9
Tag the rc release
oct2py/__init__.py
oct2py/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) oct2py developers. # Distributed under the terms of the MIT License. """ Oct2Py is a means to seamlessly call M-files and GNU Octave functions from Python. It manages the Octave session for you, sharing data behind the scenes using MAT files. Usage is as simple as: ....
Python
0
@@ -968,12 +968,11 @@ '4.0 --dev +rc1 '%0D%0A_
35801fdc81c4f5f93862b900bba656cfbbf1652c
Prepare version 0.1.18
djangocms_spa/__init__.py
djangocms_spa/__init__.py
__version__ = '0.1.17'
Python
0
@@ -17,7 +17,7 @@ .1.1 -7 +8 '%0A
42abea9c7c8a8317d85eddd8737fb75312a2576a
Update MNIST_CNN.py
MNIST_CNN/MNIST_CNN.py
MNIST_CNN/MNIST_CNN.py
import numpy as np import time from Neural_Networks import * def Read_MNIST(training_set_images, training_set_labels, test_set_images, test_set_labels, number_training, number_test, image, target_output): # training set images file = open(training_set_images, 'rb') for _ in range(4): file...
Python
0.000004
@@ -1627,16 +1627,21 @@ ch_size + = 60%0D%0Ade @@ -1645,24 +1645,29 @@ %0Adecay_rate + = 0.977%0D%0Aeps @@ -1671,16 +1671,24 @@ epsilon + = 0.001%0D @@ -1702,16 +1702,18 @@ ng_rate + = 0.005%0D @@ -1762,16 +1762,16 @@ 60000%0D%0A - number_t @@ -1774,16 +1774,20 @@ er_test + = 1...
104e05f326b7138e524296c049a1860c8c8a8cea
document col_to_number
MPropulator/helpers.py
MPropulator/helpers.py
import string def column_range(start, stop, skip_columns=None): """0-indexed function that returns a list of Excel column names, except for skip_columns :param start: column index at which you begin iterating :param stop: column index at which you want to stop iterating :param skip_columns: column...
Python
0.000301
@@ -8,16 +8,17 @@ string%0A%0A +%0A def colu @@ -635,10 +635,8 @@ top) - %5C %0A @@ -1187,20 +1187,17 @@ cel_col%0A - +%0A %0Adef col @@ -1209,24 +1209,295 @@ umber(col):%0A + %22%22%220-indexed function that, given a column name, returns%0A the number of that column in excel.%0A%0A col: string c...
660a3ccc0bbfedca23a7a317119c9402065c82b6
Fix the worksheet option.
logss.py
logss.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Log a row to a Google Spreadsheet.""" __author__ = 'Dominic Mitchell <dom@happygiraffe.net>' import getpass import optparse import os import sys import gdata.spreadsheet.service class Error(Exception): pass def Authenticate(client, username): # TODO: OAuth. ...
Python
0.000005
@@ -961,32 +961,37 @@ orksheet(client, + key, name):%0A if nam @@ -1058,24 +1058,27 @@ ksheetsFeed( +key )%0A workshee @@ -3269,24 +3269,29 @@ heet(client, + key, opts.worksh @@ -3761,24 +3761,39 @@ ListFeed(key +, wksht_id=wkey )%0A for co
c6793f73ba7f86767975ecdc7abdb287265c4733
add taggit app
meinberlin/settings.py
meinberlin/settings.py
""" Django settings for meinberlin project. Generated by 'django-admin startproject' using Django 1.8.17. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build ...
Python
0.000001
@@ -1418,24 +1418,60 @@ yleguide',%0A%0A + 'taggit', # wagtail dependency%0A 'rest_fr
50bc10585dddfbabda31b857b9bb4319110ccb8b
allow bool values in TEST_OUTPUT_VERBOSE for backwards-compatibility
src/xmlrunner/extra/djangotestrunner.py
src/xmlrunner/extra/djangotestrunner.py
# -*- coding: utf-8 -*- """Custom Django test runner that runs the tests using the XMLTestRunner class. This script shows how to use the XMLTestRunner in a Django project. To learn how to configure a custom TestRunner in a Django project, please read the Django docs website. """ from django.conf import settings try:...
Python
0.000176
@@ -1758,16 +1758,98 @@ SE', 1)%0A + if isinstance(verbosity, bool):%0A verbosity = (1, 2)%5Bverbosity%5D%0A
46cca5f2f07625054be7fcead7179fe79f0c41a8
Use existing helper function
src/zeit/content/volume/browser/form.py
src/zeit/content/volume/browser/form.py
from zeit.cms.i18n import MessageFactory as _ import gocept.form.grouped import transaction import zeit.cms.browser.form import zeit.cms.interfaces import zeit.cms.repository.folder import zeit.cms.repository.interfaces import zeit.cms.settings.interfaces import zeit.content.image.interfaces import zeit.content.volume....
Python
0.000001
@@ -3256,29 +3256,52 @@ r = -self.create_location( +zeit.cms.content.add.find_or_create_folder(* path @@ -3305,24 +3305,16 @@ ath%5B:-1%5D -, object )%0A @@ -3497,16 +3497,16 @@ lename%5D%0A + @@ -3536,378 +3536,8 @@ ue%0A%0A - def create_location(self, path, object):%0A repository = zo...
192c8bb4b3614a92edb19f71a42dfb3f973d160f
Remove unused method - we allow users to override runner parameters and make them immutable / set a default value inside action parameters.
st2api/st2api/controllers/v1/actions.py
st2api/st2api/controllers/v1/actions.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0.000002
@@ -2105,521 +2105,8 @@ ue%0A%0A - @staticmethod%0A def _validate_action_parameters(action, runnertype_db):%0A # check if action parameters conflict with those from the supplied runner_type.%0A conflicts = %5Bp for p in action.parameters.keys() if p in runnertype_db.runner_parameters%5D%0A i...
1f044c497b5a25248827b5a50e3d898ae8c7f6af
Update local_settings.py
src/odontology/odontology/local_settings.py
src/odontology/odontology/local_settings.py
""" Django settings for odontology project. Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os...
Python
0.000001
@@ -681,58 +681,8 @@ = ' -h0_%25$7qsz@i-%5E7_&tcl0_xayt1ce46&20d2#xw=jhvn+gfpm45 '%0A%0A# @@ -2865,26 +2865,16 @@ NAME': ' -odontology ',%0A @@ -2889,18 +2889,8 @@ ': ' -nanomolina ',%0A @@ -2913,16 +2913,8 @@ ': ' -nano1234 ',%0A
48a243d48c9eb2a1165ff4cadf26313c6a3659c1
Add back changes which were accidentaly removed in ac123a028f296d49e09dda35efb3bb458fa0d161.
st2common/st2common/cmd/install_pack.py
st2common/st2common/cmd/install_pack.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Python
0
@@ -2430,24 +2430,100 @@ ions=True)%0A%0A + # Raw pack name excluding the version%0A pack_name = result%5B1%5D%0A succ @@ -2617,32 +2617,37 @@ ck %22%25s%22' %25 (pack +_name ))%0A else: @@ -2743,16 +2743,21 @@ %25 (pack +_name , error) @@ -2881,32 +2881,37 @@ ck %22%25s%22' %25 (pa...
d9810b8bc00b08275af0df0b213915151f553c3a
Fix comments in `ref_doc_generation.py`.
doc/ref_doc_generation.py
doc/ref_doc_generation.py
import logging import os from jinja2 import Environment, FileSystemLoader # Input source directory and input list of directories. CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) DO_PROJECT_NAME = 'DO-CV' DO_SOURCE_DIR = os.path.join(CURRENT_DIR, '../src/DO') DO_LIBRARIES = sorted(os.walk(DO_SOURCE_DIR).nex...
Python
0
@@ -855,30 +855,41 @@ path of the -module +library directory .%0A librar @@ -1283,24 +1283,25 @@ header files +. %0A for
aafa325272649f03a3cd02cb82f2362704142b98
Improve exception proceduer
buzz2weibo.py
buzz2weibo.py
#!/usr/bin/python # vim: set fileencoding=utf-8 : # buzz2weibo # Copyright 2011 Sun Zhigang # See LICENSE for details. from config import * from urllib2 import urlopen, URLError from json import load from activity import * from weibopy.auth import OAuthHandler from weibopy.api import API import os, errno WEIBO_APP_K...
Python
0.000015
@@ -1283,30 +1283,12 @@ rror - as exc: # Python %3E2.5 +, e: %0A @@ -1292,18 +1292,16 @@ if e -xc .errno = @@ -1897,30 +1897,11 @@ rror - as (errno, strerror) +, e :%0A @@ -1931,16 +1931,18 @@ %0A if +e. errno != @@ -1942,17 +1942,28 @@ rrno != -2 +errno.ENOENT :%0A
6ec10208ea799f417b612273485e081b5b07eb21
Fix bug where __init__ was accessed for objects that might not have it.
doc/sphinxext/numpydoc.py
doc/sphinxext/numpydoc.py
""" ======== numpydoc ======== Sphinx extension that handles docstrings in the Numpy standard format. [1] It will: - Convert Parameters etc. sections to field lists. - Convert See Also section to a See also entry. - Renumber references. - Extract the signature from the docstring, if it can't be determined otherwise....
Python
0
@@ -2679,16 +2679,57 @@ bj) and%0A + (not hasattr(obj, '__init__') or%0A @@ -2780,16 +2780,17 @@ init__)) +) :%0A
c00a12fb593e329cc1fc2d3710cd9e89d0abfa16
set production api url
c4r/config.py
c4r/config.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Server parameters baseApiUrl = 'http://stage.cloud4rpi.io:3000/api'
Python
0.000001
@@ -82,17 +82,12 @@ http +s :// -stage. clou
6bed5a89f92e1ef7538058f755fecbdde2476493
Add debug output.
newsdedup.py
newsdedup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """News dedup for Tiny Tiny RSS.""" # # Copyright (C) 2015 Peter Reuterås import ConfigParser import argparse import logging import sys import time from collections import deque from fuzzywuzzy import fuzz from time import gmtime, strftime from ttrss.client import TTRClien...
Python
0.000001
@@ -1896,16 +1896,151 @@ ed += 1%0A + if arguments.debug:%0A print_time_message(arguments, %22Debug: Learned titles from %22 + str(learned) + %22 RSS articles.%22)%0A if a
920e75491f3aaa74980e11086cfebe911c2def4b
Remove yield from datasets tests
statsmodels/datasets/tests/test_data.py
statsmodels/datasets/tests/test_data.py
import numpy as np import pandas as pd import statsmodels.datasets as datasets from statsmodels.datasets import co2 from statsmodels.datasets.utils import Dataset def test_co2_python3(): # this failed in pd.to_datetime on Python 3 with pandas <= 0.12.0 dta = co2.load_pandas() class TestDatasets(object): ...
Python
0
@@ -1,12 +1,30 @@ +import importlib%0A%0A import numpy @@ -54,53 +54,41 @@ pd%0A -%0A import -statsmodels.datasets as datasets%0Afrom +nose%0Aimport pytest%0A%0Aimport sta @@ -108,19 +108,8 @@ sets - import co2 %0Afro @@ -157,213 +157,8 @@ et%0A%0A -%0Adef test_co2_python3():%0A # this failed in pd.to_date...
97badc176f4a8ac30eb3932359e2e132e36170c4
Increase the number of workers
docker/gunicorn_config.py
docker/gunicorn_config.py
import multiprocessing from os import getenv bind = '127.0.0.1:8001' workers = multiprocessing.cpu_count() * 2 timeout = 60 threads = multiprocessing.cpu_count() * 2 max_requests = 1000 max_requests_jitter = 5 # Read the DEBUG setting from env var try: if getenv('DOCKER_SAL_DEBUG').lower() == 'true': errorl...
Python
0.672158
@@ -102,17 +102,17 @@ unt() * -2 +3 %0Atimeout @@ -157,17 +157,17 @@ unt() * -2 +3 %0Amax_req @@ -178,10 +178,9 @@ s = -10 +5 00%0Am
80357e07de707b0aa989a9910f6f2d8374d978a7
Add some comments about how we're cleaning callables
lib/ansible/template/safe_eval.py
lib/ansible/template/safe_eval.py
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
Python
0
@@ -3230,16 +3230,218 @@ e_call:%0A + # Disallow calls to builtin functions that we have not vetted%0A # as safe. Other functions are excluded by setting locals in%0A # the call to eval() later on%0A @@ -4099,32 +4099,253 @@ , expr, 'eval')%0A + # Note: p...
15090b84e1c7359c49cb45aec4d9b4d492f855ac
Update smb test to include port parameter
tests/scoring_engine/engine/checks/test_smb.py
tests/scoring_engine/engine/checks/test_smb.py
from scoring_engine.engine.basic_check import CHECKS_BIN_PATH from tests.scoring_engine.engine.checks.check_test import CheckTest class TestSMBCheck(CheckTest): check_name = 'SMBCheck' required_properties = ['share', 'file', 'hash'] properties = { 'share': 'ScoringShare', 'file': 'flag.tx...
Python
0
@@ -463,16 +463,27 @@ 7.0.0.1' + --port 100 --user
0ce7fa3100ce3d1626519da3f5395622af0e7fdf
fix for issue 440
tests/window/WINDOW_SET_MOUSE_SYSTEM_CURSOR.py
tests/window/WINDOW_SET_MOUSE_SYSTEM_CURSOR.py
#!/usr/bin/env python '''Test that mouse cursor can be set to a platform-dependent image. Expected behaviour: One window will be opened. Press the left and right arrow keys to cycle through the system mouse cursors. The current cursor selected will be printed to the terminal. Note that not all curs...
Python
0
@@ -1610,16 +1610,79 @@ %5D%0A + if symbol == key.ESCAPE:%0A self.w.on_close()%0A
b3889bbdab80fb502c74b99b61cf36bae112ce2c
Add property decorator to getters
node/node.py
node/node.py
from configparser import ConfigParser from driver import BTRFSDriver class Node: """ # Dummy config example [bk1-z3.presslabs.net] ssd = True """ def __init__(self, context): self._conf_path = context['node']['conf_path'] self._driver = BTRFSDriver(context['volume_path']) ...
Python
0
@@ -702,16 +702,30 @@ _all()%0A%0A + @property%0A def @@ -763,16 +763,30 @@ ._name%0A%0A + @property%0A def
33d81aa4077a656949822a8fe45ef3dd8ebbfe2c
add a missing import (#48006)
python/paddle/fluid/tests/unittests/xpu/process_group_bkcl.py
python/paddle/fluid/tests/unittests/xpu/process_group_bkcl.py
# Copyright (c) 2022 PaddlePaddle Authors. 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 appli...
Python
0
@@ -679,16 +679,50 @@ paddle%0A +import paddle.distributed as dist%0A from pad
af7a2e59b76a5c404e393a6fc1aeca9517018185
Fix peacock crash when filename with unicode exists
python/peacock/ExodusViewer/plugins/ExodusFilterProxyModel.py
python/peacock/ExodusViewer/plugins/ExodusFilterProxyModel.py
#!/usr/bin/env python2 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
Python
0.000002
@@ -638,12 +638,8 @@ e = -str( self @@ -669,17 +669,16 @@ (index0) -) %0A%0A
814b344082fbce471509c54c683470467dd8f814
use env to find python binary
main.pyw
main.pyw
#!/usr/bin/python3 from tkinter import * from models import * import logging import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) appWindow = Tk() appWindow.title("Virtual Controller") # Set fullscreen [Not necessary when debugging] # appWindow.geometry("{0}x{1}+0+0".format(appWindow.winfo_screenwidth(), appWindow.winfo...
Python
0.000018
@@ -4,16 +4,20 @@ usr/bin/ +env python3%0A
e6547ff12935b86ecf5fa35b78073b3001dd4de0
Use single quotes for strings everywhere.
mario.py
mario.py
#!/usr/bin/env python3 # Copyright (c) 2015 Damir Jelić. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import tempfile import mimetypes import subprocess import urllib.request from urllib.error import HTTPError, URLError from urllib.parse imp...
Python
0
@@ -2025,17 +2025,17 @@ fix= -%22 +' plumber- %22, d @@ -2030,17 +2030,17 @@ plumber- -%22 +' , dir=tm @@ -4088,17 +4088,17 @@ type != -%22 +' text/htm @@ -4102,9 +4102,9 @@ html -%22 +' :%0A
59c14e1c0d69309c554ddafa5e168115ba05ddfd
Update the win/lose determination code
match.py
match.py
''' The match monitoring module for SaltBot ''' from bs4 import BeautifulSoup import requests import time from bet import bet_player1 from website import website class Match: def __init__(self): self.id = 0 # TODO: Use SQL to determine this w/ MAX() self.player1 = None self.player2...
Python
0
@@ -1004,16 +1004,64 @@ request) +%0A balance_start = None%0A balance_end = None %0A%0A wh @@ -1225,50 +1225,8 @@ s()%0A - prev_balance = site.get_balance()%0A @@ -1289,45 +1289,8 @@ us() -%0A balance = site.get_balance() %0A%0A @@ -1342,24 +1342,69 @@ == 'open'):%0A + ba...
8c9b29f0becbef26625e7a2fbe6aaf1d75faeacd
fix parameter order
lib/exabgp/reactor/network/tcp.py
lib/exabgp/reactor/network/tcp.py
# encoding: utf-8 """ setup.py Created by Thomas Mangin on 2013-07-13. Copyright (c) 2013-2013 Exa Networks. All rights reserved. """ import struct import socket import platform from exabgp.util.errstr import errstr from exabgp.protocol.family import AFI from exabgp.reactor.network.error import errno from .error i...
Python
0.000001
@@ -907,17 +907,17 @@ nd ( +ip, io,afi -,ip ):%0A%09
67e620716b494f74c9b913b6514463eb4689c590
add OMPL_DEBUG and other convenience function to python bindings
py-bindings/ompl/util/__init__.py
py-bindings/ompl/util/__init__.py
from os.path import abspath, dirname from ompl import dll_loader dll_loader('ompl', dirname(abspath(__file__))) from ompl.util._util import *
Python
0
@@ -135,8 +135,610 @@ mport *%0A +import inspect%0A%0Adef OMPL_DEBUG(text):%0A c = inspect.currentframe().f_back%0A getOutputHandler().log(text, LogLevel.LOG_DEBUG, c.f_code.co_filename, c.f_lineno)%0Adef OMPL_INFORM(text):%0A c = inspect.currentframe().f_back%0A getOutputHandler().log(text, LogLevel.LOG_I...
a0ae834ec44acdbb6b7979a3df9a50659acc1d11
Fix broken star import
src/pybel_tools/summary/error_summary.py
src/pybel_tools/summary/error_summary.py
# -*- coding: utf-8 -*- """This module contains functions that provide summaries of the errors encountered while parsing a BEL script""" from collections import Counter, defaultdict from pybel.constants import ANNOTATIONS from pybel.parser.parse_exceptions import * from .node_summary import get_namespaces, get_names...
Python
0.000003
@@ -631,37 +631,8 @@ t',%0A - 'calculate_suggestions',%0A
cdf31e64ad2b951c4c8bd0acfb087b541490746c
Add root_path to http.services.Service
py/garage/garage/http/services.py
py/garage/garage/http/services.py
__all__ = [ 'ServiceError', 'EndpointNotFound', 'VersionNotSupported', 'Service', ] import logging import re from http import HTTPStatus from http2 import HttpError from garage import asserts LOG = logging.getLogger(__name__) class ServiceError(Exception): pass class EndpointNotFound(Servic...
Python
0.000018
@@ -560,16 +560,46 @@ version%0A + self.root_path = None%0A @@ -2349,16 +2349,187 @@ path):%0A + if self.root_path:%0A if not path.startswith(self.root_path):%0A raise EndpointNotFound(path)%0A path = path%5Blen(self.root_path):%5D%0A%0A
66b6d3648c0a4229048c0f8a63ec410c407f1ba1
Fix unittest
src/pyscaffold/extensions/no_skeleton.py
src/pyscaffold/extensions/no_skeleton.py
# -*- coding: utf-8 -*- """ Extension that omits the creation of file `skeleton.py` """ from ..api import Extension from ..api import helpers class NoSkeleton(Extension): """Omit creation of skeleton.py""" def activate(self, actions): """Activate extension Args: actions (list): l...
Python
0.00002
@@ -957,42 +957,73 @@ -pkgs = opts%5B'qual_pkg'%5D.split('.') +# Namespace is not yet applied so deleting from package is enough %0A @@ -1061,20 +1061,27 @@ src' -%5D + pkgs + %5B +, opts%5B'package'%5D, 'ske
0062eeaf558a0eb9e8a736baf16932e56546001f
Fix silly Python indentation issues.
src/query_processing/query_processing.py
src/query_processing/query_processing.py
# LING 573 Question Answering System # Code last updated 4/15/14 by Andrea Kahn # # This code implements a QueryProcessor for the question answering system. import sys import general_classes import nltk # TODO: A QueryProcessor should be initialized with the Question object, but should it # have this question as an ...
Python
0.000002
@@ -902,18 +902,24 @@ (self):%0A -%09%09 + tokenize @@ -960,18 +960,24 @@ tion.q)%0A -%09%09 + tokenize @@ -1156,18 +1156,24 @@ .',','%5D%0A -%09%09 + search_q @@ -1350,18 +1350,24 @@ stions %0A -%09%09 + return %5B
74b9a7b5cba162dba986075e43ab29682a13e55e
fix orientation
py3status/modules/xrandr_rotate.py
py3status/modules/xrandr_rotate.py
# -*- coding: utf-8 -*- """ Control screen rotation. Configuration parameters: cache_timeout: how often to refresh this module. (default 10) format: a string that formats the output, can include placeholders. (default '{icon}') hide_if_disconnected: a boolean flag to hide icon when `screen`...
Python
0.000004
@@ -2140,55 +2140,8 @@ s):%0A - output = self.screen or all_outputs%5B0%5D%0A @@ -2213,55 +2213,78 @@ o -rientation = ''.join(%0A %5Bx.split()%5B3%5D +utput = self.screen or all_outputs%5B0%5D%0A output_line = ''.join(%5Bx for @@ -2320,24 +2320,25 @@ tput)%5D)%0A +%0A #...
c6b47431f75675547d54c3b68c07aad76721e513
fix srfit test
pyiid/tests/test_against_srfit.py
pyiid/tests/test_against_srfit.py
__author__ = 'christopher' from pyiid.tests import * from pyiid.experiments.elasticscatter import ElasticScatter local_test_atoms = setup_atomic_square()[0] * 3 test_data = tuple(product([local_test_atoms], [None])) def test_fq_against_srfit(): for value in test_data: yield check_fq_against_srfit, value ...
Python
0.000001
@@ -216,110 +216,33 @@ )%0A%0A%0A -def test_fq_against_srfit():%0A for value in test_data:%0A yield check_fq_against_srfit, value%0A%0A +@known_fail_if(not srfit) %0Adef @@ -269,61 +269,11 @@ fit( -value ):%0A - if not srfit:%0A KnownFailureTest()%0A @@ -322,16 +322,24 @@ s = -value%5B0%...
1b108ad916ec0d3acdb582491ab9bcd756e05f41
Check existence of updates dir only once
pyfarm/master/api/agent_updates.py
pyfarm/master/api/agent_updates.py
# No shebang line, this module is meant to be imported # # Copyright 2014 Ambient Entertainment Gmbh & Co. KG # # 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/lice...
Python
0
@@ -850,16 +850,41 @@ , isfile +%0Afrom errno import EEXIST %0A%0Atry:%0A @@ -1463,16 +1463,233 @@ ))?$%22)%0A%0A +UPDATES_DIR = read_env(%0A %22PYFARM_AGENT_UPDATES_DIR%22, join(tempfile.gettempdir(), %22pyfarm-updates%22))%0A%0Atry:%0A makedirs(UPDATES_DIR)%0Aexcept OSError as e: # pragma: no cover%0A i...
e6ee5a31177d537bbdf2c60fef9654ac967168cc
update every 5 minutes results to irc
pyfibot_module/module_nhl_stats.py
pyfibot_module/module_nhl_stats.py
# -*- coding: utf-8 -*- from peewee import SqliteDatabase from eanhlstats.model import * from eanhlstats.interface import * import eanhlstats.settings Team.create_table(True) Player.create_table(True) eanhlstats.settings.REGION = 3 import logging from twisted.internet import reactor log = logging.getLogger("motionma...
Python
0
@@ -530,10 +530,12 @@ ine( -30 +60*5 )%0A%0Ad
df5c7cdd46d2d33391bce72acc8b9f4c6de2f708
fix inifile passing to halcmd
lib/python/machinekit/launcher.py
lib/python/machinekit/launcher.py
import os import sys from time import * import subprocess import signal from machinekit import compat _processes = [] # ends a running Machinekit session def end_session(): stop_processes() stop_realtime() # checks wheter a single command is available or not def check_command(command): process = subpro...
Python
0
@@ -3194,32 +3194,17 @@ 'halcmd - -f ' + filename +' %0A if @@ -3252,16 +3252,50 @@ ' + ini%0A + command += ' -f ' + filename%0A subp
205483ef0241ee48821a801a97faa4d19121651a
check buffer, use own exception
pyscreenshot/plugins/gdk3pixbuf.py
pyscreenshot/plugins/gdk3pixbuf.py
# -*- coding: utf-8 -*- """Gdk3-based screenshotting. Adapted from https://stackoverflow.com/a/37768950/81636, but uses buffers directly instead of saving intermediate files (which is slow). """ import sys from PIL import Image from pyscreenshot.plugins.backend import CBackend from pyscreenshot.util import platform_i...
Python
0
@@ -1686,16 +1686,87 @@ (w, *g)%0A + if not pb:%0A raise Gdk3BackendError(%22empty buffer%22)%0A%0A @@ -1809,37 +1809,43 @@ raise -Value +Gdk3Backend Error(%22Expected @@ -1917,29 +1917,35 @@ raise -Value +Gdk3Backend Error(%22Expec
6880efb6231cdf8d7dd19f9ef517006e29f7afeb
Make documentaion of logpowspec match behaviour
python_speech_features/sigproc.py
python_speech_features/sigproc.py
# This file includes routines for basic signal processing including framing and computing power spectra. # Author: James Lyons 2012 import decimal import numpy import math import logging def round_half_up(number): return int(decimal.Decimal(number).quantize(decimal.Decimal('1'), rounding=decimal.ROUND_HALF_UP)) ...
Python
0
@@ -4790,17 +4790,17 @@ mes) is -1 +0 .%0A :r
8b34cf20b9cc010d321912433d772ccad8dbdb6f
Update MediaWiki version for i18n_family.py from trunk r8823
pywikibot/families/i18n_family.py
pywikibot/families/i18n_family.py
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family # The Wikimedia i18n family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'i18n' self.langs = { 'i18n': 'translatewiki.net', } def version(self...
Python
0.000001
@@ -345,9 +345,9 @@ %221.1 -7 +8 alph
aeeed413830f58c60ab4b05beddf44ab4dba5e36
Update views.py
chat/views.py
chat/views.py
import random import string from django.db import transaction from django.shortcuts import render, redirect import haikunator from .models import Room def about(request): return render(request, "chat/about.html") def new_room(request): """ Randomly create a new room, and redirect to it. """ new_ro...
Python
0
@@ -1153,16 +1153,17 @@ amp')%5B:1 +0 %5D)%0A%0A
ae996ab0bba11047d6317e18e54e926097b6759d
Add other job/mol settings when running jobs
chem/utils.py
chem/utils.py
import time import bz2 import zipfile import tarfile import re import collections from models import ErrorReport from chemtools import gjfwriter from chemtools import fileparser from chemtools.constants import KEYWORDS from chemtools.ml import get_properties_from_decay_with_predictions, \ get_...
Python
0
@@ -3912,32 +3912,111 @@ %0A%0A if names:%0A + settings = %7Bk: v for k,v in job_settings.items()+mol_settings.items()%7D%0A temp = r @@ -4050,20 +4050,16 @@ gjfs, ** -job_ settings
ba326b959a93b860da2b84ddc09250913239e6d0
reduce show query precedence
chrisjones.py
chrisjones.py
""" This module is the brain of the Chris Jones Bot. It handles queries and constructs responses """ import requests import json import elastic from elastic import ES_URL from google_nlp_api import GoogleNlp import re from QueryAnalyzer import QueryAnalyzer import random from fuzzywuzzy import process from default_quer...
Python
0.999482
@@ -2396,624 +2396,8 @@ y)%0A%0A - elif len(annotated_query.shows) %3E 0:%0A # Show related question types%0A print 'Show Query'%0A router = %7B%0A 'what did you think of SHOW': lambda x,y: DefaultQuery().generate_response(x, y),%0A 'what do you thi...
91e745e83cb6cfd60bc0a90cb6203d9dd07d28de
Implement simple file size listing
cloud-fuse.py
cloud-fuse.py
# # @file cloud-fues.py # # @brief Main entrypoint into the cloud-fuse software. # from __future__ import print_function, absolute_import, division import logging import math import sqlite3 import os import md5 from errno import ENOENT from stat import S_IFDIR, S_IFREG from sys import argv, exit f...
Python
0.000001
@@ -1983,16 +1983,247 @@ locks)%0A%0A + def getSizeOfFile(self, path):%0A totalSize = 0%0A blockRoot = self.getBlockRoot(path)%0A%0A for block in os.listdir(blockRoot):%0A totalSize += os.path.getsize(blockRoot+block)%0A%0A return totalSize%0A%0A def @@ -3452,32 +3452,66...
f66860c2015bb684d3789f3ce7a996e05521960b
fix clock pin constraint
litex_boards/platforms/zybo_z7.py
litex_boards/platforms/zybo_z7.py
# # This file is part of LiteX-Boards. # # Copyright (c) 2019-2020 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex.build.xilinx import XilinxPlatform, VivadoProgrammer # IOs -----------------------------------------------------...
Python
0
@@ -408,11 +408,11 @@ ns(%22 -L16 +K17 %22),
4a5d5318d7f965d520b183ea489e64573444d4b8
fix csr & reset region
litex_boards/targets/redpitaya.py
litex_boards/targets/redpitaya.py
#!/usr/bin/env python3 # # This file is part of LiteX-Boards. # # Copyright (c) 2020 Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com> # SPDX-License-Identifier: BSD-2-Clause import os from migen import * from litex_boards.platforms import redpitaya from litex.build.xilinx.vivado import vivado_build_args...
Python
0
@@ -494,32 +494,80 @@ c_core import *%0A +from litex.soc.integration.soc import SoCRegion%0A from litex.soc.i @@ -2308,16 +2308,268 @@ b_uart%22%0A + if kwargs.get(%22cpu_type%22, None) == %22zynq7000%22:%0A kwargs%5B%22integrated_sram_size%22%5D = 0%0A kwargs%5B%22with_uart%22%5D ...
97f4e9e40fb67ef9e57321512a533772917cb52b
Version 0.6.1
src/pymatching/_version.py
src/pymatching/_version.py
# Copyright 2020 Oscar Higgott # 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
@@ -588,11 +588,11 @@ = %220.6. -0 +1 %22%0A
156fa00da531e575297bea402d0269f85c259b7e
use Cholesky decomposition for orthogonal projection
src/pymor/algorithms/ei.py
src/pymor/algorithms/ei.py
# This file is part of the pyMor project (http://www.pymor.org). # Copyright Holders: Felix Albrecht, Rene Milk, Stephan Rave # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function from numbers import Number import math as m impo...
Python
0
@@ -369,16 +369,39 @@ iangular +, cho_factor, cho_solve %0A%0Afrom p @@ -2235,39 +2235,55 @@ ian_ -inverse = np.linalg.inv(gramian +cholesky = cho_factor(gramian, overwrite_a=True )%0A%0A @@ -2598,36 +2598,44 @@ ients = -gramian_inverse.dot( +cho_solve(gramian_cholesky, collater @@ -2781,28 +2781,36 @@ s = -...
3da923e052fc28d71c101f8990d413ba59d4bae0
Fix media template
src/redmill/views/media.py
src/redmill/views/media.py
# This file is part of Redmill. # # Redmill is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Redmill is distributed in the ho...
Python
0.000002
@@ -1194,24 +1194,69 @@ media.id))%0A%0A + if os.path.isfile(filename):%0A @@ -1280,32 +1280,36 @@ tsize(filename)%0A + pref @@ -1373,16 +1373,20 @@ + + while si @@ -1409,24 +1409,28 @@ + size /= 1024 @@ -1439,32 +1439,36 @@ ...
9e6e2fd1903b8e4deb3b6737d86aadc2627cb4eb
add the `__all__` to `_compat.py`.
flask_storage/_compat.py
flask_storage/_compat.py
import sys try: from urlparse import urljoin import urllib2 as http except ImportError: from urllib.parse import urljoin from urllib import request as http if sys.version_info[0] == 3: string_type = str else: string_type = unicode def to_bytes(text): if isinstance(text, string_type): ...
Python
0
@@ -251,16 +251,75 @@ icode%0A%0A%0A +__all__ = %5B'urljoin', 'http', 'string_type', 'to_bytes'%5D%0A%0A%0A def to_b
b9873d93c047e0d51986d74251c0378033c425ae
print done when finished generating chunks
runapp.py
runapp.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Runs the development server of the downstream_node app. # Not for production use. import argparse import csv import time from flask import Flask, jsonify from werkzeug.serving import run_simple from werkzeug.wsgi import DispatcherMiddleware from datetime import datetime...
Python
0.000001
@@ -2179,16 +2179,79 @@ k_size)%0A + if (len(missing_list) %3E 0):%0A print('Done.')%0A
901b3e88704f938dcc090bb93b9818ac7ac994dd
Update ipc_lista1.8.py
lista1/ipc_lista1.8.py
lista1/ipc_lista1.8.py
#ipc_lista1.8 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês. #Calcule e mostre o total do seu salário no referido mês. QntHora = input("Entre com o valor de seu rendimento por hora: ") hT = input("E...
Python
0
@@ -390,10 +390,11 @@ (QntHora +* %0A%0A
1d8d980a269e643aac645e6432c0b16714f8e86e
Update project.
examples/monte_carlo.py
examples/monte_carlo.py
__author__ = "Fernando Crema" __copyright__ = "Copyright 2007, The Cogent Project" __credits__ = ["Fernando Crema @FernandoCremaG", "Antonio Jesús Torres @ajtorresd"] __license__ = "GPL" __version__ = "1.0" __maintainer__ = "Fernando Crema" __email__ = "fernando.crema@sabermetrics.dev" __status__ = "Production" from r...
Python
0
@@ -56,30 +56,51 @@ t 20 -07 +19 , The -Cogent +Sabermetrics Python Package Project %22%0A__ @@ -95,16 +95,17 @@ Project +. %22%0A__cred
84f9f45f984cbf0b4192cae49e51333767bb5576
fix runtox.py failure when 'tox' is not available on the current system path
runtox.py
runtox.py
#!/usr/bin/env python import subprocess import sys if __name__ == "__main__": subprocess.call(["tox", "-i", "ALL=https://devpi.net/hpk/dev/", "--develop",] + sys.argv[1:])
Python
0.000003
@@ -94,16 +94,38 @@ s.call(%5B +sys.executable, %22-m%22, %22tox%22,%0A
bc9c43160a58508e412592b0ab9a0d7f3a35c48c
fix regression in folde tests
src/adhocracy/adhocracy/folder/test_init.py
src/adhocracy/adhocracy/folder/test_init.py
import unittest from pyramid import testing class ResourcesAutolNamingFolderUnitTest(unittest.TestCase): def setUp(self): self.config = testing.setUp() def tearDown(self): testing.tearDown() def _makeOne(self, d=None): from . import ResourcesAutolNamingFolder return Res...
Python
0
@@ -410,38 +410,20 @@ import I -AutoNamingManualFolder +Pool %0A @@ -534,30 +534,12 @@ ct(I -AutoNamingManualFolder +Pool , in
d6e06d4be5c483bdf4aff8032ff22bee5a49be02
Fix broken test.
backend/sublime/testdata/view_test.py
backend/sublime/testdata/view_test.py
# coding=utf-8 import sys import traceback try: import sublime v = sublime.test_window.new_file() assert v.id() != sublime.test_window.id() assert sublime.test_window.id() == v.window().id() assert v.size() == 0 e = v.begin_edit() v.insert(e, 0, "hellå world") v.end_edit(e) assert v....
Python
0
@@ -829,11 +829,12 @@ d%22: -Tru +Fals e%7D)%0A @@ -864,13 +864,13 @@ = (4 -7, 47 +5, 45 )%0A @@ -917,36 +917,35 @@ rs%22, %22forward%22: -Fals +Tru e%7D)%0A assert v
5e4c9f5a82f9a4f505cbb5c11e411ef70bc78db9
Bump version
metakernel/__init__.py
metakernel/__init__.py
from ._metakernel import ( MetaKernel, IPythonKernel, register_ipython_magics, get_metakernel) from . import pexpect from .replwrap import REPLWrapper, u from .process_metakernel import ProcessMetaKernel from .magic import Magic, option from .parser import Parser __all__ = ['Magic', 'MetaKernel', 'option'] __vers...
Python
0
@@ -327,17 +327,17 @@ = '0.13. -0 +1 '%0A%0Adel m
56786beda79bf5a88c73b4899c953b0a83eccaa1
edit felix to run trajectory
felix/felix.py
felix/felix.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------ # Fachhochschule Bielefeld # Ingenieurwissenschaften und Mathematik # Ingenieurinformatik - Studienarbeit # Michel Asmus, Marcel Bernauer, Phil Petschull # ------------------------------------------------ # project: felix ...
Python
0
@@ -489,20 +489,22 @@ ry:%0A -from +import test_fe @@ -510,30 +510,8 @@ elix - import run_trajectory %0Aexc @@ -558,30 +558,26 @@ porting -run_trajectory +test_felix failed! @@ -5549,16 +5549,27 @@ +test_felix. run_traj
d5ec09fe4ad4209c387b1b0da82a412ea83f7658
Change module name
misp_modules/modules/expansion/__init__.py
misp_modules/modules/expansion/__init__.py
from . import _vmray # noqa __all__ = ['vmray_submit', 'asn_history', 'circl_passivedns', 'circl_passivessl', 'countrycode', 'cve', 'dns', 'btc_steroids', 'domaintools', 'eupi', 'farsight_passivedns', 'ipasn', 'passivetotal', 'sourcecache', 'virustotal', 'whois', 'shodan', 'reversedns...
Python
0.00002
@@ -55,19 +55,18 @@ ', ' -asn_history +bgpranking ', '
ac4058c78889f9500d8d61321fa1e3071280c9d6
add dump
misc/testzookeeper2.py
misc/testzookeeper2.py
''' Created on 2016/9/20 :author: hubo ''' from __future__ import print_function from vlcp.server import main from vlcp.event import Client from vlcp.server.module import Module from vlcp.config import defaultconfig from vlcp.protocol.zookeeper import ZooKeeper, ZooKeeperConnectionStateEvent,\ ZooKeeperWatcherEven...
Python
0.000001
@@ -1364,16 +1364,21 @@ urns:', +dump( self.api @@ -1386,32 +1386,33 @@ outine.retvalue) +) %0A def _wa
bf7c37081dec2fafc2c45b3cefdf06af027d9c64
Use Name tag for reverse resolution if set
unbound_ec2/server.py
unbound_ec2/server.py
from abc import ABCMeta, abstractmethod import time from unboundmodule import * class Server: """Abstract server class for serving DNS requests. Provides functional framework for implementing authoritative or caching servers. """ __metaclass__ = ABCMeta def __init__(self, zone, reverse_zone, ttl...
Python
0
@@ -4070,60 +4070,238 @@ -return '%25s.%25s.' %25 (instance.id, self.zone.strip('.') +domain = self.zone.rstrip('.')%0A name = instance.tags%5B'Name'%5D.split(',')%5B0%5D.rstrip('.') if 'Name' in instance.tags else instance.id%0A return '%25s.' %25 (name if domain in name else '%25s.%25s' %25 (name,...
48894b2200d3324525ce3f1056fbd4d3420765e2
Make date string sent to Guardian API dynamic.
scrape.py
scrape.py
#!/usr/bin/env python import argparse from datetime import datetime from json import loads from bs4 import BeautifulSoup from ebooklib import epub import requests def get_todays_news(api_key): payload = {'api-key': api_key, 'section': 'world', 'from-date': '2015-03-22'} r = re...
Python
0
@@ -181,16 +181,25 @@ ys_news( +section, api_key) @@ -200,16 +200,81 @@ i_key):%0A + now = datetime.now()%0A api_date = now.strftime('%25Y-%25m-%25d')%0A payl @@ -330,15 +330,15 @@ n': -'world' +section ,%0A @@ -367,20 +367,16 @@ e': -'2015-03-22' +api_date %7D%0A @@ -2124,16 +2124,25 @@ ys_ne...
770d6a1b390ffd9fbade5d374e7252b265f96762
Fix (Ordered)Dict iteritems/itervalues
poet/poet.py
poet/poet.py
#!/usr/bin/env python """ homebrew-pypi-poet Invoked like "poet foo" for some package foo **which is presently installed in sys.path**, determines which packages foo and its dependents depend on, downloads them from pypi and computes their checksums, and spits out Homebrew resource stanzas. """ from __future__ impor...
Python
0
@@ -3794,20 +3794,16 @@ n nodes. -iter items()%0A @@ -4281,12 +4281,8 @@ des. -iter valu
1775ed95135f78772e74d576fbe238b677373f3b
add support for multiple networks:
src/collectors/docker_stats/docker_stats.py
src/collectors/docker_stats/docker_stats.py
""" The DockerStatsCollector collects stats from the docker daemon about currently running containers. """ import diamond.collector from diamond.utils.signals import SIGALRMException try: import docker except ImportError: docker = None def env_list_to_dict(env_list): env_dict = {} for pair in env_list: t...
Python
0
@@ -3980,24 +3980,204 @@ twork Stats%0A + networks = stats.get('networks', %5B%5D)%0A if not networks:%0A networks = %7B'eth0': stats%5B'network'%5D%7D%0A%0A for network_name, network in networks.iteritems():%0A for @@ -4208,24 +4208,26 @@ tx_bytes'%5D:%0A + se @...
62095d1f6f711304ab92ad05734395c5fe284a9c
Remove dict comprehensions for 2.6 compatibility, fixes #1
funky/funky.py
funky/funky.py
# Python imports import operator import time from functools import wraps, partial _py_hash = hash # Constants LIST_TYPES = (list, tuple, set) def first(iterable, default=None): if not iterable: # Empty iterator (list) return default return iterable[0] def rest(iterable): return iterabl...
Python
0
@@ -5156,17 +5156,21 @@ ection)( -%7B +dict( %0A @@ -5170,16 +5170,17 @@ +( mapper(v @@ -5184,11 +5184,20 @@ r(v) -: +, v +)%0A for @@ -5217,17 +5217,17 @@ ion%0A -%7D +) .values(
29134a36b3b1d5db12fe4891d1f15191f7f1fa31
make collection paths unique to avoid all sorts of mayhem
src/compas_blender/utilities/collections.py
src/compas_blender/utilities/collections.py
import bpy from typing import List, Text from compas_blender.utilities import delete_objects __all__ = [ "create_collection", "create_collections", "create_collections_from_path", "clear_collection", "clear_collections" ] def create_collection(name: Text, parent: bpy.types.Collection = None) ->...
Python
0
@@ -240,16 +240,246 @@ ns%22%0A%5D%0A%0A%0A +def collection_path(collection, names=%5B%5D):%0A for parent in bpy.data.collections:%0A if collection.name in parent.children:%0A names.append(parent.name)%0A collection_path(parent, names)%0A return names%0A%0A%0A def crea @@ -817,108 +...
886396d69f2109f8fcfe2d92e39d73959f406ccf
Add Union type hint
src/poliastro/frames/util.py
src/poliastro/frames/util.py
from typing import Dict from astropy.coordinates.baseframe import BaseCoordinateFrame from poliastro.bodies import ( Body, Earth, Jupiter, Mars, Mercury, Neptune, Saturn, SolarSystemPlanet, Sun, Uranus, Venus, ) from poliastro.constants import J2000 from .ecliptic import G...
Python
0
@@ -16,17 +16,24 @@ ort Dict +, Union %0A - %0Afrom as @@ -723,24 +723,113 @@ MAPPING = %7B%0A + Sun: %7BPlanes.EARTH_EQUATOR: HCRS, Planes.EARTH_ECLIPTIC: HeliocentricEclipticJ2000%7D,%0A Mercury: @@ -1536,16 +1536,28 @@ e: Dict%5B +Union%5BBody, SolarSys @@ -1569,176 +1569,9 @@ anet -, Dict%5BPlanes, ...
54fab9c1cb9e2888f7050392d38a94b4f6546741
fix branch reference
get_version.py
get_version.py
"""Return the short version string.""" from mpf._version import __short_version__ print(__short_version__)
Python
0
@@ -81,16 +81,30 @@ _%0Aprint( +%22%7B%7D.x%22.format( __short_ @@ -113,9 +113,10 @@ rsion__) +) %0A
293a2c5a691fc0531f26085884b0ee92117592e5
Use _instance_or_null in github3.git
github3/git.py
github3/git.py
# -*- coding: utf-8 -*- """ github3.git =========== This module contains all the classes relating to Git Data. See also: http://developer.github.com/v3/git/ """ from __future__ import unicode_literals from json import dumps from base64 import b64decode from .models import GitHubObject, GitHubCore, BaseCommit from .u...
Python
0.000605
@@ -5942,42 +5942,42 @@ urn -Tree(json, self) if json else None +self._instance_or_null(Tree, json) %0A%0A%0Ac
b14c6446ac16798f797f279818ae53adc549323e
Clean up wrap.py a bit
unnaturalcode/wrap.py
unnaturalcode/wrap.py
#!/usr/bin/env python # Copyright 2013 Joshua Charles Campbell, Alex Wilson # # This file is part of UnnaturalCode. # # UnnaturalCode 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, e...
Python
0
@@ -822,21 +822,39 @@ t re -, runpy, sys, +%0Aimport runpy%0Aimport sys%0Aimport tra @@ -910,16 +910,38 @@ error%0A%0A +%0Adef main():%0A %0A print sy @@ -947,17 +947,25 @@ ys.path%0A -%0A + %0A name_err @@ -1008,17 +1008,25 @@ '%5D+)'%22)%0A -%0A + %0A def get_ @@ -1056,14 +1056,22 @@ e...
914a7ae8480875942f6273cf70249f9f9fdf482a
Remove unused and unimplemented `retry_on_decode_error` option from modelzoo.util's `load_graphdef`. The option is no longer needed as loading itself will autodetect Exceptions during loading and retry
lucid/modelzoo/util.py
lucid/modelzoo/util.py
# Copyright 2018 The Lucid Authors. 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 l...
Python
0.000001
@@ -1134,36 +1134,8 @@ True -, retry_on_decode_error=True ):%0A
da73a9a5c63a3bbeee707dd47cf9a76b03f95819
Update SubnetCalculation.py
Main/SubnetCalculation.py
Main/SubnetCalculation.py
class subnet_calculation(): @staticmethod def verify_IP(start, end, hosts): container = [start, end] startIP = start endIP = end try: hosts = int(hosts) except (TypeError, ValueError) as e: print("cant convert", e) count = 0 validN...
Python
0
@@ -473,16 +473,51 @@ er = %5B%5D%0A + %0A # Container Block: %0A @@ -924,16 +924,66 @@ it(%22.%22)%0A + %0A # newIP Container Block:%0A
75be8ed7040cd43aa0a41cba56da48942972ca42
Add Testts For Models
monkey_pdns/app/tests.py
monkey_pdns/app/tests.py
from django.test import TestCase from .views import hello class View_hello_tests(TestCase): def test_hello(self): response = self.client.get('/') self.assertEqual(response.status_code, 200) self.assertContains(response, 'Hello World!')
Python
0
@@ -30,33 +30,132 @@ ase%0A -%0Afrom .views import hello +from django.contrib.auth.models import User%0Afrom .views import hello%0Afrom .models import Zone, Sub_Zone, Record, Record_Type %0A%0Acl @@ -360,8 +360,1642 @@ rld!')%0A%0A +class Record_Type_Test(TestCase):%0A%0A def setUp(self):%0A Record_Type.ob...
ab819232e0e036709ff6098b2d9f259fc8956ca2
add in sentinel support
update_school_data.py
update_school_data.py
import governorhub import logging import redis import os import loggly.handlers from datetime import datetime from similar_schools import update_similar_schools from dfe_data import update_dfe_data logging.basicConfig(level=logging.INFO) # Turn off requests INFO level logging requests_log = logging.getLogger("reques...
Python
0
@@ -40,16 +40,52 @@ t redis%0A +from redis.sentinel import Sentinel%0A import o @@ -552,16 +552,185 @@ ', None) +%0ASENTINEL_HOST = os.environ.get('SENTINEL_HOST', None)%0ASENTINEL_PORT = os.environ.get('SENTINEL_PORT', 26379)%0ASENTINEL_MASTER = os.environ.get('SENTINEL_MASTER', 'base') %0A%0ALOGGLY @@ -1967,16 +1...
c7a90a915af95abeda81de602287df4fcbd1555a
improve error message
mrec/base_recommender.py
mrec/base_recommender.py
try: import cPickle as pickle except ImportError: import pickle import numpy as np from scipy.sparse import csr_matrix class BaseRecommender(object): """ Minimal interface to be implemented by recommenders, along with some helper methods. A concrete recommender must implement the recommend_item...
Python
0.000008
@@ -2107,24 +2107,32 @@ eError(' +invalid filepath must ha @@ -2123,16 +2123,21 @@ filepath + %7B0%7D, must ha @@ -2153,16 +2153,33 @@ suffix' +.format(filepath) )%0A%0A
493637ace6881defedee22971f3bc39fe9a5bd0a
Make it compatible with Bob
freesas/test/__init__.py
freesas/test/__init__.py
#!usr/bin/env python # coding: utf-8 __author__ = "Jérôme Kieffer" __license__ = "MIT" __date__ = "05/09/2017" __copyright__ = "2015, ESRF" import unittest from .test_all import suite def run(): runner = unittest.TextTestRunner() return runner.run(suite()) if __name__ == '__main__': run()
Python
0.000001
@@ -97,18 +97,18 @@ = %22 -05/09 +15/01 /20 +2 1 -7 %22%0A__ @@ -126,16 +126,21 @@ = %222015 +-2021 , ESRF%22%0A @@ -140,16 +140,27 @@ ESRF%22%0A%0A +import sys%0A import u @@ -208,12 +208,79 @@ run +_tests ():%0A + %22%22%22Run test complete test_suite%22%22%22%0A mysuite = suite()%0A @@ -322...
1697e0a20b14c89cf2db209ef03cb1dc551b14a1
Bump version
cider/__init__.py
cider/__init__.py
from .core import Cider __author__ = "Michael Sanders" __version__ = "1.0" __all__ = ['Cider']
Python
0
@@ -70,9 +70,9 @@ %221. -0 +1 %22%0A__ @@ -84,13 +84,13 @@ = %5B -' +%22 Cider -' +%22 %5D%0A
e0a8f8f6765a071ba71191b6e047b861812ec2f9
Update settings.py
utilities/settings.py
utilities/settings.py
import math #Tilt pot setpoints .158 kMaxDown = .79 kMaxUp = kMaxDown - .590 kTop = kMaxUp + .050 kTopShot = .292 kTopShotAtBase = .281 kBottom = kMaxDown - .050 kShootLevel = .646 kShootAtBase = .528 kShootRamp = .400 kLongShot = .600 class Settings(): """Robot mapping. Values that are changed often go here.""" ...
Python
0.000001
@@ -47,10 +47,11 @@ = . -79 +800 %0AkMa
7503e1e505dc70c93713d8848df3cbe1d5a6f44c
Improve English tag map. Re #593, #3311
spacy/lang/en/tag_map.py
spacy/lang/en/tag_map.py
# coding: utf8 from __future__ import unicode_literals from ...symbols import POS, PUNCT, SYM, ADJ, CCONJ, NUM, DET, ADV, ADP, X, VERB from ...symbols import NOUN, PROPN, PART, INTJ, SPACE, PRON TAG_MAP = { ".": {POS: PUNCT, "PunctType": "peri"}, ",": {POS: PUNCT, "PunctType": "comm"}, "-LRB-": {POS: PUN...
Python
0
@@ -774,19 +774,17 @@ : %7BPOS: -ADJ +X , %22Hyph%22 @@ -1499,19 +1499,19 @@ : %7BPOS: -ADJ +DET , %22AdjTy @@ -1598,20 +1598,19 @@ : %7BPOS: -PRON +DET , %22PronT @@ -1633,35 +1633,35 @@ %22PRP$%22: %7BPOS: -ADJ +DET , %22PronType%22: %22p @@ -2426,27 +2426,27 @@ WDT%22: %7BPOS: -ADJ +DET , %22PronTyp...
4f905ac9e6e75975acbda7ad943751da07c409ec
Add test for ASCII filenames (#4345)
spacy/tests/test_misc.py
spacy/tests/test_misc.py
# coding: utf-8 from __future__ import unicode_literals import pytest import os import ctypes from pathlib import Path from spacy import util from spacy import prefer_gpu, require_gpu from spacy.compat import symlink_to, symlink_remove, path2str, is_windows from spacy._ml import PrecomputableAffine from subprocess imp...
Python
0.000006
@@ -3432,24 +3432,326 @@ rt not symlink.exists()%0A +%0A%0Adef test_ascii_filenames():%0A %22%22%22Test that all filenames in the project are ASCII.%0A See: https://twitter.com/_inesmontani/status/1177941471632211968%0A %22%22%22%0A root = Path(__file__).parent.parent%0A for path in root.glob(%22**/*%22...
d372d32808c25a38644e4a3c5c5a33e608ad10cf
Remove odoo.api multi as deprecated in Odoo 13.0
models/hr_complaint.py
models/hr_complaint.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
Python
0
@@ -5260,20 +5260,8 @@ )%0A%09%0A -%09@api.multi%0A %09def
0f4d44722bf5162922a7ddbfb00fcd042dc3de9d
clean up _restore_cache_key a bit
corehq/ex-submodules/casexml/apps/phone/restore_caching.py
corehq/ex-submodules/casexml/apps/phone/restore_caching.py
import hashlib import logging from casexml.apps.phone.const import RESTORE_CACHE_KEY_PREFIX, ASYNC_RESTORE_CACHE_KEY_PREFIX from dimagi.utils.couch.cache.cache_core import get_redis_default_cache logger = logging.getLogger(__name__) def _restore_cache_key(domain, prefix, user_id, version, sync_log_id, device_id): ...
Python
0.000001
@@ -280,17 +280,8 @@ _id, - version, syn @@ -298,24 +298,24 @@ device_id):%0A + # to inv @@ -397,45 +397,35 @@ = ' -8-%7Bdomain%7D-%7Bprefix%7D-%7Buser%7D-%7Bversion%7D- +0,%7Bprefix%7D,%7Bdomain%7D,%7Buser%7D, %7Bsyn @@ -437,9 +437,9 @@ _id%7D -- +, %7Bdev @@ -527,39 +527,8 @@ id,%0A - version=ve...
555e76a62f0ec955932f95bec444e7c360f23241
use environment variable to set port
server.py
server.py
from flask import Flask from flask import jsonify from flask import render_template from flask.ext.cors import CORS from api import api app = Flask(__name__) cors = CORS(app) if __name__ == "__main__": app.register_blueprint(api) app.run(debug=True, port=5100)
Python
0.000001
@@ -1,24 +1,35 @@ +import os%0A%0A from flask import Flask%0A @@ -121,16 +121,17 @@ t CORS%0A%0A +%0A from api @@ -210,16 +210,64 @@ ain__%22:%0A + port = os.environ.setdefault(%22PORT%22, %225000%22)%0A%0A app.re @@ -319,10 +319,15 @@ ort= -5100 +int(port) )%0A
828c78566879412c6e2cc6981af9fa1adb5bdcf4
return result files, not just names
server.py
server.py
import config import glob import flask import os import json app = flask.Flask(__name__) @app.route("/versions/") def get_recommended_versions(): return flask.jsonify({"versions" : config.recommended_versions}) @app.route("/results", methods=['GET', 'POST']) def submit_result(): if flask.request.method == "P...
Python
0.000001
@@ -400,10 +400,10 @@ s = -%5B%5D +%7B%7D %0A @@ -493,28 +493,209 @@ -results.ap +# get name of file and path%0A file_name, ext = os.path.splitext(os.path.basename(path))%0A with o pen -d (path) + as result_file:%0A results%5Bfile_name%5D = json.load(result_file) %0A ...
531d40748a6b49fa55f54fb834f21f8d1c2cf156
Use most compact encoding
server.py
server.py
# -*- coding: utf-8 -*- # Copyright 2013 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
0.999259
@@ -4643,28 +4643,65 @@ n.dumps( -feature_list +%0A # feature_list, separators=(',',':') )%0A%0A @@ -5549,26 +5549,59 @@ n.dumps( -properties +%0A properties, separators=(',',':') )%0A el @@ -5790,26 +5790,59 @@ n.dumps( -properties +%0A properties, separators=(',',':') )%0A%0...
0fc2cc8aafc1cf778ecc12439becf8482cb47097
resolve imports
setapp.py
setapp.py
import os import cherrypy from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool from app.setutils import Card import webservices.solitairegame class SetApp: homepage = '' @cherrypy.expose def index(self): try: return open(self.homepage) except FileNotFoundEr...
Python
0.000021
@@ -155,16 +155,51 @@ iregame%0A +import webservices.multiplayergame%0A %0A%0Aclass @@ -1961,16 +1961,44 @@ e.mount( +webservices.multiplayergame. Multipla
6b276c384141bd2f2a22523184db349a91849169
Determine supported http methods from the classes.
massa/api.py
massa/api.py
# -*- coding: utf-8 -*- from flask import Blueprint, jsonify, g, request, url_for from flask.views import MethodView from .domain import EntityNotFoundError, InvalidInputError def endpoint(f): def wrapper(*args, **kwargs): try: rv = f(*args, **kwargs) except EntityNotFoundError as e: ...
Python
0
@@ -1874,36 +1874,8 @@ '),%0A - methods=%5B'GET', 'POST'%5D%0A )%0A%0Ab @@ -1979,43 +1979,6 @@ '),%0A - methods=%5B'GET', 'PUT', 'DELETE'%5D%0A )%0A
fc4a04b72032fdce5447902d705c8e1441e27e70
Save history for projects and new makers
makerbase/views/api.py
makerbase/views/api.py
from datetime import datetime import json import traceback from flask import abort, request, Response from flask.views import MethodView from flaskext.login import login_required, current_user from werkzeug.datastructures import MultiDict from makerbase import app from makerbase.forms import MakerForm, ProjectForm, P...
Python
0
@@ -1217,32 +1217,28 @@ def +make_ history -_for_post (self, o @@ -1237,32 +1237,40 @@ (self, obj, form +, action ):%0A pass%0A @@ -1268,68 +1268,291 @@ -pass%0A%0A def history_for_put(self, obj, form):%0A pass +history = History(%0A action=action,%0A reason=form.r...
323ca8a6d8a9cfc7db2e60b515f09158ec3e0fe6
Rename lookup values
motor_interface/scripts/motor_interface.py
motor_interface/scripts/motor_interface.py
#!/usr/bin/env python import rospy import numpy import math import Adafruit_PCA9685 from vortex_msgs.msg import Float64ArrayStamped class MotorInterface(object): def __init__(self): rospy.init_node('motor_interface', anonymous=False) self.pub = rospy.Publisher('debug/thruster_pwm', Float64ArraySta...
Python
0.000001
@@ -820,28 +820,30 @@ self. -T100 +lookup _thrust @@ -907,28 +907,30 @@ self. -T100 +lookup _pulse_width @@ -3074,20 +3074,22 @@ t, self. -T100 +lookup _thrust, @@ -3098,12 +3098,14 @@ elf. -T100 +lookup _pul
3cc3c22acbdc84124bade7c6f81af016951cb4cd
Fix typo in stream_spec.
spec/data/stream_spec.py
spec/data/stream_spec.py
import mock from data import stream from spec.mamba import * with description('stream'): with it('instantiates without errors'): expect(calling(stream.Stream)).not_to(raise_error) with it('subscribes without errors'): s = stream.Stream() expect(calling(s.subscribe, mock.Mock())).not_to(raise_error) ...
Python
0
@@ -343,16 +343,17 @@ o subscr +i bers'):%0A
31a8107dafdf20a67360d39d1b11cd1c9070f6b5
Make search_children compatible with multi transactional analysis
mythril/analysis/modules/external_calls.py
mythril/analysis/modules/external_calls.py
from z3 import * from mythril.analysis.ops import * from mythril.analysis.report import Issue from mythril.analysis import solver from mythril.analysis.swc_data import REENTRANCY import re import logging from mythril.laser.ethereum.cfg import JumpType """ MODULE DESCRIPTION: Check for call.value()() to external addre...
Python
0.000001
@@ -367,16 +367,21 @@ hildren( +%0A statespa @@ -389,16 +389,32 @@ e, node, + transaction_id, start_i @@ -442,16 +442,17 @@ lts=None +%0A ):%0A i @@ -718,16 +718,38 @@ if +(%0A node.sta @@ -802,16 +802,114 @@ %22SSTORE%22 +%0A and node.states%5Bj%5D.current_...
e6751c2741d2605713e631b9984cde7b8234433e
Remove spurious log statement
nbgrader/auth/hubauth.py
nbgrader/auth/hubauth.py
"""JupyterHub authenticator.""" import requests import os import json from subprocess import check_output from flask import request, redirect, abort from IPython.utils.traitlets import Unicode, Int, List, Bool from nbgrader.html.formgrade import blueprint from .base import BaseAuth class HubAuth(BaseAuth): """J...
Python
0.000004
@@ -5171,40 +5171,8 @@ n()%0A - self.log.info(data)%0A
014409ba87895f984a453347bcfb729e157d6be0
Use pkg_resources to locate data folder within package
marcottievents/base.py
marcottievents/base.py
import re import sys import logging from contextlib import contextmanager from sqlalchemy.engine import create_engine from sqlalchemy.orm.session import Session from .version import __version__ from etl.ecsv import CSVExtractor from etl import ETL, MarcottiTransform, MarcottiLoad logger = logging.getLogger(__name__...
Python
0
@@ -29,16 +29,37 @@ logging%0A +import pkg_resources%0A from con @@ -1840,14 +1840,66 @@ tor( +pkg_resources.resource_filename('marcottievents', 'data -' +/') )%0A
e2a1830d03df1998e99ec7fae8ce2ef06ae737ab
allow dockerfile
otto/otto.py
otto/otto.py
"""ShutIt module. See http://shutit.tk """ from shutit_module import ShutItModule class otto(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 for...
Python
0.000002
@@ -5938,16 +5938,29 @@ 'docker' +,'dockerfile' %5D,%0A%09%09dep