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
c4966e274c885da4e5d252143b9feb260c8f78f5
Correct config path finding for Linux.
pokemon_go_hunter/watch_twitter.py
pokemon_go_hunter/watch_twitter.py
import logging import os import re import time import twitter import yaml from pushbullet import Pushbullet def get_config(): config_path = os.path.join(os.path.abspath(__file__), '../../config.yaml') with open(config_path) as f: return yaml.load(f) def get_twitter_api(config): api_config = con...
Python
0
@@ -161,16 +161,32 @@ os.path. +dirname(os.path. abspath( @@ -198,17 +198,15 @@ e__) +) , '../ -../ conf
8b78463ac8d8953dffb3c3ecd5e9e1e4396da106
Make sure set_mpl_backend works if qtpy is not installed
glue/_mpl_backend.py
glue/_mpl_backend.py
class MatplotlibBackendSetter(object): """ Import hook to make sure the proper Qt backend is set when importing Matplotlib. """ enabled = True def find_module(self, mod_name, pth): if self.enabled and 'matplotlib' in mod_name: self.enabled = False set_mpl_backen...
Python
0
@@ -420,16 +420,176 @@ end():%0A%0A + try:%0A from qtpy import PYQT5%0A except:%0A # If Qt isn't available, we don't have to worry about%0A # setting the backend%0A return%0A%0A from @@ -679,36 +679,8 @@ ()%0A%0A - from qtpy import PYQT5%0A%0A
1bbd84111b142daf9301842f1cb411983fccedef
Comment change.
gnuplot-py/gp_mac.py
gnuplot-py/gp_mac.py
# $Id$ # Copyright (C) 1999 Michael Haggerty <mhagger@alum.mit.edu> # Thanks to Tony Ingraldi and Noboru Yamamoto for their contributions. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eith...
Python
0.000012
@@ -1539,17 +1539,135 @@ screen) -: +.%0A # Terminal types are different in Gnuplot 3.7.1c.%0A # For earlier versions, this was default_term = 'macintosh' %0A def @@ -2255,16 +2255,17 @@ turn 0%0A%0A +%0A class _G
525795adedc79bc77d5c61f238a10255b83078d2
Fix import compatability with Python 3 (Fixes #68)
gpytorch/__init__.py
gpytorch/__init__.py
from .module import Module import models import means import kernels from torch.autograd import Variable from .contexts import fast_pred_var from .lazy import LazyVariable from .functions import AddDiag, DSMM, NormalCDF, LogNormalCDF from .utils import function_factory _inv_matmul_class = function_factory.inv_matmul_...
Python
0
@@ -20,16 +20,23 @@ Module%0A +from . import m @@ -41,16 +41,23 @@ models%0A +from . import m @@ -61,16 +61,23 @@ t means%0A +from . import k
bb6bdc5e929e6647ae772aec18556a3489911dfc
fix to poll.py, in python3 in raspberry, the cmd string to serial must be encode as UTF-8
greenery/bin/poll.py
greenery/bin/poll.py
#!/usr/bin/python3 """ Poll sensors to get temp/humid/soil-moisture etc... The Arduino accepts number-based command codes over the usb serial connection. Like, 002\n = 0=mode(get),0=measurement(temperature),2=address(digital pin 2) 0214\n = 0=mode(get),2=measurement(soil),14=address(analog pin 14, o...
Python
0.000175
@@ -1927,16 +1927,48 @@ dline()%0A + print(line)%0A
247fe732ad71d2db3e664b63636492782a804151
Support old Selenium
capture/capture.py
capture/capture.py
#!/bin/python3 from __future__ import print_function """ Benchmark creator, for Cassius. Uses Selenium Webdriver to download new benchmarks for Cassius. Opens a page in Firefox, causes it to execute get_bench.js, and saves the result. """ from selenium import webdriver import os, sys import warnings try: import...
Python
0
@@ -767,20 +767,32 @@ ons. -set_ +add_argument(%22-- headless (Tru @@ -791,13 +791,9 @@ less -(True +%22 )%0A
0c0fbfacd83a4949b9d6b4411edb5b59dc613d06
clean up __init__ imports
blaze/__init__.py
blaze/__init__.py
from __future__ import absolute_import, division, print_function from pandas import DataFrame from into import into, convert, append, resource, drop from into.backends.csv import CSV from multipledispatch import halt_ordering, restart_ordering halt_ordering() # Turn off multipledispatch ordering from datashape impo...
Python
0.999728
@@ -1017,32 +1017,63 @@ m .sql import *%0A + from .compute.sql import *%0A except ImportErr @@ -1537,20 +1537,13 @@ -import blaze +from .com @@ -1553,16 +1553,25 @@ e.chunks + import * %0Aexcept @@ -1606,16 +1606,24 @@ from +.compute .bcolz i @@ -1681,32 +1681,65 @@ .mongo import *%0A + from ....
eb1fdf3419bdfd1d5920d73a877f707162b783b0
Drop unused and dangerous entrypoint `open_fileindex`
cfgrib/__init__.py
cfgrib/__init__.py
# # Copyright 2017-2021 European Centre for Medium-Range Weather Forecasts (ECMWF). # # 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...
Python
0
@@ -772,22 +772,16 @@ ort -(%0A Dataset, %0A @@ -776,20 +776,16 @@ Dataset, -%0A Dataset @@ -795,20 +795,16 @@ ldError, -%0A open_co @@ -811,20 +811,16 @@ ntainer, -%0A open_fi @@ -826,32 +826,8 @@ ile, -%0A open_fileindex,%0A ope @@ -842,11 +842,8 @@ ndex -,%0A) %0Afro
ad8036e5a21fd29885dc7ebf201e599a0ca79563
add charliecloud 0.9.7 (#10661)
var/spack/repos/builtin/packages/charliecloud/package.py
var/spack/repos/builtin/packages/charliecloud/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Charliecloud(MakefilePackage): """Lightweight user-defined software stacks for HPC.""" ...
Python
0.000001
@@ -439,16 +439,112 @@ ar.gz%22%0A%0A + version('0.9.7', sha256='ec80a4b9bef3a2161a783e11d99cc58e09a32dfbc8a6234c8f7ce7fa76e2f62d')%0A vers
1533101139ad5497519bf2b25a6b0c8329a01535
Fix TypeError when fetching a playlist with a podcast or similar item (#201)
spotify_dl/spotify.py
spotify_dl/spotify.py
import sys from spotify_dl.scaffold import log from spotify_dl.utils import sanitize def fetch_tracks(sp, item_type, url): """ Fetches tracks from the provided URL. :param sp: Spotify client :param item_type: Type of item being requested for: album/playlist/track :param url: URL of the item :...
Python
0
@@ -1075,16 +1075,306 @@ track')%0A + # If the user has a podcast in their playlist, there will be no track%0A # Without this conditional, the program will fail later on when the metadata is fetched%0A if track_info is None:%0A offset += 1%0A ...
a3a19ab3cad0999cc61fdebe9c6fb1ceca873ab6
make it full screen
boothpy/widget.py
boothpy/widget.py
# Copyright 2017 Christian Menard # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distri...
Python
0.000233
@@ -1141,16 +1141,30 @@ ssageBox +, QApplication %0Afrom Py @@ -1945,32 +1945,57 @@ view:', str(e))%0A + self.close()%0A err. @@ -1998,32 +1998,33 @@ err.exec_()%0A +%0A self.clo @@ -2011,33 +2011,118 @@ - self.close()%0A +self.preview = QLabel(self)%0A%0A ...
c7322a1ff37c7f2d4c3dfb149c2e36daafae6043
Bump to version 0.11.3
ckanny/__init__.py
ckanny/__init__.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ ckanny ~~~~~~ Miscellaneous CKAN utility scripts Examples: literal blocks:: python example_google.py Attributes: module_level_variable1 (int): Module level variables may be documented in """ from __future__ import ( absolute_import, divisi...
Python
0
@@ -602,17 +602,17 @@ = '0.11. -2 +3 '%0A__lice
07a74375fabddc9b6fa4de0c345949bfadb54504
Revert silly change
examples/sync_test.py
examples/sync_test.py
""" ============= A-V sync test ============= This example tests synchronization between the screen and the audio playback. """ # Author: Dan McCloy <drmccloy@uw.edu> # # License: BSD (3-clause) print __doc__ import numpy as np from expyfun import ExperimentController rng = np.random.RandomState(0) with Experiment...
Python
0.000002
@@ -487,13 +487,13 @@ _fs= +2 441 -00 +4 , pa
63ec2f241c219f9a5fea33de63b520d8b0da5fd8
Fix initial display update.
classes/display.py
classes/display.py
"""Display Class""" import time class Display: """Display progress of process. Attributes: start_time (float): Seconds since epoch to when progress starts. elapsed_time (float): Seconds since progress started. last_updated (float): Seconds since epoch to when progress was l...
Python
0
@@ -1180,16 +1180,38 @@ if +self.last_updated and current_ @@ -2352,10 +2352,10 @@ ' * -72 +80 , en
d008b0cec67a1428a2761b32f8b9cd7fee6372ed
Fix hardcoded vsdk branch
generator/src/lib/managers.py
generator/src/lib/managers.py
# -*- coding: utf-8 -*- import os import shutil import threading from git import Repo, GitCommandError from printer import Printer class TaskManager(object): """ Multi threading manager """ def __init__(self): """ Initializes a TaskManager """ self.threads = list() def wait_un...
Python
0.000335
@@ -1293,22 +1293,27 @@ ranch = +str( branch +) %0A @@ -1519,13 +1519,19 @@ out( -'3.0' +self.branch )%0A
72e71235d0f5e4851b212e4c7fa583eeddce6252
Fix QueueUtility to read request from view again
src/plone.server/plone/server/async.py
src/plone.server/plone/server/async.py
# -*- coding: utf-8 -*- from datetime import datetime from plone.server.browser import ErrorResponse from plone.server.browser import UnauthorizedResponse from plone.server.browser import View from plone.server import _ from plone.server.transactions import sync from plone.server.transactions import TransactionProxy fr...
Python
0
@@ -1024,16 +1024,21 @@ txn = +view. request. @@ -1068,16 +1068,21 @@ r.begin( +view. request) @@ -1240,32 +1240,37 @@ await sync( +view. request)(txn.abo @@ -1372,32 +1372,37 @@ await sync( +view. request)(txn.abo @@ -1458,32 +1458,37 @@ await sync( +view. request)(txn.com @@ -1552,32 +1552...
85880dbf68718737fa52535326163d9b40adf7f9
Add tags to event serializer
src/sentry/api/serializers/models/event.py
src/sentry/api/serializers/models/event.py
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import Event @register(Event) class EventSerializer(Serializer): def _get_entries(self, event, user): # XXX(dcramer): These are called entries for future-proofing interface_list = [] ...
Python
0
@@ -1497,24 +1497,60 @@ rs%5B'user'%5D,%0A + 'tags': obj.get_tags(),%0A
71636292d089f16485691f242edf74fcbd72ff2b
Enforce PEP8 on readpdf.py
jarviscli/plugins/readpdf.py
jarviscli/plugins/readpdf.py
# importing the modules import PyPDF2 import pyttsx3 from plugin import plugin """ A tool for reading out the pdf files using the jarvis.Uses PyPDF2 and pyttsx3 libraries """ @plugin('readpdf') class readpdfjarvis(): def __init__(self): self.path = None def __call__(self, jarvis, s): ...
Python
0
@@ -77,17 +77,12 @@ in%0A%0A -%0A %22%22%22%0A - A to @@ -169,16 +169,14 @@ ies%0A - %22%22%22%0A +%0A%0A @plu @@ -216,10 +216,8 @@ s(): -%0A%09 %0A%0A @@ -428,17 +428,17 @@ '/' sep -e +a rations: @@ -638,17 +638,19 @@ ge No: %22 -+ + + str(1 +
08451a470fe52525ae7101a2dc4bf0295c04a044
make coastlines gray instead of black
examples/warpimage.py
examples/warpimage.py
import pylab as P from matplotlib.toolkits.basemap import Basemap from matplotlib.numerix import ma from matplotlib.image import pil_to_array from PIL import Image # shows how to warp an image from one map projection to another. # image from http://visibleearth.nasa.gov/ # read in jpeg image to rgba array of normaliz...
Python
0.000006
@@ -928,32 +928,44 @@ es(linewidth=0.5 +,color='0.5' )%0A# draw lat/lon @@ -1031,16 +1031,28 @@ 0,0,0,1%5D +,color='0.5' )%0Am.draw @@ -1097,16 +1097,28 @@ 1,0,0,0%5D +,color='0.5' )%0AP.titl @@ -1289,17 +1289,17 @@ t_0= -5 +4 0,lon_0= -100 @@ -1294,19 +1294,17 @@ 0,lon_0= --10 +4 0,resolu @@ -2005,32 +2005,...
bb7fa507a31901819dbc7712b13c4223fe6d3585
Correct p tags on system message output
src/sentry/templatetags/sentry_activity.py
src/sentry/templatetags/sentry_activity.py
""" sentry.templatetags.sentry_activity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from django import template from django.utils.html import escape, linebreaks from django.utils.safestring import mark_...
Python
0.00002
@@ -1027,16 +1027,36 @@ .type%5D%0A%0A + output = '%3Cp%3E'%0A%0A if i @@ -1139,15 +1139,13 @@ put ++ = '%3C -p%3E%3C stro @@ -1217,16 +1217,17 @@ output ++ = 'The s
736e1f7f4de56a57df3b51058c5b45455e577cf0
Fix flake8
busstops/management/commands/import_areas.py
busstops/management/commands/import_areas.py
""" Import administrative areas from the NPTG. Usage: import_areas < AdminAreas.csv """ from ..import_from_csv import ImportFromCSVCommand from ...models import AdminArea class Command(ImportFromCSVCommand): def handle_row(self, row): AdminArea.objects.update_or_create( id=row['Adminis...
Python
0
@@ -761,27 +761,25 @@ # -There is the legacy +Necessary because of @@ -830,16 +830,8 @@ line - region, %0A @@ -840,21 +840,20 @@ # -%C2%A0but actually + region, but Cum @@ -866,16 +866,17 @@ bus +* services are @@ -875,13 +875,23 @@ ices +* are +actually in t
8a870c6faf8aa50ad7f8c58458c4af9ddef7cfdc
Make authbind check graceful.
braid/authbind.py
braid/authbind.py
import os from fabric.api import sudo, run, abort from braid import package, hasSudoCapabilities def install(): package.install('authbind') def allow(user, port): path = os.path.join('/etc/authbind/byport', str(port)) state = run('stat -c %U:%a {}'.format(path)) if state.strip().split(':') != (use...
Python
0
@@ -43,16 +43,23 @@ n, abort +, quiet %0A%0Afrom b @@ -228,24 +228,69 @@ str(port))%0A + needsUpdate = True%0A with quiet():%0A state = @@ -330,18 +330,33 @@ h))%0A -if + needsUpdate = state.s @@ -376,17 +376,17 @@ ':') != -( +%5B user, '5 @@ -388,17 +388,36 @@ r, '500' -) +%5D%0A i...
ad2087daae138d3897fc47f0713c8955352ed6ae
add SecretBallotUserIdMiddleware
secretballot/middleware.py
secretballot/middleware.py
# -*- coding: utf-8 -*- from hashlib import md5 from django.utils.deprecation import MiddlewareMixin class SecretBallotMiddleware(MiddlewareMixin): def process_request(self, request): request.secretballot_token = self.generate_token(request) def generate_token(self, request): raise NotImpleme...
Python
0.000001
@@ -465,16 +465,295 @@ DDR'%5D%0A%0A%0A +class SecretBallotUserIdMiddleware(SecretBallotMiddleware):%0A %22%22%22%0A As the token is generated based on the user ID, this middleware%0A should only be used on pages where the user is logged in.%0A %22%22%22%0A def genereate_token(self, request):%0A ...
c81b20dde92979b563228bd35eb218e65139d283
fix model param
spych/kaldi/decode.py
spych/kaldi/decode.py
import os from spych.utils import textfile class KaldiDecode(object): def __init__(self, env): self.env = env def make_graph(self, language_folder, model_folder, output_folder): """ Creates training graph from model, lexicon and language model. :param language_folder: Path to...
Python
0.000001
@@ -1361,94 +1361,84 @@ obs) -,%0A os.path.abspath(graph_folder),%0A os.path.abspath(data_folder), +%0A %5D%0A%0A if model is not None:%0A args.append('--model') %0A @@ -1438,32 +1438,44 @@ l')%0A +args.append( os.path.abspath( @@ -1478,98 +1478,123 @@ ...
17dd75df619519a3a565d6d95d87f8aa20cf8cf7
Switch testing grid district
test_dingo2.py
test_dingo2.py
#!/usr/bin/env python3 import matplotlib.pyplot as plt from oemof import db from dingo.core import NetworkDingo from dingo.tools import config as cfg_dingo plt.close('all') cfg_dingo.load_config('config_db_tables') cfg_dingo.load_config('config_calc') cfg_dingo.load_config('config_files') cfg_dingo.load_config('con...
Python
0
@@ -1039,19 +1039,19 @@ tricts=%5B -386 +489 %5D%0A%0And.im
910a715a2543b3e87879937da0aa0a6d63f33d7f
remove unused import
test_pillow.py
test_pillow.py
# MIT License # Copyright (c) 2017 Tuxedo # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish...
Python
0.000001
@@ -4418,18 +4418,8 @@ -import cv2 %0A
898e97a38ea0510b743ca79d97444458274426b2
Add tests for queue predeclaration.
st2common/tests/unit/test_service_setup.py
st2common/tests/unit/test_service_setup.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
@@ -794,43 +794,206 @@ le%0A%0A -from st2common import service_setup +import mock%0Afrom oslo_config import cfg%0A%0Afrom st2common import service_setup%0Afrom st2common.transport.bootstrap_utils import register_exchanges%0Afrom st2common.transport.bootstrap_utils import QUEUES %0A%0Afr @@ -3258,28 +3258,777 @@ ...
ea17679936442d8e5af90dcae72c003f708d7b0c
Fix check_user_support for custom user models
guardian/backends.py
guardian/backends.py
from __future__ import unicode_literals from django.db import models from guardian.compat import get_user_model from guardian.conf import settings from guardian.exceptions import WrongAppError from guardian.core import ObjectPermissionChecker def check_object_support(obj): """ Returns ``True`` if given ``ob...
Python
0.000001
@@ -1153,24 +1153,20 @@ -u +U ser -_obj = get_u @@ -1180,58 +1180,122 @@ el() -.objects.get(username=settings.ANONYMOUS_USER_NAME +%0A lookup = %7BUser.USERNAME_FIELD: settings.ANONYMOUS_USER_NAME%7D%0A user_obj = User.objects.get(**lookup )%0A%0A
112cb1eb06034f5afb24f9f1c20052a87d8a6374
Update pir_test.py
sensor_testing/pir_test.py
sensor_testing/pir_test.py
# parallax_pir_reva.py - write to screen when movement detected # (c) BotBook.com - Karvinen, Karvinen, Valtokari # 22.9.2017 modified by Vesa Valli import time import botbook_gpio as gpio learningPeriod = 30 def main(): pirPin = 7 gpio.mode(pirPin,"in") #Learning period print ("learning... " + str(learningPeri...
Python
0.000004
@@ -132,22 +132,21 @@ ied -by Vesa Valli%0A +from original %0Aimp
e79b5ec2b31c69c80ea8123720b822ca825dab91
add find_or_create_or_refresh
client/__init__.py
client/__init__.py
# -*- encoding: utf-8 -*- # # Copyright 2015 Red Hat, 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 ...
Python
0.00001
@@ -598,16 +598,28 @@ cense.%0A%0A +import copy%0A import j @@ -674,16 +674,27 @@ scanner%0A +import six%0A import s @@ -4851,16 +4851,830 @@ ate_id%0A%0A + def find_or_create_or_refresh(self, path, data, unicity_key=%5B'name'%5D):%0A # TODO(Gon%C3%A9ri): need a test coverage%0A where = %7Bk: data...
6c17a81685f4f1b24cefb4760b26e9a33298742c
Bump to v1.10.0
client/__init__.py
client/__init__.py
__version__ = 'v1.9.6' FILE_NAME = 'ok' import os import sys sys.path.insert(0, '') # Add directory in which the ok.zip is stored to sys.path. sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
Python
0.000001
@@ -15,11 +15,12 @@ 'v1. -9.6 +10.0 '%0A%0AF
86d59bbcad5d33e9a4cbad473a36972d29ddbaf0
missing comma
src/rwtypes/writers/activemq/ActivemqWriter.py
src/rwtypes/writers/activemq/ActivemqWriter.py
import datetime import time import json from third.stomp import stomp_sender from __writer import Writer class ActivemqWriter(Writer): def write(self, msg): try: headers = {'destination' : self.destination, 'eventtype' : self.eventtype 'timestamp...
Python
0.999885
@@ -279,16 +279,17 @@ venttype +, %0A
be4535f3671fd1e9e58ac4a82d3a9640ff7e2382
remove unused imports
fasttld/FastTLDExtract.py
fasttld/FastTLDExtract.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: Jophy and Wu Tingfeng @file: psl.py Copyright (c) 2022 Wu Tingfeng Copyright (c) 2017-2018 Jophy """ import re import socket from operator import itemgetter import idna from fasttld.psl import getPublicSuffixList, update IP_RE = re.compile( r"^(([0-9]|...
Python
0.000001
@@ -182,40 +182,8 @@ cket -%0Afrom operator import itemgetter %0A%0Aim
dac03e2a04e69622c3afa6d3386a8b3f5a39b9a4
Fix one-day all-day events
features/content/forms.py
features/content/forms.py
import django.db.transaction from django import forms import core.forms from . import models from features.associations import models as associations from features.contributions import forms as contributions from features.groups import models as groups class Comment(contributions.Text): def __init__(self, *args,...
Python
0.999999
@@ -1029,32 +1029,48 @@ eld(label='Ende' +, required=False )%0A all_day = @@ -3291,16 +3291,32 @@ l='Ende' +, required=False )%0A al
4b54488dd2b40254f6217d98c37690dcb37cf783
fix false origin on replies
halibot/halmodule.py
halibot/halmodule.py
from .halobject import HalObject from .message import Message class HalModule(HalObject): def reply(self, msg0=None, **kwargs): # Create the reply message body = kwargs.get('body', msg0.body) mtype = kwargs.get('type', msg0.type) author = kwargs.get('author', msg0.author) origin = kwargs.get('origin', msg0...
Python
0.000003
@@ -313,19 +313,17 @@ n', -msg0.origin +self.name )%0A%0A%09 @@ -508,16 +508,17 @@ g, %5B msg +0 .origin
13b5a5ade126b39c683f3f81968b9350fc0f6ba2
Remove redundant FakeSchemaAPI __init__ method
tests/utils.py
tests/utils.py
# Copyright 2012 OpenStack Foundation # 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 requ...
Python
0.000083
@@ -2176,89 +2176,8 @@ I):%0A - def __init__(cls, *args):%0A super(FakeSchemaAPI, cls).__init__(*args)%0A%0A
8dd9d4bf58e976ca40bcafa7249ed3140b77ea69
fix cfg parsing
tf2director.py
tf2director.py
#!/usr/bin/env python3 import os import sys from argparse import ArgumentParser from configparser import ConfigParser import actions from tf2server import Tf2Server def main(): """ Parse command line options, read config and run desired action. """ description = 'tf2director is a script that helps m...
Python
0.000007
@@ -2025,16 +2025,20 @@ c else +int( server.p @@ -2040,16 +2040,17 @@ ver.port +) + 5%0A%0A
cd3cdf787bcd878e3a0a39641cbf8ba35a7e62f2
Update logging
jobcrawl/selenium_scraper.py
jobcrawl/selenium_scraper.py
import time import logging from selenium import webdriver from pyvirtualdisplay import Display from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from seleniu...
Python
0.000001
@@ -3537,28 +3537,16 @@ unt += 1 - %0A @@ -3728,16 +3728,17 @@ count=%7B%7D +, %22%0A @@ -3767,16 +3767,24 @@ %22 + page=%7B%7D %22.format @@ -3816,32 +3816,44 @@ otal_crash_count +, page_count ))%0A @@ -3957,32 +3957,75 @@ l_crash_count=%7B%7D +, page=%7B%7D%22%0A ...
4123beacbd89128193c69c1b61f77acdd82419ad
version 0.1.9
jokekappa/__init__.py
jokekappa/__init__.py
# coding: utf-8 from jokekappa.core import get_joke, get_jokes, update_jokes # noqa: F401 __version__ = '0.1.8'
Python
0.000002
@@ -106,11 +106,11 @@ = '0.1. -8 +9 '%0A
c802426e1c7e45ed456ad92a8b88ab18fba59aa3
更新 modules ELOs 中的 management command 'clone_metadata', 新增函式功能宣告註解
commonrepo/elos/management/commands/clone_metadata.py
commonrepo/elos/management/commands/clone_metadata.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.conf import settings from django.core.management.base import BaseCommand, CommandError from commonrepo.elos.models import ELO, ELOMetadata class Command(BaseCommand): help = 'Clone Metadata of ELOs' def add_argument...
Python
0
@@ -17,16 +17,883 @@ f-8 -*-%0A +%0A#%0A# Copyright 2016 edX PDR Lab, National Central University, Taiwan.%0A#%0A# http://edxpdrlab.ncu.cc/%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of t...
c01c97583e11bfe1c41dd41e7b39d19be22fbb7c
use the real paths
tools/build.py
tools/build.py
#!/usr/bin/env python import os import subprocess import sys # TODO: release/debug root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) build_dir = os.path.join(root, 'out') def build(): if sys.platform != "win32": cmd = 'make -C %s' % build_dir else: cmd = 'tools\win_build.bat' pri...
Python
0.000017
@@ -406,16 +406,32 @@ in(root, + 'out', 'Debug', 'monito @@ -461,16 +461,26 @@ s --zip +out/Debug/ monitori
d0bdd50a8ca6367b08434075ab9573f5e412a197
typeify dbschema
graphscale/kvetch/dbschema.py
graphscale/kvetch/dbschema.py
from warnings import filterwarnings, resetwarnings import contextlib import pymysql import graphscale.check as check from graphscale.utils import execute_gen from .kvetch import IndexDefinition, IndexType @contextlib.contextmanager def disable_pymysql_warnings(): filterwarnings('ignore', category=pymysql.Warning...
Python
0.999999
@@ -66,56 +66,58 @@ lib%0A -import pymysql%0A%0Aimport graphscale.check as check +%0Afrom typing import Iterator, List%0Aimport pymysql%0A %0Afro @@ -201,16 +201,51 @@ dexType%0A +from .dbshard import KvetchDbShard%0A %0A%0A@conte @@ -291,24 +291,36 @@ l_warnings() + -%3E Iterator :%0A filter @@ -363,16 +363,3...
1edac6151b4a730039e0782a5cb9777fe7f4a21d
Implement basic teste
code/web/scisynergy_flask/tests/test_basic.py
code/web/scisynergy_flask/tests/test_basic.py
import os import unittest from scisynergy import app class BasicTests(unittest.TestCase): def test_main_page(self): response = self.app.get('/', follow_redirects=True) self.assertEqual(response.status_code, 200)
Python
0.02115
@@ -36,16 +36,22 @@ isynergy +_flask import @@ -54,16 +54,16 @@ ort app%0A - %0Aclass @@ -93,16 +93,107 @@ tCase):%0A + def setUp(self):%0A self.app = app.test_client()%0A self.app.testing = True%0A%0A def @@ -326,8 +326,190 @@ e, 200)%0A +%0A def test_maintenance(self):%0A re...
0e03dd0b82b0c7030345475bb03424deb651e3bc
Update tests.py
helios_auth/tests.py
helios_auth/tests.py
""" Unit Tests for Auth Systems """ import unittest import models from django.db import IntegrityError, transaction from django.test.client import Client from django.test import TestCase from django.core import mail from auth_systems import AUTH_SYSTEMS class UserModelTests(unittest.TestCase): def setUp(self...
Python
0.000001
@@ -1,12 +1,36 @@ +# -*- coding: utf-8 -*-%0A %22%22%22%0AUnit Tes
20d1ad27c85ecc7dcfbfb30abd7a68be10db2a33
Change showIt=False to pass test on Travis
simpegEM/Tests/test_forward_EMproblem.py
simpegEM/Tests/test_forward_EMproblem.py
import unittest from SimPEG import * import simpegEM as EM from scipy.constants import mu_0 from simpegEM.Utils.Ana import hzAnalyticDipoleT import matplotlib.pyplot as plt class TDEM_bTests(unittest.TestCase): def setUp(self): cs = 10. ncx = 15 ncy = 10 npad = 20 hx = Uti...
Python
0.000004
@@ -1243,19 +1243,20 @@ howIt = -Tru +Fals e%0A
1c1232d523687a11a9ec66bd550b671d4243a99a
disable logging
file_has_rationale_yes.py
file_has_rationale_yes.py
#!/usr/bin/env python from __future__ import unicode_literals """ Copyright (C) 2012 Legoktm Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the r...
Python
0.000002
@@ -4045,24 +4045,25 @@ ly:%0A +# bot.pushLog(
1e5345a786b24d341cfd99c3334c3122e3e5a91b
Update simulate method in Framework
simulation/MappingSimulationFrameWork.py
simulation/MappingSimulationFrameWork.py
from ResourceGetter import ResouceGetter from RequestGenerator import TestReqGen from RequestGenerator import SimpleReqGen from RequestGenerator import MultiReqGen from AbstractOrchestrator import sys #sys.path.append(./RequestGenerator) #from escape.mapping.simulation import ResourceGetter #from escape.mapping.simul...
Python
0
@@ -183,16 +183,24 @@ strator +import * %0A%0Aimport @@ -394,40 +394,137 @@ -#__request_generator = None%0A +__discrete_simulation = True%0A __resource_getter = None%0A __request_generator = None%0A __orchestrator_adaptor = None%0A __ rema @@ -553,10 +553,14 @@ s = -%5B%5D +list() %0A%0A ...
492ab05637b92f2decbd8fe60e25783ce63f9733
remove ignore from staging
server/settings/staging.py
server/settings/staging.py
""" Do not put secrets in this file. This file is public. For staging environment (Using Dokku) """ import os import sys import binascii from server.settings import RAVEN_IGNORE_EXCEPTIONS default_secret = binascii.hexlify(os.urandom(24)) ENV = 'staging' PREFERRED_URL_SCHEME = 'https' SECRET_KEY = os.getenv('SE...
Python
0.000001
@@ -918,162 +918,8 @@ ue%0A%0A -RAVEN_IGNORE_EXCEPTIONS =%5B'werkzeug.exceptions.Forbidden', 'werkzeug.exceptions.NotFound',%0A 'werkzeug.exceptions.Unauthorized'%5D%0A%0A try:
f5d3bb1dd20e9d2c3c5bd66b30032bea6c3f45d8
fix CLIP conversion script (#13474)
src/transformers/models/clip/convert_clip_original_pytorch_to_hf.py
src/transformers/models/clip/convert_clip_original_pytorch_to_hf.py
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 r...
Python
0
@@ -3954,16 +3954,30 @@ nt_path, + device=%22cpu%22, jit=Fal
21561f33e14018b7081e91f5d84ff65c8797909e
refactor me later
conditional/blueprints/dashboard.py
conditional/blueprints/dashboard.py
import uuid import structlog from flask import Blueprint, request from conditional.util.ldap import ldap_get_room_number from conditional.util.ldap import ldap_is_active from conditional.util.ldap import ldap_is_onfloor from conditional.util.ldap import ldap_get_housing_points from conditional.util.ldap import ldap_i...
Python
0.000002
@@ -3324,16 +3324,54 @@ _list%0A%0A%0A +# pylint: disable=too-many-statements%0A @dashboa
1569633e1e73bbfb11a2cc34a1ed5239fdc58b1f
load extent data as json from form
casework/forms.py
casework/forms.py
# -*- coding: utf-8 -*- from flask_wtf import Form from wtforms import StringField, RadioField, DecimalField, HiddenField, TextAreaField, FieldList, DateField, FormField from wtforms.validators import DataRequired, Optional from casework.validators import validate_postcode, validate_price_paid, validate_extent, forma...
Python
0
@@ -4019,16 +4019,33 @@ xtent%22: +simplejson.loads( self%5B'ex @@ -4051,24 +4051,25 @@ xtent'%5D.data +) %0A %7D)%0A @@ -4089,11 +4089,8 @@ rn data%0A -%0A%0A%0A
661fa0d89d66fe012165ee7553c65e1e73356763
Fix pylint
batchflow/tests/filesindex_test.py
batchflow/tests/filesindex_test.py
""" Tests for FilesIndex class. """ # pylint: disable=missing-docstring # pylint: disable=protected-access # pylint: disable=redefined-outer-name import os import shutil from contextlib import ExitStack as does_not_raise import pytest import numpy as np from batchflow import FilesIndex, DatasetIndex @pytest.fixtur...
Python
0.000099
@@ -948,16 +948,17 @@ + %5B%5B%5D, pyt @@ -1028,16 +1028,17 @@ + %5B%5B'', '' @@ -1061,55 +1061,8 @@ e()%5D -%0A %5D)%0Ad @@ -1350,16 +1350,17 @@ + (%5B2, 3%5D, @@ -1364,32 +1364,33 @@ 3%5D, TypeError),%0A +
352583af500746b431d46d7efc3a0d3f931b43a0
Fix context processors
skcodeonlinetester/context_processors.py
skcodeonlinetester/context_processors.py
""" Extra context processors for the SkCodeOnlineTester app. """ from django.utils.translation import ugettext_lazy as _ from django.contrib.sites.shortcuts import get_current_site def app_constants(request): """ Constants context processor. :param request: the current request. :return: All constants...
Python
0.024871
@@ -426,79 +426,8 @@ LE': - _('Test console for the PySkCode project'),%0A 'TITLE_SHORT': _(' @@ -516,16 +516,18 @@ RIGHT': +_( 'TamiaLa @@ -533,16 +533,17 @@ ab 2016' +) ,%0A
75926fe8be6f47287561200a0d6e47cad5c51082
Update tokenizers.py
cobe/tokenizers.py
cobe/tokenizers.py
# Copyright (C) 2010 Peter Teichman import re import Stemmer import types class MegaHALTokenizer: """A traditional MegaHAL style tokenizer. This considers any of these to be a token: * one or more consecutive alpha characters (plus apostrophe) * one or more consecutive numeric characters * one or more cons...
Python
0.000001
@@ -457,107 +457,8 @@ se): -%0A if type(phrase) != types.UnicodeType:%0A raise TypeError(%22Input must be Unicode%22) %0A%0A @@ -2699,108 +2699,8 @@ e):%0A - if type(phrase) != types.UnicodeType:%0A raise TypeError(%22Input must be Unicode%22)%0A%0A
447b0bb977f050b904d36cb44aabe34cb03b87af
fix notation
chainer/functions/array/reshape.py
chainer/functions/array/reshape.py
from chainer import function from chainer.utils import type_check def _count_unknown_dims(shape): cnt = 0 for dim in shape: cnt += dim < 0 return cnt class Reshape(function.Function): """Reshapes an input array without copy.""" def __init__(self, shape): cnt = _count_unknown_di...
Python
0.000026
@@ -1477,22 +1477,24 @@ The -%60 +** size -%60 +** of shap @@ -1500,14 +1500,16 @@ pe ( -%60 +** size -%60 +** mea @@ -1539,19 +1539,16 @@ ts) must - be %0A @@ -1552,16 +1552,19 @@ +be equal to @@ -1618,19 +1618,16 @@ n be -1. - In %0A @@ -1631,16 +1631,19 @@ +In t...
f2edfbbf3a5c4e18a26b8b9479456b91311bd4ea
check that the datum has a module_id
corehq/apps/app_manager/app_schemas/session_schema.py
corehq/apps/app_manager/app_schemas/session_schema.py
from django.utils.text import slugify from corehq import toggles from corehq.apps.app_manager.const import USERCASE_TYPE from corehq.apps.app_manager.templatetags.xforms_extras import clean_trans from corehq.apps.app_manager.util import is_usercase_in_use def get_session_schema(form): """Get form session schema ...
Python
0.000018
@@ -1719,16 +1719,69 @@ tums)):%0A + if not datum.module_id:%0A continue%0A
e3548d62aa67472f291f6d3c0c8beca9813d6032
Make it possible to step() in a newly created env, rather than throwing AttributeError
gym/envs/toy_text/discrete.py
gym/envs/toy_text/discrete.py
from gym import Env from gym import spaces import numpy as np def categorical_sample(prob_n): """ Sample from categorical distribution Each row specifies class probabilities """ prob_n = np.asarray(prob_n) csprob_n = np.cumsum(prob_n) return (csprob_n > np.random.rand()).argmax() class Di...
Python
0.000004
@@ -898,16 +898,38 @@ endering +%0A self._reset() %0A%0A @p
253a0f786339e90b1b5841b94a22d44e5db3b85c
Add small delay in TemporalInformationRetriever to avoid endless loop
server/src/weblab/user_processing/TemporalInformationRetriever.py
server/src/weblab/user_processing/TemporalInformationRetriever.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005-2009 University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, # listed...
Python
0
@@ -2501,10 +2501,43 @@ nd_time) +%0A time.sleep(0.01) %0A%0A
92737e3f95ff94129e52e1fab1f40a0f70550d46
Update the ParticleFilterSetOperations
hoomd/filter/set_.py
hoomd/filter/set_.py
from hoomd.filter.filter_ import ParticleFilter from hoomd import _hoomd class ParticleFilterSetOperations(ParticleFilter): def __init__(self, f, g): if f == g: raise ValueError("Cannot use same filter for {}" "".format(self.__class__.__name__)) else: ...
Python
0
@@ -356,16 +356,128 @@ ._g = g%0A + # Grab the C++ class constructor for the set operation using the class%0A # variable _cpp_cls_name%0A @@ -635,24 +635,56 @@ lf, other):%0A + if self._symmetric:%0A retu @@ -722,32 +722,37 @@ d %5C%0A + ( self._f == other ...
c6218505ee78077b682490ecd6cba64b0d12ba28
update docs for electric field
hoomd/md/external.py
hoomd/md/external.py
# Copyright (c) 2009-2021 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause License. # Maintainer: joaander / All Developers are free to add commands for new features R""" External forces. Apply an external force to all particles in the simulatio...
Python
0
@@ -3559,17 +3559,16 @@ l):%0A -R %22%22%22 Elec @@ -3588,18 +3588,8 @@ -:py:class: %60Ele @@ -3642,20 +3642,16 @@ hould be -%0A added t @@ -3657,16 +3657,20 @@ to every +%0A particl @@ -3764,16 +3764,17 @@ ath:%60V(%5C +%5C vec%7Br%7D)%60 @@ -3808,16 +3808,20 @@ ollowing +%0A formula @...
8d98fe5570ce37512128d46853000dc860f798b2
Update jupyterhub_config.py
jupyterhub/jupyterhub_config.py
jupyterhub/jupyterhub_config.py
# Configuration file for jupyterhub. from jupyter_client.localinterfaces import public_ips c = get_config() # noqa c.JupyterHub.ssl_key = 'test.key' c.JupyterHub.ssl_cert = 'test.crt' c.JupyterHub.hub_ip = public_ips()[0] # Choose between system-user mode and virtual-user mode setting_mode = ('system_user', 'virtu...
Python
0.000001
@@ -951,16 +951,26 @@ pawners. +SystemUser Spawner'
6e10b24fe798c2c666c050eb834370e5745276b4
fix retry options
cumulusci/tasks/salesforce/install_package_version.py
cumulusci/tasks/salesforce/install_package_version.py
from cumulusci.core.exceptions import TaskOptionsError from cumulusci.core.utils import process_bool_arg from cumulusci.salesforce_api.exceptions import MetadataApiError from cumulusci.salesforce_api.package_install import install_package_version from cumulusci.salesforce_api.package_zip import InstallPackageZipBuilder...
Python
0.000022
@@ -4062,30 +4062,221 @@ ions = %7B -**self.options +%0A %22retries%22: self.options%5B%22retries%22%5D,%0A %22retry_interval%22: self.options%5B%22retry_interval%22%5D,%0A %22retry_interval_add%22: self.options%5B%22retry_interval_add%22%5D,%0A %7D%0A
1de78567614ace199e03aca5d93aee9d426ddb3e
Allow lastchange.py to be used for arbitrary repositories.
build/util/lastchange.py
build/util/lastchange.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ lastchange.py -- Chromium revision fetching utility. """ import re import optparse import os import subprocess import sys _GI...
Python
0.000009
@@ -5556,16 +5556,139 @@ umber%22)%0A + parser.add_option(%22-s%22, %22--source-dir%22, metavar=%22DIR%22,%0A help=%22use repository in the given directory%22)%0A opts, @@ -5722,16 +5722,16 @@ gv%5B1:%5D)%0A - %0A out_f @@ -5955,16 +5955,134 @@ xit(2)%0A%0A + if opts.source_dir:%0A src_...
fc6716854bc876730f1f3684945061fcf1d48072
Fix default optional prefix
hashid_field/rest.py
hashid_field/rest.py
from django.apps import apps from django.core import exceptions from hashids import Hashids from rest_framework import fields, serializers from hashid_field.conf import settings from hashid_field.hashid import Hashid class UnconfiguredHashidSerialField(fields.Field): def bind(self, field_name, parent): ...
Python
0.000002
@@ -977,20 +977,42 @@ refix = -None +kwargs.pop('alphabet', %22%22) %0A%0A
713a3c19fa5ec4bc5aa865e1403022069b62bfd9
Remove obsolete line break. (#539)
buildifier/buildifier.py
buildifier/buildifier.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import fnmatch import html import locale import os.path import re import subprocess import sys regex = re.compile( r"^(?P<filename>[^:]*):(?P<line>\d*):(?:(?P<column>\d*):)? (?P<message_id>[^:]*): (?P<message>.*) \((?P<message_url>.*)\)$", re.MULTILINE, ) BUILD...
Python
0.000235
@@ -5752,21 +5752,16 @@ %22 -%3Cbr/%3E %5Cn%22.form
bca7f7f6ae870a0a307566ee1735e899596d3f99
Simplify the brightness calculation, in preparation for multi-LED drips
hardware/mote/mote_icicles.py
hardware/mote/mote_icicles.py
import time from random import randint from mote import Mote mote = Mote() mote.configure_channel(1, 16, False) mote.configure_channel(2, 16, False) mote.configure_channel(3, 16, False) mote.configure_channel(4, 16, False) max_brightness = 40 class Icicle: def __init__(self, channel): self.channel = cha...
Python
0
@@ -219,19 +219,20 @@ False)%0A%0A -max +full _brightn @@ -736,11 +736,12 @@ s = -max +full _bri @@ -751,32 +751,8 @@ ness - -(2*self.current_pixel) %0A
9718e6c216b8d5205a19f095593ec099004785a6
add app
src/studio/launch/commands/app_commands.py
src/studio/launch/commands/app_commands.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import os import sys import importlib from sh import pip from termcolor import colored from studio.frame.config import common as common_config from studio.launch.base import manager app_manager = manager.subcommand('...
Python
0.000003
@@ -117,16 +117,28 @@ ort sys%0A +import json%0A import i @@ -146,16 +146,16 @@ portlib%0A - from sh @@ -337,16 +337,17 @@ )%0AVASSAL +S = commo @@ -1309,18 +1309,18 @@ %0A con -i f +i g_d = %7B%7D @@ -1442,18 +1442,18 @@ con -i f +i g_d%5Bk%5D = @@ -1459,24 +1459,613 @@ = v%0A +%0A -print(...
3739c8c54d48d4b4cb82f6d5fa6197cf1ae374ee
add 'cv.' where needed to improve parsing
datasources/botgarden/gbif/parseAndInsertGBIFparts.py
datasources/botgarden/gbif/parseAndInsertGBIFparts.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """originally this was parseNamesGBIF.py "Use the GBIF name parser API (http://tools.gbif.org/nameparser/api.do) to disect [sic] name strings into their components. Input should be a simple list of name strings separated by newline-characters. The names can be read either...
Python
0.999993
@@ -1690,17 +1690,16 @@ hus cv. -' Berkeley @@ -1704,17 +1704,16 @@ ey Skies -' for GBI @@ -1761,14 +1761,14 @@ (.*) -('.*') +'(.*)' %22)%0A%0A
6380aabe25e38d198b6c4e10d126d6fd97860c85
remove Simple.validate function
flask_pam/token/simple.py
flask_pam/token/simple.py
# -*- coding: utf-8 -*- from hashlib import sha256 from token import Token class Simple(Token): """Simple token implementation. It's not safe. Only for testing purposes!""" def generate(self): return sha256(self.username).hexdigest() def validate(self, token): return sha256(self.username)...
Python
0.000126
@@ -249,94 +249,4 @@ t()%0A -%0A def validate(self, token):%0A return sha256(self.username).hexdigest() == token%0A
5a9c7222360051ea9b0b58426285d72d3726daf6
Add game to userinfo
cogs/moderation.py
cogs/moderation.py
from discord.ext import commands from cogs.utils import checks import discord import datetime class Moderation: def __init__(self, liara): self.liara = liara @commands.command(pass_context=True, no_pm=True) async def userinfo(self, ctx, user: discord.Member=None): """Shows you a user's in...
Python
0.000001
@@ -1169,16 +1169,124 @@ r_url)%0A%0A + if user.game is not None:%0A embed.description += '%5Cn**Game**: %7B%7D'.format(user.game.name)%0A%0A
d37d99dedfb7cc2c86a9f01a75213fcc430af13d
fix inheritance for `SmAttr`s
hashstore/utils/file_types.py
hashstore/utils/file_types.py
import mimetypes from typing import List from os.path import join, dirname from hashstore.utils import load_json_file from hashstore.utils.smattr import SmAttr class FileType(SmAttr): mime:str ext:List[str] def read_file_types(json_file): load_json = load_json_file(json_file) return {n: FileType(v) ...
Python
0.000021
@@ -1579,14 +1579,17 @@ msdo -wnload +s-program '%0A%0A
c78b6d46ef68d079a1c3b19427eee41902079dfb
Use control_data network ip for amqp_server_ip.
fabfile/utils/host.py
fabfile/utils/host.py
import paramiko from netaddr import * from fabfile.config import testbed from fabric.context_managers import settings from fabric.api import env, run def hstr_to_ip(host_string): return host_string.split('@')[1] def get_control_host_string(mgmt_host): ctrl_ip_info= getattr(testbed, 'control_data', None) ...
Python
0.000006
@@ -4501,33 +4501,16 @@ _host',%0A - @@ -4537,16 +4537,40 @@ r_to_ip( +get_control_host_string( env.role @@ -4587,16 +4587,17 @@ '%5D%5B0%5D))) +) %0A%0Adef ge
beccef4eccda11e32ba30022008de44450f69fa2
Check if block exists before DAG edits.
src/api.py
src/api.py
def execute_blocks(dag_fpathname, block_ids, all=False): import dag import dagexecutor d = dag.DAG.from_file(dag_fpathname) if all: block_ids = d.block_ids() dex = dagexecutor.DAGExecutor(d, dag_fpathname) dex.execute_blocks(block_ids) def open_notebook(nbfile): from utils import Consol...
Python
0
@@ -1,12 +1,130 @@ +%0A%0Adef check_blocks(dag, block_ids):%0A if set(block_ids) - set(dag.block_ids()):%0A return False%0A return True %0A%0Adef execut @@ -288,16 +288,177 @@ k_ids()%0A + nonexistent = set(block_ids) - set(d.block_ids())%0A elif nonexistent:%0A print('Block(s) %7B%7D have n...
eb57a07277f86fc90b7845dc48fb5cde1778c8d4
Test cut_by_number with words and normal chunk numbers
test/unit_test/test_cut_number.py
test/unit_test/test_cut_number.py
from lexos.processors.prepare.cutter import split_keep_whitespace, \ count_words, cut_by_number class TestCutByNumbers: def test_split_keep_whitespace(self): assert split_keep_whitespace("Test string") == ["Test", " ", "string"] assert split_keep_whitespace("Test") == ["Test"] assert s...
Python
0.000003
@@ -632,8 +632,304 @@ %5D) == 0%0A +%0A def test_cut_by_number_normal(self):%0A assert cut_by_number(%22Text%22, 1) == %5B%22Text%22%5D%0A assert cut_by_number(%22This text has five words%22, 5) == %5C%0A %5B%22This %22, %22text %22, %22has %22, %22five %22, %22words%22%5D%0A asse...
4c109fdca6aa0bcd3d2c883ae193a025838573d5
Assign explicit names to MNIST op. Change: 134345909
tensorflow_serving/example/mnist_export.py
tensorflow_serving/example/mnist_export.py
# 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 applicable law or a...
Python
0.999999
@@ -2434,16 +2434,28 @@ )%0A x = +tf.identity( tf_examp @@ -2461,16 +2461,63 @@ ple%5B'x'%5D +, name='x') # use tf.identity() to assign name %0A y_ = @@ -2712,16 +2712,26 @@ , w) + b +, name='y' )%0A cros
c05d0f2dd77678133af1bbf49915aeaf24efbedc
simplify line counting method
httplang/httplang.py
httplang/httplang.py
import parse import sys import utils import repl def main(): if len(sys.argv) < 2: repl.enterREPL() sys.exit() inputFile = sys.argv[1] run(inputFile) def run(file_): with open(file_, 'rb') as file: #pass enumerated file so we can get line numbers parse.preParse(enumerat...
Python
0.03329
@@ -281,16 +281,30 @@ numbers + starting at 1 %0A @@ -333,16 +333,18 @@ ate(file +,1 ))%0A r
c806a3702c95812dd57aca4106a782a854268993
Comment out configuration of real systems
server/systems/__init__.py
server/systems/__init__.py
import logging from base import BaseEnvironment from producers import CogenerationUnit, PeakLoadBoiler from storages import HeatStorage, PowerMeter from consumers import ThermalConsumer, ElectricalConsumer from server.models import Device, Configuration, DeviceConfiguration from django.core.exceptions import ObjectDoe...
Python
0
@@ -9,16 +9,71 @@ ogging%0A%0A +from django.core.exceptions import ObjectDoesNotExist%0A%0A from bas @@ -97,16 +97,16 @@ ronment%0A - from pro @@ -327,62 +327,8 @@ tion -%0Afrom django.core.exceptions import ObjectDoesNotExist %0A%0Alo @@ -780,24 +780,26 @@ v))%0A%0A + # configurati @@ -837,32 +837,34 @...
cf84dfda73032a276b2d6f63f2c70f69e61f89fe
Check validity of the config to avoid silent errors.
keras_retinanet/utils/config.py
keras_retinanet/utils/config.py
""" Copyright 2017-2018 Fizyr (https://fizyr.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 or agreed to in w...
Python
0
@@ -573,16 +573,26 @@ e.%0A%22%22%22%0A%0A +import os%0A import c @@ -786,16 +786,439 @@ ig_path) +%0A %0A assert os.path.isfile(config_path), %22Could not find %7B%7D.%22.format(config_path)%0A%0A assert 'anchor_parameters' in config, %5C%0A %22Malformed config file. Verify that it contains the anch...
91e916cb67867db9ce835be28b31904e6efda832
Add comment to new test
spacy/tests/regression/test_issue1727.py
spacy/tests/regression/test_issue1727.py
from __future__ import unicode_literals import numpy from ...pipeline import Tagger from ...vectors import Vectors from ...vocab import Vocab from ..util import make_tempdir def test_issue1727(): data = numpy.ones((3, 300), dtype='f') keys = [u'I', u'am', u'Matt'] vectors = Vectors(data=data, keys=keys) ...
Python
0
@@ -1,12 +1,117 @@ +'''Test that models with no pretrained vectors can be deserialized correctly%0Aafter vectors are added.'''%0A from __futur
50d8bb92e397602d07223aff40359bcbde50baf7
Enable debug output on loadsched
cheddar/summit.py
cheddar/summit.py
# Copyright 2016 Thierry Carrez <thierry@openstack.org> # 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 ...
Python
0
@@ -6243,16 +6243,28 @@ events', + debug=True, payload @@ -6687,16 +6687,28 @@ r%5B'id'%5D, + debug=True, %0A
3826140004b0686f9f262756da20c5163fc5b80d
update icinga_simple format string handling
py3status/modules/icinga_simple.py
py3status/modules/icinga_simple.py
# -*- coding: utf-8 -*- """ Display Icinga2 service status information Configuration Parameters: - cache_timeout: how often the data should be updated - base_url: the base url to the icinga-web2 services list - disable_acknowledge: enable or disable counting of acknowledged service problems - user: use...
Python
0
@@ -858,24 +858,158 @@ %22%22%22%0A %22%22%22%0A + STATUS_NAMES = %7B%0A 0: 'OK',%0A 1: 'WARNING',%0A 2: 'CRITICAL',%0A 3: 'UNKNOWN'%0A %7D%0A # availa @@ -1037,16 +1037,16 @@ ameters%0A - cach @@ -1232,24 +1232,46 @@ format = ' +%7Bstatus_name...
30e984a0517e6443835f113c3a479aa8302ef14f
Update profile url on amazon tests
social_core/tests/backends/test_amazon.py
social_core/tests/backends/test_amazon.py
import json from .oauth import OAuth2Test class AmazonOAuth2Test(OAuth2Test): backend_path = 'social_core.backends.amazon.AmazonOAuth2' user_data_url = 'https://www.amazon.com/ap/user/profile' expected_username = 'FooBar' access_token_body = json.dumps({ 'access_token': 'foobar', 'tok...
Python
0
@@ -157,35 +157,35 @@ _url = 'https:// -www +api .amazon.com/ap/u @@ -172,35 +172,32 @@ /api.amazon.com/ -ap/ user/profile'%0A
08834335285b292fe0337525eb2052a38c35d881
Test a random element.
OWR/oh/tests.py
OWR/oh/tests.py
from __future__ import absolute_import import json from unittest import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import reverse from django.contrib.auth.models import AnonymousUser from django.core.exceptions import SuspiciousOperation, PermissionDenied from OWR.users.factor...
Python
0
@@ -44,16 +44,31 @@ rt json%0A +import random%0A%0A from uni @@ -497,16 +497,38 @@ tCase):%0A + BATCH_NUMBER = 10%0A def @@ -734,18 +734,33 @@ e_batch( -10 +self.BATCH_NUMBER )%0A%0A d @@ -1528,32 +1528,85 @@ d_logged(self):%0A + idx = random.randrange(0, self.BATCH_NUMBER)%0A count_st...
a85019e7c5e117467d0ce3bf30b9a7589cd17958
Update create_test_cutout
src/tasks/python/create_test_cutout.py
src/tasks/python/create_test_cutout.py
from cloudvolume import CloudVolume image_in = 'gs://neuroglancer/pinky100_v0/image_single_slices' image_out = 'gs://neuroglancer/pinky100_v0/test_image' image_mip = 0 roi_in = 'gs://neuroglancer/pinky100_v0/image_single_slices/roicc' roi_out = 'gs://neuroglancer/pinky100_v0/test_image/roicc' roi_mip = 6 cfsplit_in = ...
Python
0.000001
@@ -454,16 +454,175 @@ mip = 2%0A +cfmanual_in = 'gs://neuroglancer/pinky100_v0/image_single_slices/cfmanual'%0Acfmanual_out = 'gs://neuroglancer/pinky100_v0/test_image/cfmanual'%0Acfmanual_mip = 5%0A match_in @@ -847,33 +847,35 @@ %5B(cf -split +manual _in, cf -split +manual _out, cf spli @@ -874,50 +874,14 @@ ...
20f14f6c86607d0f1d084ee35c8f2645fde2dacb
Replace 1s and 2s with Xs and Os
capstone/util/tic2pdf.py
capstone/util/tic2pdf.py
from __future__ import division import subprocess import tempfile BG_COLOR = '1.0 1.0 1.0' COLORS = { '1': '0.85 0.12 0.15', '2': '0.00 0.00 1.00', ' ': '0.90 0.90 0.90' } X_OFFSET = 17.0 ROWS = 3 COLS = 3 CELL_SIZE = 20 OFFSET = 10 class Tic2PDF(object): ''' Generates a PDF of the given Tic-Tac...
Python
0.010829
@@ -24,17 +24,35 @@ division +, unicode_literals %0A - import s @@ -120,17 +120,17 @@ %7B%0A ' -1 +X ': '0.85 @@ -151,27 +151,27 @@ ' -2 +O ': '0. -00 0.00 1.00 +21 0.60 0.83 ',%0A @@ -185,20 +185,20 @@ '0. -90 0.9 +83 0.6 0 0. -90 +32 '%0A%7D%0A @@ -387,17 +387,17 @@ , ' ', ' -1 +X '%5D,%0A @...
6ae4f3a71a80d7fe5bb1abe6925a05c4fe811f3c
bump version
forms_builder/__init__.py
forms_builder/__init__.py
__version__ = "0.12.2"
Python
0
@@ -12,12 +12,12 @@ = %22 -0.12.2 +9.7.16 %22%0A
66fc51e41b0b2db15c636ca366d5508c58840e0e
Initialize config with empty json.
src/app.py
src/app.py
import datetime import glob import os import argparse import setproctitle import requests import shutil import json from datetime import datetime, timezone from operator import itemgetter import numpy from PIL import Image from PIL.ExifTags import TAGS from flask import Flask, Response, render_template, request, jsonif...
Python
0
@@ -1014,61 +1014,181 @@ me'%0A -open('%25s/src/config.json' %25 rpi_folder, 'a+').close() +if not os.path.isfile('%25s/src/config.json' %25 rpi_folder):%0A with open('%25s/src/config.json' %25 rpi_folder, 'w') as f:%0A f.write('%7B%7D')%0A f.close()%0Aelse:%0A pass%0A %0A%0A#
0f7f8d71dc1c8eda869c423a324064d4bc419879
Use ContextualZipFile and contextlib.closing for archiveutil
setuptools/archive_util.py
setuptools/archive_util.py
"""Utilities for extracting common archive formats""" __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] import zipfile import tarfile import os import shutil import posixpath from pkg_resources import ensure_d...
Python
0
@@ -279,16 +279,34 @@ sixpath%0A +import contextlib%0A from pkg @@ -339,16 +339,35 @@ irectory +, ContextualZipFile %0Afrom di @@ -3571,20 +3571,23 @@ -z = zipfile. +with Contextual ZipF @@ -3599,24 +3599,21 @@ ilename) -%0A try + as z :%0A @@ -4548,39 +4548,8 @@ es)%0A - finally:%0A z....
a58646ee72fc894a2f2b885b242cc283a0addd7c
remove args
src/app.py
src/app.py
import argparse import os from actions import server, client # the main entry point for the application # for simplicity, let's decide that the user decides at runtime to listen # and the server decides to serve # location from which files should be served app_directory = '/home/chris/blaster' def main(): # get ...
Python
0.999811
@@ -551,179 +551,8 @@ )%0A - # parser.add_argument('directory',%0A # help=%22The top level directory from which to serve files, e.g. '~/Downloads'%22,%0A # )%0A @@ -609,27 +609,8 @@ ion) - #, args.directory) %0A%0Ade
0f216b43f42ebabedda701fafefe271a223798cb
Fix mcscf example
examples/mcscf/41-mcscf_with_given_densityfit_ints.py
examples/mcscf/41-mcscf_with_given_densityfit_ints.py
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # import tempfile import h5py from pyscf import gto, df, scf, mcscf ''' Input Cholesky decomposed integrals for CASSCF ''' mol = gto.M(atom='H 0 0 0; F 0 0 1', basis='ccpvdz') # # Integrals in memory. The size of the integral array is (M,N*(N+1)/2)...
Python
0.000001
@@ -481,16 +481,24 @@ ol))%0Amf. +with_df. _cderi = @@ -596,24 +596,32 @@ nce in%0A# mf. +with_df. _cderi. DFC @@ -1148,16 +1148,24 @@ %0A mf. +with_df. _cderi =
e610eb413915e0d124fe7b1df37f69e128e8fd41
fix decode issue for local testing in email user mgmt cmd
sources/management/commands/email_user.py
sources/management/commands/email_user.py
from django.core.management.base import BaseCommand, CommandError from django.core.mail import send_mail from django.contrib.auth.models import User from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode from sesame import utils from sources.models import Person from sources.f...
Python
0.000114
@@ -2033,16 +2033,159 @@ er.pk))%0A + # necessary for prod%0A try:%0A uid = uid.decode()%0A # this has only been observed locally%0A except AttributeError:%0A pass%0A conf @@ -2255,25 +2255,16 @@ uid -.decode() ,%0A
6035b13efda5180a42d00f1e1f7f75046f988e46
Raise more meaningful exception when trying to access methods on the Courier handler.
launchpad/nodes/courier/node.py
launchpad/nodes/courier/node.py
# Copyright 2020 DeepMind Technologies Limited. 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.000039
@@ -1310,24 +1310,263 @@ s = kwargs%0A%0A + def __getattr__(self, method):%0A raise AttributeError(%0A f'%5C'CourierHandle%5C' object has no attribute %5C'%7Bmethod%7D%5C'. '%0A 'Most likely you need to dereference handle before use '%0A '(see launchpad.maybe_dereference).')%0A%0A def set_c...
d7b260005a30cfd848eefe62f021cb4bf7a59087
Use tempfile for default upload directory
pyfarm/master/api/agent_updates.py
pyfarm/master/api/agent_updates.py
# No shebang line, this module is meant to be imported # # Copyright 2014 Ambient Entertainment Gmbh & Co. KG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lice...
Python
0
@@ -771,16 +771,32 @@ port re%0A +import tempfile%0A from os @@ -2662,15 +2662,69 @@ IR%22, - %22/tmp/ +%0A join(tempfile.gettempdir(), %22 pyfa @@ -2735,16 +2735,17 @@ pdates%22) +) %0A
cd828f76511d439af3baa0d209d6e23a19776142
Check if minValue/maxValue is not none before setting default uiMin/uiMax
Python/kraken/core/objects/attributes/number_attribute.py
Python/kraken/core/objects/attributes/number_attribute.py
"""Kraken - objects.Attributes.NumberAttribute module. Classes: NumberAttribute - Base Attribute. """ from attribute import Attribute class NumberAttribute(Attribute): """Number Attributee. Base class for number attribute types""" def __init__(self, name, value=0, minValue=None, maxValue=None): su...
Python
0.000001
@@ -615,32 +615,107 @@ -self.setUIMin(minValue)%0A +if minValue is not None:%0A self.setUIMin(minValue)%0A%0A if maxValue is not None:%0A
9a4f1da48e72627aa0ff358a3dafe8bb5639482a
refresh access token on each verification
componentsdb/ui.py
componentsdb/ui.py
""" Traditional Web UI. """ from functools import wraps from flask import ( Blueprint, redirect, url_for, render_template, request, session ) from werkzeug.exceptions import BadRequest, Unauthorized from componentsdb.app import set_current_user_with_token from componentsdb.auth import user_for_google_id_token u...
Python
0
@@ -138,16 +138,19 @@ session +, g %0A)%0Afrom @@ -1071,16 +1071,185 @@ ken(t)%0A%0A + # Update the token in the session to make sure that the user always has a%0A # good long expiry windows%0A session%5BAUTH_TOKEN_SESSION_KEY%5D = g.current_user.token%0A%0A def auth
b92ce9a245ad9582a833b4d0ce62bf1230e99a68
Allow sending emails via Server Script (#11162)
frappe/utils/safe_exec.py
frappe/utils/safe_exec.py
import os, json, inspect import mimetypes from html2text import html2text from RestrictedPython import compile_restricted, safe_globals import RestrictedPython.Guards import frappe import frappe.utils import frappe.utils.data from frappe.website.utils import (get_shade, get_toc, get_next_link) from frappe.modules impo...
Python
0
@@ -2225,16 +2225,47 @@ e.throw, +%0A%09%09%09sendmail = frappe.sendmail, %0A%0A%09%09%09use
becef09e0680786343c581d984e7de5dcb961d16
Fix for handle failed html parse
frappe/utils/xlsxutils.py
frappe/utils/xlsxutils.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import openpyxl import re from openpyxl.styles import Font from openpyxl import load_workbook from six import BytesIO, string_types ILLEGAL_CHARACTERS_RE = re.comp...
Python
0.000002
@@ -1542,21 +1542,20 @@ %09return -value +data %0A%0A%09value
49d8bd1dbec1fa5927a1e487e7f0799de2e2ee11
Remove unused import
tests/unit/states/archive_test.py
tests/unit/states/archive_test.py
# -*- coding: utf-8 -*- ''' unit tests for the archive state ''' # Import Python Libs import os import tempfile try: import pwd HAS_PWD = True except ImportError: HAS_PWD = False # Import Salt Libs from salt.states import archive # Import Salt Testing Libs from salttesting import skipIf, TestCase from sa...
Python
0.000001
@@ -109,87 +109,8 @@ file -%0Atry:%0A import pwd%0A HAS_PWD = True%0Aexcept ImportError:%0A HAS_PWD = False %0A%0A#
9c096a749610115569eec9c5f3946e9e55b95514
Add image in metablock for blog (#5292)
frappe/website/context.py
frappe/website/context.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, os, json from frappe.website.doctype.website_settings.website_settings import get_website_settings from frappe.website.router import get_page_context from frappe.m...
Python
0
@@ -6406,22 +6406,23 @@ url( -%22image%22)%0A +tags.get(%22image%22)) %0A
f5a1e7f8e350a5f1b29c0e60caf178208946a2b1
Add more samples.
learning-python/ch02/Looping.py
learning-python/ch02/Looping.py
for i in [1, 2, 3, 4]: print(i) for i in range(5): print(i) colors = ["red", "green", "blue"] for i in range(len(colors)): print(i, colors[i]) for color in colors: print(color) for idx, color in enumerate(colors): print(idx, color) people = ["Scott", "John", "Mike"] ages = [50, 30, 25] for pers...
Python
0
@@ -414,8 +414,845 @@ t(data)%0A +%0Aarr = %5B1, 2, 3, 4, 5, 6%5D%0Aprint(arr)%0Aarr = arr%5B::-1%5D%0Aprint(arr)%0A%0Aempid = 2%0Aclass NoResourceFoundException(Exception):%0A pass%0Aemps = %7B1: %22Scott%22, 2: %22John%22, 3: %22Tiger%22%7D%0Afor emp in emps.items():%0A if emp.__contains__(empid):%0A pr...