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
35c3fa719b57186a63bdf1110e76fc78b620c818
order presentations
pyconca2017/pycon_schedule/models.py
pyconca2017/pycon_schedule/models.py
from datetime import datetime from django.db import models """ Presentation """ class Speaker(models.Model): """ Who """ email = models.EmailField(unique=True) full_name = models.CharField(max_length=255) bio = models.TextField(default='') twitter_username = models.CharField(max_length=255, nul...
Python
0.000001
@@ -1388,16 +1388,63 @@ .title%0A%0A + class Meta:%0A ordering = ('title',)%0A%0A %0A%22%22%22 Sch
6d4038653bf237a285f99e68288454ce9ebdfc92
Add allowed hosts
cinderella/cinderella/settings/production.py
cinderella/cinderella/settings/production.py
from .base import * DEBUG = False ALLOWED_HOSTS = ['cinderella.io'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': os.environ['DB_NAME'], 'USER': os.environ['DB_USER'], 'PASSWORD': os.environ['DB_PASSWORD'], 'HOST': '127.0.0.1', ...
Python
0
@@ -46,16 +46,34 @@ OSTS = %5B +'188.226.249.33', 'cindere @@ -80,10 +80,10 @@ lla. +l i -o '%5D%0A%0A
c0787c468e1b71d7e9db93b5f5990ae9bb506d82
FIX other two sample data load for Windows
pystruct/datasets/dataset_loaders.py
pystruct/datasets/dataset_loaders.py
import cPickle from os.path import dirname from os.path import join import numpy as np def load_letters(): """Load the OCR letters dataset. This is a chain classification task. Each example consists of a word, segmented into letters. The first letter of each word is ommited from the data, as it ...
Python
0
@@ -794,32 +794,37 @@ 'scene.pickle') +,'rb' )%0A return cPi @@ -956,16 +956,21 @@ pickle') +,'rb' )%0A re
19a9465424400ca1a194e5516c44ca77a0f5591a
add Alpha Vantage API key to config file
moneywatch/moneywatchconfig.py
moneywatch/moneywatchconfig.py
#!/usr/bin/python #=============================================================================== # Copyright (c) 2016, James Ottinger. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # MoneyWatch - https://github.com/jamesottinger/moneywatch...
Python
0
@@ -651,16 +651,45 @@ e, NJ' %7D +%0Aalphavantage_apikey = %22----%22 %0A%0Auilink
1b1578cbfbe0e03f1341017f20027d164c61a6ce
bump version
pb_job_manager/__init__.py
pb_job_manager/__init__.py
# coding: utf-8 from __future__ import print_function from __future__ import unicode_literals __version__ = "0.2.1" import os import sys import time import binascii import collections import multiprocessing as mp PY2 = sys.version_info[0] == 2 if PY2: iteritems = lambda d: d.iteritems() else: iteritems = la...
Python
0
@@ -107,17 +107,17 @@ = %220.2. -1 +2 %22%0A%0Aimpor @@ -2848,17 +2848,16 @@ (self):%0A -%0A
87a14ba6b2a2fff0ab80ff204119795a8e4173f8
Update mongodb_atlas.py
mongodb_atlas/mongodb_atlas.py
mongodb_atlas/mongodb_atlas.py
#!/usr/bin/python import json import urllib import urllib.request as urlconnection from urllib.error import URLError, HTTPError from urllib.request import ProxyHandler plugin_version = 1 heartbeat_required = "true" resultjson={} metrics_units={ "disksize":"GB" } public_key = "" private_key = "" group_id= ""...
Python
0.000001
@@ -1143,17 +1143,17 @@ %22mongodb -. +_ majorver @@ -1212,17 +1212,17 @@ %22mongodb -. +_ version%22 @@ -1273,13 +1273,13 @@ ongo -.uri. +_uri_ upda @@ -1474,16 +1474,16 @@ ider -. +_ backup -. +_ enab @@ -1613,33 +1613,33 @@ ata%5B%22maxinstance -. +_ size%22%5D=data%5B%22pro @@ -1728,17 +1728,17 @@ insta...
04c67e99af363cd8eea4414f59a9294a84faaa6d
Fix test layout
tests/api/test_views.py
tests/api/test_views.py
# -*- coding: utf-8 -*- import json from django.test import TestCase from django.utils.encoding import smart_str from bakery.auth.models import BakeryUser from bakery.cookies.models import Cookie from bakery.utils.test import read import httpretty class TestApi(TestCase): def test_cookies_list_empty(self): ...
Python
0.000001
@@ -16,16 +16,34 @@ tf-8 -*- +%0A%0Aimport httpretty %0Aimport @@ -47,16 +47,17 @@ rt json%0A +%0A from dja @@ -167,16 +167,17 @@ eryUser%0A +%0A from bak @@ -244,33 +244,16 @@ rt read%0A -import httpretty%0A %0A%0Aclass @@ -560,17 +560,8 @@ - cookie = Coo @@ -1127,38 +1127,41 @@ def test_cookie -s_...
376ba2cf694dec62fc784ee2346b5cff2c7a7d93
change debug level
python/erase-pdf-wartermark-image.py
python/erase-pdf-wartermark-image.py
#!/usr/bin/env python3 #ref: https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/image-replacement/remover.py #required pkgs on Fedora: mupdf python3-PyMuPDF import fitz #python3 pymupdf module import io,os,sys from PIL import Image usage = f"Usage: {sys.argv[0]} <pdf-file-with-wartermark-image> [-h] [-d|-debug...
Python
0
@@ -1608,24 +1608,28 @@ ()%0Aif (debug + %3E 1 ):%0A print @@ -3995,16 +3995,20 @@ (debug +%3E 1 and inde @@ -4088,25 +4088,25 @@ if (debug %3E -1 +2 ):%0A p
6940035d7827a6a2aa719e537f122c07a91bd7c1
support werkzeug==1.0.0
tests/apps/multi/app.py
tests/apps/multi/app.py
import os from flask import Flask, render_template from werkzeug.wsgi import SharedDataMiddleware app = Flask(__name__) @app.route('/') def hello_world(): return render_template('index.html') app.wsgi_app = SharedDataMiddleware(app.wsgi_app, { '/': os.path.join(os.path.dirname(__file__), 'static') }) app.wsgi_ap...
Python
0.000028
@@ -44,16 +44,25 @@ emplate%0A +try:%0A from wer @@ -99,16 +99,105 @@ ddleware +%0Aexcept ImportError:%0A from werkzeug.middleware.shared_data import SharedDataMiddleware %0A%0Aapp =
d45bbe102efec23656d1329b5c3e6a785c69acee
switch base test cases of pickle backend from tests.backend.ini to tests.backend.common
tests/backend/pickle.py
tests/backend/pickle.py
# # Copyright (C) 2017 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=missing-docstring from __future__ import absolute_import try: import anyconfig.backend.pickle as TT except ImportError: TT = None import tests.backend.ini from tests.common import dicts_equal CNF_0 = dict(a=0, b="bbb...
Python
0.000001
@@ -50,16 +50,51 @@ at.com%3E%0A +# Copyright (C) 2017 Red Hat, Inc.%0A # Licens @@ -137,16 +137,52 @@ ocstring +,invalid-name,too-few-public-methods %0Afrom __ @@ -218,17 +218,8 @@ rt%0A%0A -try:%0A impo @@ -256,456 +256,84 @@ TT%0A -except ImportError:%0A TT = None%0A%0Aimport tests.backend.ini%0Afrom ...
779e74593b40f0e5e5c50c684dd250f771918b77
Fix tests
pendulum/locales/locale.py
pendulum/locales/locale.py
# -*- coding: utf-8 -*- import os import re from typing import Union, Optional, Any from importlib import import_module from pendulum.utils._compat import basestring from pendulum.utils._compat import decode class Locale: """ Represent a specific locale. """ _cache = {} def __init__(self, loc...
Python
0.000003
@@ -16,16 +16,56 @@ tf-8 -*- +%0Afrom __future__ import unicode_literals %0A%0Aimport
5ee67f15bff1111a9ae40bb8972e4bca4987102b
fix code style #9660
python/paddle/dataset/uci_housing.py
python/paddle/dataset/uci_housing.py
# Copyright (c) 2016 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 applic...
Python
0.000001
@@ -4059,16 +4059,17 @@ :-1%5D,)%0A%0A +%0A def fetc
f0ef4f5e269d7f2d7fd347e8f458c1c9ce1ffb34
Fix bug in redis hook
mqueue/hooks/redis/__init__.py
mqueue/hooks/redis/__init__.py
import redis import time from mqueue.conf import DOMAIN from mqueue.hooks.redis import serializer from mqueue.conf import HOOKS conf = HOOKS["redis"] R = redis.StrictRedis(host=conf["host"], port=conf["port"], db=conf["db"]) event_num = int(time.time()) def save(event, conf): name = DOMAIN+"_event"+str(event_num...
Python
0
@@ -247,17 +247,17 @@ .time()) - +%0A %0A%0Adef sa @@ -273,16 +273,50 @@ conf):%0A + global event_num%0A global R%0A name @@ -328,17 +328,19 @@ MAIN -+ + + %22_event%22 +str @@ -335,17 +335,19 @@ %22_event%22 -+ + + str(even @@ -440,18 +440,16 @@ k(event) - %0A R.s @@ -462,8 +462,28 @@ e,...
54035774d3b9aece86e68f047e9ff4a270d344cb
add mountain climbing emoji #2001
c2corg_ui/format/emoji_databases/c2c_activities.py
c2corg_ui/format/emoji_databases/c2c_activities.py
SVG_CDN = "/static/img/documents/activities/" emoji = { ":rock_climbing:": { "category": "activitiy", "name": "rock climbing", "svg_name": "rock_climbing", "unicode": "1f9d7", }, ":skitouring:": { "category": "activitiy", "name": "ski touring", "svg_n...
Python
0.999999
@@ -1407,16 +1407,162 @@ %0A %7D,%0A + %22:mountain_climbing:%22: %7B%0A %22category%22: %22activitiy%22,%0A %22name%22: %22mountain climbing%22,%0A %22svg_name%22: %22mountain_climbing%22,%0A %7D%0A %7D%0A%0Aalias
f58d82173b7defbed651a1eaec2c318e7bc17911
add giant queue test
qiita_db/test/test_sql_connection.py
qiita_db/test/test_sql_connection.py
from unittest import TestCase, main from qiita_db.sql_connection import SQLConnectionHandler from qiita_db.exceptions import QiitaDBExecutionError from qiita_core.util import qiita_test_checker @qiita_test_checker() class TestConnHandler(TestCase): def test_create_queue(self): self.conn_handler.create_qu...
Python
0
@@ -1417,67 +1417,8 @@ %22%22%22%0A - with self.assertRaises(QiitaDBExecutionError):%0A @@ -1464,20 +1464,16 @@ ndler()%0A - @@ -1516,36 +1516,32 @@ queue%22)%0A - - self.conn_handle @@ -1560,36 +1560,32 @@ ue(%0A - %22toy_queue%22,%0A @@ -1593,20 +159...
d5167d8ba1b3107e5ce121eca76b5496bf8d6448
Truncate a long log message.
qipipe/registration/ants/template.py
qipipe/registration/ants/template.py
import os import logging import envoy from .ants_error import ANTSError def create_template(metric, files): """ Builds a template from the given image files. :param metric: the similarity metric :param files: the image files :return: the template file name """ CMD = "buildtemplateparal...
Python
0.000003
@@ -761,24 +761,29 @@ ing.info(cmd +%5B:80%5D )%0A r = en
dddcc1574b3468d777b2a2f70cbc3410b8b955e0
Fix docstring in dilated_convolution_2d
chainer/links/connection/dilated_convolution_2d.py
chainer/links/connection/dilated_convolution_2d.py
import numpy from chainer.functions.connection import dilated_convolution_2d from chainer import initializers from chainer import link class DilatedConvolution2D(link.Link): """Two-dimensional dilated convolutional layer. This link wraps the :func:`~chainer.functions.dilated_convolution_2d` function an...
Python
0.000279
@@ -3068,36 +3068,32 @@ hape%0A - %3E%3E%3E (1, 7, 2, 2)%0A%0A @@ -3227,20 +3227,16 @@ - %3E%3E%3E (1, 7,
682864af6827c47a2c2d814a656af0f44ffe8495
Fix resource used items call
nodeconductor/billing/tasks.py
nodeconductor/billing/tasks.py
import logging from datetime import timedelta, datetime from celery import shared_task from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.db import transaction from django.utils import timezone from nodeconductor.billing.backend import BillingBackend, BillingBacken...
Python
0
@@ -3773,16 +3773,24 @@ d_items( +resource )%0A%0A
52b98755a8b26fb50d90b7988ee8ee16053e5c11
Update lint.py to automatically find .py files
lint.py
lint.py
# coding: utf-8 from __future__ import unicode_literals import os from pylint.lint import Run cur_dir = os.path.dirname(__file__) rc_path = os.path.join(cur_dir, './.pylintrc') print('Running pylint...') files = [ '__init__.py', '_osx_ctypes.py', '_osx_public_key.py', '_osx_symmetric.py', '_os...
Python
0
@@ -216,319 +216,250 @@ = %5B -%0A '__init__.py',%0A '_osx_ctypes.py',%0A '_osx_public_key.py',%0A '_osx_symmetric.py',%0A '_osx_util.py',%0A '_win_util.py',%0A 'errors +%5D%0Afor root, dirnames, filenames in os.walk('oscrypto/'):%0A for filename in filenames:%0A if not filename.endswit...
566c97f99668691b19dad7f0cb737157338ec57b
Add language attribute to dataset holder.
load.py
load.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=C0103 """ Load CoNLL16st/CoNLL15st dataset. """ __author__ = "GW [http://gw.tnode.com/] <gw.2016@tnode.com>" __license__ = "GPLv3+" from files import load_parses, load_raws, load_relations_gold from words import get_words, get_pos_tags, get_word_metas fro...
Python
0
@@ -2097,32 +2097,42 @@ lf, dataset_dir, + lang='?', doc_ids=None, f @@ -2345,16 +2345,44 @@ ter_fn%0A%0A + self%5B'lang'%5D = lang%0A @@ -2819,16 +2819,26 @@ n %22 %7B%7D: + lang: %7B%7D, doc_ids @@ -2912,16 +2912,30 @@ set_dir, + self%5B'lang'%5D, len(sel
851d53a68b4c9d8a7ea926d031c9e136b069a820
add abstraction to message handler
examples/accounts/app.py
examples/accounts/app.py
import json import asyncio from nats.aio.client import Client as NATS from nats.aio.errors import ErrConnectionClosed, ErrTimeout, ErrNoServers # TODO ADD possible actions list! # TODO ADD abstractions to Message Handler! class ServiceBroker: def __init__(self, io_loop, **settings): self.io_loop = io_loo...
Python
0.000001
@@ -215,16 +215,1119 @@ Handler! +%0A# MessageHandler must be able to call methods of Service and control requests%0A%0Aclass MessageHandler:%0A%0A def __init__(self, io_loop, **settings):%0A self.io_loop = io_loop%0A self.nc = NATS()%0A self.logger = settings.get('logger')%0A%0A async def m...
10a685d69d6866f86c3db7997e3fcf8b837470e4
add posible actions list
examples/accounts/app.py
examples/accounts/app.py
import json import asyncio from nats.aio.client import Client as NATS from nats.aio.errors import ErrConnectionClosed, ErrTimeout, ErrNoServers class ServiceBroker: def __init__(self, io_loop, **settings): self.io_loop = io_loop self.nc = NATS() self.logger = settings.get('logger') __...
Python
0.000019
@@ -138,16 +138,51 @@ ervers%0A%0A +# TODO ADD possible actions list!%0A%0A class Se @@ -1432,13 +1432,62 @@ -sid = +for service_key in self.__services.keys():%0A awa @@ -1511,16 +1511,23 @@ ibe( -%22users.* +f%22%7Bservice_key%7D %22, c
671ff419731084681edaf3fdc826c1139383c325
add Raises to orthogonal_procrustes docstring
scipy/linalg/_procrustes.py
scipy/linalg/_procrustes.py
""" Solve the orthogonal Procrustes problem. """ from __future__ import division, print_function, absolute_import import numpy as np from .decomp_svd import svd __all__ = ['orthogonal_procrustes'] def orthogonal_procrustes(A, B, compute_scale=False, check_finite=True): """ Compute the matrix solution of t...
Python
0
@@ -1541,16 +1541,273 @@ ested.%0A%0A + Raises%0A ------%0A ValueError%0A If the input arrays are incompatibly shaped.%0A This may also be raised if matrix A or B contains an inf or nan%0A and check_finite is True, or if the matrix product AB contains%0A an inf or nan.%0A%0A R...
d8b4dbfed17be90846ea4bc47b5f7b39ad944c24
Remove raw SQL from oscar_calculate_scores
oscar/apps/analytics/scores.py
oscar/apps/analytics/scores.py
from django.db import connection, transaction from oscar.core.loading import get_model ProductRecord = get_model('analytics', 'ProductRecord') Product = get_model('catalogue', 'Product') class Calculator(object): # Map of field name to weight weights = {'num_views': 1, 'num_basket_additions':...
Python
0
@@ -7,24 +7,31 @@ jango.db +.models import connecti @@ -26,31 +26,9 @@ ort -connection, transaction +F %0Afro @@ -244,16 +244,25 @@ ghts = %7B +%0A 'num_vie @@ -273,31 +273,24 @@ 1,%0A - - 'num_basket_ @@ -312,23 +312,16 @@ - 'num_pur @@ -330,16 +330,21 @@ ases': 5...
a66cba1f1c41ae371c752dc7b4b0f4609c8e8161
Fix Houzz usufy wrapper
osrframework/wrappers/houzz.py
osrframework/wrappers/houzz.py
# !/usr/bin/python # -*- coding: cp1252 -*- # ################################################################################## # # Copyright 2016-2018 Félix Brezo and Yaiza Rubio (i3visio, contacto@i3visio.com) # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the ter...
Python
0
@@ -2017,19 +2017,20 @@ uzz.com/ -pro +user /%22 + %22%3Cu @@ -3078,102 +3078,72 @@ = %5B -%22%3Ctitle%3EBest Home Improvement Professionals - Reviews, Past Projects & Photos %7C Houzz%3C/title%3E%22 +%0A '%3Cmeta name=%22rating%22 content=%22General%22 /%3E'%0A %5D%0A
52b1448c6eb91ca9d59c7f2be5fa60f93262d52b
Bump version to 2.2.0
pip_check_reqs/__init__.py
pip_check_reqs/__init__.py
__version__ = '2.1.1'
Python
0
@@ -14,9 +14,9 @@ '2. -1.1 +2.0 '%0A
695ea0a9b9768c713e03f9d3ec3ca4a702de0347
Update repeaterBotScript.py
script/repeaterBotScript.py
script/repeaterBotScript.py
# For the Repeater Bot import telepot # your bot key bot = telepot.Bot("228412441:AAH0hKP-WOlcFGsZRaSCETVKIFBZf7C4gXc") def handle(msg): chat_id = msg['chat']['id'] chat_msg = msg['text'] bot.sendMessage(chat_id, chat_msg) bot.message_loop(handle)
Python
0.000001
@@ -71,53 +71,20 @@ ot(%22 -228412441:AAH0hKP-WOlcFGsZRaSCETVKIFBZf7C4gXc +%5BYOUR_TOKEN%5D %22)%0A%0A
2033166b57ec566c763a9ff70df9a4123243160d
Bump version to 1.17.4
platformio_api/__init__.py
platformio_api/__init__.py
# Copyright 2014-present Ivan Kravets <me@ikravets.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0
@@ -682,17 +682,17 @@ (1, 17, -3 +4 )%0A__vers
1ce9101f4ac12e400e0ba09a2221c16f3b02f0ab
Add iter_plugins_dirs() test
podoc/tests/test_plugin.py
podoc/tests/test_plugin.py
# -*- coding: utf-8 -*- """Test plugin system.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os.path as op from ..core import save_text from ..plugin import IPluginRegistry, IPlugin...
Python
0.000001
@@ -285,24 +285,25 @@ ugin import +( IPluginRegis @@ -332,16 +332,58 @@ _plugins +,%0A iter_plugins_dirs) %0A%0A%0A#---- @@ -1237,8 +1237,147 @@ Plugin'%0A +%0A%0Adef test_iter_plugins_dirs():%0A assert 'json' in %5Bop.basename(plugin_dir)%0A for plugin_dir in iter_plu...
9c73bba34609226d065ed75603d15abafc616072
make a plot too
scripts/make-orbitfit-w0.py
scripts/make-orbitfit-w0.py
# coding: utf-8 """ Make w0.npy files from orbitfit results Call like: TODO python fitorbit.py --output-path=../output/orbitfits/ --potential=barred_mw \ -v --nsteps=256 --nwalkers=64 --mpi --fixtime """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard libr...
Python
0.000026
@@ -476,16 +476,146 @@ chusData +%0Afrom ophiuchus.util import integrate_forward_backward%0Afrom ophiuchus.plot import plot_data_orbit%0Aimport ophiuchus.potential as op %0A%0Adef ma @@ -1726,16 +1726,663 @@ e, w0)%0A%0A + potential = op.load_potential(potential_name)%0A%0A ix = np.random.randint(len(s...
5a865e7f9fd8745006c581519802dfc321acfeea
Fix LZ4 Compression for Python-LZ4
_lz4.py
_lz4.py
try: # Try to import the python-lz4 package import lz4.block except ImportError: # If python-lz4 isn't present, fallback to using pure python from io import BytesIO try: from six import byte2int from six.moves import xrange except ImportError: xrange = range de...
Python
0.010003
@@ -3724,20 +3724,25 @@ z4'%0A +%0A +def compress = l @@ -3741,29 +3741,74 @@ ress - = lz4.block.compress +(data):%0A return lz4.block.compress(data, store_size=False)%0A %0A
7fa19f13df92a3ddea6f69519539ead6cdeab3af
implement list --version option
reno/lister.py
reno/lister.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Python
0.000105
@@ -853,48 +853,162 @@ -for version, notefiles in notes.items(): +if args.version:%0A versions = args.version%0A else:%0A versions = notes.keys()%0A for version in versions:%0A notefiles = notes%5Bversion%5D %0A
090dd65c051b3cb9e9f1bf8274f1d75276ed274f
Fix build after swig_bot_lib changes.
scripts/prepare_bindings.py
scripts/prepare_bindings.py
#!/usr/bin/env python """ The LLVM Compiler Infrastructure This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details. Prepares language bindings for LLDB build process. Run with --help to see a description of the supported command line arguments. ...
Python
0.000004
@@ -2791,16 +2791,32 @@ %22sphinx%22 +, %22swig_bot_lib%22 %5D:%0A
98edde06a481cc18727a8c030bc670f7ab43b73f
increase timeout
scripts/pyinstaller/sign.py
scripts/pyinstaller/sign.py
import argparse import os import pathlib import sys from subprocess import STDOUT, check_call if sys.platform != "darwin": raise NotImplementedError parser = argparse.ArgumentParser() parser.add_argument( "--application-id", required=True, help="Certificate ID (should be added to the keychain).", ) ar...
Python
0.999426
@@ -940,9 +940,10 @@ out= -5 +10 ,%0A
713f9188ad5b25c604ac8736609b1ce5fefa224d
Include Cache-Control headers to avoid caching private files
private_storage/servers.py
private_storage/servers.py
""" Sending files efficiently for different kind of webservers. """ import os import sys import time from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.http import FileResponse, HttpResponse, HttpResponseNotModified from django.utils.http import http_date from django.u...
Python
0
@@ -93,16 +93,44 @@ ort time +%0Afrom functools import wraps %0A%0Afrom d @@ -997,24 +997,569 @@ )%0A%0A%0A +def add_no_cache_headers(func):%0A %22%22%22%0A Makes sure the retrieved file is not cached on disk, or cached by proxy servers in between.%0A This would circumvent any checking whether the u...
8b8ce9c4d3eb34894dbddb66cc06faa364963cd9
Determine highest semantic version
scripts/update_changelog.py
scripts/update_changelog.py
import os import pprint from copy import copy from datetime import datetime, timezone from pathlib import Path import git from github import Github # The owner and repository name. For example, octocat/Hello-World. GITHUB_REPOSITORY = os.getenv('GITHUB_REPOSITORY') GITHUB_TOKEN = os.getenv('GITHUB_TOKEN') PRODUCTIO...
Python
0.999999
@@ -3238,41 +3238,8 @@ # - pprint.pprint(dir(pull))%0A ppr @@ -3260,32 +3260,34 @@ l.title)%0A + # pprint.pprint(' @@ -3344,16 +3344,18 @@ %0A + # pprint. @@ -3406,24 +3406,26 @@ at))%0A + # print(pull. @@ -3568,16 +3568,18 @@ %0A + # print(' @@ -3584,24 +3584,435 @@...
abc31fd4e6b61cc45dbb606a98e450773951e52d
Use lmots.txt
anav.py
anav.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import string import random from itertools import chain import networkx as nx import pickle import Levenshtein letters = list(string.ascii_lowercase) def out(G): for n in sorted(G) : print(n, G....
Python
0.000001
@@ -619,21 +619,36 @@ ef cree_ -dico( +anag(infile, outfile ):%0A %22 @@ -954,17 +954,14 @@ pen( -%22gut.txt%22 +infile ) as @@ -1211,28 +1211,23 @@ th open( -%22gut.pick +outfi le -%22 , %22wb%22) @@ -4415,19 +4415,52 @@ # - cree_dico( +anag = cree_anag(%22lmots.txt%22, %22lmots.pickle%22 )%0A @@ -44...
ab704f6f3cb77fc89faab938a6474c0cbe831815
Fix verdana check
seaborn/tests/test_rcmod.py
seaborn/tests/test_rcmod.py
import numpy as np import matplotlib as mpl from distutils.version import LooseVersion import nose import matplotlib.pyplot as plt import nose.tools as nt import numpy.testing as npt from .. import rcmod class RCParamTester(object): def flatten_list(self, orig_list): iter_list = map(np.atleast_1d, orig...
Python
0
@@ -5177,32 +5177,34 @@ if has_verdana +() :%0A @@ -6123,16 +6123,18 @@ _verdana +() :%0A
4020c3dea19ac7624ec15b076224845aa79a2c2c
fix last commit (missing import)
protocols/ircs2s_common.py
protocols/ircs2s_common.py
""" ircs2s_common.py: Common base protocol class with functions shared by TS6 and P10-based protocols. """ from pylinkirc.classes import Protocol from pylinkirc.log import log class IRCS2SProtocol(Protocol): def checkCollision(self, nick): """ Nick collision checker. """ uid = sel...
Python
0
@@ -101,16 +101,29 @@ s.%0A%22%22%22%0A%0A +import time%0A%0A from pyl
8284279a5e92679976637bc9f966f4b776636e82
Use copies of net to avoid cross-talk between tests.
Testing/test_InitialConditions.py
Testing/test_InitialConditions.py
import copy import unittest import scipy from TestNetwork import net net = copy.deepcopy(net) net.compile() net.setInitialVariableValue('A', 1.0) net.setInitialVariableValue('B', 2.0) class test_ics(unittest.TestCase): def test_default_initial_conditions(self): """Test that default ICs are handled correc...
Python
0
@@ -316,24 +316,54 @@ orrectly%22%22%22%0A + test_net = net.copy()%0A traj @@ -357,32 +357,37 @@ %0A traj = +test_ net.integrate(sc @@ -729,32 +729,67 @@ ICs%22%22%22%0A +test_net = net.copy()%0A test_ net.set_initial_ @@ -815,32 +815,37 @@ %0A traj = +test_ net.in...
b989bc03278cf1049656f7a91bd95806b6a63580
Use lockfile to ensure just one process
bdbc.py
bdbc.py
""" Listen to windows focus changes, and close Dropbox Preference window when opened. """ def only_one(): from tendo import singleton me = singleton.SingleInstance() # will sys.exit(-1) if other instance is running def kill_window(): from pywinauto import Application, findwindows try: for hand...
Python
0
@@ -87,212 +87,414 @@ %22%22%22%0A -%0Adef only_one():%0A from tendo import singleton%0A me = singleton.SingleInstance() # will sys.exit(-1) if other instance is running%0A%0Adef kill_window():%0A from pywinauto import Application, find +import logging%0Aimport ctypes%0Afrom sys import exit%0Afrom pywinauto i...
50ac5ff1d350360d8c9227f6a05e718ca056dd98
Allow to print non-string messages (#3)
blaz.py
blaz.py
from distutils.spawn import find_executable from os import environ, chdir, getenv from os.path import abspath, basename, dirname, join as join_dir from subprocess import check_call, CalledProcessError from sys import argv from colors import bold from hashlib import md5 from version import __version__ import semantic_ve...
Python
0.000029
@@ -3539,19 +3539,24 @@ te(bold( +str( msg +) + '%5Cn',
906059dc50e3c850da9da61e3eedb7bc73b777b4
remove pager while no blog listed.
blog.py
blog.py
''' Created on 2013-12-12 @author: zhangzhi ''' from google.appengine.api import users, memcache from google.appengine.ext import ndb import webapp2 import jinja2 import gettext import os, logging from model import * from base import BaseRequestHandler #START: BlogsListPage class BlogsList(BaseRequestHandler): ...
Python
0
@@ -665,33 +665,57 @@ =int(page-1)*6)%0A -%0A + if articles:%0A older = @@ -738,32 +738,36 @@ ax else page+1)%0A + newer =
c8ba22ce19656c48c7e034adff884d499af14c44
remove debug print
monolithe/generators/sdkdoc/lib/sdkdocwriter.py
monolithe/generators/sdkdoc/lib/sdkdocwriter.py
# -*- coding: utf-8 -*- import os import shutil import importlib import inspect import json from monolithe.lib import Printer, SDKUtils, TaskManager from monolithe.generators.lib import TemplateFileWriter class SDKDocWriter(object): """ Writer of the Python SDK Documentation """ def __init__(self, mon...
Python
0.000008
@@ -2332,71 +2332,8 @@ e)%0A%0A - from pprint import pprint%0A pprint(info)%0A
c5f9f63a1657fbae97777cbf241df0ef9adbc1d4
Fix info messages
motor_interface/scripts/motor_interface_node.py
motor_interface/scripts/motor_interface_node.py
#!/usr/bin/env python import math import Adafruit_PCA9685 import numpy import rospy from vortex_msgs.msg import Float64ArrayStamped from motor_interface.srv import ThrustersEnable, ThrustersEnableResponse class MotorInterface(object): def __init__(self): rospy.init_node('motor_interface', anonymous=Fals...
Python
0.000001
@@ -2144,16 +2144,20 @@ oginfo(%22 +%25s: Launchin @@ -2162,16 +2162,8 @@ ing -node %25s at %25 @@ -2726,17 +2726,34 @@ oginfo(' -I +%25s: Successfully i nitializ @@ -2758,11 +2758,8 @@ ized - %25s ', r
d246e36c824931613229a6467e21d65d392a2fa3
Revert commit "[FIX] sale_margin: purchase price calculated using the currency of the price type" Reasons: - the currency conversion is done assuming that the cost price currency is the company currency - we support only one price type per field. Defining several price types on the same field using different price type...
addons/sale_margin/sale_margin.py
addons/sale_margin/sale_margin.py
############################################################################## # # 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 GNU Affero General Public L...
Python
0
@@ -2105,96 +2105,22 @@ uct. -price_get(ptype='standard_price', context=dict(context, currency_id=to_cur))%5Bproduct.id%5D +standard_price %0A
a40f87d700d37590a44d67b3044bd06cea52b495
Delete snapshots once gif is rendered
gifbox/core/management/commands/render_gifs.py
gifbox/core/management/commands/render_gifs.py
import os import subprocess import requests import shutil import tempfile from datetime import timedelta from django.utils import timezone from django.core.management.base import BaseCommand, CommandError from core.models import Image, AnimatedGif class Command(BaseCommand): help = """ Generates animat...
Python
0
@@ -3152,103 +3152,24 @@ shot -_image_fields = %5B%0A snapshot.image%0A for snapshot in (%0A +s_to_render = (%0A @@ -3198,20 +3198,16 @@ objects%0A - @@ -3296,20 +3296,16 @@ - - .order_b @@ -3316,16 +3316,18 @@ reated') +)%0A %0A @@...
aac855cb0339f87e1046811b9097858201cfe841
isolate helper functions
grove/alpha/jordan_gradient/gradient_helper.py
grove/alpha/jordan_gradient/gradient_helper.py
import numpy as np from jordan_gradient import gradient_estimator def real_to_binary(number, precision=16): """ Convert real decimal to precision-bit binary fraction :param float number: Real decimal over [0, 1). :param int precision: Number of bits of binary precision. :return float bf: Binary fr...
Python
0.000004
@@ -15,55 +15,8 @@ s np -%0Afrom jordan_gradient import gradient_estimator %0A%0Ade @@ -1528,1074 +1528,4 @@ bf%0A%0A -def gradient_error(f_h, precision=5, n_measurements=100):%0A %22%22%22 Computes error of gradient estimates for an input perturbation value%0A %0A :param np.array/float f_h: Value of f at p...
935a9dda8ffcbef049f62f7df6778be5c502dcfa
Update quick_install.py
bin/quick_install.py
bin/quick_install.py
#!/usr/bin/env python """Quickly install Mapbender3 starter using Git. You can just call it or give the name of a branch (defaults to 'develop' as well as a the directory where to install/update (defaults to mapbender3_BRANCH). The default admin account (root <root@example.com> / root) can also be given using command...
Python
0.000001
@@ -859,20 +859,16 @@ admin -- -user email=ad @@ -885,20 +885,16 @@ e.com -- -user password
29d209feb2a52c8cffb3f4116d43b2b01053df4b
Create latest and branch folder
deploy_gh_pages.py
deploy_gh_pages.py
import json import os import shutil import tempfile def copytree(src, dst, symlinks=False, ignore=None): for item in os.listdir(src): s = os.path.join(src, item) d = os.path.join(dst, item) if os.path.isdir(s): shutil.copytree(s, d, symlinks, ignore) else: s...
Python
0
@@ -1532,19 +1532,21 @@ n_folder +s = +%5B %22en/%25s%22 @@ -1547,17 +1547,16 @@ n/%25s%22 %25 -( folder_n @@ -1558,16 +1558,21 @@ der_name +%5D%0A if bran @@ -1574,17 +1574,17 @@ branch -! += = %22maste @@ -1589,24 +1589,99 @@ ter%22 - else %22latest%22)%0A +:%0A version_folders.append(%22la...
48e7bc7f8adf13dd4ac89277e086ba007e555810
Return unicode string if element on preprint provider form doesn't exist.
admin/preprint_providers/forms.py
admin/preprint_providers/forms.py
import bleach from django import forms from osf.models import PreprintProvider, Subject from admin.base.utils import get_subject_rules, get_toplevel_subjects, get_nodelicense_choices class PreprintProviderForm(forms.ModelForm): toplevel_subjects = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple(),...
Python
0.000011
@@ -1348,32 +1348,111 @@ rgs, **kwargs):%0A + if not self.data.get('advisory_board'):%0A return unicode('')%0A return b @@ -1456,32 +1456,32 @@ n bleach.clean(%0A - self @@ -1795,32 +1795,108 @@ rgs, **kwargs):%0A + if not self.data.get('description'):%0A ret...
4aa1b4d79ef7777f060a05c70ead7a27dc6ed6e9
Add plot_coef
fft2d/plot.py
fft2d/plot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import fft2d import numpy as np import matplotlib.pyplot as plt import argparse def main(args): arr, prop = fft2d.load(args.filename) Nx, Ny = arr.shape Lx = prop.Lx if prop.Lx > 0 else 1.0 Ly = prop.Ly if prop.Ly > 0 else 1.0 X, Y = np.meshgrid(np.l...
Python
0.000013
@@ -131,84 +131,25 @@ def -main(args):%0A arr, prop = fft2d.load(args.filename)%0A Nx, Ny = arr.shape +_load_size(prop): %0A @@ -235,221 +235,757 @@ -X, Y = np.meshgrid(np.linspace(0, Ly, Ny), np.linspace(0, Lx, Nx))%0A plt.pcolormesh(X, Y, arr)%0A plt.colorbar()%0A plt.axis(%22image%22)%0A ...
7ee29cfee740d6096fca8379253073077890a54c
Add more info to the redis example.
examples/util/wordcount_redis.py
examples/util/wordcount_redis.py
from disco.schemes.scheme_redis import redis_output_stream from disco.worker.task_io import task_output_stream from disco.core import Job, result_iterator class WordCount(Job): reduce_output_stream = (task_output_stream, redis_output_stream) @staticmethod def map(line, params): k, v = line ...
Python
0
@@ -1,16 +1,555 @@ +%22%22%22%0AUsage:%0Apython wordcount_redis.py redis://redis_server:6379:0 redis://redis_server:6379:1%0A%0AThe input is read from db 0 and the output is written to db 1. The inputs%0Ashould be of the form (key, list_of_values) (they are read from the server with the%0Alrange command. See the redi...
8f37b3716dbda37c4a092f606692b7bfae0afd75
add possibility to delete socket;
syncano_cli/custom_sockets/command.py
syncano_cli/custom_sockets/command.py
# -*- coding: utf-8 -*- import json import os import subprocess import yaml import click from syncano.models import CustomSocket, SocketEndpoint from syncano_cli.custom_sockets.formatters import SocketFormatter class SocketCommand(object): list_line_template = '{socket_name:^29}|{socket_status:^19}|{status_info...
Python
0
@@ -1757,25 +1757,182 @@ -print('delete %7B%7D' +custom_socket = CustomSocket.please.get(name=socket_name, instance_name=self.instance.name)%0A custom_socket.delete()%0A click.echo(%22INFO: Custom Socket %7B%7D delted.%22 .for
a52bba727dd83acc129494e764c64714ff2d4e52
fix typo
sympy/utilities/pytest.py
sympy/utilities/pytest.py
"""py.test hacks to support XFAIL/XPASS""" # XXX this should be integrated into py.tes # XXX but we can't force everyone to install py-lib trunk # tested with py-lib 0.9.0 from py.__.test.outcome import Outcome, Passed, Failed, Skipped from py.__.test.terminal.terminal import TerminalSession from time import time as ...
Python
0.999991
@@ -80,16 +80,17 @@ o py.tes +t %0A# XXX b
a08c04151e88eb95ae05484adb8b3f64ef91bd87
Update example
examples/tools/print_mo_and_dm.py
examples/tools/print_mo_and_dm.py
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # import sys import numpy from pyscf import gto, tools ''' Formatted output for 2D array ''' mol = gto.M(atom='H 0 0 0; F 0 0 1', basis='ccpvdz') nf = mol.nao_nr() orb = numpy.random.random((nf,4)) # # Print orbital coefficients # tools.dump_mat.du...
Python
0.000001
@@ -110,16 +110,21 @@ ort gto, + scf, tools%0A%0A @@ -656,8 +656,189 @@ gits=2)%0A +%0A%0A#%0A# Change the default output format of .analyze function.%0A#%0Amol = gto.M(atom='H 0 0 0; F 0 0 1', basis='ccpvdz')%0Amf = scf.RHF(mol).run()%0Amf.analyze(verbose=5, ncol=10, digits=9)%0A
c8b3fc11e04ea0a77348be5542d08937818193e3
Fix TensorBoard tag. Change: 145832229
tensorflow/tensorboard/tensorboard.py
tensorflow/tensorboard/tensorboard.py
# Copyright 2015 The TensorFlow 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 applica...
Python
0.000009
@@ -3943,24 +3943,41 @@ : %25s', tag)%0A + return tag%0A except I @@ -4043,21 +4043,22 @@ )%0A -tag = +return ''%0A%0A d
ee2be0278636c363a0091516c47d8fc7795ad99a
Add comment
emission/net/ext_service/geocoder/nominatim.py
emission/net/ext_service/geocoder/nominatim.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() import os from builtins import * from builtins import object import urllib.request, urllib.parse, ur...
Python
0
@@ -1186,16 +1186,44 @@ y_url%22%5D%0A + #nominatim_file.close()%0A except:%0A
75a233b472c03bba9a6ca8b4d97cd41b8d73b1ce
check if the item group exist or not
erpnext/setup/doctype/item_group/item_group.py
erpnext/setup/doctype/item_group/item_group.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 import urllib from frappe.utils import nowdate, cint, cstr from frappe.utils.nestedset import NestedSet from frappe.website.website_genera...
Python
0
@@ -5343,16 +5343,69 @@ group):%0A +%09%09if frappe.db.exists(%22Item Group%22, d.get(%22name%22)):%0A%09 %09%09d = fr @@ -5433,22 +5433,30 @@ oup%22, d. +get(%22 name +%22) )%0A +%09 %09%09if d.r @@ -5461,16 +5461,17 @@ .route:%0A +%09 %09%09%09clear
a3fea6080df132c9fcd719cfa0fade5f167a515e
Add optional polling for completion to test_run_gzip.py
compress/test/cloud/test_run_gzip.py
compress/test/cloud/test_run_gzip.py
#!/usr/bin/python # # Copyright 2016 Google Inc. 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...
Python
0
@@ -1150,16 +1150,124 @@ ng-path%3E + %5C%0A --poll-interval %3Cinterval-in-seconds%3E%0A%0AWhere the poll-interval is optional (default is no polling). %0A%22%22%22%0A%0Aim @@ -1305,11 +1305,12 @@ ort -sys +time %0A%0Afr @@ -2060,16 +2060,172 @@ utput%22)%0A +parser.add_argument(%22--poll-interval%22, defau...
ad595aae697abbf7c7de79a4a2448f0c47133934
Make viewer runnable from outer dirs.
execution_trace/viewer/viewer.py
execution_trace/viewer/viewer.py
# Run with `python viewer.py PATH_TO_RECORD_JSON. import json import sys from flask import Flask, jsonify from flask.helpers import send_from_directory app = Flask(__name__) # `main` inits these. # File containing `record` output. record_path = None # 0 is source, 1:N is state record_data = [] @app.route("/") de...
Python
0
@@ -56,16 +56,26 @@ rt json%0A +import os%0A import s @@ -77,16 +77,16 @@ ort sys%0A - %0Afrom fl @@ -181,16 +181,74 @@ name__)%0A +viewer_root = os.path.abspath(os.path.dirname(__file__))%0A%0A %0A# %60main @@ -427,11 +427,19 @@ ory( -'.' +viewer_root , 'i
385fbdc0401c979a71b0ff326852292bbb6a6ceb
Print coverages and deal with missing files
exp/influence2/ProcessResults.py
exp/influence2/ProcessResults.py
import numpy import matplotlib matplotlib.use("GTK3Agg") import matplotlib.pyplot as plt from exp.influence2.ArnetMinerDataset import ArnetMinerDataset from apgl.util.Latex import Latex from apgl.util.Util import Util from apgl.util.Evaluator import Evaluator numpy.set_printoptions(suppress=True, precision=3, l...
Python
0
@@ -261,16 +261,31 @@ uator %0A%0A +ranLSI = False%0A numpy.se @@ -370,16 +370,29 @@ Dataset( +runLSI=ranLSI )%0A%0Ans = @@ -434,17 +434,17 @@ sionN = -2 +3 0 %0AbestP @@ -557,21 +557,117 @@ elds))%0A%0A +coverages = numpy.load(dataset.coverageFilename)%0Aprint(%22==== Coverages ====%22)%0Aprint(coverages)%0A%...
1c939a99e377ff1dfe037c47dd99f635d3cb0a1f
Remove Cotswold election id (update expected)
polling_stations/apps/data_collection/management/commands/import_cotswold.py
polling_stations/apps/data_collection/management/commands/import_cotswold.py
from data_collection.management.commands import BaseXpressWebLookupCsvImporter class Command(BaseXpressWebLookupCsvImporter): council_id = 'E07000079' addresses_name = 'CotswoldPropertyPostCodePollingStationWebLookup-2017-03-27.TSV' stations_name = 'CotswoldPropertyPostCodePollingStationWebLookup-2017-03-2...
Python
0
@@ -390,16 +390,17 @@ +# 'parl.20
55fd2ec6454df9c62e40c5115be94a00bf944bc4
Allow list_classes.py to be loaded without side-effects
examples/list_classes.py
examples/list_classes.py
#!/usr/bin/python """This script lists classes and optionally attributes from UML model created with Gaphor. """ import optparse import sys from gaphor import UML from gaphor.application import Session # Setup command line options. usage = "usage: %prog [options] file.gaphor" parser = optparse.OptionParser(usage=u...
Python
0.000001
@@ -275,16 +275,33 @@ aphor%22%0A%0A +%0Adef main():%0A parser = @@ -337,16 +337,20 @@ usage)%0A%0A + parser.a @@ -360,16 +360,20 @@ option(%0A + %22-a%22 @@ -374,16 +374,20 @@ %22-a%22,%0A + %22--a @@ -402,16 +402,20 @@ s%22,%0A + + dest=%22at @@ -416,24 +416,28 @@ st=%22at...
5ced1112e75a076b253072e7386af0cac994c937
Address flake8 errors with long strings in actions/lib/get_scan_executions.py, via cleanup
packs/alertlogic/actions/lib/get_scan_executions.py
packs/alertlogic/actions/lib/get_scan_executions.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
@@ -789,16 +789,30 @@ equests%0A +from datetime import d @@ -1580,30 +1580,12 @@ c -reate_date = datetime. +d = date @@ -1615,32 +1615,61 @@ %5B'create_date'%5D) +%0A create_date = cd .strftime('%25Y-%25m @@ -1753,30 +1753,12 @@ f -inish_date = datetime. +d = date @@ -1796,16 +1796,49 @@ _d...
5018d20024651e632f30ab72918041d2ebf8ebcb
Test renaming a multiindex with duplicates (GH 38015) (#43187)
pandas/tests/indexing/multiindex/test_multiindex.py
pandas/tests/indexing/multiindex/test_multiindex.py
import numpy as np import pandas._libs.index as _index from pandas.errors import PerformanceWarning import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Series, ) import pandas._testing as tm class TestMultiIndexBasic: def test_multiindex_perf_warn(self): df = DataFram...
Python
0
@@ -3588,28 +3588,439 @@ ame_equal(result, expected)%0A +%0A def test_rename_multiindex_with_duplicates(self):%0A # GH 38015%0A mi = MultiIndex.from_tuples(%5B(%22A%22, %22cat%22), (%22B%22, %22cat%22), (%22B%22, %22cat%22)%5D)%0A df = DataFrame(index=mi)%0A df = df.rename(index=%7B%22A%...
99927b39cdfa47d60d6e045898ad4e0745fb763a
Add the ability to get the queue depth by calling len(queue) where queue is an instance of Queue
rmqid/queue.py
rmqid/queue.py
""" Queue is a class that encompasses and returns the methods of the Specification.Queue class """ import contextlib import logging from pamqp import specification from rmqid import base LOGGER = logging.getLogger(__name__) class Queue(base.AMQPClass): """Queue class that with methods that return the specifica...
Python
0.000018
@@ -1131,16 +1131,265 @@ delete%0A%0A + def __len__(self):%0A %22%22%22Return the pending number of messages in the queue by doing a passive%0A Queue declare.%0A%0A :rtype: int%0A%0A %22%22%22%0A response = self.rpc(self._declare(True))%0A return response.message_count%0A%0...
8a348c30e2381e76f09355f3cf23a9e87e060d80
Update without_end.py
Python/String_1/without_end.py
Python/String_1/without_end.py
# Given a string, return a version without the first and last char, so "Hello" # yields "ell". The string length will be at least 2. # without_end('Hello') -> 'ell' # without_end('java') -> 'av' # without_end('coding') -> 'odin' def without_end(str): return str[1:len(str) - 1] print(without_end('Hello')) print(wit...
Python
0.000002
@@ -150,16 +150,17 @@ Hello') +- -%3E 'ell' @@ -182,16 +182,17 @@ 'java') +- -%3E 'av'%0A @@ -215,16 +215,17 @@ oding') +- -%3E 'odin
9259bcd9d4dd745a5f34dff8dd4286eecf4a62f2
Update verifyAuthenticodePS.py
Python/verifyAuthenticodePS.py
Python/verifyAuthenticodePS.py
# NOTE: This is Windows Only - tested in Python2.7.1 # https://twitter.com/jgstew/status/1011657455275610112 # https://github.com/jgstew/tools/blob/master/CMD/PS_VerifyFileSig.bat # https://github.com/jgstew/tools/blob/master/Python/verifyAuthenticode.py # powershell -ExecutionPolicy Bypass -command "(Get-Authenticod...
Python
0
@@ -488,16 +488,147 @@ somehow%0A +# TODO: capture the output in python and evaluate it rather than just passing through the PowerShell result with stdout=sys.stdout%0A # TODO:
f1ef248f046c91683df8e6837249cc407a5f1cf2
Update ngrokwebhook.py
examples/ngrokwebhook.py
examples/ngrokwebhook.py
#sample script that reads ngrok info from localhost:4040 and create Cisco Spark Webhook #typicall ngrok is called "ngrok http 8080" to redirect localhost:8080 to Internet #accesible ngrok url # #To use script simply launch ngrok, then launch this script. After ngrok is killed, run this #script a second time to re...
Python
0.000001
@@ -2058,22 +2058,16 @@ okname, -target Url, res
339459eefa9c2b3daab76f258a4bde576b374c9b
Update create_http_task.py (#2187)
tasks/create_http_task.py
tasks/create_http_task.py
# Copyright 2019 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Python
0.000001
@@ -1357,16 +1357,36 @@ 'hello' +%0A in_seconds = 10 %0A%0A # @@ -1956,17 +1956,16 @@ payload%0A -%0A if i
fc8bfc1f2cda0844adbf1d831a1a5e1888f8949b
add regression test for behavior when fallbackfee is disabled
test/functional/wallet_fallbackfee.py
test/functional/wallet_fallbackfee.py
#!/usr/bin/env python3 # Copyright (c) 2017-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test wallet replace-by-fee capabilities in conjunction with the fallbackfee.""" from test_framework.tes...
Python
0
@@ -408,16 +408,69 @@ pc_error +%0Afrom test_framework.util import rpc_port ## ELEMENTS %0A%0Aclass @@ -562,17 +562,17 @@ nodes = -1 +2 %0A @@ -1347,16 +1347,16 @@ 1%7D%5D)))%0A - @@ -1481,16 +1481,1315 @@ : 1%7D))%0A%0A + ## ELEMENTS: test claimpegin with fallback fee set to zero%0A ...
94c1b54ef1db5180c5f1d07e857bf91d6b6fbf25
fix for python2.7 on windows
examples/usage_stream.py
examples/usage_stream.py
# -*- coding: utf-8 -*- from janome.tokenizer import Tokenizer import sys from io import open PY3 = sys.version_info[0] == 3 print(u'Tokenize (stream mode)') t = Tokenizer(mmap=True) with open('text_lemon.txt', encoding='utf-8') as f: text = f.read() if not PY3: text = unicode(text, 'utf-8') for t...
Python
0.000001
@@ -297,17 +297,8 @@ text -, 'utf-8' )%0A
331cef286380f3369344dbc9a60e460619c17405
fix dnn
federatedml/nn/homo_nn/zoo/dnn.py
federatedml/nn/homo_nn/zoo/dnn.py
# # Copyright 2019 The FATE 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.000032
@@ -614,23 +614,8 @@ %0A#%0A%0A -import typing%0A%0A from @@ -774,36 +774,8 @@ odel -, KerasSequenceDataConverter %0Afro @@ -806,19 +806,16 @@ .zoo -.nn import buil @@ -810,22 +810,16 @@ import -build_ nn%0A%0A%0Adef @@ -818,24 +818,28 @@ nn%0A%0A%0Adef is_ +dnn_ supported_la @@ -926,12 +926,30 @@ ild_ ...
41bac18d88d51abf057b2d26886fe929e8c5a4ad
Fix for optional mag field
feed/feed.home.usgs.earthquake.py
feed/feed.home.usgs.earthquake.py
#!/usr/local/bin/python3 -u """ Author: Oliver Ratzesberger <https://github.com/fxstein> Copyright: Copyright (C) 2016 Oliver Ratzesberger License: Apache License, Version 2.0 """ # Make sure we have access to SentientHome commons import os import sys try: sys.path.append(os.path.dirname(os.pat...
Python
0
@@ -2006,64 +2006,8 @@ %5D),%0A - 'mag': float(feature%5B'properties'%5D%5B'mag'%5D),%0A @@ -3262,24 +3262,134 @@ '%5D%5B'cdi'%5D)%0A%0A + if feature%5B'properties'%5D%5B'mag'%5D is not None:%0A fields%5B'mag'%5D = float(feature%5B'properties'%5D%5B'mag'%5D)%0A%0A return e
c830da138e8efc86204f96eff96fd9c0d956da20
Add GDrive listfiles method
file_distributor/gdrive_upload.py
file_distributor/gdrive_upload.py
#!/usr/bin/env python3 import argparse import configparser import httplib2 import os import sys import time # Google Drive API from apiclient.discovery import build from apiclient.http import MediaFileUpload from oauth2client import client from oauth2client import tools from oauth2client.file import Storage config_f...
Python
0
@@ -69,16 +69,28 @@ ttplib2%0A +import json%0A import o @@ -3102,16 +3102,314 @@ _auth)%0A%0A + def list_files(self):%0A %22%22%22Retrieves the data of all files in the Google Drive account.%22%22%22%0A Logger.debug(%22File and directory details:%22)%0A%0A file_list = self.__service.files().l...
428a2528a1164ffd1a84a3eee89936cacab49b8e
Fix test2_unicode test_view_name
test/python/topology/test2_unicode.py
test/python/topology/test2_unicode.py
# coding=utf-8 # Licensed Materials - Property of IBM # Copyright IBM Corp. 2017 import unittest from streamsx.topology.topology import * from streamsx.topology.tester import Tester from streamsx.topology import context from streamsx import rest import streamsx.ec as ec import test_vers class view_name_source(object...
Python
0.000082
@@ -486,20 +486,16 @@ -for instance @@ -495,18 +495,17 @@ nstance -in += self.sc @@ -517,17 +517,16 @@ instance -s (id=ec.i @@ -538,27 +538,25 @@ ce_id()) -:%0A +%0A for j @@ -551,21 +551,13 @@ - for job -in += ins @@ -569,17 +569,16 @@ .get_job -s (id=ec.j @@ -585,33 +5...
031bc75556d24f7f603cb9b33ecb47e0f06eb826
Add test for parsing slice_time_reference options
fmriprep/cli/tests/test_parser.py
fmriprep/cli/tests/test_parser.py
"""Test parser.""" from packaging.version import Version import pytest from ..parser import _build_parser from .. import version as _version from ... import config MIN_ARGS = ["data/", "out/", "participant"] @pytest.mark.parametrize( "args,code", [ ([], 2), (MIN_ARGS, 2), # bids_dir does not...
Python
0.000001
@@ -156,16 +156,63 @@ t config +%0Afrom ...tests.test_config import _reset_config %0A%0AMIN_AR @@ -4011,16 +4011,450 @@ ror in:%22 in err%0A + _reset_config()%0A%0A%0A@pytest.mark.parametrize(%22st_ref%22, (None, %220%22, %221%22, %220.5%22, %22start%22, %22middle%22))%0Adef test_slice_time_ref(tmp_path, st_ref):...
81cd7e3126db68872dbd57625cfa4368e0f98050
change name back from byte
flexget/plugins/output/pyload.py
flexget/plugins/output/pyload.py
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from future.moves.urllib.parse import quote from logging import getLogger from requests.exceptions import RequestException from flexget import plugin from flexget.event import...
Python
0.000007
@@ -6526,17 +6526,8 @@ mps( -'%22%25s%22' %25 name @@ -6552,16 +6552,25 @@ ignore') +.decode() ),%0A
cee0a7a3af8f17c69e4c9701a363f50904321bd1
fix daemonizer.kill
aquests/lib/daemonize.py
aquests/lib/daemonize.py
import os import sys import time import signal from . import killtree, processutil class Daemonizer: def __init__(self, chdir="/", procname = None, umask=0o22): self.chdir = chdir self.procname = procname self.umask = umask self.pidfile = os.path.join (chdir, '.pid') def runAsDaemon(self): if status (sel...
Python
0.000002
@@ -1401,17 +1401,16 @@ id or 0%0A -%09 %0Adef kil @@ -1454,16 +1454,34 @@ ildren = + True, signaling = True):%0A @@ -1550,16 +1550,18 @@ rocname) +%09%09 %0A%09%09if no @@ -1579,16 +1579,37 @@ break%0A%09%09 +%0A%09%09if signaling:%09%0A%09%09%09 os.kill @@ -1629,19 +1629,18 @@ SIGTERM) -%09%09 %0A +%09 %...
15283945f3103392d5d056a4ccf58281192ab8e4
Fix Pylint warnings
specdep.py
specdep.py
#!/usr/bin/python # see http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch16s04.html import sys import os import platform import urlparse import pkg import getopt from scripts.lib import mappkgname def build_type(): debian_like = ["ubuntu", "debian"] rhel_like = ["fedora",...
Python
0
@@ -3433,17 +3433,16 @@ %22hi:d:%22, - %0A @@ -4677,16 +4677,18 @@ tch as e +xn :%0A @@ -4727,16 +4727,18 @@ s%5Cn%22 %25 e +xn .message
f5c5fef9cfdc94ad2d1b7d95f990e288251f57fe
Add search analyzer to search
froide/helper/search/__init__.py
froide/helper/search/__init__.py
import importlib from django.conf import settings from elasticsearch_dsl import analyzer, tokenizer from django_elasticsearch_dsl import Index from .signal_processor import CelerySignalProcessor from .queryset import SearchQuerySetWrapper from .registry import search_registry __all__ = [ 'CelerySignalProcessor...
Python
0
@@ -1877,19 +1877,89 @@ nc(' +text_analyzer', get_default_text_analyzer)%0Aget_search_analyzer = get_func(' search -_text _ana @@ -2024,23 +2024,16 @@ t_func(' -search_ ngram_an
56b38e64aeea12269b36d11849e0952377510c16
Change method of listening to state changes
homeassistant/components/automation/template.py
homeassistant/components/automation/template.py
""" homeassistant.components.automation.template ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Offers template automation rules. For more details about this automation rule, please refer to the documentation at https://home-assistant.io/components/automation/#template-trigger """ import logging from homeassistant...
Python
0
@@ -346,17 +346,38 @@ TEMPLATE +, EVENT_STATE_CHANGED %0A - from hom @@ -423,67 +423,8 @@ ror%0A -from homeassistant.helpers.event import track_state_change%0A from @@ -777,80 +777,8 @@ se%0A%0A - # Get all entity ids%0A all_entity_ids = hass.states.entity_ids()%0A%0A @@ -895,54 +895,28 @@ def -stat...
1d68777981ef9189ba1b871211cee58598daf498
Add transmission sensor: number of active torrents (#9914)
homeassistant/components/sensor/transmission.py
homeassistant/components/sensor/transmission.py
""" Support for monitoring the Transmission BitTorrent client API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.transmission/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.components.sensor impor...
Python
0.00004
@@ -271,16 +271,69 @@ as vol%0A%0A +import homeassistant.helpers.config_validation as cv%0A from hom @@ -518,23 +518,8 @@ LES, - STATE_UNKNOWN, STA @@ -618,61 +618,8 @@ ttle -%0Aimport homeassistant.helpers.config_validation as cv %0A%0ARE @@ -791,16 +791,66 @@ PES = %7B%0A + 'active_torrents': %5B'Active To...
afffe668a1f5ec5f5073897ec712f34b77bb3613
Allow intermediate caching on API calls
telostats/stations/api.py
telostats/stations/api.py
import json from datetime import datetime, timedelta from dateutil.parser import parse as parse_date from tastypie.cache import SimpleCache from tastypie.resources import ModelResource, Resource, fields from tastypie.serializers import Serializer from .models import Station from ..utils.tempodb import TempoDbClient ...
Python
0
@@ -122,22 +122,18 @@ import -Simple +No Cache%0Afr @@ -309,16 +309,341 @@ lient%0A%0A%0A +class APICache(NoCache):%0A def __init__(self, timeout=60, *args, **kwargs):%0A super(APICache, self).__init__(*args, **kwargs)%0A self.timeout = timeout%0A%0A def cache_control(self):%0A return %7...
3f80950f1fa9c5bad018a8cdaa9f6ae70168e4e1
Update main.py
device/src/main.py
device/src/main.py
#This is the file executing while STM32 MCU bootup, and in this file, #it will call other functions to fullfill the project. #Communication module: LoRa. #Communication method with gateway via LoRa. #Uart port drive LoRa module. #Parse JSON between device and gateway via LoRa channel. #LoRa module: E32-TTL-100 #Pin s...
Python
0.000001
@@ -1779,16 +1779,17 @@ _main__' +: %0A while
06a398c6f14259ed03899eae84d54d12fb4336c3
Update test_code_style.py
_unittests/ut_module/test_code_style.py
_unittests/ut_module/test_code_style.py
""" @brief test log(time=0s) """ import sys import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.pycode import check_pep8, ExtTestCase try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.path.s...
Python
0.000004
@@ -454,16 +454,83 @@ t src%0A%0A%0A +def _run_cmd_filter(name):%0A print(%22#%22, name)%0A return False%0A%0A%0A class Te @@ -855,16 +855,48 @@ OG=fLOG, + run_cmd_filter=_run_cmd_filter, %0A @@ -2785,16 +2785,48 @@ emp_.*%22, + run_cmd_filter=_run_cmd_filter, %0A
cc80ceb0a27d1aa0564f43e4d21d069272eab3c0
fix icons in public index
archivebox/index/html.py
archivebox/index/html.py
__package__ = 'archivebox.index' from datetime import datetime from typing import List, Optional, Iterator, Mapping from pathlib import Path from django.utils.html import format_html, mark_safe from collections import defaultdict from .schema import Link from ..system import atomic_write from ..logging_util import p...
Python
0.000001
@@ -4582,16 +4582,37 @@ exists = + False%0A if extract @@ -4642,16 +4642,274 @@ not None +:%0A outpath = (Path(path) / canon%5Bf%22%7Bextractor%7D_path%22%5D)%0A if outpath.is_dir():%0A exists = any(outpath.glob('*.*'))%0A elif outpath.is_fi...
5f0e00378b49ca2431d819debaa6ad0d4b4921fe
manage account does not exist exception fix error handling
src/dm/api.py
src/dm/api.py
import json from .pythontwitter import twitter from bot.models import Account import logging import typing from django.conf import settings logger = logging.getLogger(__name__) def get_api_dict(__screen_name: typing.Optional[str]=None): if not __screen_name: return try: account = Account.obje...
Python
0
@@ -718,20 +718,25 @@ ot exist -%22, e +. %5Cn %7Be%7D%22 )%0A
608c55bb681667a6e1fe65e328676a3a99deb391
Update mupenGenerator.py
configgen/generators/mupen/mupenGenerator.py
configgen/generators/mupen/mupenGenerator.py
#!/usr/bin/env python import Command import mupenControllers import recalboxFiles from generators.Generator import Generator class MupenGenerator(Generator): # Main entry of the module # Configure mupen and return a command def generate(self, system, rom, playersControllers): # Settings recalbox d...
Python
0
@@ -844,34 +844,32 @@ configdir%22, -%22/ recalbox /share/syste @@ -860,39 +860,23 @@ lbox -/share/system/configs/ +Files. mupen -64/%22 +Conf , %22- @@ -890,18 +890,16 @@ r%22, -%22/ recalbox /sha @@ -898,39 +898,23 @@ lbox -/share/system/configs/ +Files. mupen -64/%22 +Conf , ro
38a199ebf039ddfe33ad3dd3142a821db1495603
Add support of JSON sources
import_data/management/commands/process_xslt.py
import_data/management/commands/process_xslt.py
from django.core.management.base import BaseCommand from lxml import etree, html import urllib2 from os import path import importlib from django.db.models.fields import related class Command(BaseCommand): help = 'Processes XSLT transformation on a fetched by URL resource and outputs the result' def add_argume...
Python
0
@@ -169,16 +169,60 @@ related +%0Afrom dicttoxml import dicttoxml%0Aimport json %0A%0Aclass @@ -6845,32 +6845,163 @@ parse(response)%0A + elif 'json' in content_type:%0A dictionary = json.load(response)%0A source_etree = dicttoxml(dictionary)%0A else:%0A
76d5ada4b5853cea1445d3331fa9fb95299a335d
Update at 2017-07-19 00-12-21
data.py
data.py
import json import random from pathlib import Path from pprint import pprint import numpy as np from tqdm import tqdm from utils import sample, split, read_json, read_img DATASET = Path('~/dataset/').expanduser() DIRS = [x for x in DATASET.iterdir() if x.is_dir()] TRAIN_DIRS = DIRS[:-1] VAL_DIRS = DIRS[-1:] IMAGE_T...
Python
0
@@ -640,16 +640,25 @@ l.json') +%5B'label'%5D %0A
8dcc7deb52fcbc907c4ea57102ae94daabc70502
use refactored frepple data load method
contrib/django/freppledb/execute/commands.py
contrib/django/freppledb/execute/commands.py
from __future__ import print_function import os, sys from datetime import datetime from django.db import transaction, DEFAULT_DB_ALIAS from django.conf import settings from freppledb.common.models import Parameter from freppledb.execute.models import Task import frepple def printWelcome(prefix = 'frepple', databas...
Python
0
@@ -4899,32 +4899,54 @@ load -frepple%0A loadfrepple(db +Data%0A loadData(database=db, filter=None).run( )%0A
0c88ed9bce4004938d7119f784b82a630b22b95d
Revise doc string with complexity
alg_bellman_ford_shortest_path.py
alg_bellman_ford_shortest_path.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np def update_distance(v, v_neighbor, w_graph_d, distance_d, previous_d): if (distance_d[v_neighbor] > distance_d[v] + w_graph_d[v][v_neighbor]): ...
Python
0.000006
@@ -543,16 +543,59 @@ thm for +single-source shortest path problem%0A in weighted @@ -599,9 +599,11 @@ ted -/ +and neg @@ -614,16 +614,73 @@ e graph. +%0A%0A Time complexity for graph G(V, W): O(%7CV%7C*%7CE%7C).%0A %22%22%22%0A
e954a0a400eeca33bfba6b5eada12728c3b15287
Set window active if AppQWidget is minimized
alignak_app/widgets/app_widget.py
alignak_app/widgets/app_widget.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2016: # Matthieu Estrada, ttamalfor@gmail.com # # This file is part of (AlignakApp). # # (AlignakApp) is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Sof...
Python
0.000001
@@ -5700,16 +5700,53 @@ f.show() +%0A QWidget.activateWindow(self) %0A%0A de
ad3554ae58f65a295ac94c131d8193e0b2e7e6f8
Add reminder to look at the number of terms returned
termsuggester/word2vec.py
termsuggester/word2vec.py
from gensim.models import Word2Vec import logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) logger.addHandler(logging.StreamHandler()) class Word2VecSuggester(): def __init__(self, modelfile): try: self.model = Word2Vec.load(modelfile) logger.info('Load Wo...
Python
0
@@ -589,16 +589,94 @@ _word):%0A + # TODO: make the number of terms returned a parameter of the function%0A @@ -828,16 +828,25 @@ ative=%5B%5D +, topn=10 )%0A
e06fdea0355f7d4df80c0eeba9a30486d4ddb158
add types to enum testcases
altair_parser/tests/_testcases.py
altair_parser/tests/_testcases.py
""" JSONSchema test cases. Each object defined in this file should be a dictionary with three keys: - 'schema' should be to a dictionary defining a valid JSON schema. - 'valid' should be a list of dictionaries, each of which is a valid instance under the specified schema. - 'invalid' should be a list of dictionarie...
Python
0.000001
@@ -120,11 +120,8 @@ be -to a di @@ -3224,16 +3224,51 @@ 1, 2, 3%5D +,%0A 'type': 'integer' %0A @@ -3339,16 +3339,50 @@ b', 'c'%5D +,%0A 'type': 'string' %0A
c15dda4fb4671975e4dcbe75141bf5ab0572a85e
move timing to library mode
main.py
main.py
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime as dt import sys import os import unittest import xbmc import xbmcgui from lib import constants as const from lib import library from lib.utils import (os_join, uni_join) from lib.xbmcwrappers import (rpc, log, dial...
Python
0.000001
@@ -2400,16 +2400,20 @@ ultiple +can instance @@ -2867,29 +2867,88 @@ return%0A +%0A -try:%0A +starttime = dt.datetime.now()%0A log.info(%22Starting %25s%22 %25 action)%0A xbmc @@ -3017,16 +3017,25 @@ %22true%22)%0A + try:%0A @@ -3151,16 +3151,101 @@ false%22)%0A + log.info...
73a375a3adb140c270444e886b3df842e0b28a86
Fix formatting tests: cfloat and cdouble as well as np.float and np.double are the same; make sure we test 4 bytes float.
numpy/core/tests/test_print.py
numpy/core/tests/test_print.py
import numpy as np from numpy.testing import * def check_float_type(tp): for x in [0, 1,-1, 1e10, 1e20] : assert_equal(str(tp(x)), str(float(x))) def test_float_types(): """ Check formatting. This is only for the str function, and only for simple types. The precision of np.float and n...
Python
0.000011
@@ -408,24 +408,26 @@ in %5Bnp.float +32 , np.double, @@ -971,21 +971,24 @@ in %5Bnp.c -float +omplex64 , np.cdo
8c8d97de4c5684f623194260997e01d9b5edbdae
Remove print statements.
dit/divergences/jensen_shannon_divergence.py
dit/divergences/jensen_shannon_divergence.py
""" The Jensen-Shannon Diverence. This is a reasonable measure of distinguishablity between distribution. """ from __future__ import division import numpy as np from six.moves import zip # pylint: disable=redefined-builtin import dit from ..distconst import mixture_distribution from ..shannon import entropy as H, e...
Python
0.000021
@@ -1501,76 +1501,8 @@ fs)%0A - print(pmfs)%0A print(entropies)%0A print(entropies * weights)%0A