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
be9cdec44485a90c77f919e1e87b580e7a2bae6d
Use 'null_or_str' for timestamp validation
repour/server/endpoint/validation.py
repour/server/endpoint/validation.py
import logging from voluptuous import * from ...adjust import adjust as adjustmodule from ... import pull as pullmodule from ... import repo def mode_b_ify(raw): clone = raw.copy() del clone["name"] clone["internal_url"] = { "readwrite": Url(), #pylint: disable=no-value-for-parameter "rea...
Python
0.000006
@@ -1175,16 +1175,24 @@ tamp%22): +null_or_ str,%0A%7D%0A%0A
6cb3d7e9e95cc009579260d67a4525f17c8508cd
comment out the code
regulus/alg/alg.py
regulus/alg/alg.py
from regulus.topo.cache import Cache from regulus.models import NullModel # from regulus.tree import reduce_tree Node # from regulus.topo import Partition def model_cache(model): return Cache(key=lambda n: n.data.id, factory=lambda n: model(n.data) if n.data.id is not -1 else NullModel()) def co...
Python
0
@@ -1,24 +1,26 @@ +# from regulus.topo.cache @@ -8,20 +8,20 @@ regulus. -topo +core .cache i @@ -32,16 +32,18 @@ t Cache%0A +# from reg @@ -76,89 +76,13 @@ el%0A# - from regulus.tree import reduce_tree Node%0A# from regulus.topo import Partition%0A%0A +%0A#%0A# def @@ -101,16 +101,18 @@ model):%0A +# ...
2d3b27d7d4f787513a31b5a3650febd15ffa98ed
fix missing key in repo templates
ceph_deploy/util/templates.py
ceph_deploy/util/templates.py
ceph_repo = """ [ceph] name=Ceph packages for $basearch baseurl={repo_url}/$basearch enabled=1 gpgcheck=1 priority=1 type=rpm-md gpgkey={gpg_url} [ceph-noarch] name=Ceph noarch packages baseurl={repo_url}/noarch enabled=1 gpgcheck=1 priority=1 type=rpm-md gpgkey={gpg_url} [ceph-source] name=Ceph source packages bas...
Python
0
@@ -1440,24 +1440,53 @@ ', '%5B%25s%5D'),%0A + ('name', 'name=%25s'),%0A ('ba
34a14ae374af9ca499f7bf90bf441ccfe9fe6b85
Simplify init
rehash/__init__.py
rehash/__init__.py
from __future__ import absolute_import, division, print_function, unicode_literals import os, sys, hashlib, base64, zlib from ctypes import cast, memmove, POINTER, c_void_p from .structs import EVPobject opaque_repr = False class ResumableHasher(object): name = None def __init__(self, name=None, data=None, ...
Python
0.999744
@@ -2684,16 +2684,40 @@ _data)%0A%0A +%0Anew = ResumableHasher%0A%0A def _ini @@ -2766,41 +2766,8 @@ __%5D%0A - module.new = ResumableHasher%0A
dabed8ed06fc7f72de7bc1d3bc038f40f18ecc91
Simplify if logic
girder/molecules/molecules/utilities/molecules.py
girder/molecules/molecules/utilities/molecules.py
import json import requests from .. import avogadro from .. import openbabel from .. import chemspider from .. import semantic from .. import constants from molecules.models.molecule import Molecule as MoleculeModel from girder.constants import TerminalColor from girder.api.rest import RestException from .async_reque...
Python
0.999999
@@ -3060,22 +3060,8 @@ if -not cjson and usin
53cde98d57baf8bac0d6387e8a342333f1a2066e
update example imports (+pep8)
examples/plot_fitting_dists.py
examples/plot_fitting_dists.py
# -*- coding: utf-8 -*- """ ===================== Fitting Distributions ===================== Histograms, PDF fits, Kernel Density. """ # Author: Moritz Lotze <mlotze@km3net.de> # License: BSD-3 import matplotlib.pyplot as plt import numpy as np import statsmodels.api as sm from scipy.stats import norm from sklearn...
Python
0
@@ -362,19 +362,23 @@ arn. -grid_search +model_selection imp @@ -888,11 +888,15 @@ 5, 3 -*N+ + * N + 1)%0A%0A
61abbfb28ceb134f514ed2b3fd2757366df01246
attach isoline filter via timer
examples/basics/scene/contour.py
examples/basics/scene/contour.py
# -*- coding: utf-8 -*- # vispy: gallery 30 # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -----------------------------------------------------...
Python
0
@@ -946,17 +946,16 @@ ostor')%0A -%0A level = @@ -983,17 +983,21 @@ r(level= -2 +level , width= @@ -1018,26 +1018,8 @@ te') -%0Aimage.attach(iso) %0A%0A# @@ -2072,16 +2072,195 @@ date()%0A%0A +%0A# attaching of isoline filter via timer%0Adef on_timer1(event):%0A image.attach(iso)%0A canvas.update()%0A%0A...
a8e51f540cbfd3ab8800f6d2c5de98200b03d028
remove redundant components from service
invenio_communities/communities/service_config.py
invenio_communities/communities/service_config.py
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Records-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Invenio Communities Service API config.""" from flas...
Python
0.000008
@@ -444,88 +444,8 @@ nks%0A -from invenio_records_resources.services.records.components import DataComponent%0A from @@ -1755,110 +1755,4 @@ %7D%22)%0A -%0A # Service components%0A components = %5B%0A DataComponent%0A %5D + RecordServiceConfig.components%0A
e37312d5b5066f19ec202c0c12b71a42b9c4e9d1
Bring unicode fix from galaxy for job_script.
pulsar/managers/util/job_script/__init__.py
pulsar/managers/util/job_script/__init__.py
from string import Template from pkg_resources import resource_string DEFAULT_JOB_FILE_TEMPLATE = Template( resource_string(__name__, 'DEFAULT_JOB_FILE_TEMPLATE.sh').decode('UTF-8') ) SLOTS_STATEMENT_CLUSTER_DEFAULT = \ resource_string(__name__, 'CLUSTER_SLOTS_STATEMENT.sh').decode('UTF-8') SLOTS_STATEMENT_S...
Python
0
@@ -62,16 +62,50 @@ e_string +%0Afrom galaxy.util import unicodify %0A%0ADEFAUL @@ -2394,16 +2394,111 @@ nds_str%0A + for key, value in template_params.items():%0A template_params%5Bkey%5D = unicodify(value)%0A if n
359456dbd33cc3d817d8df9a6604a3f1f838d69c
Remove dead code
fusesoc/vlnv.py
fusesoc/vlnv.py
from functools import total_ordering @total_ordering class Vlnv(object): def __init__(self, s, default_relation=">="): def _is_rev(s): return s.startswith("r") and s[1:].isdigit() def _is_version(s): return s[0].isdigit() if s.startswith("!"): self.con...
Python
0
@@ -3024,306 +3024,118 @@ -if self.relation == %22=%22:%0A relation = %22%22%0A else:%0A relation = self.relation%0A if self.revision %3E 0:%0A revision = %22-r%22 + str(self.revision)%0A else:%0A revision = %22%22%0A # return %22%7B%7...
722c17992ea9cd7949a2ca02d7aa1c8a2d10a312
Fix path for pathfinder test files.
pymatgen/analysis/tests/test_path_finder.py
pymatgen/analysis/tests/test_path_finder.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals import os import unittest from pymatgen.analysis.path_finder import NEBPathfinder, ChgcarPotential from pymatgen.io.vasp im...
Python
0.998422
@@ -593,45 +593,183 @@ -test_file_dir = %22../../../test_files/ +module_dir = os.path.dirname(os.path.abspath(__file__))%0A test_file_dir = os.path.join(module_dir, %22..%22, %22..%22, %22..%22, %22test_files%22,%0A %22 path @@ -776,16 +776,17 @@ _finder%22 +) %0A ...
2d72c32476a5cfad4b4cac99a02fe46b64f8bd19
Remove the buged log line
checkinatfmi/clients/views.py
checkinatfmi/clients/views.py
# Create your views here. import sys import datetime from django.utils.timezone import utc from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.core.exceptions import ObjectDoesNotExist from django.http import Http404 from models import Client from users.models import...
Python
0.000002
@@ -1979,32 +1979,34 @@ %0A + # print %22CHECKOUT
82c122ecea4c0510f9e96d998f59eee76b840d62
child table (__) exclusion
frappe/utils/global_search.py
frappe/utils/global_search.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def setup_global_search_table(): '''Creates __global_seach table''' if not '__global_search' in frappe.db.get_tables(): frappe.db.sq...
Python
0.999887
@@ -175,16 +175,46 @@ t frappe +%0Afrom frappe.utils import cint %0A%0Adef se @@ -945,24 +945,29 @@ rch'''%0A%0A%09if +cint( doc.meta.ist @@ -970,16 +970,62 @@ .istable +) == 1 and not doc.parenttype.startswith(%22__%22) :%0A%09%09d =
88b538f687c0570e242d448d8a1c23b9b658a4b7
Enable PD plotter tests.
pymatgen/phasediagram/tests/test_plotter.py
pymatgen/phasediagram/tests/test_plotter.py
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals import unittest import os import numpy as np from pymatgen import Element from pymatgen.phasediagram.entries import PDEntryIO, PDEntry from pymatgen.phasediagram.maker ...
Python
0
@@ -435,16 +435,57 @@ _coord%0A%0A +import matplotlib%0A%0Amatplotlib.use(%22pdf%22)%0A %0Amodule_ @@ -1213,17 +1213,16 @@ =True)%0A%0A -%0A def @@ -2200,74 +2200,8 @@ ))%0A%0A - @unittest.skipIf(%22DISPLAY%22 not in os.environ, %22Need display%22)%0A @@ -2310,63 +2310,8 @@ le.%0A - import ma...
bced86e6779f58622611c9ec66133355ec0e45d6
use qibuild.find everywhere
python/qibuild/test/test_qibuild_install.py
python/qibuild/test/test_qibuild_install.py
import qisys.command import qibuild.find from qibuild.test.conftest import QiBuildAction from qitoolchain.test.conftest import QiToolchainAction def test_running_from_install_dir_dep_in_worktree(qibuild_action, tmpdir): qibuild_action.add_test_project("world") qibuild_action.add_test_project("hello") qi...
Python
0.000011
@@ -2306,85 +2306,63 @@ o = -tmpdir.join(%22usr%22).join(%22bin%22).join(%22hello%22)%0A assert hello.check(file=True +qibuild.find.find(%5Btmpdir.join(%22usr%22).strpath%5D, %22hello%22 )%0A%0Ad
4f49394a5bf457de2952194a1900726c3908b6da
build python eggs, too
build.py
build.py
# CloudWatchLogs Logging # Copyright 2015 Immobilien Scout GmbH # # 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 applic...
Python
0.00001
@@ -1265,17 +1265,16 @@ e 2.0'%0A%0A -%0A @init%0Ade @@ -1817,16 +1817,84 @@ ipts')%0A%0A + project.get_property('distutils_commands').append('bdist_egg')%0A%0A proj
d1104d581b0b28f086461a826753dc6fa8ac5db0
Change project name
build.py
build.py
from pybuilder.core import init, use_plugin, task, depends, description # Core build plugins use_plugin("python.core") use_plugin("python.distutils") use_plugin("python.install_dependencies") use_plugin("exec") # Testing plugins use_plugin("python.unittest") use_plugin("python.integrationtest") use_plugin("python.co...
Python
0.000004
@@ -647,27 +647,19 @@ 'zahpee -- api --client '%0A pr
e3d94a339d5f230a7407765ab30d575cb15518f8
If the build fails, return a non-zero exit status.
build.py
build.py
# Copyright (C) 2006, Thomas Leonard # See http://0install.net/0compile.html import sys, os, __main__, time from os.path import join from logging import info from xml.dom import minidom from support import * def env(name, value): info('Setting %s="%s"', name, value) os.environ[name] = value def do_env_binding(bin...
Python
0.999992
@@ -2620,16 +2620,19 @@ mmand%0A%09%09 +if os.syste @@ -2641,16 +2641,102 @@ command) +:%0A%09%09%09raise SafeException(%22Build command '%25s' failed (non-zero exit status)%22 %25 command) %0A%0Adef do
f45e38cba0a61815b29ecc0ec9d503e289343961
add lru_cache import, bump version
build.py
build.py
from pybuilder.core import use_plugin, init, Author, task use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.integrationtest") use_plugin("python.install_dependencies") use_plugin("python.flake8") use_plugin("python.coverage") use_plugin("python.distutils") use_plugin('copy_resources') use_plug...
Python
0
@@ -490,17 +490,17 @@ = %220.7.1 -1 +2 %22%0A%0Aautho @@ -1136,16 +1136,144 @@ %22flask%22) +%0A try:%0A import functools.lru_cache%0A except ImportError:%0A project.depends_on(%22backports.functools_lru_cache%22) %0A%0A pr
eea846254d7b591e4f325f52ca519f11c93d39d7
Add BaseTestCase
quokka/modules/accounts/tests/test_model.py
quokka/modules/accounts/tests/test_model.py
# coding: utf-8 from flask.ext.testing import TestCase from flask.ext.security.utils import encrypt_password from quokka import create_app from quokka.core.admin import create_admin from ..models import User, Role class TestAccountsModels(TestCase): def setUp(self): self.user_dict = { 'name':...
Python
0.000001
@@ -13,47 +13,8 @@ f-8%0A -from flask.ext.testing import TestCase%0A from @@ -68,38 +68,8 @@ rd%0A%0A -from quokka import create_app%0A from @@ -85,21 +85,21 @@ ore. -admin +tests import crea @@ -94,28 +94,28 @@ import -create_admin +BaseTestCase %0Afrom .. @@ -166,16 +166,20 @@ sModels( +Base TestCase @...
3c029ad25c2066ecb484ea6dfb7c9887ea0a2101
Raise exception on docker-build error
build.py
build.py
import re import argparse from utils import build_docker_image def main(): parser = argparse.ArgumentParser() parser.add_argument('--nocache', action='store_true', default=False) parser.add_argument('--nopull', action='store_true', default=False) args = parser.parse_args() content = '' stream ...
Python
0.000001
@@ -402,16 +402,87 @@ stream:%0A + if 'error' in item:%0A raise Exception(item%5B'error'%5D)%0A
59c7126b911358dd13566b3c259081ec5af72352
fix docstring
generate_xml.py
generate_xml.py
""" Copyright 2013 Lyle Scott, III lyle@digitalfoo.net """ import os from lxml import html from lxml import etree from urllib import urlencode URLS = {'root': 'http://tidesandcurrents.noaa.gov'} URLS.update({ 'tide_predictions': '%s/tide_predictions.shtml' % URLS['root'], }) def get_regions(): """Scrape the...
Python
0.000018
@@ -2472,30 +2472,139 @@ m td -:%0A :param nbsp_map: +node: The %3Ctd/%3E node that contains the header text.%0A :param nbsp_map: A map that defines what header node belongs to what level. %0A @@ -3036,32 +3036,36 @@ .%0A%0A :param td +node : The %3Ctd/%3E node @@ -3139,32 +3139,37 @@ nes what header ...
f8de778f01a01020aca4c1ea721f9f28e2e4698d
Use hfov instead of vfov.
citysim3d/envs/panda3d_env.py
citysim3d/envs/panda3d_env.py
import sys import numpy as np from direct.showbase.ShowBase import ShowBase from panda3d.core import WindowProperties, FrameBufferProperties from panda3d.core import GraphicsPipe, GraphicsEngine, GraphicsOutput from panda3d.core import Texture from citysim3d.envs import Env import citysim3d.utils.transformations as tf ...
Python
0
@@ -1312,15 +1312,15 @@ 0), -v +h fov= -45 +60 ):%0A @@ -2965,62 +2965,8 @@ s()%0A - hfov = vfov * float(size%5B0%5D) / float(size%5B1%5D)%0A @@ -2982,38 +2982,32 @@ lens.setFov(hfov -, vfov )%0A self.l
adc072ec59351bcd6e0175aa72faf415eef35c50
Change toolkit.NotFound to toolkit.ObjectNotFound
ckanext/barnet/controllers.py
ckanext/barnet/controllers.py
import json import os.path import inspect import ckan.model as model import ckan.plugins.toolkit as toolkit from ckan.controllers.user import UserController from ckan import new_authz import ckanapi_exporter.exporter as exporter import losser.losser def this_directory(): """Return the path to this Python file's...
Python
0.000049
@@ -1540,16 +1540,22 @@ toolkit. +Object NotFound
4328fa54cb2779b9e7774e9e5cc7152353218c3d
get cl fields vi git_cl accessors instead of using backquote
git_cl_hooks.py
git_cl_hooks.py
# Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import re import subprocess import sys import breakpad import presubmit_support import scm import watchlists def Backquote(cmd, cwd=None): ...
Python
0.999293
@@ -15,10 +15,10 @@ ) 20 +1 0 -9 The @@ -231,61 +231,184 @@ ad%0A%0A -import presubmit_support%0Aimport scm%0Aimport watchlists +from git_cl_repo import git_cl%0Afrom git_cl_repo import upload%0A%0Aimport presubmit_support%0Aimport scm%0Aimport watchlists%0A%0A# Really ugly hack to quiet upload.py%0Aupload.verbosi...
51094519cec780e3896ee02347c43ac31b606279
Add extra create to fix problem with XMLRPC order import
sale_margin_actual_cost/models/sale_cost.py
sale_margin_actual_cost/models/sale_cost.py
# -*- coding: utf-8 -*- # # Sales - Actual Costs and Margins # © 2016 - 1200 WebDevelopment <http://1200wd.com/> # # 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 ve...
Python
0
@@ -1506,99 +1506,14 @@ -compute=%22calculate_actual_costs%22, store=True,%0A digits_compute +digits =dp. @@ -1774,85 +1774,8 @@ g%22,%0A - compute=%22calculate_actual_costs%22, store=True,%0A @@ -1851,18 +1851,16 @@ e%22)%0A%0A - # @api.mo...
c695d230952b3602cc5b69a5c8aa6fd21e5035ae
Make sure metrics are always float to ES
duct/outputs/elasticsearch.py
duct/outputs/elasticsearch.py
import time import json import datetime from twisted.internet import reactor, defer, task from twisted.python import log try: from OpenSSL import SSL from twisted.internet import ssl except: SSL=None from duct.protocol import elasticsearch from duct.objects import Output class ElasticSearch(Output): ...
Python
0
@@ -2270,16 +2270,54 @@ e.time)%0A + d%5B'metric'%5D = float(e.metric)%0A
bbc0db5cd2b777531300435bc3df6ee652cd8a53
Fix variable name typo
capiq.py
capiq.py
import requests,json,logging from requests.auth import HTTPBasicAuth from settings import CAPIQ_USERNAME, CAPIQ_PASSWORD from requests.packages.urllib3.exceptions import InsecureRequestWarning class CapIQClient: _endpoint = 'https://sdk.gds.standardandpoors.com/gdssdk/rest/v2/clientservice.json' _headers = {'C...
Python
0.999959
@@ -1594,16 +1594,18 @@ for r +et in resp @@ -1661,16 +1661,18 @@ fier = r +et %5B'Identi @@ -1797,16 +1797,18 @@ merate(r +et %5B'Header @@ -1932,16 +1932,18 @@ ery: '+r +et %5B'ErrMsg @@ -2066,16 +2066,18 @@ %5D%5Bh%5D = r +et %5B'Rows'%5D
b3a57443f58caf6be930d00e7f8805fd0e64e80a
bump the version
remoto/__init__.py
remoto/__init__.py
from .connection import Connection __version__ = '0.0.9'
Python
0
@@ -53,7 +53,8 @@ 0.0. -9 +10 '%0A
fbccef017f48628c3f2e1457f21c38ba4d4fa90c
fix HAIL_GENETICS_IMAGES variable (#11117)
hail/python/hailtop/batch/hail_genetics_images.py
hail/python/hailtop/batch/hail_genetics_images.py
HAIL_GENETICS = 'hailgenetics/' HAIL_GENETICS_IMAGES = ( HAIL_GENETICS + name for name in ('hail', 'genetics', 'python-dill'))
Python
0
@@ -48,17 +48,17 @@ MAGES = -( +%5B %0A HAI @@ -126,10 +126,10 @@ n-dill') -) +%5D %0A
67eafee956adf8bbcdb6acde746a6a7a50d7e7a1
Use a ws to get all departments for the report
reports/reports.py
reports/reports.py
# -*- encoding: UTF-8 -*- from abc import ABCMeta from django.core.exceptions import ObjectDoesNotExist from django.conf import settings as st from cvn.models import (Articulo, Libro, Capitulo, Congreso, Proyecto, Convenio, TesisDoctoral, Patente) from statistics.models import Area, Department ...
Python
0
@@ -270,55 +270,8 @@ te)%0A -from statistics.models import Area, Department%0A from @@ -1120,21 +1120,23 @@ print(' -ERROR +WARNING : La uni @@ -1143,20 +1143,25 @@ dad ' + +str( unit +) + ' no @@ -1166,16 +1166,64 @@ o existe + el a%C3%B1o '%0A + str(self.year) + ' %5Cn')%0A @@ -1879,1...
0005728baa20e78f095bd73da0de87ce118d531d
Modify pylint disable scope to handle differences in py versions.
adbwp/header.py
adbwp/header.py
""" adbwp.header ~~~~~~~~~~~~ Object representation of a message header. """ import struct import typing from . import consts, enums, exceptions, hints #: Struct pack/unpack string for handling six unsigned integers that represent a header. HEADER_FORMAT = '<6I' class Header(typing.NamedTuple('Header'...
Python
0
@@ -3374,16 +3374,55 @@ .FAIL%0A%0A%0A +# pylint: disable=redefined-outer-name%0A def new( @@ -3579,48 +3579,8 @@ der: - # pylint: disable=redefined-outer-name %0A @@ -4416,16 +4416,54 @@ magic)%0A +# pylint: enable=redefined-outer-name%0A %0A%0Adef ma
1f517cf69b99ca74ec328ad1a80762590252e72a
Add session close.
endpoint/admin/corrections.py
endpoint/admin/corrections.py
import falcon from sqlalchemy import func from db import session import model import util import datetime import json class Correction(object): # GET pozadavek na konkretni correction se spousti prevazne jako ospoved na POST # id je umele id, konstrukce viz util/correction.py def on_get(self, req, resp, id): use...
Python
0
@@ -1572,24 +1572,43 @@ ion.commit() +%0A%09%09%09session.close() %0A%0A%09%09if (corr @@ -2424,32 +2424,52 @@ session.commit() +%0A%09%09%09%09session.close() %0A%0A%09# POST: zprac
b461e1788aa3ab2794c0058799f89d7265d171b1
patch list updated
erpnext/patches/patch_list.py
erpnext/patches/patch_list.py
patch_list = [ { 'patch_module': 'patches.jan_mar_2012', 'patch_file': 'stable_branch_shift_09_01_12', 'description': 'Various Reloads for shifting branch from master to stable' }, { 'patch_module': 'patches.jan_mar_2012', 'patch_file': 'print_hide_totals', 'description': 'Uncheck print_hide for RV, SO, ...
Python
0
@@ -3076,10 +3076,270 @@ es'%0A%09%7D,%0A +%09%7B%0A%09%09'patch_module': 'patches.jan_mar_2012',%0A%09%09'patch_file': 'no_copy_patch',%0A%09%09'description': 'insert after fld in custom fld should be no_copy'%0A%09%7D,%0A%09%7B%0A%09%09'patch_module': 'patches.jan_mar_2012',%0A%09%09'patch_file': 'reload_item',%0A%0...
fe074835f0ec339df35a0a4cb6ab63e9441b43c0
Fix pylint issue
homeassistant/components/switch/command_switch.py
homeassistant/components/switch/command_switch.py
# -*- coding: utf-8 -*- """ homeassistant.components.switch.command_switch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Allows to configure custom shell commands to turn a switch on/off. Configuration: To use the command_line switch you will need to add something like the following to your configuration.yaml file. ...
Python
0.000004
@@ -894,16 +894,35 @@ logging%0A +import subprocess%0A%0A from hom @@ -969,34 +969,16 @@ chDevice -%0Aimport subprocess %0A%0A_LOGGE
1c28a7cd116363e769dffc17d9b9ae951f0bcf20
Add test for Literal value property
sql/tests/test_literal.py
sql/tests/test_literal.py
# -*- coding: utf-8 -*- # # Copyright (c) 2011-2013, Cédric Krier # Copyright (c) 2011-2013, B2CK # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain...
Python
0
@@ -1832,8 +1832,51 @@ , (1,))%0A + self.assertEqual(literal.value, 1)%0A
9df96086317c324b46b9eb9fecb031ec676e6c4f
Add `get_queryset` method to UserDetailsView due to issue with Swagger
rest_auth/views.py
rest_auth/views.py
from django.contrib.auth import ( login as django_login, logout as django_logout ) from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext_lazy as _ from rest_framework import status from rest_framework.views import APIView from rest_...
Python
0
@@ -117,16 +117,63 @@ ettings%0A +from django.contrib.auth import get_user_model%0A from dja @@ -4129,16 +4129,272 @@ t.user%0A%0A + def get_queryset(self):%0A %22%22%22%0A Adding this method since it is sometimes called when using%0A django-rest-swagger%0A https://github.com/Tivix/dja...
e9f4f2ae5ab6585b246668628b0f0eed332b76b4
Fix error message of assert_one to report the correct expected value
assertions.py
assertions.py
import re from cassandra import InvalidRequest, Unavailable, ConsistencyLevel, WriteTimeout, ReadTimeout from cassandra.query import SimpleStatement from tools import rows_to_list def assert_unavailable(fun, *args): try: if len(args) == 0: fun(None) else: fun(*args) exce...
Python
0.000004
@@ -1276,32 +1276,33 @@ got %25s%22 %25 ( +%5B expected , query, lis @@ -1281,32 +1281,33 @@ %25s%22 %25 (%5Bexpected +%5D , query, list_re
70f7dc8a3a745b51bf57339115a6917998edc765
Make the documentation for PingHandler more correct.
authserver.py
authserver.py
#!/usr/bin/env python # ##### BEGIN AGPL LICENSE BLOCK ##### # This file is part of SimpleMMO. # # Copyright (C) 2011, 2012 Charles Nelson # # 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 Foundati...
Python
0
@@ -2162,17 +2162,24 @@ -T +Always t he strin @@ -2191,25 +2191,8 @@ ng%22. - Unconditionally. %0A%0A @@ -2480,16 +2480,70 @@ %22pong%22)%0A + self.set_header(%22Content-Type%22, %22text/plain%22)%0A %0A%0Aclass
bbeaf90677970bf39fad21321f9a4b16418b8894
Complete recur sol
lc0116_populating_next_right_pointers_in_each_node.py
lc0116_populating_next_right_pointers_in_each_node.py
"""Leetcode 116. Populating Next Right Pointers in Each Node Medium URL: https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: struct Node ...
Python
0.000007
@@ -1865,16 +1865,21 @@ Solution +Recur (object) @@ -1892,134 +1892,1184 @@ def -connect(self, root):%0A %22%22%22%0A :type root: Node%0A :rtype: Node%0A %22%22%22%0A pass%0A%0A%0Adef main():%0A pass +_preorder(self, node):%0A if node and node.left and node.right:%0A ...
b76b627b61879a15d746c307f28db7a0edd4e4fc
Fix for NoneType Target (#3792)
python/tvm/relay/quantize/_partition.py
python/tvm/relay/quantize/_partition.py
# Licensed to the Apache Software Foundation (ASF) 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 u...
Python
0
@@ -5266,20 +5266,16 @@ -if 'cuda' in +target = _ta @@ -5295,16 +5295,51 @@ target() +%0A if target and 'cuda' in target .keys:%0A
5fba152efa3ea46c0370dbd22370a28479fee2f8
use progname explicitly rather than guess
rpmquality/bin.py
rpmquality/bin.py
#!/usr/bin/python import RpmQuality import sys import os import re import datetime def version(): progname = os.path.basename(__file__) print("%s 0.1" % progname) print print("Written by Honza Horak <hhorak@redhat.com>") exit(0) def usage(): progname = os.path.basename(__file__) print("...
Python
0.000001
@@ -88,60 +88,59 @@ def -version():%0A progname = os.path.basename(__file__) +progname():%0A return %22rpmquality%22%0A%0Adef version(): %0A @@ -157,32 +157,34 @@ 0.1%22 %25 progname +() )%0A print%0A @@ -265,50 +265,8 @@ ():%0A - progname = os.path.basename(__file__)%0A @@ -359,32 +359,...
217cd5e0847031df41274acc2bb5463e09870219
Add help to memcached
blues/memcached.py
blues/memcached.py
from fabric.decorators import task from refabric.api import run, info from refabric.context_managers import sudo, silent from refabric.contrib import blueprints from . import debian __all__ = ['start', 'stop', 'restart', 'status', 'setup', 'configure', 'flush'] blueprint = blueprints.get(__name__) start = debian....
Python
0
@@ -1,12 +1,185 @@ +%22%22%22%0AMemcached%0A%0Asettings:%0A memcached:%0A size: 256 # Cache size in mb (Default: 64)%0A bind: 1.2.3.4 # Force memcached bind to address (Default: listen to all)%0A%0A%22%22%22%0A from fabric.
6b7d7c1ae04cd00f06f05d8c5d55b2f8776bb1b2
Fix skp listing
run_dev_server.py
run_dev_server.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import json from trace_viewer import trace_viewer_project import tvcm def do_GET_json_examples(request): te...
Python
0.000001
@@ -841,16 +841,103 @@ quest):%0A + skp_data_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'skp_data'))%0A data_f
9cbfe323e0c8886e7c306ed2168220e9f23219fd
Fix import error
clean.py
clean.py
import datetime import lib.SQLite as SQLite # ascit was refactored from senAdd in favor of ascit in fwork. # They differ by 1 line. Leave this comment until covered # by unit test. import lib.senAdd as senAdd import lib.fwork as fwork import lib.locFunc as locFunc import lib.orgClean as orgClean from lib.xml_util im...
Python
0.000002
@@ -302,16 +302,25 @@ rom lib. +handlers. xml_util
5cc1ff3f4e15fa8a369da6e85dd7c0e01a93c1ee
Improve comments/documentation for driver script
runac/__main__.py
runac/__main__.py
#!/usr/bin/env python import optparse, sys, os from runac import util import runac def tokens(fn, opts): with open(fn) as f: for x in runac.lex(f.read()): print (x.name, x.value, (x.source_pos.lineno, x.source_pos.colno)) def parse(fn, opts): print runac.parse(fn) def show(fn, opts): for name, ast in runac....
Python
0
@@ -100,16 +100,64 @@ opts):%0A +%09'''Print a list of tokens and location info'''%0A %09with op @@ -298,50 +298,184 @@ ):%0A%09 -print runac.parse(fn)%0A%0Adef show(fn, opts): +'''Print the syntax tree resulting from parsing the source'''%0A%09print runac.parse(fn)%0A%0Adef show(fn, opts):%0A%09'''Print syntax tre...
55303124fd67881362a03fe4d2035daa0331dab8
Version 1.6.10
sacad/__init__.py
sacad/__init__.py
#!/usr/bin/env python3 """ Smart Automatic Cover Art Downloader : search and download music album covers. """ __version__ = "1.6.9" __author__ = "desbma" __license__ = "MPL 2.0" import argparse import functools import logging import os import sys from sacad import colored_logging from sacad import sources from saca...
Python
0
@@ -128,9 +128,10 @@ 1.6. -9 +10 %22%0A__
7636d5e054bf77e94942e3ab3019d5633896f185
Remove duplicate item info.
Hue.lbaction/Contents/Scripts/hue.py
Hue.lbaction/Contents/Scripts/hue.py
#!/Users/nicholas/Documents/Development/Hue/bin/python __all__ = ('lights', 'light', 'item_for_light', 'toggle_item_for_light') # XXX replace this with either nothing or something that isn't GPLv2 import collections, qhue bridge = qhue.Bridge('192.168.0.14', 'USERNAME') def lights(): lights = dict((light_info['...
Python
0
@@ -1070,115 +1070,8 @@ te(%0A - title=light_info%5B'name'%5D,%0A icon='font-awesome:fa-lightbulb-o',%0A iconIsTemplate=True,%0A
6a53955ad1ae67b4dad4bec3288e6f4ef313904c
Remove whitespace
rx/concurrency/eventloopscheduler.py
rx/concurrency/eventloopscheduler.py
import logging import threading from threading import Timer from rx.concurrency import ScheduledItem from rx.disposables import Disposable from rx.internal.exceptions import DisposedException from rx.internal.priorityqueue import PriorityQueue from .scheduler import Scheduler log = logging.getLogger('Rx') class Ev...
Python
0.999999
@@ -1179,24 +1179,16 @@ , None)%0A - %0A @@ -3944,36 +3944,16 @@ .wait()%0A - %0A @@ -4869,8 +4869,9 @@ eduler() +%0A
7ab650ff4180ce263d789d2266391a93daa7298f
Use master_config function
saltapi/config.py
saltapi/config.py
''' Manage configuration files in salt-cloud ''' # Import python libs import os # Import salt libs import salt.config def api_config(path): ''' Read in the salt master config file and add additional configs that need to be stubbed out for cloudapi ''' opts = { 'extension_modules': []...
Python
0.000002
@@ -281,64 +281,21 @@ = %7B -%0A 'extension_modules': %5B%5D,%0A %7D%0A%0A +%7D%0A%0A opts = sal @@ -307,20 +307,22 @@ fig. -load +master _config( opts @@ -321,40 +321,12 @@ fig( -opts, path, 'SALT_MASTER_CONFIG' +path )%0A%0A
0c403a18fa12a3bda3a2f51c7d4bbc37c7fb3960
Patch Release
bqplot/_version.py
bqplot/_version.py
version_info = (0, 8, 0, 'dev0') __version__ = '.'.join(map(str, version_info))
Python
0.000001
@@ -16,20 +16,12 @@ (0, -8, 0, 'dev0' +7, 1 )%0A__
895316c506a6f9b79c5db1cbae157b6514938517
Add image support to WordPress example
samples/wordpress/quiptowordpress.py
samples/wordpress/quiptowordpress.py
#!/usr/bin/python # # Copyright 2014 Quip # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Python
0
@@ -729,16 +729,46 @@ rt quip%0A +import xml.etree.cElementTree%0A import x @@ -827,16 +827,25 @@ tParser( +%0A descript @@ -853,32 +853,38 @@ on=%22 -Backup of a Quip account +Post Quip threads to WordPress %22)%0A @@ -1846,132 +1846,1230 @@ # -Remove the title from the top of the document HTML%0A ...
2f8e030a879855d8a6a3d7ba6fd881b1341b64ea
Add test for location_sequences method
greengraph/test/test_graph.py
greengraph/test/test_graph.py
from greengraph.map import Map from greengraph.graph import Greengraph from mock import patch import geopy from nose.tools import assert_equal from nose.tools import assert_almost_equal import os import yaml start = "London" end = "Durham" def test_Greengraph_init(): #Test instance of Greengraph class instantiate...
Python
0.000059
@@ -875,16 +875,20 @@ places%0A + with @@ -980,32 +980,36 @@ s_file:%0A + test_Greengraph @@ -1024,32 +1024,36 @@ raph(start,end)%0A + fixtures @@ -1260,8 +1260,506 @@ )%0A +%0Adef test_location_sequence():%0A #Test that the location_sequence method computes the steps b...
50c306aead2376ba8b307a1731eb952e985ff138
Move clock imports
clock.py
clock.py
import django django.setup() from django.core.management import call_command from apscheduler.schedulers.blocking import BlockingScheduler sched = BlockingScheduler() @sched.scheduled_job('interval', minutes=3) def timed_job(): print('This job is run every three minutes.') call_command("check") sched.start(...
Python
0.000001
@@ -1,82 +1,4 @@ -import django%0Adjango.setup()%0A%0Afrom django.core.management import call_command%0A from @@ -196,16 +196,191 @@ utes.')%0A + import os%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22project.settings%22)%0A import django%0A django.setup()%0A from django.core.management im...
a68e9793779b37ff10b884d2a51c3584d0c2230b
resolve bind() endpoint in udpserver, allowing to bind to hostname or ipv6 addresses
bucky/udpserver.py
bucky/udpserver.py
# -*- coding: utf-8 - # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
Python
0
@@ -952,16 +952,188 @@ = True%0A + addrinfo = socket.getaddrinfo(ip, port, socket.AF_UNSPEC, socket.SOCK_DGRAM)%0A af, socktype, proto, canonname, addr = addrinfo%5B0%5D%0A ip, port = addr%5B:2%5D%0A @@ -1200,38 +1200,26 @@ cket.socket( -socket.AF_INET +af , socket.SOC @@ -2598,32 +25...
bf6247615d6f1799e70171bdd7e174ca2061a296
Update docstring for Coins
coins.py
coins.py
from collections import Counter class Coins(Counter): """ Class that represents Coins Usage: ``` > coins = Coins([0, 2, 4, 3, 1], [200, 100, 50, 20, 10]) > coins.value 470 > coins2 = Coins([0, 0, 0, 2, 0], [200, 100, 50, 20, 10]) > coins + coins2 Coins({200:0, 100:2, 50:4, 20:...
Python
0
@@ -132,47 +132,45 @@ ins( -%5B0, 2, 4, 3, 1%5D, %5B200, 100 +%7B200: 0, 100: 2 , 50 +: 4 , 20 +: 3 , 10 -%5D +: 1%7D )%0A @@ -219,47 +219,40 @@ ins( -%5B0, 0, 0, 2, 0%5D, %5B20 +%7B200: 0, 100 +:0 , 50 +:0 , 20 +:2 , 10 -%5D +:0%7D )%0A
60eaa4b01089f4018175309b071f20925c70353c
Isolate tests from the environment variable http_proxy.
nova/test.py
nova/test.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
Python
0.000003
@@ -925,16 +925,57 @@ t uuid%0A%0A +from fixtures import EnvironmentVariable%0A import m @@ -2521,24 +2521,83 @@ modules = %7B%7D +%0A self.useFixture(EnvironmentVariable('http_proxy')) %0A%0A def te
0194d17e4c31009ecba1e638b4705d3f03bb1cb5
Update win_iis_webapppool.py (#58930)
lib/ansible/modules/windows/win_iis_webapppool.py
lib/ansible/modules/windows/win_iis_webapppool.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported...
Python
0.000002
@@ -3041,16 +3041,18 @@ restart +ed %0A%0A- name
3b23a7a3bba469487a4694e0653341740e64cd7a
Update Python path
count.py
count.py
#!/usr/local/bin/python3 import sys import re import os line = sys.argv[1] # line = "the feature **bloated** IDE Emacs is rather **off-putting**" # line = "**bloated** IDE Emacs is" # line = "asdfasdf asdf sad fasdf as dfasd f" # print ('The line is: ', line) pattern = "\*\*[^*]*\*\*" matches = re.findall(pattern, ...
Python
0.000002
@@ -4,14 +4,8 @@ usr/ -local/ bin/
aac1fd15571f937da4bdf32402b1b5387d785a3d
Add '--build-all' option for building all targets
csibe.py
csibe.py
#!/usr/bin/env python import argparse import os import subprocess import sys class CSiBEBuilder: def __init__(self, csibe_path, build_path, toolchain_name): self.csibe_dir = csibe_path self.build_dir = build_path self.toolchain_name = toolchain_name self.toolchain_build_dir = os...
Python
0.000285
@@ -1912,16 +1912,103 @@ var=%22%22)%0A + parser.add_argument(%22--build-all%22, action=%22store_true%22, help=%22build every target%22)%0A args @@ -2089,24 +2089,180 @@ __file__))%0A%0A + if args.build_all:%0A targets_to_build = toolchains%0A else:%0A targets_to_build = %5Bargs.toolchain%...
19c601bbc36f1e049ee146439d767edd8004008a
add new line at end of file for toy_text __init__
gym/envs/toy_text/__init__.py
gym/envs/toy_text/__init__.py
from gym.envs.toy_text.blackjack import BlackjackEnv from gym.envs.toy_text.roulette import RouletteEnv from gym.envs.toy_text.frozen_lake import FrozenLakeEnv from gym.envs.toy_text.nchain import NChainEnv from gym.envs.toy_text.hotter_colder import HotterColder from gym.envs.toy_text.guessing_game import GuessingGame...
Python
0
@@ -505,8 +505,9 @@ lkingEnv +%0A
7535176b26ccfe5f4a3c4e6cd596aea9cd0a0653
Implement Ancient of War
fireplace/cards/classic/druid.py
fireplace/cards/classic/druid.py
from ..utils import * ## # Minions # Cat Form (Druid of the Claw) class EX1_165a: def action(self): self.morph("EX1_165t1") # Bear Form (Druid of the Claw) class EX1_165b: def action(self): self.morph("EX1_165t2") ## # Spells # Claw class CS2_005: def action(self): buffSelf(self, "CS2_005o") self.contr...
Python
0.000923
@@ -218,16 +218,239 @@ 5t2%22)%0A%0A%0A +# Rooted (Ancient of War)%0Aclass EX1_178a:%0A%09action = buffSelf(%22EX1_178ae%22)%0A%0Aclass EX1_178ae:%0A%09Health = 5%0A%09Taunt = True%0A%0A%0A# Uproot (Ancient of War)%0Aclass EX1_178b:%0A%09action = buffSelf(%22EX1_178be%22)%0A%0Aclass EX1_178be:%0A%09Atk = 5%0A%0A%0A #...
d6cae7d5cc88539cb9bd310e5f81ee5c43f338bf
add Proxy xiaoice_storage
flask_website/xiaoice_storage.py
flask_website/xiaoice_storage.py
dict_xiaoice = {} def get_xiaoice_by_username(username): return dict_xiaoice[username] def add_xiaoice(xiaoice): dict_xiaoice[xiaoice.username] = xiaoice def get_all_xiaoice(): return dict_xiaoice def get_avail_xiaoice(): # todo check avail for username, xiaoice in dict_xiaoice.items(): ...
Python
0
@@ -13,16 +13,333 @@ = %7B%7D%0A%0A%0A +class Xiaoice():%0A def __init__(self, weibo):%0A self._weibo = weibo%0A self.client_id = None%0A%0A def getWeibo(self):%0A return self._weibo%0A%0A def post_msg(self, msg):%0A self._weibo.post_msg_to_xiaoice(msg)%0A%0A def is_avail(self)...
bc8340136b8a70844d194d60e1c9faeb991eb971
add stop_consuming method to strategic broker
flow/brokers/strategic_broker.py
flow/brokers/strategic_broker.py
from flow.protocol.exceptions import InvalidMessageException from pika.spec import Basic from flow.brokers.base import BrokerBase import logging import pika import signal LOG = logging.getLogger(__name__) TERMINATION_SIGNALS = [signal.SIGINT, signal.SIGTERM] class StrategicAmqpBroker(BrokerBase): def __init__...
Python
0.000001
@@ -615,16 +615,49 @@ ode=2)%0A%0A + self._consumer_tags = %5B%5D%0A @@ -677,16 +677,16 @@ rs = %7B%7D%0A - @@ -872,16 +872,61 @@ _tag = 0 +%0A self._notified_to_disconnect = False %0A%0A @@ -1292,16 +1292,16 @@ gs%5B1:%5D:%0A - @@ -1319,24 +1319,286 @@ f.ack(tag)...
2e32827d9fd881835264246dac026f98d34ea8fc
fix type (missing self.)
flow/brokers/strategic_broker.py
flow/brokers/strategic_broker.py
from flow.protocol.exceptions import InvalidMessageException from pika.spec import Basic from flow.brokers.base import BrokerBase import logging import pika import signal LOG = logging.getLogger(__name__) TERMINATION_SIGNALS = [signal.SIGINT, signal.SIGTERM] class StrategicAmqpBroker(BrokerBase): def __init__...
Python
0
@@ -5407,16 +5407,21 @@ ssage = +self. message_
e1b238f4e36fc387db54c42676e2beed39292012
Update view_errors.py
flowtype/commands/view_errors.py
flowtype/commands/view_errors.py
import sublime from .base import BaseCommand from .exec_flow import ExecFlowCommand from ..logger import Logger from ..helpers import get_flow_bin, prepare_arguments, get_settings logger = Logger() class FlowtypeViewErrors(BaseCommand): """Run Flow check-contents.""" def get_cmd(self): """Construct...
Python
0.000001
@@ -163,22 +163,8 @@ ents -, get_settings %0A%0Alo
a55cfa7870fb821680b132c46011ac92179df0ce
Fix that one test.
fmn/lib/tests/test_recipients.py
fmn/lib/tests/test_recipients.py
from nose.tools import eq_, assert_not_equals import os import fmn.lib.models import fmn.lib.tests class TestRecipients(fmn.lib.tests.Base): def create_user_and_context_data(self): user1 = fmn.lib.models.User.get_or_create(self.sess, username="ralph") user2 = fmn.lib.models.User.get_or_create(sel...
Python
0.000654
@@ -1687,19 +1687,8 @@ ict( -ralph=dict( ircn @@ -1702,17 +1702,30 @@ reebean%22 -) +, user=%22ralph%22 )%5D)%0A%0A
539fbe3cddc6f04d8781e6913599bc5b5aeef82f
Put main entry at the end of the module
floggr.py
floggr.py
# all the imports import os import sqlite3 from flask import Flask, request, session, g, redirect, url_for, abort, \ render_template, flash # create our little application :) app = Flask(__name__) app.config.from_object(__name__) # Load default config and override config from an environment variable app.config.u...
Python
0
@@ -1316,50 +1316,8 @@ ()%0A%0A -if __name__ == '__main__':%0A app.run()%0A%0A @app @@ -2547,28 +2547,70 @@ ct(url_for('show_entries'))%0A +%0Aif __name__ == '__main__':%0A app.run()%0A
3b7a3755a43c21471aa39c89914179862c66bf8a
Add Sample code
gdrive.py
gdrive.py
#!/usr/bin/python __author__ = 'Jervis Muindi' __date__ = 'November 2013' class GFile(object): """Encapsulates a GFile Object""" def __init__(self): pass class GDriveAuth(object): """Encapsulates OAUTH2 authentication details for Google Drive API. """ def __init__(self, client_id, client_secr...
Python
0
@@ -1182,28 +1182,1551 @@ iven path.%22%22%22%0A pass%0A%0A +%0A################################################%0A%0A# Sample Test Code borrowed from %0A# https://developers.google.com/drive/quickstart-python#step_3_set_up_the_sample%0A%0Aimport httplib2%0Aimport pprint%0A%0Afrom apiclient.discovery import bui...
c9b035e576459673c2034aa0dc09aa67dde23886
Add some logging to the getter lambda
getter.py
getter.py
import requests import xmltodict import boto3 import botocore import re def get_latest_info(): r = requests.get("https://xkcd.com/rss.xml") rss = xmltodict.parse(r.text) post = dict() post["url"] = rss["rss"]["channel"]["item"][0]["link"] post["num"] = re.search(r"xkcd.com\/([0-9]+)", ...
Python
0.000001
@@ -1251,24 +1251,92 @@ filename):%0A + print %22Latest XKCD has already been cached. Exiting now...%22%0A retu @@ -1839,16 +1839,61 @@ traArgs) +%0A print %22Latest XKCD Cached successfully!%22 %0A%0A re @@ -1989,16 +1989,88 @@ _info()%0A + print %22Latest XKCD is number %22 + latest%5B%2...
46cb9cff4182387086c3507549c0adc59b248a99
Fix ESPHome discovery for ignored config entries (#36964)
homeassistant/components/esphome/config_flow.py
homeassistant/components/esphome/config_flow.py
"""Config flow to configure esphome component.""" from collections import OrderedDict from typing import Optional from aioesphomeapi import APIClient, APIConnectionError import voluptuous as vol from homeassistant.config_entries import CONN_CLASS_LOCAL_PUSH, ConfigFlow from homeassistant.const import CONF_HOST, CONF_...
Python
0
@@ -3655,33 +3655,43 @@ if -(%0A +CONF_HOST in entry.data and entry.d @@ -3709,18 +3709,36 @@ ST%5D -== +in %5B%0A address %0A @@ -3733,16 +3733,17 @@ address +, %0A @@ -3754,36 +3754,8 @@ - or entry.data%5BCONF_HOST%5D == dis @@ -3768,32 +3768,33 @@ _in...
e7e2f4e78663e7474c13524582cb5481a0465a55
Set default pjlink timeout (#36781)
homeassistant/components/pjlink/media_player.py
homeassistant/components/pjlink/media_player.py
"""Support for controlling projector via the PJLink protocol.""" import logging from pypjlink import MUTE_AUDIO, Projector from pypjlink.projector import ProjectorError import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_pla...
Python
0
@@ -725,16 +725,37 @@ %22utf-8%22 +%0ADEFAULT_TIMEOUT = 10 %0A%0APLATFO @@ -2847,16 +2847,29 @@ address( +%0A self._ho @@ -2898,16 +2898,42 @@ encoding +, DEFAULT_TIMEOUT%0A )%0A
53a95088e0a0ecbca50c370a7803724a5cc67c6f
Bump version to 18.04.15-4
gosubl/about.py
gosubl/about.py
import re import sublime # GoSublime Globals ANN = 'a18.04.15-3' VERSION = 'r18.04.15-3' VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE) DEFAULT_GO_VERSION = 'go?' GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE) GO_VERSION_NORM_PAT = re.compile...
Python
0
@@ -49,33 +49,33 @@ NN = 'a18.04.15- -3 +4 '%0AVERSION = 'r18 @@ -85,9 +85,9 @@ .15- -3 +4 '%0AVE
9eb90cef9323be1f631e30677cf47658cd2f5bfd
Improve ContributionDelete view.
dariah_contributions/views.py
dariah_contributions/views.py
from django.http import HttpResponseRedirect from django.core.exceptions import PermissionDenied from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views.generic.detail import DetailView from django.views.generic.list import ListView from django.vi...
Python
0
@@ -6365,24 +6365,177 @@ ssfully.%22)%0A%0A + @method_decorator(login_required)%0A def dispatch(self, *args, **kwargs):%0A return super(ContributionDelete, self).dispatch(*args, **kwargs)%0A%0A def get( @@ -6559,32 +6559,32 @@ rgs, **kwargs):%0A - self.obj @@ -6821,69 +6821,8 @@ s):%0A - ...
47497dee7fd10ebad084638b2f15f8e50e088737
fix imports
images/models.py
images/models.py
# -*- coding: utf-8 -*- from django.db import models from django.contrib.contenttypes import generic from entropy.base import EnabledMixin, OrderingMixin from .settings import CONTENT_MODELS class Image(models.Model): ''' Image URLs that reference an external source; such as FilePicker / S3 [{ "...
Python
0.000002
@@ -112,12 +112,14 @@ opy. -base +mixins imp
2494842bc19f9d20761c7ddc10569ea3833fcf7d
fix typo
gspread/urls.py
gspread/urls.py
""" gpread url patterns storage # General pattern /feeds/feedType/key/worksheetId/visibility/projection # Spreadsheet metafeed /feeds/spreadsheets/private/full /feeds/spreadsheets/private/full/key # Worksheet /feeds/worksheets/key/visibility/projection /feeds/worksheets/key/visibility/projection/worksheetId # Cell-...
Python
0.999991
@@ -1,13 +1,14 @@ %22%22%22%0Ag +s pread ur
2b0fc1690da9de9d20901531979e760edd9ec023
Fix cuda.test()
numba/cuda/__init__.py
numba/cuda/__init__.py
from __future__ import print_function, absolute_import, division from numba import config if config.ENABLE_CUDASIM: from .simulator_init import * else: from .device_init import * from .device_init import _auto_device def test(): if not is_available(): raise cuda_error() from .tests.cudapy...
Python
0.000001
@@ -58,16 +58,17 @@ ivision%0A +%0A from num @@ -83,16 +83,37 @@ t config +%0Aimport numba.testing %0A%0Aif con @@ -246,16 +246,17 @@ device%0A%0A +%0A def test @@ -256,16 +256,31 @@ ef test( +*args, **kwargs ):%0A i @@ -337,368 +337,67 @@ -from .tests.cudapy.runtests import test as test_cudapy%0A f...
3c93da928a59f8ce6b69838c4c406e4b0d7d04f7
Update release version in docs
documentation/source/conf.py
documentation/source/conf.py
# -*- coding: utf-8 -*- # # defcon documentation build configuration file, created by # sphinx-quickstart on Sun Jan 11 12:32:49 2009. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
Python
0
@@ -1623,25 +1623,25 @@ ersion = '0. -2 +7 .0'%0A# The fu @@ -1695,17 +1695,17 @@ se = '0. -2 +7 .0'%0A%0A# T
20a8b81e1e73417c4a5efed2d65c1819adb41391
Make the API in glyphslib.py a little more useful.
glyphslib.py
glyphslib.py
#!/usr/bin/python __all__ = [ "load_to_rfonts", "build_instances", "load", "loads", ] import json import sys from fontbuild.convertCurves import glyphCurvesToQuadratic from fontbuild.outlineTTF import OutlineTTFCompiler from parser import Parser from casting import cast_data, cast_noto_data from interpolation i...
Python
0
@@ -113,120 +113,8 @@ ys%0A%0A -from fontbuild.convertCurves import glyphCurvesToQuadratic%0Afrom fontbuild.outlineTTF import OutlineTTFCompiler%0A%0A from @@ -185,50 +185,8 @@ ata%0A -from interpolation import build_instances%0A from @@ -788,16 +788,47 @@ , italic +=False, include_instances=False ):%0A %22 @@...
4d5cf06d5b802c60ced55ddee55ce5e13d704e76
Replace globals with instance variables (with defaults).
githubinator.py
githubinator.py
import os import re import sublime import sublime_plugin class GithubinatorCommand(sublime_plugin.TextCommand): ''' This will allow you to highlight your code, activate the plugin, then see the highlighted results on GitHub/Bitbucket. ''' def load_config(self): s = sublime.load_settings("...
Python
0
@@ -249,16 +249,84 @@ %0A ''' +%0A DEFAULT_GIT_REMOTE = ('origin')%0A DEFAULT_HOST = 'github.com' %0A%0A de @@ -413,24 +413,25 @@ tings%22)%0A +%0A global D @@ -426,153 +426,62 @@ -global DEFAULT_GIT_REMOTE, DEFAULT_HOST%0A%0A DEFAULT_GIT_REMOTE = s.get(%22default_remote%22)%0A ...
595410e5f41167703d7a2ef8fef6591d7f7ef27f
id = int
integration-test/931-locality-changes-places.py
integration-test/931-locality-changes-places.py
# ne state capitals assert_has_feature( 9, 83, 196, 'places', { 'id': 6809, 'kind': 'locality'}) assert_no_matching_feature( 9, 83, 196, 'places', { 'id': 6809, 'kind': 'city'}) assert_has_feature( 9, 83, 196, 'places', { 'id': 6809, 'name': 'Sacramento', 'region_capital': True}) assert_no_ma...
Python
0.999981
@@ -63,36 +63,35 @@ s',%0A %7B 'id': -6809 +int , 'kind': 'local @@ -164,20 +164,19 @@ %7B 'id': -6809 +int , 'kind' @@ -237,36 +237,35 @@ s',%0A %7B 'id': -6809 +int , 'name': 'Sacra @@ -368,12 +368,11 @@ d': -6809 +int , 'n @@ -489,36 +489,35 @@ s',%0A %7B 'id': -7285 +int , 'kind': 'local @@ ...
8eba46a73280c290aa03f5282da2b423facb9e6b
Add test for "archive list"
glacier_test.py
glacier_test.py
#!/usr/bin/env python # Copyright (c) 2013 Robie Basak # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
Python
0.000001
@@ -2107,24 +2107,424 @@ ult_name')%0A%0A + def test_archive_list(self):%0A self.init_app(%5B'archive', 'list', 'vault_name'%5D)%0A archive_list = %5Bsentinel.archive_one, sentinel.archive_two%5D%0A self.cache.get_archive_list.return_value = archive_list%0A print_mock = Mock()%0A ...
37340d0119254399517920dd9a85d295aee16cab
add newline at end
dataset/models/tf/__init__.py
dataset/models/tf/__init__.py
""" Contains tensorflow models and functions """ from .base import TFModel from .vgg import VGG, VGG16, VGG19, VGG7 from .linknet import LinkNet from .unet import UNet from .vnet import VNet from .fcn import FCN, FCN32, FCN16, FCN8 from .resnet import ResNet, ResNet18, ResNet34, ResNet50, ResNet101, ResNet152 from .inc...
Python
0.000002
@@ -766,8 +766,9 @@ NetFC103 +%0A
2a8be2b8bd5cbb795380f1915e28ce0146cc6ab7
Fix bug with swapped DenseNet121 and 169
dataset/models/tf/densenet.py
dataset/models/tf/densenet.py
""" Huang G. et al. "`Densely Connected Convolutional Networks <https://arxiv.org/abs/1608.06993>`_" """ import tensorflow as tf from . import TFModel from .layers import conv_block class DenseNet(TFModel): """ DenseNet **Configuration** inputs : dict dict with keys 'images' and 'masks'. See :m...
Python
0
@@ -5243,18 +5243,18 @@ %5B6, 12, -3 2 +4 , 32%5D%0A @@ -5650,18 +5650,18 @@ %5B6, 12, +3 2 -4 , 16%5D%0A
a68f928382ba583ff8c89eb490159d56746c7338
Simplify target names for f2py tool.
numscons/tools/f2py.py
numscons/tools/f2py.py
"""f2py Tool Tool-specific initialization for f2py. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ import os from os.path import join as pjoin, dirname as pdirname import re import sys import subprocess im...
Python
0.000001
@@ -645,197 +645,129 @@ -target.append(default_fs.Entry(pjoin(build_dir, %0A _mangle_fortranobject(str(target%5B0%5D), %0A 'fortranobject.c')) +fobj = pjoin(build_dir, _mangle_fortranobject(str(target%5B0%5D), 'fortranobject.c'))%0A ...
006c6d6f61b03f08c8fea49094ef87f38862bcf2
add test for split_norm_shape
rootpy/stats/histfactory/tests/test_histfactory.py
rootpy/stats/histfactory/tests/test_histfactory.py
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from nose.plugins.skip import SkipTest try: from rootpy.stats import mute_roostats; mute_roostats() except ImportError: raise SkipTest("ROOT is not compiled with RooFit and RooStats enabled") from rootpy.io ...
Python
0.000005
@@ -2388,16 +2388,398 @@ None)%0A%0A + # test split_norm_shape%0A nominal = Hist(1, 0, 1)%0A nominal.FillRandom('gaus')%0A hsys = HistoSys('shape', high=nominal * 1.5, low=nominal * 0.9)%0A norm, shape = split_norm_shape(hsys, nominal)%0A assert_equal(norm.low, 0.9)%0A assert_equal(norm.high, 1.5...
38625cceb031b66980fc7b0ace3717f9d3931ac0
add another dp_aux_ch error msg to whitelist
meta-iotqa/lib/oeqa/runtime/core/baseos/baseos.py
meta-iotqa/lib/oeqa/runtime/core/baseos/baseos.py
#[PROTEXCAT] #\License: ALL RIGHTS RESERVED #\Author: Wang, Jing <jing.j.wang@intel.com> from oeqa.oetest import oeRuntimeTest from oeqa.utils.decorators import tag import re @tag(TestType="FVT", FeatureID="IOTOS-638") class BaseOsTest(oeRuntimeTest): '''Base os health check @class BaseOsTest ''' def ...
Python
0
@@ -3407,24 +3407,84 @@ l timeout%22,%0A + %22*ERROR* dp_aux_ch not done status 0xa1450064%22,%0A
021af9e73e6960347e47cf783c2d90d9e399a8c5
bump version
gosubl/about.py
gosubl/about.py
import re import sublime # GoSublime Globals ANN = 'a18.04.15-6' VERSION = 'r18.04.15-6' VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE) DEFAULT_GO_VERSION = 'go?' GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE) GO_VERSION_NORM_PAT = re.compile...
Python
0
@@ -49,33 +49,33 @@ NN = 'a18.04.15- -6 +7 '%0AVERSION = 'r18 @@ -85,9 +85,9 @@ .15- -6 +7 '%0AVE
f865430dae183cfcaaa65de6e6353a7724a49e2b
remove the cleaning process in the main run file
analysis/run.py
analysis/run.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import getopt import pandas as pd from include.config import CleaningConfig, CountingConfig, NotebookConfig from include.preprocessing import CleaningData from include.generate_notebook import GenerateNotebook import nbformat from nbconvert import HTMLExporter im...
Python
0.000001
@@ -114,24 +114,8 @@ port - CleaningConfig, Cou @@ -1023,28 +1023,76 @@ -return country, year +folder_path = os.path.join(year, country)%0A return folder_path %0A @@ -1376,20 +1376,13 @@ -country, yea +folde r = @@ -1414,361 +1414,8 @@ %5D)%0A%0A - # Getting the different location files ...
86fd9ad2035ab9ce5b7d3e6790b19c1d8e9bf756
revert changed word
gp2-core/app.py
gp2-core/app.py
# -*- coding: utf-8 -*- """ app.py flask application that serves webpages --- Written by Yangwook Ryoo, 2017 MIT License: see LICENSE at root directory """ from flask import Flask app = Flask(__name__) @app.route('/') def route_root(): return 'Hello, WWWWWWWWorld!'
Python
0.000068
@@ -250,23 +250,16 @@ 'Hello, -WWWWWWW World!'%0A
a6d7af093ccfd31dcb017877cd7557945090e83d
Add option to choose data file extension.
batch_analyze.py
batch_analyze.py
#!/usr/bin/env python import sys from pathlib import Path from multiprocessing import Pool from analyze import run_analysis, default_notebook_name def get_file_list(folder, init_filelist=None): folder = Path(folder) if init_filelist is None: init_filelist = [] return [f for f in folder.glob('**/...
Python
0
@@ -188,16 +188,28 @@ ist=None +, ext='hdf5' ):%0A f @@ -327,21 +327,25 @@ b('**/*. -hdf5' +%25s' %25 ext )%0A @@ -506,16 +506,28 @@ ve=False +, ext='hdf5' ):%0A a @@ -746,24 +746,33 @@ _user(folder +, ext=ext )%0A else:%0A @@ -810,16 +810,25 @@ t(folder +, ext=ext )%0A%0A p @@ -1304,16 +130...
1e4f9a32a8cd784790cd2841d2ed9af2855f9d6c
remove unused imports
kobo/apps/subsequences/utils/parse_knowncols.py
kobo/apps/subsequences/utils/parse_knowncols.py
# coding: utf-8 ''' this util parses the string of known_cols saved in the db and builds the structure that formpack expects to see in the asset.analysis_form_json() input is an array of strings that look like this: - q1:transcr:en - q1:translt:fr - q1:translt:de output is a more descriptive structure. (See tes...
Python
0.000001
@@ -376,46 +376,8 @@ ict%0A -from copy import deepcopy%0Aimport json%0A %0A%0Ade
69c601b75f0ba00128f686f03747a76f63816081
add compatible version check, fixes #6
datpy.py
datpy.py
from __future__ import absolute_import from __future__ import unicode_literals import pickle import subprocess import time try: import ujson as json except: import json try: import pandas as pd except: pd = False class DatException(Exception): pass def on_error(log): message = log.get('message') if n...
Python
0
@@ -71,16 +71,56 @@ literals +%0Afrom pkg_resources import parse_version %0A%0Aimport @@ -258,16 +258,52 @@ False%0A%0A +%0ACOMPATIBLE_DAT_VERSION = '7.0.5'%0A%0A%0A class Da @@ -3928,16 +3928,366 @@ , val)%0A%0A + current_version = subprocess.check_output(%5B'dat -v'%5D, shell=True).strip()%0A if parse_version...
e33307999d804cb65c60459b74d76a10511f1e63
Fix an indent in Day 14
day14.py
day14.py
#Advent of Code December 14 #Written by icydoge - icydoge AT gmail dot com def reindeer_fly(reindeer, time): #Give the distance the reindeer covered until that time cycles = time / (reindeer[2] + reindeer[3]) remainder = time % (reindeer[2] + reindeer[3]) distance = cycles * reindeer[1] * reindeer[2] #...
Python
0.999992
@@ -871,17 +871,20 @@ ontent:%0A -%09 + line = r @@ -906,9 +906,12 @@ ')%0A -%09 + rein
b16e88eac09285786bed0af50955ad74c352e1ca
Remove text repr of js includes.
IPython/html/widgets/widget.py
IPython/html/widgets/widget.py
"""Base Widget class. Allows user to create widgets in the backend that render in the IPython notebook frontend. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The fu...
Python
0
@@ -1676,16 +1676,38 @@ js_path) +, exclude=%22text/plain%22 ) %0A%0A%0A#-
1cc960fc6601cd29339db363d5961336a8c389af
Set ontology folder only if unset
oeplatform/settings.py
oeplatform/settings.py
""" Django settings for oeplatform project. Generated by 'django-admin startproject' using Django 1.8.5. 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 p...
Python
0.000001
@@ -2339,16 +2339,63 @@ ation%22%0A%0A +try:%0A ONTOLOGY_FOLDER%0Aexcept NameError:%0A ONTOLOGY
4bd3f2167b342a1d4a31d85923a07bc0cd2e203e
Update setup.py
openVulnQuery/setup.py
openVulnQuery/setup.py
from setuptools import setup, find_packages setup(name='OpenVulnQuery', version='1.25', description='A python-based module(s) to query the Cisco PSIRT openVuln API.', url='https://github.com/CiscoPSIRT/openVulnAPI/tree/master/openVulnQuery', author='Bradley Korabik, Parash Ghimire', autho...
Python
0.000001
@@ -88,9 +88,9 @@ '1.2 -5 +6 ',%0A @@ -299,16 +299,29 @@ Ghimire +, Omar Santos ',%0A @@ -373,16 +373,30 @@ isco.com +, os@cisco.com ',%0A
e5c92700533ea021807971a4b2276d405e621160
make UserUtilityModel extract_features pass
CFC_DataCollector/recommender/user_utility_model.py
CFC_DataCollector/recommender/user_utility_model.py
# Phase 1: Build a model for User Utility Function (per Vij, Shankari) # First, for each trip, we must obtain alternatives through some method # (currently Google Maps API), alongside the actual trips which were taken. # Once we have these alternatives, we can extract the features from each of the # possible trips. Now...
Python
0.000001
@@ -3222,182 +3222,9 @@ -# TODO: Change the pipeline test to use an concrete subclass instead of the%0A # abstract superclass so that we can go back to passing here%0A # pass%0A return list(range(5)) +pass %0A
dacad103e6f02f1953c6d5a9837e347793d1c52a
Fix cache folder issue.
gutter_color.py
gutter_color.py
from .file import File from sublime_plugin import EventListener from sublime import load_settings def plugin_loaded(): """ If the folder exists, and has more than 5MB of icons in the cache, delete it to clear all the icons then recreate it. """ from os.path import getsize, join, isfile, exists ...
Python
0
@@ -570,43 +570,32 @@ -# Get the size of the cache folder%0A +if exists(icon_path):%0A @@ -692,17 +692,18 @@ h, f)))%0A -%0A + if s @@ -733,16 +733,17 @@ n_path)%0A +%0A if n
b040c3783a179618d1e87d52df6d5799f782d5b1
Bump version to 0.9.0+dev
h11/_version.py
h11/_version.py
# This file must be kept very simple, because it is consumed from several # places -- it is imported by h11/__init__.py, execfile'd by setup.py, etc. # We use a simple scheme: # 1.0.0 -> 1.0.0+dev -> 1.1.0 -> 1.1.0+dev # where the +dev versions are never released into the wild, they're just what # we stick into the ...
Python
0
@@ -676,10 +676,14 @@ = %220.9.0 ++dev %22%0A