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
a67a25b80c70450c3a68a3f8f6c2925a64a735b6
version bump and ug regen
src/robot/version.py
src/robot/version.py
# Automatically generated by 'package.py' script. import sys VERSION = 'trunk' RELEASE = '20131203' TIMESTAMP = '20131203-143027' def get_version(sep=' '): if RELEASE == 'final': return VERSION return VERSION + sep + RELEASE def get_full_version(who=''): sys_version = sys.version.split()[0] ...
Python
0
@@ -88,21 +88,21 @@ E = '201 -31203 +40126 '%0ATIMEST @@ -115,20 +115,20 @@ '201 -31203-143027 +40126-184803 '%0A%0Ad
fa1f80f2cb99cf44c7584eed85a04fb8dee56a38
Move the encoding and shebang to the first two lines
testing-game.py
testing-game.py
''' * Copyright (c) 2015 Spotify AB. * * 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...
Python
0.000304
@@ -1,12 +1,55 @@ +# !/usr/bin/python%0A# -*- coding: utf-8 -*-%0A '''%0A * Copyr @@ -886,53 +886,8 @@ '''%0A -%0A# !/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0A impo
04aa968a70b8065c9c9cd013d1266f8988c4220a
remove accidentally committed maxDiff change
tests/__init__.py
tests/__init__.py
import os import unittest import pytest class ScraperTest(unittest.TestCase): maxDiff = None online = False test_file_name = None def setUp(self): os.environ[ "RECIPE_SCRAPERS_SETTINGS" ] = "tests.test_data.test_settings_module.test_settings" test_file_name = ( ...
Python
0
@@ -79,27 +79,8 @@ ):%0A%0A - maxDiff = None%0A
cc0521c2f72c534e2fa94573f90e9ec2bb169405
use utc time for timestamps
database.py
database.py
import os.path from datetime import datetime from collections import defaultdict from flask import json from flaskext.sqlalchemy import SQLAlchemy import logging log = logging.getLogger(__name__) log.setLevel(logging.INFO) db = SQLAlchemy() class User(db.Model): id = db.Column(db.Integer, primary_key=True) ...
Python
0.000105
@@ -754,24 +754,27 @@ r):%0A +utc now = dateti @@ -768,32 +768,35 @@ cnow = datetime. +utc now()%0A ve @@ -843,24 +843,27 @@ =user, time= +utc now)%0A @@ -1689,16 +1689,19 @@ h):%0A +utc now = da @@ -1707,16 +1707,19 @@ atetime. +utc now()%0A @@ -2402,24 +2402,24 @@ _content():%0A...
c72b28ece7fe5313c7eff5f26d9ef0baaad1bad2
Update denormalization command
project/apps/api/management/commands/denormalize.py
project/apps/api/management/commands/denormalize.py
from django.core.management.base import ( BaseCommand, ) from apps.api.models import ( Convention, Contest, Contestant, Performance, Song, Group, Singer, Director, Panelist, ) class Command(BaseCommand): help = "Command to denormailze data." def handle(self, *args, **...
Python
0.000004
@@ -118,26 +118,63 @@ st,%0A -Contestant +Award,%0A Contestant,%0A Entrant,%0A Session ,%0A Pe @@ -198,19 +198,8 @@ ng,%0A - Group,%0A @@ -518,72 +518,379 @@ -cs = Contestant.objects.all()%0A for c in cs:%0A c +ps = Panelist.objects.all()%0A for p in ps:%0A ...
74c4c832b5f99643ac23ad3885f22f7a493016f7
Update denormalization command
project/apps/api/management/commands/denormalize.py
project/apps/api/management/commands/denormalize.py
from django.core.management.base import ( BaseCommand, ) from apps.api.models import ( Convention, Contest, Contestant, Performance, Song, Group, Singer, Director, Panelist, ) class Command(BaseCommand): help = "Command to denormailze data." def handle(self, *args, **...
Python
0.000004
@@ -118,26 +118,63 @@ st,%0A -Contestant +Award,%0A Contestant,%0A Entrant,%0A Session ,%0A Pe @@ -198,19 +198,8 @@ ng,%0A - Group,%0A @@ -518,72 +518,379 @@ -cs = Contestant.objects.all()%0A for c in cs:%0A c +ps = Panelist.objects.all()%0A for p in ps:%0A ...
7ebf1beec0912273317ed094e1c3806b2e910600
Remove commented lines
mbtiles/worker.py
mbtiles/worker.py
"""rio-mbtiles processing worker""" import logging import warnings from rasterio.enums import Resampling from rasterio.io import MemoryFile from rasterio.transform import from_bounds as transform_from_bounds from rasterio.warp import reproject, transform_bounds from rasterio.windows import Window from rasterio.window...
Python
0
@@ -395,42 +395,8 @@ io%0A%0A -%0A# base_kwds = None%0A# src = None%0A%0A TILE
6785219c9e4e4bfd1d28e4802e992b84000a7f63
increase default read timeout to 5 seconds
pyatk/channel/uart.py
pyatk/channel/uart.py
# Copyright (c) 2012-2013 Harry Bock <bock.harryw@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # ...
Python
0
@@ -2002,10 +2002,8 @@ = -0. 5%0A
5e02a4c3c7664d58375ec4af980e25322f98eb3c
add missing converter functions
pyexcel_io/service.py
pyexcel_io/service.py
""" pyexcel_io.service ~~~~~~~~~~~~~~~~~~~ provide service code to downstream projects :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import re import math import datetime from pyexcel._compact import PY2 def has_no_digits_in_float(va...
Python
0.000002
@@ -4074,16 +4074,713 @@ lue%0A%7D%0A%0A%0A +def ods_date_value(value):%0A return value.strftime(%22%25Y-%25m-%25d%22)%0A%0A%0Adef ods_time_value(value):%0A return value.strftime(%22PT%25HH%25MM%25SS%22)%0A%0A%0Adef ods_bool_value(value):%0A %22%22%22convert a boolean value to text%22%22%22%0A if value is ...
ec9bc89372670e623dbe98c34591fba62a0ee64a
Rename merge to pack in postp.
pyfr/scripts/postp.py
pyfr/scripts/postp.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from tempfile import NamedTemporaryFile from argparse import ArgumentParser, FileType import numpy as np from pyfr.util import rm def process_pack(args): # List the contents of the directory relnames = os.listdir(args.indir) # Get the absolute fi...
Python
0
@@ -1540,21 +1540,20 @@ %0A ap_ -merge +pack = sp.ad @@ -1640,17 +1640,16 @@ - 'pyfrs-d @@ -1685,17 +1685,16 @@ If no '%0A - @@ -1786,17 +1786,16 @@ - 'input d @@ -1834,17 +1834,16 @@ will '%0A - @@ -1904,37 +1904,36 @@ ctory.')%0A ap_ -merge +pack .add_argume...
ef628bcdd79ceb28e2b320059c9b00e52372663a
Improve the error message when PyGMT fails to load the GMT library (#814)
pygmt/clib/loading.py
pygmt/clib/loading.py
""" Utility functions to load libgmt as ctypes.CDLL. The path to the shared library can be found automatically by ctypes or set through the GMT_LIBRARY_PATH environment variable. """ import ctypes import os import sys from ctypes.util import find_library from pygmt.exceptions import GMTCLibError, GMTCLibNotFoundError...
Python
0.000811
@@ -1252,22 +1252,9 @@ ary -'%7B%7D':%22.format( +%22 %0A @@ -1266,16 +1266,15 @@ - %22, %22 +f%22%7B', ' .joi @@ -1289,30 +1289,30 @@ llnames) -%0A ) +%7D.%5Cn %7Berror%7D.%22 %0A
d3bc063cc35f5b7bc806c83cd23780108c509fb6
Disable checkin in embedded mode.
pykeg/core/checkin.py
pykeg/core/checkin.py
# Copyright 2014 Bevbot LLC, All Rights Reserved # # This file is part of the Pykeg package of the Kegbot project. # For more information on Pykeg or Kegbot, see http://kegbot.org/ # # Pykeg is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
Python
0
@@ -834,16 +834,49 @@ es.%22%22%22%0A%0A +from django.conf import settings%0A from dja @@ -1957,16 +1957,116 @@ %22%22%22%0A + if settings.EMBEDDED:%0A LOGGER.debug('Checkin disabled in embedded mode')%0A return%0A%0A kbsi
454abe8f3081e8186b29d677e2bca88ca10112c7
Add support for a GYP_DEFINES environment variable as a way to pass in default values for definitions. Review URL: http://codereview.chromium.org/62128
pylib/gyp/__init__.py
pylib/gyp/__init__.py
#!/usr/bin/python import gyp.input import optparse import os.path import sys def FindBuildFiles(): extension = '.gyp' files = os.listdir(os.getcwd()) build_files = [] for file in files: if file[-len(extension):] == extension: build_files.append(file) return build_files def main(args): my_name...
Python
0
@@ -60,16 +60,29 @@ os.path%0A +import shlex%0A import s @@ -3411,45 +3411,105 @@ %7D%0A -if options.defines:%0A for +defines = os.environ.get('GYP_DEFINES', %5B%5D)%0A if defines:%0A defines = shlex.split( define +s)%0A i -n +f opt @@ -3520,24 +3520,78 @@ .defines:%0A + defines += options.define...
301b2ca9cdf33665312e092937c63b1db7db888f
Add missing imports
pymessenger2/utils.py
pymessenger2/utils.py
import hashlib import hmac import six def validate_hub_signature(app_secret, request_payload, hub_signature_header): """ @inputs: app_secret: Secret Key for application request_payload: request body hub_signature_header: X-Hub-Signature header sent with request ...
Python
0.000009
@@ -31,16 +31,40 @@ ort six%0A +import attr%0Aimport json%0A %0A%0Adef va
20d41656488ea43978f749e2e34303e49981695c
fix imports to include OR tools
pymzn/mzn/__init__.py
pymzn/mzn/__init__.py
from .model import * from .solvers import * from .minizinc import * from .templates import * __all__ = [ 'Solutions', 'minizinc', 'mzn2fzn', 'solns2out', 'MiniZincError', 'MiniZincUnsatisfiableError', 'MiniZincUnknownError', 'MiniZincUnboundedError', 'MiniZincModel', 'Statement', 'Constraint', 'Variab...
Python
0
@@ -523,16 +523,31 @@ arCBLS', + 'ORTools',%0A 'gecode @@ -548,20 +548,16 @@ gecode', -%0A 'chuffe @@ -612,16 +612,20 @@ 'g12fd', +%0A 'g12laz @@ -627,20 +627,16 @@ 12lazy', -%0A 'g12mip @@ -651,16 +651,28 @@ r_cbls', + 'or_tools', 'discre @@ -692,16 +692,20 @@ string', +%0A 'add_pa @@ ...
9395ef840d9dd9194b2f89e2a7240bb951662e0b
add missing imports
tabby/conversation.py
tabby/conversation.py
# # Copyright (C) 2006 Collabora Limited # Copyright (C) 2006 Nokia Corporation # @author Ole Andre Vadla Ravnaas <ole.andre.ravnaas@collabora.co.uk> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Softwa...
Python
0.000605
@@ -913,16 +913,29 @@ ort gtk%0A +import pango%0A import s @@ -957,16 +957,50 @@ port *%0A%0A +from util import dbus_call_async%0A%0A class Co
3cd595fb0a2f1d027aefe70b59e235ef3dd14d61
update basespider download
xspider/libs/basespider/basespider.py
xspider/libs/basespider/basespider.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created on 2017-02-21 # Project: basespider import json import time import socket import requests import traceback from requests.exceptions import ReadTimeout from requests.exceptions import ConnectionError class BaseGenerator(object): """ BaseSpider Generator ...
Python
0
@@ -1016,29 +1016,17 @@ elf. -reqst. headers -.update( + = %0A @@ -1324,17 +1324,16 @@ x/39.0'%7D -) %0A%0A de @@ -1355,19 +1355,20 @@ , url, t -ype +ools =%22reques @@ -1381,16 +1381,26 @@ meout=50 +, **kwargs ):%0A @@ -1499,19 +1499,20 @@ if t -ype +ools == %22req @@ -1630,16 +1630,26 @@ =...
80bc283676be51ef67fe7924bcc32adaa93fc985
Change timestamp format
guestbook/__init__.py
guestbook/__init__.py
# coding: utf-8 import pickle from datetime import datetime from collections import namedtuple, deque from flask import Flask, request, render_template, redirect, escape, Markup application = Flask(__name__) DATA_FILE = 'guestbook.dat' Post = namedtuple('Post', ['name', 'timestamp', 'comment']) def save_post(name...
Python
0.000162
@@ -1083,13 +1083,15 @@ e('%25 -Y%25m%25d +d/%25m/%25Y %25H:
7c81e7dc96fc66c0dc82b2d431e07167c6a97557
Add failing tests re: Parser.ignore_unknown
tests/parser.py
tests/parser.py
from spec import Spec, skip, ok_, eq_, raises from invoke.parser import Parser, Context, Argument from invoke.collection import Collection class Parser_(Spec): def can_take_initial_context(self): c = Context() p = Parser(initial=c) eq_(p.initial, c) def can_take_initial_and_other_con...
Python
0
@@ -1235,24 +1235,196 @@ t('bar')))%0A%0A + def takes_ignore_unknown_kwarg(self):%0A Parser(ignore_unknown=True)%0A%0A def ignore_unknown_defaults_to_False(self):%0A eq_(Parser().ignore_unknown, False)%0A%0A class pa
f860a306b4c9fc583a83289ae2a6ecf407214e38
Add more checks to avoid crashing when input files are missing
pysteps/io/readers.py
pysteps/io/readers.py
"""Methods for reading files. """ import numpy as np def read_timeseries(inputfns, importer, **kwargs): """Read a list of input files using io tools and stack them into a 3d array. Parameters ---------- inputfns : list List of input files returned by any function implemented in archive. i...
Python
0
@@ -655,16 +655,32 @@ ng data%0A + Rref = None%0A if a @@ -750,32 +750,102 @@ None%0A else:%0A + if len(inputfns%5B0%5D) == 0:%0A return None, None, None%0A for ifn @@ -978,16 +978,70 @@ break%0A%0A + if Rref is None:%0A return None, None, None%0A%0A R = @@ -1...
e43fa4a0897d5dc909c4f8d77068c87393d1c03e
Remove print
comnnpass/views.py
comnnpass/views.py
from django.shortcuts import render from django.views.generic.list import ListView from .forms import QueryForm from .models import Result import pandas as pd import requests import datetime import math # 検索ページへ遷移 def top(request): return render(request,'search.html') # 検索処理・検索結果を返す def search(request): if re...
Python
0.000016
@@ -3802,59 +3802,8 @@ se:%0A - print(df%5B0:1%5D%5B'results_available'%5D%5B0%5D)%0A @@ -4055,31 +4055,8 @@ 00)%0A - print(iterate)%0A
748d54cb46782fc1f6a5c46f8d270ddd516cf3c5
fix code style of test_dataset.py test=develop
python/paddle/fluid/tests/unittests/test_dataset.py
python/paddle/fluid/tests/unittests/test_dataset.py
# Copyright (c) 2018 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 app...
Python
0.000449
@@ -1,12 +1,16 @@ +%22%22%22%0A # Copyrigh @@ -608,16 +608,20 @@ License. +%0A%22%22%22 %0A%0Afrom _
c3527f5526ee96398760cbef11d7de48f41fe998
Annotate NormOP test to skip grad check (#21894)
python/paddle/fluid/tests/unittests/test_norm_op.py
python/paddle/fluid/tests/unittests/test_norm_op.py
# Copyright (c) 2018 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 app...
Python
0
@@ -706,16 +706,36 @@ t OpTest +, skip_check_grad_ci %0A%0A%0Adef l @@ -1807,32 +1807,179 @@ psilon = 1e-8%0A%0A%0A +@skip_check_grad_ci(reason=%22'check_grad' on large inputs is too slow, %22 +%0A %22however it is desirable to cover the forward pass%22)%0A class TestNormOp @@ -2158,97 +2158,161 ...
dbc1df293f283367526b3a80c5f24d71e5d46be1
fix bug abort is undefined and return 204
middleware/app.py
middleware/app.py
from flask import Flask, jsonify, request from sense_hat import SenseHat from hat_manager import HatManager app = Flask(__name__) sense_hat = SenseHat() hat_manager = HatManager(sense_hat) @app.route('/') def index(): return 'Welcome to the PI manager. Choose a route according to what you want to do.' @app.ro...
Python
0.00001
@@ -34,16 +34,23 @@ request +, abort %0Afrom se @@ -821,16 +821,42 @@ essage)%0A + return jsonify(), 204%0A %0A%0Aif __n
fb34eebd253727dcc718e2387cb6f4ac763f0bae
Add DateTime Completed Field to Task
tasks/models/tasks.py
tasks/models/tasks.py
"""Models for tasks Each new type of task corresponds to a task model """ from django.db import models from data import Data_FullGrid_Confidence, Data_FullGrid # Tasks class Task_Naming_001(Data_FullGrid_Confidence): class Meta: db_table = 'tbl_response_naming_001' def __unicode__(self): retu...
Python
0
@@ -857,32 +857,87 @@ 32, unique=True) +%0A dt_completed = models.DateTimeField(auto_now=True) %0A%0Aclass Task_Map
5c49071a6f03cc07f520ab57d71eccade4620261
enforce whitelist
python/parse_log_for_errmsg/parse_log_for_errmsg.py
python/parse_log_for_errmsg/parse_log_for_errmsg.py
# -*- coding: utf-8 -*- #!/usr/bin/python ##------------------------------------------------------------------- ## @copyright 2017 DennyZhang.com ## Licensed under MIT ## https://raw.githubusercontent.com/DennyZhang/devops_public/master/LICENSE ## ## File : parse_log_for_errmsg.py ## Author : Denny <denny@dennyzhang....
Python
0.000001
@@ -411,12 +411,12 @@ 16:0 -5:17 +6:26 %3E%0A## @@ -1596,24 +1596,52 @@ r_msg_list:%0A + has_matched = False%0A for @@ -1747,14 +1747,86 @@ -break%0A +has_matched = True%0A break%0A if has_matched is False:%0A
f4fff0375f238a21ccbe5a5a4316f848c4af401e
use 'params' instead of url quote
flexget/components/sites/sites/newznab.py
flexget/components/sites/sites/newznab.py
from urllib.parse import quote, urlencode import feedparser from loguru import logger from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils.requests import RequestException __author__ = 'deksan' logger = logger.bind(name='newznab') class Newznab: """ ...
Python
0.000027
@@ -21,15 +21,8 @@ port - quote, url @@ -1580,16 +1580,19 @@ url'%5D = +f%22%7B config%5B' @@ -1604,21 +1604,15 @@ te'%5D - + ' +%7D /api? -' + +%7B urle @@ -1624,16 +1624,18 @@ (params) +%7D%22 %0A%0A @@ -3585,25 +3585,25 @@ -lookup = f%22&rid=%7B +params = %7B'rid': arg_ @@ -3625,17 +3625,16...
6db0dccc5643cb2af254b0bf052806645f7445fd
fix regression on qibuild deploy
python/qibuild/gdb.py
python/qibuild/gdb.py
## Copyright (c) 2012 Aldebaran Robotics. All rights reserved. ## Use of this source code is governed by a BSD-style license that can be ## found in the COPYING file. """ Tools for the GNU debbugger """ import os from qibuild import ui import qibuild.sh import qibuild.command def split_debug(base_dir, objcopy=Non...
Python
0.000001
@@ -1120,23 +1120,24 @@ binary(f -ilename +ull_path ):%0A
547c1d5d1ff2ced0969a86eda6e0094f8b76d94f
Bump to 0.1.1 with setup.py fix
minio/__init__.py
minio/__init__.py
# Minimal Object Storage Library, (C) 2015 Minio, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0
@@ -739,11 +739,11 @@ = %220.1. -0 +1 %22%0A
4bb8a61cde27575865cdd2b7df5afcb5d6860523
Add weird SLP orientation to get_world_pedir
fmriprep/interfaces/tests/test_reports.py
fmriprep/interfaces/tests/test_reports.py
import pytest from ..reports import get_world_pedir @pytest.mark.parametrize("orientation,pe_dir,expected", [ ('RAS', 'j', 'Posterior-Anterior'), ('RAS', 'j-', 'Anterior-Posterior'), ('RAS', 'i', 'Left-Right'), ('RAS', 'i-', 'Right-Left'), ('RAS', 'k', 'Inferior-Superior'), ('RAS', 'k-', 'Sup...
Python
0
@@ -557,16 +557,241 @@ rior'),%0A + ('SLP', 'k-', 'Posterior-Anterior'),%0A ('SLP', 'k', 'Anterior-Posterior'),%0A ('SLP', 'j-', 'Left-Right'),%0A ('SLP', 'j', 'Right-Left'),%0A ('SLP', 'i', 'Inferior-Superior'),%0A ('SLP', 'i-', 'Superior-Inferior'),%0A %5D)%0Adef t
a059a7e8b751fbc49bd1f363378d630d774ed2c1
set subtypes to None if not supported in this TAXII version
taxii_client/utils.py
taxii_client/utils.py
import pytz import json import calendar from libtaxii.clients import HttpClient from libtaxii.messages_10 import ContentBlock as ContentBlock10 from datetime import datetime from collections import namedtuple def ts_to_date(timestamp): if not timestamp: return None return datetime.utcfromtimestam...
Python
0.000001
@@ -2294,10 +2294,12 @@ s = -%5B%5D +None ,%0A
bfa66827e5afd175c15640b1678fbba347009953
Fix unit tests
python/test/_utils.py
python/test/_utils.py
from python.ServerGateway import DwebGatewayHTTPRequestHandler def _processurl(url, verbose, **kwargs): # Simulates HTTP Server process - wont work for all methods args = url.split('/') method = args.pop(0) f = getattr(DwebGatewayHTTPRequestHandler, method) assert f namespace = args.pop(0) ...
Python
0.000005
@@ -87,16 +87,28 @@ verbose, + headers=%7B%7D, **kwarg @@ -222,24 +222,146 @@ args.pop(0)%0A + DwebGatewayHTTPRequestHandler.headers = headers # This is a kludge, put headers on class, method expects an instance.%0A f = geta
c6d5d8e4128a8eb8a6f73d414b303000362135ef
Fix up logger for celery 3.x
mixpanel/tasks.py
mixpanel/tasks.py
import httplib import urllib import base64 import urlparse import logging import socket from django.utils import simplejson from celery.task import Task from celery.registry import tasks from mixpanel.conf import settings as mp_settings class EventTracker(Task): """ Task to track a Mixpanel event. """ ...
Python
0.000221
@@ -1421,15 +1421,8 @@ f l. -logger. getE
1ca1137a57c16b1141e167ac8210ca3ac9014e2e
remove unnecessary import
mkt/stats/urls.py
mkt/stats/urls.py
from django.conf.urls import patterns, url from django.shortcuts import redirect import addons.views from . import views from stats.urls import series_re # Time series URLs following this pattern: # /app/{app_slug}/statistics/{series}-{group}-{start}-{end}.{format} # Also supports in-app URLs: # /app/{app_slug}/stat...
Python
0.000037
@@ -79,28 +79,8 @@ ct%0A%0A -import addons.views%0A from
c7e9ea888bbbcef9e7ae29340c45e9aaf211d1da
Fix tests
tests/travis.py
tests/travis.py
import os os.environ['QT_API'] = os.environ['USE_QT_API'] from qtpy import QtCore, QtGui, QtWidgets print('Qt version:%s' % QtCore.__version__) print(QtCore.QEvent) print(QtGui.QPainter) print(QtWidgets.QWidget)
Python
0.000103
@@ -51,16 +51,24 @@ QT_API'%5D +.lower() %0A%0Afrom q
efac3c253dcd71be2c6510b5025ddedbb9a7358e
work when there's no RAVEN_CONFIG
temba/temba_celery.py
temba/temba_celery.py
from __future__ import absolute_import, unicode_literals import celery import os import raven import sys from django.conf import settings from raven.contrib.celery import register_signal, register_logger_signal # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_...
Python
0.000004
@@ -475,16 +475,123 @@ _APPS)%0A%0A +# register raven if configured%0Araven_config = getattr(settings, 'RAVEN_CONFIG', None)%0Aif raven_config:%0A client = @@ -634,16 +634,20 @@ 'dsn'%5D)%0A + register @@ -669,16 +669,20 @@ client)%0A + register
bf0930121a53ea2df3a7b851256cb47ce86aec00
fix non-integer index error
pywt/data/_readers.py
pywt/data/_readers.py
import os import numpy as np def ascent(): """ Get an 8-bit grayscale bit-depth, 512 x 512 derived image for easy use in demos The image is derived from accent-to-the-top.jpg at http://www.public-domain-image.com/people-public-domain-images-pictures/ Parameters ---------- None ...
Python
0.025431
@@ -4179,16 +4179,20 @@ n = +int( np.floor @@ -4217,16 +4217,17 @@ 12.)*12. +) %0A # B @@ -4343,21 +4343,26 @@ %5B:n, + 4%5D, + (n/ +/ 3, + -1)), + axis
9dc4bb5dbfbd4702487b00fda9f267e19dd9d4d6
rename local to werkzeug
qg/web/app/wsgiapp.py
qg/web/app/wsgiapp.py
# -*- coding: utf-8 -*- # # Copyright 2013, Qunar OPSDEV # # 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.00099
@@ -1115,21 +1115,24 @@ corn', ' -local +werkzeug '),%0A @@ -4282,21 +4282,24 @@ ode == %22 -local +werkzeug %22:%0A
dd70c4a7fdde0ba5c221d7c3268827b1d6a38aea
Add param show_codes to v0/Ptref
source/jormungandr/jormungandr/interfaces/v0/Ptref.py
source/jormungandr/jormungandr/interfaces/v0/Ptref.py
# coding=utf-8 # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility a...
Python
0
@@ -1275,16 +1275,60 @@ fields%0A +from flask.ext.restful.types import boolean%0A from jor @@ -2988,16 +2988,184 @@ forbid%22) +%0A self.parsers%5B%22get%22%5D.add_argument(%22show_codes%22, type=boolean, default=False,%0A description=%22Either to show or not codes%22)...
460f218c2ed71a0a7aff5bb3353bca01a4841af1
Update Homework_Week4_CaseStudy2.py
Week4-Case-Studies-Part2/Bird-Migration/Homework_Week4_CaseStudy2.py
Week4-Case-Studies-Part2/Bird-Migration/Homework_Week4_CaseStudy2.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 23 21:46:13 2017 @author: lamahamadeh """ ''' ============================== Case Study 2 - Bird Migration ============================== ''' #In this case study, we will continue taking a look at patterns of flight #for each of the ...
Python
0.000001
@@ -2944,18 +2944,16 @@ plt%0D%0A%0D%0A -%0D%0A eric_dai
e9e40dd4d9d5357069261653cd1a432e99e8e1aa
Remove unexpected dummy code
initialize_data.py
initialize_data.py
import pandas import numpy as np from google.cloud import datastore from math import floor import pdb RATING_KIND = 'Rating' MOVIE_KIND = 'Movie' PROJECT_ID = 'cf-mr-service' client = datastore.Client(PROJECT_ID) def load_from_store(): query = client.query(kind=RATING_KIND) result = query.fetch() rating =...
Python
0.000037
@@ -1359,20 +1359,16 @@ g_key = -key= client.k
6cb9a09ee92f3be6a5d807e9c5af41bac4796435
Remove loading of env file in development
{{cookiecutter.repo_name}}/config/settings/base.py
{{cookiecutter.repo_name}}/config/settings/base.py
# -*- coding: utf-8 -*- """ Django settings for {{ cookiecutter.project_name }}. For more information on this file, see https://docs.djangoproject.com/en/stable/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/stable/ref/settings/ """ from os.path import dirname,...
Python
0
@@ -289,50 +289,8 @@ %22%22%0A%0A -from os.path import dirname, join, exists%0A impo @@ -410,174 +410,8 @@ ()%0A%0A -# Load environment files from file in development%0Aenv_file = join(dirname(__file__), 'development.env')%0Aif exists(env_file):%0A environ.Env.read_env(str(env_file))%0A%0A # Bu @@ -450,20 +450,1...
c90fce44f30398fef0c20ec08f761ae19951308a
Delete unused pipeline settings
{{cookiecutter.repo_name}}/src/settings/project.py
{{cookiecutter.repo_name}}/src/settings/project.py
# -*- coding: utf-8 -*- """ Project settings for {{cookiecutter.project_name}} Author : {{cookiecutter.author_name}} <{{cookiecutter.email}}> """ from defaults import * from getenv import env INSTALLED_APPS += ( 'applications.front', ) GRAPPELLI_ADMIN_TITLE = "Admin" PIPELINE_CSS = { 'styleshee...
Python
0.000001
@@ -285,343 +285,4 @@ in%22%0A -%0APIPELINE_CSS = %7B%0A 'stylesheets': %7B%0A 'source_filenames': (%0A ),%0A 'output_filename': 'stylesheets.css',%0A 'extra_context': %7B%0A 'media': 'screen,projection',%0A %7D,%0A %7D,%0A%7D%0A%0APIPELINE_JS = %7B%0A 'scripts': ...
c83e8d7d83b9395b5b0428dcac2909b8d6762fe4
make Tool work without invoke scripts again
hublib/rappture/tool.py
hublib/rappture/tool.py
from __future__ import print_function from .node import Node import numpy as np from lxml import etree as ET import os import subprocess import sys from .rappture import RapXML class Tool(RapXML): def __init__(self, tool): """ tool can be any of the following: - Path to a tool.xml file. ...
Python
0
@@ -773,35 +773,15 @@ ath( -os.path.join(dirname, '..') +dirname )%0A%0A @@ -935,16 +935,59 @@ ile.%22)%0A%0A + sessdir = os.environ%5B'SESSIONDIR'%5D%0A @@ -1133,51 +1133,351 @@ ile%0A -%0A sessdir = os.environ%5B'SESSIONDIR'%5D + else:%0A self.invoke_file = os.path.join(...
89057827a1d301715f9275dafb6a3936c8fa170d
Fix breadcrumb path
interface/views.py
interface/views.py
import hashlib import hmac import json import re from django.conf import settings from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.core.urlresolvers import reverse from django.db.models import Count fr...
Python
0.999749
@@ -3477,32 +3477,33 @@ url = '%7B0%7D +/ %7B1%7D/'.format(con
c06ceb1c3f06bb08e9adb84d82d33325e54ec507
Update accordion.py
cmsplugin_cascade/bootstrap4/accordion.py
cmsplugin_cascade/bootstrap4/accordion.py
from django.forms import widgets, BooleanField, CharField from django.forms.fields import IntegerField from django.utils.translation import ungettext_lazy, ugettext_lazy as _ from django.utils.text import Truncator, mark_safe from django.utils.html import escape from entangled.forms import EntangledModelFormMixin from ...
Python
0.000001
@@ -1,24 +1,25 @@ +%0A from django.forms import @@ -184,47 +184,192 @@ ango -.utils.text import Truncator, mark_safe + import VERSION as DJANGO_VERSION%0Aif DJANGO_VERSION %3C (2, 0):%0A from django.utils.text import Truncator, mark_safe%0Aelse:%0A from django.utils.safestring import Truncator, mark_safe %0Af...
eaf390b065944a64a3b74c1b0e43b1df60d4e88f
Reimplement deduping hurr
invoke/executor.py
invoke/executor.py
class Executor(object): """ An execution strategy for Task objects. Subclasses may override various extension points to change, add or remove behavior. """ def __init__(self, collection): """ Create executor with a pointer to the task collection ``collection``. This poi...
Python
0.000001
@@ -975,16 +975,69 @@ # + Dedupe if requested%0A if dedupe:%0A # Compact @@ -1079,32 +1079,36 @@ st+set)%0A + compact_tasks = @@ -1110,32 +1110,36 @@ ks = %5B%5D%0A + + for task in all_ @@ -1137,32 +1137,36 @@ k in all_tasks:%0A + if t @@ -1199,...
375d12ab7486f6bb0d57232d48c556e6c0eda0c1
Update P05_stylingExcel fixed PEP8 spacing
books/AutomateTheBoringStuffWithPython/Chapter12/P05_stylingExcel.py
books/AutomateTheBoringStuffWithPython/Chapter12/P05_stylingExcel.py
# This program uses the OpenPyXL module to manipulate Excel documents import openpyxl from openpyxl.styles import Font, NamedStyle wb = openpyxl.Workbook() sheet = wb["Sheet"] # Setting the Font Style of Cells italic24Font = NamedStyle(name="italic24Font") italic24Font.font = Font(size=24, italic=True) sheet["A1"].s...
Python
0
@@ -2415,16 +2415,17 @@ h = 300 + # set th
17793c9b3ceecc206aab1d1c34c0d3dc69892cbd
Use ArgumentParser to enforce required arguments
monitor/runner.py
monitor/runner.py
import sys from time import sleep from camera import Camera from controller import Controller from plotter_pygame import PyGamePlotter import epics import argparse if __name__ == "__main__": parser = argparse.ArgumentParser(description='') parser.add_argument('--prefix', dest='prefix', help='controller IOC pr...
Python
0
@@ -158,16 +158,17 @@ gparse%0A%0A +%0A if __nam @@ -186,17 +186,16 @@ ain__%22:%0A -%0A pars @@ -274,16 +274,31 @@ prefix', + required=True, dest='p @@ -368,16 +368,31 @@ --name', + required=True, dest='n @@ -582,128 +582,8 @@ ()%0A%0A - if not (args.prefix and args.name):%0A parser.error(%22A...
81a4b04173033d7e678ad6c4b4efae654af9ac11
Use a threading local object to isolate MongoDB connection between different threads but reuse the same connection in the same thread
moocng/mongodb.py
moocng/mongodb.py
# Copyright 2013 Rooter Analysis S.L. # # 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 w...
Python
0.000001
@@ -592,16 +592,44 @@ urlparse +%0Afrom threading import local %0A%0Afrom d @@ -1987,16 +1987,40 @@ tion%5D%0A%0A%0A +connections = local()%0A%0A%0A def get_ @@ -2183,27 +2183,122 @@ -return MongoDB(db_uri) +if not hasattr(connections, 'default'):%0A connections.default = MongoDB(db_uri)%0A%0A retur...
aa9143302b376e1274c8c11b53687771d0444b5a
Remove now-unused isInt code
morss/__main__.py
morss/__main__.py
# ran on `python -m morss` import os import sys from . import wsgi from . import cli from .morss import MorssException import wsgiref.simple_server import wsgiref.handlers PORT = int(os.getenv('PORT', 8080)) def isInt(string): try: int(string) return True except ValueError: retu...
Python
0.000444
@@ -213,123 +213,8 @@ )%0A%0A%0A -def isInt(string):%0A try:%0A int(string)%0A return True%0A%0A except ValueError:%0A return False%0A%0A%0A def
f021922dec168a4bb97516eb6b7a7ca5fe3bfb96
Use HostAddressOpt for opts that accept IP and hostnames
ironic/conf/api.py
ironic/conf/api.py
# Copyright 2016 Intel Corporation # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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:...
Python
0.000094
@@ -761,27 +761,35 @@ = %5B%0A cfg. -Str +HostAddress Opt('host_ip @@ -787,24 +787,32 @@ ('host_ip',%0A + @@ -840,32 +840,40 @@ %0A + help=_('The IP a @@ -879,16 +879,28 @@ address +or hostname on which @@ -903,32 +903,65 @@ hich ironic-api +'%0A ...
2159e6c2b550367d456e3d743b7757c59636a3c7
update dictionary on ramiro's desktop to use starmon data
pycqed/init/config/setup_dict.py
pycqed/init/config/setup_dict.py
# Dictionaries used in setup. mac_dict = {'203178706891063': 'CDickel_Desktop', '203308017140376': 'Adriaans_Macbook', '963460802314': 'La_Ferrari', '46390847648': 'La_Maserati', '215977245841658': 'La_Maserati_JrJr', '13795386264098': 'Serwans_Laptop', ...
Python
0
@@ -2044,16 +2044,18 @@ + # 'Ramiro @@ -2083,32 +2083,121 @@ 0.82.81%5C%5Cdata',%0A + 'Ramiro_Desktop': r'%5C%5C131.180.82.190%5C%5CExperiments%5C%5C1611_Starmon%5C%5CData',%0A
3927fd757ff404af61e609cc1728d1f3fe398230
Fix on error text.
mp3datastorage.py
mp3datastorage.py
#store file attributes component import sqlite3 as sql import os import mp3metadata #TODO add directory of the database #Allow database recognition and resetting the database class SQLmgr: def __init__(self, username): #note everytime function is called MusicData table is dropped! self.serv = False self.errors...
Python
0
@@ -1472,24 +1472,29 @@ rror, e:%0A%09%09%09 +self. errors.write @@ -1757,16 +1757,21 @@ ept:%0A%09%09%09 +self. errors.w
73529579a6abaf1b33e6135d4abaa2c892dbfa3c
exit with retcode when called directly
kcheck/command.py
kcheck/command.py
#!/usr/bin/env python3 """ Entry point for utility, option handling. """ def main() -> int: """ Entry point for command line utility. :return: integer for return code of command line """ import configargparse import importlib import logging import platform from configparser imp...
Python
0
@@ -3676,15 +3676,21 @@ _':%0A +exit( main() +) %0A
2d92e69d00a7419a23bcb38ab7c55ccc533237df
Fix artwork size
itunescli/query.py
itunescli/query.py
import logging from cliff.command import Command from cliff.lister import Lister from cliff.show import ShowOne import itunes class ITunesSearchBase(object): MEDIA_TYPES = frozenset([ 'movie', 'podcast', 'music', 'musicVideo', 'audiobook', 'shortFilm', 't...
Python
0.000001
@@ -882,13 +882,13 @@ , '. -400x4 +300x3 00-7
e1e25bc1166efa9a39fdf769f1081fafd08dd937
handle unknown source country, add recovered
pyfibot/modules/module_korona.py
pyfibot/modules/module_korona.py
# -*- coding: utf-8 -*- """ Koronavirus statistics from HS.fi open data https://github.com/HS-Datadesk/koronavirus-avoindata """ from __future__ import unicode_literals, print_function, division from collections import Counter def init(bot): global lang config = bot.config.get("module_posti", {}) lang = ...
Python
0
@@ -851,16 +851,31 @@ olleita: + %25s Parantunut: %25s%22 %25 ( @@ -917,16 +917,40 @@ eaths'%5D) +, len(data%5B'recovered'%5D) )%0A%0A # @@ -1158,16 +1158,73 @@ n top5:%0A + if country == None:%0A country = %22N/A%22%0A%0A
7427adb86b23ece7d7b577754c771e1b31429eab
return to default queue if deleting current queue
ztf_sim/Scheduler.py
ztf_sim/Scheduler.py
from builtins import object import configparser import numpy as np from astropy.time import Time from .QueueManager import ListQueueManager, GreedyQueueManager, GurobiQueueManager from .ObsLogger import ObsLogger from .configuration import SchedulerConfiguration from .constants import BASE_DIR from .utils import block...
Python
0.000001
@@ -1844,32 +1844,122 @@ n self.queues):%0A + if self.Q.queue_name == queue_name:%0A self.set_queue('default')%0A del
ea07c07604232e59d238ea8f6b1605bad1124b8c
add kwargs to __init__ of CSVData
pylearn2/datasets/csv_dataset.py
pylearn2/datasets/csv_dataset.py
# -*- coding: utf-8 -*- """ A simple general csv dataset wrapper for pylearn2. Can do automatic one-hot encoding based on labels present in a file. """ __authors__ = "Zygmunt Zając" __copyright__ = "Copyright 2013, Zygmunt Zając" __credits__ = ["Zygmunt Zając", "Nicholas Dronen"] __license__ = "3-clause BSD" __maintain...
Python
0.000057
@@ -2046,16 +2046,43 @@ ion=None +,%0A **kwargs ):%0A @@ -3972,16 +3972,26 @@ X=X, y=y +, **kwargs )%0A @@ -4120,16 +4120,26 @@ x(y) + 1 +, **kwargs )%0A%0A d
13f26d9007629be019140aa3bedd5f6fbfefe69b
delete all() method when apply document filter
jellyblog/views.py
jellyblog/views.py
# -*- coding: utf-8 -*- from django.shortcuts import render, get_object_or_404 from django.core.paginator import Paginator from .models import Category, Document from htmlmin.decorators import minified_response from .util import get_page_number_range, get_documents, \ categoryList def home(request): Category....
Python
0.000001
@@ -526,38 +526,32 @@ ocument.objects. -all(). filter(public_do
deaee894589a2247b9322ba5cdb94e4c127c35bd
correct docstring for KeyringLocked class
keyring/errors.py
keyring/errors.py
import sys __metaclass__ = type class KeyringError(Exception): """Base class for exceptions in keyring """ class PasswordSetError(KeyringError): """Raised when the password can't be set. """ class PasswordDeleteError(KeyringError): """Raised when the password can't be deleted. """ clas...
Python
0
@@ -476,32 +476,24 @@ ing -could not be initialised +failed unlocking %0A
15f45377dffa2e267464b38f5f87ffe9526fa8f6
Update support to jax (#585)
tensorboardX/x2num.py
tensorboardX/x2num.py
# DO NOT alter/distruct/free input object ! from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import numpy as np import six def check_nan(array): tmp = np.sum(array) if np.isnan(tmp) or np.isinf(tmp): logging.warning('NaN or In...
Python
0
@@ -922,24 +922,92 @@ e_mxnet(x))%0A + if 'jax' in str(type(x)):%0A return check_nan(np.array(x))%0A raise No
4e280094687d8c369a1eee3c8b7bb246549898eb
Update utils.py
backend/utils.py
backend/utils.py
from rest_framework.views import exception_handler from rest_framework.exceptions import APIException, AuthenticationFailed checks = ['Username not found', 'Username already exists', 'Authentication failed'] def custom_exception_handler(exc): """ Exception handler called by all raised exceptions during HTTP r...
Python
0.000001
@@ -463,16 +463,17 @@ s' %25exc%0A +%0A if n
cd4e7c5bc10c8e946ddf31d99a249a5a97b2dfda
Update get-observations.py
python-files/get-observations.py
python-files/get-observations.py
#!/usr/bin/env python3 """ Utility to get observations from a SatNOGS Network server. Collects the paginated objects into a single JSON list and stores in a file. """ import json import requests OBSERVATIONS_API = 'https://network.satnogs.org/api/observations' OBSERVATIONS_JSON = 'observations.json' def get(url)...
Python
0
@@ -364,119 +364,729 @@ l)%0A%0A -observations = %5B%5D%0Ar = get(OBSERVATIONS_API)%0A# r = requests.get(OBSERVATIONS_API)%0A%0Aobservations.extend(r.json()) +%0Atry:%0A with open(OBSERVATIONS_JSON) as f:%0A data = json.load(f)%0A # json.dump() coerces to string keys%0A # convert keys back to i...
1b18e4a777b387af072afec4d3df4d3b71b4042b
version bump to 0.1.1
nflcmd/version.py
nflcmd/version.py
__version__ = '0.1.0' __pdoc__ = { '__version__': "The version of the installed nflcmd module.", }
Python
0.000001
@@ -12,17 +12,17 @@ = '0.1. -0 +1 '%0A%0A__pdo
bf349b5f41e3b7edb4efbe279f79ded856320388
Fix typo
python/xchainer/testing/array.py
python/xchainer/testing/array.py
import numpy.testing import xchainer # NumPy-like assertion functions that accept both NumPy and xChainer arrays def _check_xchainer_array(x): # Checks basic conditions that are assumed to hold true for any given xChainer array passed to assert_array_close and # assert_array_equal. assert isinstance(x, ...
Python
0.999999
@@ -470,20 +470,18 @@ t conver +t s - an xChaine @@ -487,22 +487,21 @@ er array +s to -a NumPy ar @@ -503,16 +503,17 @@ Py array +s .%0A
d52bbb41ee6d5760e94b5414b74750cc6c308e0a
Fix cache middleware key prefix
opps/core/middleware.py
opps/core/middleware.py
# -*- coding: utf-8 -*- import re from django.contrib.sites.models import Site from django.contrib.sites.models import get_current_site from django.http import HttpResponseRedirect from django.conf import settings from opps.channels.models import Channel class URLMiddleware(object): def process_request(self, req...
Python
0.00001
@@ -2023,17 +2023,17 @@ pps_site -: +- %7B%7D%22.form
f238a7d227036510b91ea4a7e1e9178ea60b3997
Update imagecodecs/__main__.py
imagecodecs/__main__.py
imagecodecs/__main__.py
# -*- coding: utf-8 -*- # imagecodecs/__main__.py """Imagecodecs package command line script.""" import sys from matplotlib.pyplot import show from tifffile import imshow import imagecodecs def askopenfilename(**kwargs): """Return file name(s) from Tkinter's file open dialog.""" try: from Tkinter...
Python
0.000005
@@ -1423,32 +1423,106 @@ cs.webp_decode,%0A + imagecodecs.zfp_decode,%0A imagecodecs.numpy_decode,%0A %5D%0A%0A m
2af301cf69cb0a9c3c22d57f290f4962868f7d05
Add liwc entities to ElasticSearch index
folia2es.py
folia2es.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to put a folia xml file in ElasticSearch. """ import os import argparse import time from elasticsearch import Elasticsearch from lxml import etree from bs4 import BeautifulSoup from emotools.plays import extract_character_name, xml_id2play_id from emotools.bs4_hel...
Python
0
@@ -133,16 +133,46 @@ rt time%0A +from datetime import datetime%0A from ela @@ -203,16 +203,16 @@ csearch%0A - from lxm @@ -369,16 +369,24 @@ ce, note +, entity %0A%0A%0Adef c @@ -2641,16 +2641,926 @@ doc)%0A%0A%0A +def entities2es(event_xml, entity_class, timestamp, es, index_name, doc_type):%0A events = ev...
d73804341f19f577ee68a45e38234e9097b827aa
Improve summary
joblib/__init__.py
joblib/__init__.py
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be fast an...
Python
0
@@ -310,23 +310,31 @@ be +** fast +** and +** robust +** in @@ -433,277 +433,445 @@ s.%0A%0A -____%0A%0A* The latest user documentation for %60joblib%60 can be found on%0A http://packages.python.org/joblib/%0A%0A* The latest packages can be downloaded from%0A http://pypi.python.org/pypi/joblib%0A%0A* Inst...
43e8b090d806d615a8153d1e14063cc6d274bb25
Update issue 130 Now I also applied the fix :)
rdflib/plugins/serializers/nt.py
rdflib/plugins/serializers/nt.py
""" N-Triples RDF graph serializer for RDFLib. See <http://www.w3.org/TR/rdf-testcases/#ntriples> for details about the format. """ from rdflib.serializer import Serializer import warnings class NTSerializer(Serializer): """ Serializes RDF graphs to NTriples format. """ def serialize(self, stream, ba...
Python
0
@@ -1563,17 +1563,68 @@ rd(char) -) + if ord(char) %3C= 0xFFFF else '%5CU%2508X' %25 ord(char)) %0A %0A ret
e22a222865f19099e73b1294000adb4dd624d9fe
Use is_callable_object function from kyoto.utils module
kyoto/dispatch.py
kyoto/dispatch.py
import types import gevent import traceback import termformat import kyoto import kyoto.conf import kyoto.utils.modules import kyoto.utils.validation try: # Python 2.x from itertools import izip except ImportError: # Python 3.x izip = zip class Dispatcher(object): __slots__ = ("address", "handl...
Python
0.000004
@@ -3834,169 +3834,55 @@ and -isinstance(function, (types.FunctionType, types.MethodType,%0A types.BuiltinFunctionType, types.BuiltinMethodType) +kyoto.utils.modules.is_callable_object(function ):%0A
318457d727eece813cc1dd0b5037b6df89734ec5
Use Domain objects for CNAME symlinking
readthedocs/projects/symlinks.py
readthedocs/projects/symlinks.py
import os import logging from django.conf import settings import redis from readthedocs.core.utils import run_on_app_servers from readthedocs.projects.constants import LOG_TEMPLATE from readthedocs.restapi.client import api log = logging.getLogger(__name__) def symlink_cnames(version): """ OLD Link fro...
Python
0
@@ -176,16 +176,63 @@ EMPLATE%0A +from readthedocs.projects.models import Domain%0A from rea @@ -266,16 +266,16 @@ ort api%0A - %0Alog = l @@ -573,365 +573,102 @@ -try:%0A redis_conn = redis.Redis(**settings.REDIS)%0A cnames = redis_conn.smembers('rtd_slug:v1:%25s' %25 version.project.slug)%0A ...
0035200543a7b226a095d2fb4ec880e0dd8732fd
Rearrange test data
make_test_data.py
make_test_data.py
import sqlite3 INSERT_SONG = ''' INSERT INTO jukebox_song_queue VALUES (?) ''' TEST_URIS = [ 'spotify:track:7udJ4LFSIrRnySD3eI8lad', 'spotify:track:0p1VSXFdkr71f0nO21IEyq', 'spotify:track:68MToCqJRJvNW8tYoxDl5p' ] if __name__ == '__main__': conn = sqlite3.connect('jukebox.db') cursor = conn.c...
Python
0.000026
@@ -112,33 +112,32 @@ ack: -7udJ4LFSIrRnySD3eI8lad +68MToCqJRJvNW8tYoxDl5p ', - %0A @@ -196,38 +196,38 @@ y:track: -68MToCqJRJvNW8tYoxDl5p +7udJ4LFSIrRnySD3eI8lad '%0A%5D%0A%0A%0Aif
95ea1d7d6564bcbb2e3b8d2ba254ccd2c1c38436
Add import for focused stuff
mamba/__init__.py
mamba/__init__.py
__version__ = '0.9.2' def description(message): pass def _description(message): pass def it(message): pass def _it(message): pass def context(message): pass def _context(message): pass def before(): pass def after(): pass
Python
0
@@ -88,24 +88,62 @@ %0A pass%0A%0A%0A +def fdescription(message):%0A pass%0A%0A%0A def it(messa @@ -183,24 +183,53 @@ %0A pass%0A%0A%0A +def fit(message):%0A pass%0A%0A%0A def context( @@ -279,24 +279,58 @@ %0A pass%0A%0A%0A +def fcontext(message):%0A pass%0A%0A%0A def before()
b98429f96e228eab675a97cd5f15f473360a7155
fix typo
parsers/pywwa/common.py
parsers/pywwa/common.py
"""Support lib for the parser scripts found in this directory""" import os import inspect import logging import pwd import datetime from io import StringIO import socket import sys import traceback from email.mime.text import MIMEText from syslog import LOG_LOCAL2 # 3rd party from twisted.python import log as tplog fr...
Python
0.999991
@@ -4918,16 +4918,17 @@ %22.join(%5B +f %22%7Ba:.2f%7D
d3b3e9af722ac00b21bf36706f4e0ab7cf94af00
bump to v0.6.4
mando/__init__.py
mando/__init__.py
__version__ = '0.5' try: from mando.core import Program except ImportError as e: # pragma: no cover # unfortunately the only workaround for Python2.6, argparse and setup.py e.version = __version__ raise e main = Program() command = main.command arg = main.arg parse = main.parse execute = main.execute...
Python
0
@@ -14,9 +14,11 @@ '0. -5 +6.4 '%0A%0At
59400100aa2f35bfea52b3cf049ef8d0f958527d
Fix error when reaching a dead end in the markov chain
markov/markov2.py
markov/markov2.py
#!python3 import string import random import time import sys ''' This is an implementation of a markov chain used for text generation. Just pass a file name as an argument and it should load it up, build a markov chain with a state for each word(s), and start walking through the chain, writing incoherent text to the...
Python
0.000006
@@ -1288,24 +1288,147 @@ def -transition(word, +walk(transmap, prev=None):%0A if prev == None:%0A prev = random.choice(list(transmap.keys()))%0A%0A while True:%0A if not prev in tra @@ -1436,50 +1436,161 @@ smap -) :%0A -return random.choice(transmap%5Bword%5D + prev = random.choice...
7ccb52897e82629e4bbb0298dba4de76bc6a63db
Add a deprecation warning
pathvalidate/_symbol.py
pathvalidate/_symbol.py
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import re from typing import Sequence from ._common import ascii_symbols, preprocess, unprintable_ascii_chars from .error import InvalidCharError __RE_UNPRINTABLE = re.compile( "[{}]".format(re.escape("".join(unprintable_ascii_chars))), re....
Python
0.001163
@@ -76,16 +76,32 @@ port re%0A +import warnings%0A from typ @@ -759,36 +759,137 @@ -%3E str:%0A -# deprecated +warnings.warn(%0A %22'replace_unprintable' has moved to 'replace_unprintable_char'%22, DeprecationWarning%0A )%0A %0A try:%0A
12dac769152ebd074ed2b415d3980729bdbe3e46
Make nonexistent warning more obvious
regparser/commands/compare_to.py
regparser/commands/compare_to.py
import json import os import click from json_delta import udiff import requests import requests_cache def local_and_remote_generator(api_base, paths): """Find all local files in `paths` and pair them with the appropriate remote file (prefixing with api_base). As the local files could be at any position i...
Python
0
@@ -5,16 +5,31 @@ rt json%0A +import logging%0A import o @@ -1579,26 +1579,28 @@ -click.echo +logging.warn (%22Nonexi @@ -1610,11 +1610,12 @@ nt: -%22 + +%25s%22, rem
cfb09353b02dd230546775d18dadb1ba7ed2acc6
Refactor submit_comment tests
regulations/tests/tasks_tests.py
regulations/tests/tasks_tests.py
import json import mock import six from celery.exceptions import Retry, MaxRetriesExceededError from requests.exceptions import RequestException from django.test import SimpleTestCase, override_settings from regulations.tasks import submit_comment @mock.patch('regulations.tasks.save_failed_submission') @mock.patch(...
Python
0
@@ -724,16 +724,292 @@ Case):%0A%0A + def setUp(self):%0A self.file_handle = six.BytesIO(%22some-content%22)%0A self.submission = %7B'assembled_comment': %5B%0A %7B%22id%22: %22A1%22, %22comment%22: %22A simple comment%22, %22files%22: %5B%5D%7D,%0A %7B%22id%22: %22A5%22, %22comm...
29e491c5505d2068b46eb489044455968e53ab70
Add tests for strait and fjord
test/400-bay-water.py
test/400-bay-water.py
assert_has_feature( 14, 2623, 6318, 'water', { 'kind': 'bay', 'label_placement': 'yes' })
Python
0.000007
@@ -1,8 +1,47 @@ +# osm_id: 43950409 name: San Pablo Bay%0A assert_h @@ -130,8 +130,290 @@ yes' %7D)%0A +%0A# osm_id: 360566115 name: Byron strait%0Aassert_has_feature(%0A 14, 15043, 8311, 'water',%0A %7B 'kind': 'strait', 'label_placement': 'yes' %7D)%0A%0A# osm_id: -1451065 name: Horsens Fjord%0Aassert_has_fe...
83781f3b2f1cde0aab913ff4d64de45cf9b798be
Update snooper for multi-spline qp controller inputs
software/control/src/qp_controller_input_snooper.py
software/control/src/qp_controller_input_snooper.py
#!/usr/bin/python ''' Listens to QP Controller Inputs and draws, in different but order-consistent colors, the cubic splines being followed by each body motion block. ''' import lcm import drc from drake import lcmt_qp_controller_input, lcmt_body_motion_data import sys import time from bot_lcmgl import lcmgl, GL_LINE...
Python
0
@@ -902,16 +902,128 @@ bmd.ts;%0A + color = color_order%5Bi%25len(color_order)%5D;%0A for j in range(0, msg.body_motion_data%5Bi%5D.num_spline_coefs):%0A tsde @@ -1047,16 +1047,17 @@ (ts%5B -0 +j %5D, ts%5B -- +j+ 1%5D, @@ -1061,16 +1061,18 @@ %5D, 20);%0A + coef @@ -1097,56 +1097,22 @@ oefs ...
cdf545cf9385a0490590cd0162141025a1301c09
Use argparse formatter RawDescriptionHelpFormatter, maybe temporarily
track/config.py
track/config.py
import configargparse DEFAULT_CONFIG_FILES=[ './track.cfg', '~/.track.cfg', ] # Bit of a cheat... not actually an object constructor, just a 'make me an object' method def ArgParser(): return configargparse.ArgParser( ignore_unknown_config_file_keys =True, allow_abbrev ...
Python
0
@@ -384,16 +384,17 @@ _FILES,%0A +# @@ -472,16 +472,101 @@ matter,%0A + formatter_class =configargparse.RawDescriptionHelpFormatter,%0A
148d4c44a9eb63016b469c6bf317a3dbe9ed7918
Add documentation for Permutations class
permuta/permutations.py
permuta/permutations.py
from .misc import DancingLinks from .permutation import Permutation import random class Permutations(object): def __init__(self, n): assert 0 <= n self.n = n def __iter__(self): left = DancingLinks(range(1, self.n+1)) res = [] def gen(): if len(left) == 0: ...
Python
0
@@ -76,16 +76,17 @@ random%0A%0A +%0A class Pe @@ -113,97 +113,305 @@ -def __init__(self, n):%0A assert 0 %3C= n%0A self.n = n%0A%0A def __iter__(self):%0A +%22%22%22Class for iterating through all Permutations of length n%22%22%22%0A%0A def __init__(self, n):%0A %22%22%22Returns an o...
f2e14108374d0b6afe67cd6c310804144016af5e
Fix numba.test() after rebase
numba/__init__.py
numba/__init__.py
# Import all special functions before registering the Numba module # type inferer from ._version import get_versions __version__ = get_versions()['version'] del get_versions from numba.special import * import os import sys import logging from numba import typesystem def get_include(): numba_root = os.path.dir...
Python
0.000022
@@ -2036,61 +2036,8 @@ %22%5D%0A%0A -def split_path(path):%0A return path.split(os.sep)%0A%0A def @@ -4243,16 +4243,139 @@ %22-%22 * 80 +%0A%0A run += 1%0A res = call(%5Bsys.executable, '-m', qname + modname%5D)%0A if res != 0: %0A
8b9f68514d78851f3b445f996f3eaf607831d352
Add more descriptive names to variables and functions
raspisump/checkpid.py
raspisump/checkpid.py
#!/usr/bin/python # Check to make sure process raspi-sump is running and restart if required. import subprocess import time def check_pid(): '''Check status of raspisump.py process.''' cmdp1 = "ps aux" cmdp2 = "grep -v grep" cmdp3 = "grep -v sudo" cmdp4 = "grep -c /home/pi/raspi-sump/raspisump.py"...
Python
0.000001
@@ -839,17 +839,35 @@ e()%0A -x +number_of_processes = int(p @@ -896,17 +896,35 @@ %0A if -x +number_of_processes == 0:%0A @@ -934,21 +934,24 @@ log_ -check +restarts (%22Proces @@ -1003,17 +1003,35 @@ elif -x +number_of_processes == 1:%0A @@ -1067,21 +1067,24 @@ log_ -check +restarts ...
51373b776403b94cf0b72b43952013f3b4ecdb2d
Remove useless codes
holosocket/encrypt.py
holosocket/encrypt.py
import struct from Cryptodome.Cipher import AES from Cryptodome.Hash import SHA256 from Cryptodome.Random import get_random_bytes #Cipher_Tag = {'aes-256-gcm': 16} #Nonce_Len = 8 # fuck you 12 bytes class aes_gcm: def __init__(self, key, salt=None): """Create a new AES-GCM cipher. key: Your pas...
Python
0.000221
@@ -128,79 +128,8 @@ es%0A%0A -#Cipher_Tag = %7B'aes-256-gcm': 16%7D%0A#Nonce_Len = 8 # fuck you 12 bytes%0A%0A %0Acla @@ -1191,38 +1191,8 @@ w()%0A - #Return (cpiher, MAC)%0A @@ -1371,16 +1371,17 @@ # + Verify M
9e450865a92e21ba1a40c494575b0205ed2c14fa
Fix bug in CommentSecureRedirectToMixin
pinax/comments/views.py
pinax/comments/views.py
from django.contrib.auth.decorators import login_required from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ImproperlyConfigured from django.http import JsonResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.template import RequestContex...
Python
0
@@ -1094,19 +1094,27 @@ -url +redirect_to = objec @@ -1200,19 +1200,27 @@ -url +redirect_to = self.
53d34397a8df598378820a9115a94097a1e92bce
use val as the value for the update
repository/netrepos/instances.py
repository/netrepos/instances.py
# # Copyright (c) 2004 Specifix, Inc. # All rights reserved # import idtable import sqlite class InstanceTable: """ Generic table for assigning id's to a 3-tuple of IDs. """ def __init__(self, db): self.db = db cu = self.db.cursor() cu.execute("SELECT tbl_name FROM sql...
Python
0
@@ -1963,17 +1963,18 @@ Present= -0 +%25d WHERE i @@ -1990,21 +1990,42 @@ =%25d%22 - %0A%09%09%09%25 +,%0A (val, theId) +) %0A%0A
6288caa954c8834ef6fec0bf24c62a1c8265e302
Use InstanceProfileName value to remove
pipes/iam/create_iam.py
pipes/iam/create_iam.py
"""Create IAM Instance Profiles, Roles, Users, and Groups.""" import logging import boto3 from boto3.exceptions import botocore from .utils import get_details, get_template LOG = logging.getLogger(__name__) def create_iam_resources(env='dev', app=''): """Create the IAM Resources for the application. Args:...
Python
0
@@ -2771,16 +2771,39 @@ _profile +%5B'InstanceProfileName'%5D ,%0A
069ef4868e1015dda609c0747b988ec99e461f92
Tweak Badge PDF
registration/admin.py
registration/admin.py
from registration.models import School, Teacher, Participant, Team from django.contrib import admin from reportlab.pdfgen import canvas from django.http import HttpResponse from django.contrib.admin.views.decorators import staff_member_required from reportlab.lib.pagesizes import letter from reportlab.lib.units import ...
Python
0
@@ -340,16 +340,59 @@ rt ceil%0A +from scoring.models import PreRegistration%0A import t @@ -836,26 +836,16 @@ elds = ( -'teacher', 'name', @@ -3421,16 +3421,199 @@ m_id'%5D)%0A + for event_team in PreRegistration.objects.filter(teams__name=team%5B'team_name'%5D):%0A team_string ...
f21204c8828e840dc54c6822348fa9a47bc8964e
Add model's to_dict method.
opensrs/models.py
opensrs/models.py
from dateutil.parser import parse class Domain(object): def __init__(self, data): self.name = data['name'] self.auto_renew = (data['f_auto_renew'] == 'Y') self.expiry_date = parse(data['expiredate']).date() @property def tld(self): return self.name.split('.')[-1]
Python
0
@@ -304,8 +304,177 @@ .')%5B-1%5D%0A +%0A def to_dict(self):%0A return %7B%0A 'name': self.name,%0A 'auto_renew': self.auto_renew,%0A 'expiry_date': self.expiry_date%0A %7D%0A
fa82883576a659d9cd9d830919e744299ac14ac7
improve show command to show target types, build phase types and filter other build phases.
pbxproj/pbxcli/pbxproj_show.py
pbxproj/pbxcli/pbxproj_show.py
""" usage: pbxproj show [options] <project> pbxproj show [options] (--target <target>...) <project> [(-s | --source-files) | (-H | --header-files) | (-r | --resource-files) | (-f | --framework-files)] positional arguments: <project> Project path to the .xcodeproj folder. generic optio...
Python
0
@@ -129,82 +129,369 @@ s) %7C - (-H %7C --header-files) %7C (-r %7C --resource-files) %7C (-f %7C --framework-files +%0A (-H %7C --header-files) %7C%0A (-r %7C --resource-files) %7C%0A ...
93c0deffe1d8edc9a3508a623a4f412261127702
Remove new internal field.
pdcupdater/handlers/compose.py
pdcupdater/handlers/compose.py
# -*- coding: utf-8 -*- import copy import logging import requests import pdcupdater.handlers import pdcupdater.services import pdcupdater.utils log = logging.getLogger(__name__) session = requests.Session() # These are the states of a pungi4 compose that we care about. # There are other states that we don't care ...
Python
0
@@ -5063,16 +5063,163 @@ , 'ga')%0A +%0A # PDC doesn't know about this field which showed up recently in pungi%0A # productmd metadata here.%0A release.pop('internal')%0A%0A
da12bb0058cb48d3262eb70469aa30cdb8312ee2
fix typos/bugs/indexing in block dicing
Control/dice_block.py
Control/dice_block.py
import os import sys import subprocess import h5py def check_file(filename): # verify the file has the expected data f = h5py.File(filename, 'r') if set(f.keys()) != set(['segmentations', 'probabilities']): os.unlink(filename) return False return True try: args = sys.argv[1:] i...
Python
0.000017
@@ -325,32 +325,33 @@ = int(args.pop( +0 ))%0A j_min = i @@ -358,24 +358,25 @@ nt(args.pop( +0 ))%0A i_max @@ -387,24 +387,25 @@ nt(args.pop( +0 ))%0A j_max @@ -420,16 +420,17 @@ rgs.pop( +0 ))%0A o @@ -446,16 +446,17 @@ rgs.pop( +0 )%0A in @@ -500,61 +500,37 @@ sts( -segmentations_file):%0A ...
2443c891e5f9cccb5c36b02303a3b9b7a94a4c45
Change Jinja escape sequences.
generate.py
generate.py
#!/usr/bin/env python3 import os import shutil from jinja2 import Environment,FileSystemLoader from pygments import highlight from pygments.lexers import TexLexer from pygments.formatters import HtmlFormatter from subprocess import Popen,PIPE env = Environment(loader=FileSystemLoader("tmpl")) snippets_dir = "snippe...
Python
0
@@ -288,16 +288,123 @@ (%22tmpl%22) +,%0A block_start_string='~%7B',block_end_string='%7D~',%0A variable_start_string='~%7B%7B', variable_end_string='%7D%7D~' )%0A%0Asnipp
18aa5e20a5dbc931f48774c4bf034e6efe022923
Implement 'force' and 'directory' options
generate.py
generate.py
#!/usr/bin/env python import sys import os import re from optparse import OptionParser from crontab import CronTab from jinja2 import FileSystemLoader, Environment from yaml import dump def remove_user_from_command(command_with_user): match = re.search(r'\{{0,2}\s?\w+\s?\}{0,2}\s(.*)', command_with_user) re...
Python
0.999999
@@ -1172,16 +1172,152 @@ _name%0A%0A%0A +def render_to_file(filename, template, **kwargs):%0A with open(filename, 'w') as ofile:%0A ofile.write(template.render(kwargs))%0A%0A%0A def main @@ -1464,16 +1464,28 @@ t files%22 +, default='' )%0A pa @@ -2435,75 +2435,333 @@ -with open(task + '.py', 'w'...
6da8bcbf2946b35188e99474b87d2c79856895a1
fix an import
source/jormungandr/jormungandr/scripts/qualifier.py
source/jormungandr/jormungandr/scripts/qualifier.py
# coding=utf-8 from ANSI import term import navitiacommon.response_pb2 as response_pb2 from functools import partial from datetime import datetime, timedelta import logging #compute the duration to get to the transport plus que transfert def get_nontransport_duration(journey): sections = journey.sections curr...
Python
0.004115
@@ -12,30 +12,8 @@ f-8%0A -from ANSI import term%0A impo
54e2359ed2cd75b87dc4a8007df6b252af3a3765
fix typo
HARK/ConsumptionSaving/tests/test_ConsLaborModel.py
HARK/ConsumptionSaving/tests/test_ConsLaborModel.py
from HARK.ConsumptionSaving.ConsLaborModel import ( LaborIntMargConsumerType, init_labor_lifecycle, ) import unittest class test_LaborIntMargConsumerType(unittest.TestCase): def setUp(self): self.model = LaborIntMargConsumerType() self.model_finte_lifecycle = LaborIntMargConsumerType(**ini...
Python
0.999991
@@ -260,32 +260,33 @@ self.model_fin +i te_lifecycle = L @@ -347,32 +347,33 @@ self.model_fin +i te_lifecycle.cyc @@ -459,16 +459,17 @@ odel_fin +i te_lifec