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
2ab9c74041b998e1cad3a7a9c1f5be6feb7b63ac
Add todo for config validation
scd/config.py
scd/config.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import collections import logging import os.path import six import scd.files import scd.utils import scd.version Parser = collections.namedtuple("Parser", ["name", "func"])...
Python
0
@@ -17,16 +17,41 @@ f-8 -*-%0A +# TODO Config validation%0A %0A%0Afrom _ @@ -2855,16 +2855,77 @@ ontent)%0A + logging.info(%22Parsed config as %25s%22, parser.name)%0A
398157d2b7e42a5de028af2a074c4465c6360e13
add timestamps to result in mongo
results.py
results.py
# experiment result wrapper import numpy as np import uuid import h5py from git import Repo from pymongo import MongoClient path_to_repo = '~/Documents/Thesis/latent_ssvm' path_to_datafile = '/home/dmitry/Documents/Thesis/latent_ssvm/notebooks/experiment_data.hdf5' class experiment(object): def __init__(self...
Python
0.000007
@@ -120,16 +120,68 @@ oClient%0A +from datetime import datetime%0Afrom time import time%0A %0A%0Apath_t @@ -1022,16 +1022,114 @@ 1().hex%0A + self.meta%5B'now'%5D = datetime.now().ctime()%0A self.meta%5B'timestamp'%5D = time()%0A
d104046a008bda71bf80f607d4f974a59050548b
Remove debug message
results.py
results.py
# Results management module # import matchupsv2 as matchups_store import players import predictions def get_player_prediction(player_id, preds): result=[] for prediction in preds: if prediction['player'] == player_id and int(prediction['winner']) > 0: p = prediction.copy() del p...
Python
0.000001
@@ -1332,67 +1332,8 @@ + 10 -%0A%0A print('Winner', winner, 'final winner', final_winner) %0A @@ -1781,66 +1781,8 @@ + 5%0A - print('Winner', winner, 'final winner', final_winner)%0A
8c8d6147f51d8c036f9d7cf9f7aa72e99cd6f4dd
fix list of unselected projects
rhw/models.py
rhw/models.py
from ckeditor.fields import RichTextField from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Idea(models.Model): title = models.CharField(max_length=100, u...
Python
0.000003
@@ -1924,22 +1924,23 @@ eas. -filter +exclude (project =Non @@ -1939,13 +1939,18 @@ ject -=None +__rhw=self )%0A%0A%0A
76a7b89cd8c935dec87ac89ec36b174c9a0636c4
change lambda with broken typing to def
rich/pager.py
rich/pager.py
from abc import ABC, abstractmethod from typing import Any, Callable class Pager(ABC): """Base class for a pager.""" @abstractmethod def show(self, content: str) -> None: """Show content in pager. Args: content (str): Content to be displayed. """ class SystemPager(P...
Python
0.000003
@@ -379,65 +379,61 @@ +def _pager -: Callable%5B%5BAny, str%5D, Any%5D = lambda self, content: +(self, content: str) -%3E Any:%0A return __i @@ -459,29 +459,15 @@ ger( -%0A content -%0A )%0A%0A
9bd5662194007d995c924d2d57f6af5c75075472
fix dashboard json output
ctfengine/views.py
ctfengine/views.py
import hashlib from flask import abort, flash, jsonify, render_template, request, redirect, \ url_for from ctfengine import app from ctfengine import database from ctfengine import lib from ctfengine import models @app.route('/') def index(): scores = models.Handle.topscores() total_points = database....
Python
0.000129
@@ -2275,16 +2275,40 @@ chines': + %5Bm.serialize() for m in machine @@ -2308,16 +2308,17 @@ machines +%5D ,%0A
821e87d574ec4eeb3c8e740c82dba3a979d9bae9
allow for Decimal and other types not inherently addable to float in SMA calculator.
cubes/statutils.py
cubes/statutils.py
from collections import deque from cubes.model import Attribute def _wma(values): n = len(values) denom = n * (n + 1) / 2 total = 0.0 idx = 1 for val in values: total += float(idx) * float(val) idx += 1 return round(total / denom, 4) def _sma(values): # use all the values ...
Python
0
@@ -349,17 +349,24 @@ a i, c: -c +float(c) + i, va
65e8aba17517247770ba27d796016c49fa41e0ab
correct handling of measure.ref() and aggregation selection in statutils' calculated aggregations
cubes/statutils.py
cubes/statutils.py
from collections import deque from cubes.model import Attribute def _wma(values): n = len(values) denom = n * (n + 1) / 2 total = 0.0 idx = 1 for val in values: total += float(idx) * float(val) idx += 1 return round(total / denom, 4) def _sma(values): # use all the values ...
Python
0
@@ -519,17 +519,16 @@ _wma, ' -_ wma')%0A%0Ad @@ -655,17 +655,16 @@ _sma, ' -_ sma')%0A%0Ad @@ -726,28 +726,32 @@ g_func, -field_suffix +aggregation_name ):%0A i @@ -934,62 +934,165 @@ -relevant_level = drilldown_paths%5B-1%5D%5B2%5D%5B-1%5D%0A if not +key_drilldown_paths = %5B%5D%0A num_units =...
582cacac1411312ad5e5dc132562883693f3877a
bump version
cyvcf2/__init__.py
cyvcf2/__init__.py
from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness, par_het) Reader = VCFReader = VCF __version__ = "0.8.6"
Python
0
@@ -150,7 +150,7 @@ 0.8. -6 +7 %22%0A
e624e5ae4b93f61f3a53ad911d9fe3b8baa68377
Bump to 4.0 RC 2 dev.
reviewboard/__init__.py
reviewboard/__init__.py
"""Review Board version and package information. These variables and functions can be used to identify the version of Review Board. They're largely used for packaging purposes. """ from __future__ import unicode_literals #: The version of Review Board. #: #: This is in the format of: #: #: (Major, Minor, Micro, Pat...
Python
0
@@ -400,14 +400,15 @@ c', -1, Tru +2, Fals e)%0A%0A
e53ae572ac6c232a6afc01ae9ad2988ea1ef456a
Bump version.
robobrowser/__init__.py
robobrowser/__init__.py
__version__ = '0.4.0' from .browser import RoboBrowser
Python
0
@@ -12,17 +12,17 @@ = '0.4. -0 +1 '%0A%0Afrom
9efc16a9ce2187636d2ba75ff7982033854dbbe8
optimise apriltags
robotd/vision/vision.py
robotd/vision/vision.py
"""Classes for handling vision""" from robotd.native.apriltag._apriltag import ffi, lib from robotd.vision.camera import Camera from robotd.vision.camera_base import CameraBase from robotd.vision.tokens import Token class Vision: """Class that handles the vision library""" def __init__(self, camera: Camera...
Python
0.999998
@@ -1425,17 +1425,17 @@ , 1, 0, -1 +0 )%0A
70b4be757d671bc86876b4568632bb6fe6064001
Fix a Django deprecation warning
admin_interface/templatetags/admin_interface_tags.py
admin_interface/templatetags/admin_interface_tags.py
# -*- coding: utf-8 -*- from django import template from admin_interface.models import Theme register = template.Library() @register.assignment_tag(takes_context = True) def get_admin_interface_theme(context): theme = None request = context.get('request', None) if request: theme = getattr(re...
Python
0.006582
@@ -136,18 +136,14 @@ ter. -assignment +simple _tag
2f3b5a6e0600f92ae0803ad3df44948dd5408444
comment out stdout log handler
cssbot/log.py
cssbot/log.py
# # Copyright (C) 2011 by Brian Weck # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # import logging from datetime import date import utils def __configure_logging(): # configure the base logger for the pkg l = logging.getLogger("cssbot") l.setLevel(logging.DEBUG) #...
Python
0
@@ -433,16 +433,17 @@ andler.%0A +# ch = @@ -466,16 +466,17 @@ ndler()%0A +# ch.se @@ -496,16 +496,17 @@ g.WARN)%0A +# ch.se @@ -519,32 +519,33 @@ tter(formatter)%0A +# l.addHandler(
9abce530e50e4c1132e512abd51f39a60e4bd261
change max_depth check to >=
ai/minimax.py
ai/minimax.py
# http://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning def minimax(game, player, depth, max_depth): if game.game_over() or depth > max_depth: return game.heuristic_value(player), [] best_score = -float('inf') if game.current_player == player else float('inf') best_moves = [] for move in l...
Python
0
@@ -124,32 +124,33 @@ ver() or depth %3E += max_depth:%0A @@ -1466,16 +1466,17 @@ depth %3E += max_dep
3f54ba70972afc0b32a6de106b0f1758536c98a5
Support building on Cuda11
cuda_setup.py
cuda_setup.py
# Adapted from https://github.com/rmcgibbo/npcuda-example and # https://github.com/cupy/cupy/blob/master/cupy_setup_build.py import logging import os import sys from distutils import ccompiler, errors, msvccompiler, unixccompiler from setuptools.command.build_ext import build_ext as setuptools_build_ext def find_in_...
Python
0
@@ -2254,64 +2254,8 @@ = %5B -'-gencode=arch=compute_30,code=sm_30',%0A '-ge @@ -2402,24 +2402,85 @@ ompute_60',%0A + '-gencode=arch=compute_70,code=compute_70',%0A
057110e3aa4007ad7221873029bed383ee1e0e3b
Remove platform check
aiotkinter.py
aiotkinter.py
import asyncio import tkinter import sys if sys.platform == 'win32': raise ImportError('%s is not available on your platform'.format(__name__)) class _TkinterSelector(asyncio.selectors._BaseSelectorImpl): def __init__(self): super().__init__() self._tk = tkinter.Tk(useTk=0) self._read...
Python
0
@@ -27,126 +27,8 @@ ter%0A -import sys%0A%0Aif sys.platform == 'win32':%0A raise ImportError('%25s is not available on your platform'.format(__name__)) %0A%0Acl
7ab744fe8464ce85a27431adf94039c45551010f
Remove Google analytics code.
publishconf.py
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'https://dicasdejava.com.br' RELATIVE_URLS = F...
Python
0.000001
@@ -920,43 +920,8 @@ va%22%0A -GOOGLE_ANALYTICS = %22UA-39997045-4%22%0A %0A%0AMI
e9240123541e91145bac29f52ff8f04f412aaf6c
Add reminder to use scope helper in module.py
pycc/module.py
pycc/module.py
from collections import namedtuple import os ImportResult = namedtuple('ImportResult', ('module', 'target',)) class Package(object): """Contains AST nodes and metadata for modules in a Python package.""" def __init__(self, location): self.location = os.path.realpath(location) self.root = o...
Python
0
@@ -1940,16 +1940,70 @@ n None%0A%0A + # TODO(kevinconway): Make target a scope.Name%0A
e48fcd11e5a208d8177862c824d2fa6f3fbf1ee2
Remove body of __main__ method in jobs file
d1lod/jobs.py
d1lod/jobs.py
""" jobs.py A collection of common jobs for the D1 LOD service. """ import os import sys import uuid import datetime from redis import StrictRedis sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) from d1lod import dataone from d1lod.sesame import store from d1lod.sesame import ...
Python
0.000038
@@ -4296,17 +4296,26 @@ -hourly_job() +print %22main executed%22 %0A
dccb841600c35ce9b0e93953221088ba11bc2a02
Fix hard-coded http:// in akvo/iati/
akvo/iati/exports/org_elements/document_link.py
akvo/iati/exports/org_elements/document_link.py
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from lxml import etree def document_...
Python
0.000002
@@ -672,34 +672,70 @@ b%5B'url'%5D = ' -http://' + +%7B%7D://%7B%7D%7B%7D'.format(%0A request.scheme, request.get @@ -741,18 +741,17 @@ t_host() - + +, organis @@ -761,24 +761,34 @@ on.logo.url%0A + )%0A logo @@ -1663,90 +1663,82 @@ = ' -http://' + request.get_host() + %5C%0A ...
1021c07edf6016a8d34e5bfec7a38445aff9cbaf
Rearrange create-or-find-policy logic.
s3same/iam.py
s3same/iam.py
import json from botocore.exceptions import ClientError IAMName = 's3same_travis' def _policy_string(bucket): return json.dumps({ "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:ListBucket" ], "Effect": "...
Python
0.000004
@@ -779,127 +779,73 @@ ef _ -all +find _polic -ies +y (iam -, **kwargs):%0A marker = None%0A while True:%0A if marker:%0A kwargs%5B'Marker'%5D = marker +):%0A kwargs = %7B'Scope': 'Local'%7D%0A while True: %0A @@ -956,13 +956,70 @@ -yield +if policy.get('PolicyName') == IAMNam...
a7d3376d730a04fec533a46a4faefb5c88f618f9
Add docstring for pymt plugins.
pymt/plugin.py
pymt/plugin.py
"""Dynamically find and load plugins.""" from __future__ import print_function __all__ = [] import os import logging import importlib from glob import glob from .framework.bmi_bridge import bmi_factory from .babel import setup_babel_environ def load_plugin(entry_point, callback=None): """Load a generic plugin....
Python
0
@@ -30,16 +30,1149 @@ plugins. +%0A%0APyMT plugins are components that expose the CSDMS Basic%0AModel Interface and provide CSDMS Model Metadata. With%0Athese two things, third-party components can be imported%0Ainto the PyMT modeling framework.%0A%0ABy default PyMT searches a package named %60csdms%60, if%0Ait exists...
2c9e88ee3addf491bb8abfb9b0691b282d5ab6ec
Add todo re: pre-processing name parameter
pynano/base.py
pynano/base.py
import requests import xmltodict from .history import NanoHistorySequence as History from .day import NanoDay class NanoBase(object): """Base object for pynano API objects. This object implements the common functionality for fetching and processing API data from the NaNoWriMo API. By default the API is...
Python
0
@@ -479,16 +479,128 @@ rameter. +%0A%0A .. todo::%0A Process %60name%60 to match what the API requires of it, e.g. replace%0A spaces with '-'. %0A %22%22%22
b51aa47a5b9b0a4b57904049af2e073682f77350
Add line blocks to docstring for Slot (#167)
pyquil/slot.py
pyquil/slot.py
############################################################################## # Copyright 2016-2017 Rigetti Computing # # 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
@@ -922,16 +922,18 @@ ue.%0A%0A + %7C Arithme @@ -960,16 +960,18 @@ */%60%60%0A + %7C Logical @@ -1006,16 +1006,18 @@ , ==%0A + %7C Arbitra
0ec3a663c9ec8b28b30e5a0b29d2c5109c657863
Remove prettyprinting indent
pyr/console.py
pyr/console.py
from code import InteractiveConsole import readline, atexit, os, sys, pprint from pygments import highlight from pygments.lexers import PythonLexer from pygments.formatters import Terminal256Formatter from pygments.styles import get_style_by_name from pyr.compiler import PyrCompiler # py3 compatibility # raw_input r...
Python
0.000058
@@ -3203,16 +3203,8 @@ ter( -indent=4 )%0A%0A
a949f38888bfd0da71dfafb3f39feb3407eeedb6
fix imports, remove old from future imports
pysub/pysub.py
pysub/pysub.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Subtitle downloader using OpenSubtitles.org API Command line command-line user interface """ # Copyright 2016 Nikola Kovacevic <nikolak@outlook.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wi...
Python
0.000001
@@ -741,47 +741,8 @@ e.%0A%0A -from __future__ import print_function%0A%0A impo @@ -769,17 +769,16 @@ e%0A%0Afrom -. pysub_ob @@ -822,17 +822,16 @@ er%0Afrom -. settings
a057850a1dff3319533d983a24de29cd28f63803
Add server check before logging out
pysub/pysub.py
pysub/pysub.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Subtitle downloader using OpenSubtitles.org API Command line command-line user interface """ # Copyright 2014 Nikola Kovacevic <nikolak@outlook.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wit...
Python
0
@@ -2547,16 +2547,35 @@ video)%0A%0A + if server:%0A serv
6b308f3be482dae291a725c29fcf9e93f7251dfc
add fucking changes to http client
python/http.py
python/http.py
# Copyright 2013 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Python
0
@@ -603,16 +603,26 @@ cense.%0A%0A +import os%0A import j @@ -959,27 +959,85 @@ oin( -LOGS_DIR, 'sys_test +os.path.join(os.getcwd()),%0A 'nailgun .log
51d7d217bc1454b93145657c1e8a3e05fecd6cd4
add logger
sequana/mh.py
sequana/mh.py
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with this s...
Python
0.000026
@@ -610,57 +610,60 @@ ab%0A%0A -from sequana import logger%0Alogger.name = +import colorlog%0Alogger = colorlog.getLogger( __name__ %0A%0A%0A_ @@ -658,16 +658,19 @@ __name__ +)%0A%0A %0A%0A%0A__all
59b95edb27089eb8f6842b9861945310ec71029b
use packaging.version
py/desidatamodel/test/datamodeltestcase.py
py/desidatamodel/test/datamodeltestcase.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """Utility class used by other tests. """ import os import tempfile import unittest import logging import shutil from astropy import __version__ as astropyVersion from desiutil.log import log from desiutil.test.test_log import Nul...
Python
0.000001
@@ -193,16 +193,46 @@ t shutil +%0Afrom packaging import version %0A%0Afrom a @@ -502,22 +502,21 @@ n = -float('.'.join +version.parse (ast @@ -530,25 +530,8 @@ sion -.split('.')%5B0:2%5D) )%0A @@ -3404,17 +3404,36 @@ sion %3E= -4 +version.parse('4.0') :%0A @@ -3732,11 +3732,28 @@ %3E= +version.par...
07a4cb667e702a1cbb758a3761ec41b89fa98313
Add options to python script
python/test.py
python/test.py
#!/usr/bin/env python # Copyright (C) 2010 Red Hat, Inc. # # This 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 Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # This so...
Python
0.000002
@@ -817,214 +817,562 @@ g.%0A%0A -opts = %7B%0A 'host' : 'localhost',%0A 'port' : 8080,%0A 'impl' : %22dummy%22,%0A%7D%0Aopts%5B'uri'%5D = 'http://%25(host)s:%25(port)s/rhevm-api-%25(impl)s-war/' %25 opts%0A%0Aimport http%0Aimport xmlfmt%0Aimport yamlfmt%0Aimport jsonfmt +import http%0Aimport xmlfmt%0Aimport ...
4656f7834f2c56f9dffcb775a5c9833304a3a55f
Fix doctests with Python 2
pyuca/utils.py
pyuca/utils.py
""" utilities for formatting the datastructures used in pyuca. Useful mostly for debugging output. """ from __future__ import unicode_literals def hexstrings2int(hexstrings): """ list of hex strings to list of integers >>> hexstrings2int(["0000", "0001", "FFFF"]) [0, 1, 65535] """ return [in...
Python
0.000056
@@ -542,16 +542,20 @@ return %5B +str( %22%7B:04X%7D%22 @@ -564,16 +564,17 @@ ormat(n) +) for n i @@ -719,32 +719,36 @@ ights)%0A%0A %3E%3E%3E +str( format_collation @@ -777,16 +777,17 @@ %5B4, 5%5D%5D) +) %0A '%5B0 @@ -1214,24 +1214,28 @@ ies%0A %3E%3E%3E +str( format_sort_ @@ -1248,24 +1248,25 @...
7e3d913c6a669d075a8b50995abbfaed0d550a49
重构,修复错误的拼写
pyactive/tests/test_relation_belongs_to.py
pyactive/tests/test_relation_belongs_to.py
# -*- coding: utf-8 -*- from ..record import ActiveRecord from ..relation import belongs_to, BelongsTo from pyactive.utils import ColumnNotInColumns from datetime import datetime import unittest import fudge class Person(ActiveRecord): __columns__ = ['id', 'created_at', 'updated_at'] class RelationBelongsToTest...
Python
0.000012
@@ -963,18 +963,18 @@ est_belo -g n +g s_to_rel @@ -4304,8 +4304,64 @@ time))%0A%0A + %0Aif __name__ == '__main__':%0A unittest.main()%0A
9d1a44dd85b452430f90e1d5eb2400c9869934b6
use get_latest() instead of _latest() for #393
pycqed/instrument_drivers/pq_parameters.py
pycqed/instrument_drivers/pq_parameters.py
from qcodes.instrument.parameter import ManualParameter from qcodes.utils.validators import Validator, Strings class InstrumentParameter(ManualParameter): """ Args: name (string): the name of the instrument that one wants to add. instrument (Optional[Instrument]): the "parent" instrument this...
Python
0
@@ -2812,24 +2812,27 @@ lue != self. +get _latest()%5B'v @@ -2828,25 +2828,16 @@ latest() -%5B'value'%5D :%0A @@ -2987,16 +2987,19 @@ rn self. +get _latest( @@ -3003,14 +3003,5 @@ st() -%5B'value'%5D %0A
a23374939583b3954baa1418f12ce309442d31ff
Mark certain resources as uncompressible
pyforge/pyforge/lib/widgets/form_fields.py
pyforge/pyforge/lib/widgets/form_fields.py
from pylons import c from pyforge.model import User from formencode import validators as fev import ew class MarkdownEdit(ew.InputField): template='genshi:pyforge.lib.widgets.templates.markdown_edit' validator = fev.UnicodeString() params=['name','value','show_label'] show_label=True name=None ...
Python
0.999999
@@ -408,24 +408,40 @@ tup.pack.js' +, compress=False )%0A yi @@ -599,24 +599,40 @@ arkitup.css' +, compress=False )%0A yi @@ -682,16 +682,32 @@ own.css' +, compress=False )%0A
2b5e94f6c301932eb9387bba9a80414a714e2b38
Tidy up the references
pygraphc/abstraction/ClusterAbstraction.py
pygraphc/abstraction/ClusterAbstraction.py
class ClusterAbstraction(object): """Get cluster abstraction based on longest common substring [jtjacques2010]_. References ---------- .. [jtjacques2010] jtjacques, Longest common substring from more than two strings - Python. http://stackoverflow.com/questions/2892931/longest-common-substr...
Python
0.019729
@@ -245,20 +245,16 @@ %0A - http://s
1bd5d7179c49004f47e169512a784248979fbea3
Update compile_engine.py (#4393)
python/tvm/relay/backend/compile_engine.py
python/tvm/relay/backend/compile_engine.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
0
@@ -3713,36 +3713,35 @@ -------%0A -cach +jit ed_func: CachedF @@ -3729,34 +3729,36 @@ jited_func: -CachedFunc +tvm.Function %0A @@ -3768,32 +3768,38 @@ e result of -lowering +jited function .%0A %22%22
ac61b2f99f91a274572e96be8f0136871288f1bb
update timer to be able to measure time more times
proso/util.py
proso/util.py
import re import importlib import time _timers = {} def timer(name): now = time.clock() if name in _timers: diff = now - _timers[name] return diff _timers[name] = now def instantiate(classname, *args, **kwargs): matched = re.match('(.*)\.(\w+)', classname) if matched is None: ...
Python
0
@@ -84,15 +84,30 @@ ime. -clock() +time()%0A diff = None %0A @@ -166,28 +166,8 @@ me%5D%0A - return diff%0A @@ -186,16 +186,32 @@ %5D = now%0A + return diff%0A %0A%0Adef in
c85db50907f21495ea5927a0f2bdc88d4ba4e5b9
fix import order
relengapi/blueprints/slaveloan/__init__.py
relengapi/blueprints/slaveloan/__init__.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import flask_login import logging import sqlalchemy as sa from sqlalchemy import asc from flask import Blueprint from ...
Python
0.000001
@@ -792,20 +792,24 @@ import -rest +bugzilla %0Afrom re @@ -840,32 +840,28 @@ loan import -bugzilla +rest %0Afrom releng
ce1350bb42028ad29356af275ab5b90257ccf0cb
fix import
yr/__init__.py
yr/__init__.py
from yr import YR
Python
0.000001
@@ -1,13 +1,14 @@ from +. yr impor
1cfc885597f14282245c68179922e27e3974a26f
use environment var for file location
publish-ci.py
publish-ci.py
import requests import json import os # import tarfile # def make_tarfile(output_filename, source_dir): # with tarfile.open(output_filename, "w:gz") as tar: # tar.add(source_dir, arcname=os.path.basename(source_dir)) uri = 'https://zenodo.org/api/deposit/depositions' access_token = os.environ['ZENODO_API_...
Python
0
@@ -529,65 +529,29 @@ e': -'/data/artefacts/gmp-6.1.0-generic-x86_64-centos6.tar.gz' +os.environ%5B'TARBALL'%5D %7D%0A#
32f308d3697c72a6655df38eedd23ebb71d95d40
Fix typos, works in linux now.
pyglet/lib.py
pyglet/lib.py
#!/usr/bin/env python '''Functions for loading dynamic libraries. These extend and correct ctypes functions. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import os import sys import ctypes import ctypes.util class LibraryLoader(object): def load_library(self, *names, **kwargs): '''Fin...
Python
0.999999
@@ -791,20 +791,30 @@ = tuple( -list +platform_names )%0A @@ -1051,16 +1051,35 @@ ibrary = + lambda self, name: ctypes. @@ -1095,16 +1095,22 @@ _library +(name) %0A%0A pl
c424efd76f5c6949729d17d131333ce6ec8103f8
Add Event model
app/models.py
app/models.py
from app import db from flask_security import RoleMixin # Define associations friends = db.Table('friends', db.Column('friend_id', db.Integer, db.ForeignKey('user.id')), db.Column('friended_id', db.Integer, db.ForeignKey('user.id')) ) roles_users = db.Table('roles_users', db.Column('user_id', db.Int...
Python
0
@@ -3065,16 +3065,325 @@ teger)%0A%0A +class Event(db.Model):%0A id = db.Column(db.Integer, primary_key=True)%0A description = db.Column(db.String(255))%0A longitude = db.Column(db.Float(precision='3,8'))%0A latitude = db.Column(db.Float(precision='3,8'))%0A start_datetime = db.Column(db.DateTime)%0A ...
e4880658f92c0b55c883b136405fa9a2a9d8c8dc
Define update_commits method.
app/models.py
app/models.py
from datetime import datetime from app import slack, redis, app from app.redis import RedisModel class Channel(RedisModel): __prefix__ = '#' @staticmethod def load_from_slack(): """Update channel list from slack""" slack_response = slack.channels.list() if not slack_response.succ...
Python
0
@@ -1820,16 +1820,1904 @@ n True%0A%0A + def update_commits(self, commits=1):%0A %22%22%22Update the number of commits%22%22%22%0A if not 'commits_updated' in self:%0A # Start from 0%0A self.commits_updated = datetime.now()%0A self.commits_in_last_day ...
437f50f768f3c250364e33289403164ade464509
Add a default option for the field 'field' of the social network app model
app/models.py
app/models.py
import connectors.models from django.db import models class SocialNetworkApp(models.Model): name = models.CharField(max_length=50) url = models.URLField(null=True, blank=True) connector = models.OneToOneField(connectors.models.SocialNetworkConnector) blocked = models.DateTimeField(null=True, editable...
Python
0.000003
@@ -810,24 +810,40 @@ , blank=True +, default='page' )%0A field_ @@ -911,24 +911,40 @@ , blank=True +, default='feed' )%0A token_
99b65f7308a4b5719f5cf2e15200767af6780775
deploy keynote images
pytx/files.py
pytx/files.py
import os from django.conf import settings JS_HEAD = [] JS = [ # 'raven.min.js', # 'plugins/vue.min.js', # 'showdown.min.js', 'pytexas.js', ] CSS = [ 'vuetify.min.css', 'global.css', 'pytexas.css', ] IMAGES = [ 'img/atx.svg', 'img/banner80.png', 'img/icon.svg', 'img/icon...
Python
0
@@ -807,127 +807,8 @@ ng', -%0A%0A 'img/apl/library1.png',%0A 'img/apl/library2.png',%0A%0A 'img/keynote/emily.jpg',%0A 'img/keynote/adrienne.jpg', %0A%5D%0A%0A
e9314b02c482314efeb7e36ecf3f6613f9a99adb
fix fetch loop block server
app/server.py
app/server.py
import logging import os import sys import requests from flask import Flask from flask import send_file, send_from_directory from gevent import sleep, spawn from api import load_api from blockchain import web3_client from settings import SOURCE_ROOT from storage import Cache log = logging.getLogger(__name__) consol...
Python
0
@@ -122,40 +122,8 @@ tory -%0Afrom gevent import sleep, spawn %0A%0Afr @@ -1169,24 +1169,111 @@ ch_nodes():%0A + from time import sleep%0A from threading import Thread%0A%0A def fetch_loop():%0A while Tr @@ -1288,13 +1288,21 @@ + try:%0A + @@ -1393,16 +1393,20 @@ + ...
69f24cd7a1936fb7dc4cfb03e3e97997332f633e
add portforward_get method
akanda/horizon/client.py
akanda/horizon/client.py
Python
0.000001
@@ -0,0 +1,338 @@ +import requests%0A%0Adef portforward_get(request):%0A headers = %7B%0A %22User-Agent%22 : %22python-quantumclient%22,%0A %22Content-Type%22 : %22application/json%22,%0A %22Accept%22 : %22application/json%22,%0A %22X-Auth-Token%22 : request.user.token.id%0A %7D%0A ...
5ae16add0ad711340d92983814eb4c0eff524933
Fix video regex matching whitespace
alexBot/cogs/video_dl.py
alexBot/cogs/video_dl.py
import logging import re from functools import partial import discord from discord.errors import DiscordException from discord.ext import commands import os import shutil import asyncio import subprocess import math from ..tools import Cog, timing from youtube_dl import YoutubeDL, DownloadError log = logging.getLogger...
Python
0.998861
@@ -379,17 +379,37 @@ ok%5C.com/ -. +%5Ba-zA-Z0-9#-_!*%5C(%5C),%5D %7B6,%7D/'), @@ -547,17 +547,37 @@ edd%5C.it/ -. +%5Ba-zA-Z0-9#-_!*%5C(%5C),%5D %7B6,%7D'),%0A @@ -652,17 +652,37 @@ mments%5C/ -. +%5Ba-zA-Z0-9#-_!*%5C(%5C),%5D %7B6,%7D'),%0A
2641b2a1c3d438144191c3a088e2c9b2b777a74c
Implement cloudforms license
awx/main/tests/functional/core/test_licenses.py
awx/main/tests/functional/core/test_licenses.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. import time import pytest from datetime import datetime from awx.main.models import Host from awx.main.task_engine import TaskEnhancer @pytest.mark.django_db def test_license_writer(inventory, admin): task_enhancer = TaskEnhancer( company_name='a...
Python
0.000828
@@ -2849,8 +2849,536 @@ g'%5D %3E 0%0A +%0A%0A@pytest.mark.django_db%0Adef test_cloudforms_license(mocker):%0A with mocker.patch('awx.main.task_engine.TaskEnhancer._check_cloudforms_subscription', return_value=True):%0A task_enhancer = TaskEnhancer()%0A vdata = task_enhancer.validate_enhancements()%0A...
b8f09b57289a5ae1749a33fa9141bb4b3fb67df9
Add an organisation package to quickstart
quickstart.py
quickstart.py
#!/usr/bin/env python # IATI Data Quality, tools for Data QA on IATI-formatted publications # by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith # # Copyright (C) 2013 Publish What You Fund # # This programme is free software; you may redistribute and/or modify # it under the terms of the GNU Affero Gen...
Python
0
@@ -1133,24 +1133,49 @@ dstates-tz', + True),%0A (u'dfid-org', True)%0A %5D
db52119430c2d62a82759ada121a5e7d1e1f82ef
Update redis_cola.py
redis_cola.py
redis_cola.py
__author__ = 'mariosky' import redis import os import json HOST = os.environ['REDIS_HOST'] PORT = os.environ['REDIS_PORT'] WORKER_HEARTBEAT_INTERVAL = 1 #Time a worker waits for a Task before unblocking to send a heartbeat #TODO: Connection Exception r = redis.Redis(host=HOST, port=PORT) class Task: def __ini...
Python
0.000001
@@ -51,16 +51,28 @@ ort json +%0Aimport time %0A%0AHOST = @@ -260,16 +260,18 @@ ception%0A +%0A%0A r = redi @@ -300,16 +300,189 @@ t=PORT)%0A +redis_ready = False%0Awhile not redis_ready:%0A try:%0A redis_ready = r.ping()%0A except:%0A print(%22waiting for redis%22)%0A time.sleep(3)%0A%0...
ad79fab7d18b1a31ba06f46e91d573dd3898cca2
fix update points
fantasydota/scripts/update_leaderboard_points.py
fantasydota/scripts/update_leaderboard_points.py
import transaction from fantasydota.lib.account import add_achievement, team_swap_all from fantasydota.lib.general import match_link from sqlalchemy import and_ from fantasydota.lib.constants import MULTIPLIER from fantasydota.lib.session_utils import make_session from fantasydota.models import Result, LeagueUser, Lea...
Python
0
@@ -1268,9 +1268,9 @@ amp -%3E +%3C res
b37814280dc06dbf8aefec4490f6b73a47f05c1a
Simplify python3 unicode fixer and make it replace all occurrences of __unicode__ with __str__.
custom_fixers/fix_alt_unicode.py
custom_fixers/fix_alt_unicode.py
# Taken from jinja2. Thanks, Armin Ronacher. # See also http://lucumr.pocoo.org/2010/2/11/porting-to-python-3-a-guide from lib2to3 import fixer_base from lib2to3.fixer_util import Name, BlankLine class FixAltUnicode(fixer_base.BaseFix): PATTERN = """ func=funcdef< 'def' name='__unicode__' ...
Python
0.000015
@@ -148,55 +148,8 @@ ase%0A -from lib2to3.fixer_util import Name, BlankLine%0A %0A%0Acl @@ -206,240 +206,136 @@ = %22 -%22%22%0A func=funcdef%3C 'def' name='__unicode__'%0A parameters%3C '(' NAME ')' %3E any+ %3E%0A %22%22%22%0A%0A def transform(self, node, results):%0A name = resul...
8f4918a63e312309e835c3a9fc0513ddd6b4bbc1
test restore resnet
restore_resnet.py
restore_resnet.py
__author__ = 'Mohammad' import tensorflow as tf sess = tf.Session() #First let's load meta graph and restore weights saver = tf.train.import_meta_graph('data/tensorflow-resnet-pretrained-20160509/ResNet-L152.meta') saver.restore(sess, 'data/tensorflow-resnet-pretrained-20160509/ResNet-L152.ckpt') for i in tf.get_col...
Python
0
@@ -652,18 +652,16 @@ data%0A#%0A -# graph = @@ -683,18 +683,16 @@ graph()%0A -# w1 = gra @@ -718,12 +718,16 @@ me(%22 -w1:0 +scale5/x %22)%0A#
caba041d4297cf7c64a6eef50ddc147331092f26
Implement utils.game_state_to_xml() to export a game to XML
fireplace/utils.py
fireplace/utils.py
import os.path from importlib import import_module from pkgutil import iter_modules # Autogenerate the list of cardset modules _cards_module = os.path.join(os.path.dirname(__file__), "cards") CARD_SETS = [cs for _, cs, ispkg in iter_modules([_cards_module]) if ispkg] # Dict of registered custom cards, by id. for @cu...
Python
0.000002
@@ -77,16 +77,89 @@ modules%0A +from xml.etree import ElementTree%0Afrom hearthstone.enums import CardType%0A %0A%0A# Auto @@ -2579,12 +2579,715 @@ module, id)%0A +%0A%0Adef entity_to_xml(entity):%0A%09e = ElementTree.Element(%22Entity%22)%0A%09for tag, value in entity.tags.items():%0A%09%09if value and not isinstan...
5632447a202ef3a83e5b96d11cbbc653fafac99b
Use os.getlogin to get login user name.
ibus/common.py
ibus/common.py
# vim:set et sts=4 sw=4: # # ibus - The Input Bus # # Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> # # 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 Software Foundation; either # version 2 of ...
Python
0
@@ -1184,23 +1184,8 @@ sys -%0Aimport getpass %0A%0Adi @@ -1311,23 +1311,19 @@ %25 ( -getpass.getuser +os.getlogin (),
a97947b3fb718eb764b982e895da7e21ddf6809a
Debug print removed from Package
idl/Package.py
idl/Package.py
from idl.IDLError import IDLError from idl.TypeGetter import TypeGetter class Package(): def __init__(self, env, parent, name): TypeGetter.__init__(self) self._env = env self._parent = parent self._modules = [] self._name = name self._children = [] ...
Python
0
@@ -1543,65 +1543,8 @@ %0A - print('proc %25r' %25 package.name)%0A %0A
b08a8fa6132d3533421088f617342abd094187be
make test runs independent of folder possible
scarce/testing/tools.py
scarce/testing/tools.py
import inspect import os import tables as tb from collections import OrderedDict import numpy as np import itertools FIXTURE_FOLDER = 'fixtures' def _call_function_with_args(function, **kwargs): ''' Calls the function with the given kwargs and returns the result in a numpy array ''' # Create all combina...
Python
0
@@ -42,44 +42,8 @@ tb%0A -from collections import OrderedDict%0A impo @@ -79,26 +79,203 @@ ls%0A%0A -FIXTURE_FOLDER = ' +import scarce%0A%0A# Get package path%0Apackage_path = os.path.dirname(scarce.__file__) # Get the absoulte path of the online_monitor installation%0AFIXTURE_FOLDER = os.path.join(package_path, '...
eb4cda636a0b0ceb5312b161e97ae5f8376c9f8e
Change biolookup test to work around service bug
indra/tests/test_biolookup_client.py
indra/tests/test_biolookup_client.py
from indra.databases import biolookup_client def test_lookup_curie(): curie = 'pubchem.compound:40976' res = biolookup_client.lookup_curie(curie) assert res['name'] == '(17R)-13-ethyl-17-ethynyl-17-hydroxy-11-' \ 'methylidene-2,6,7,8,9,10,12,14,15,16-decahydro-1H-' \ 'cyclopenta[a]phenanth...
Python
0
@@ -389,19 +389,20 @@ up(' -FPLX', 'ERK +HGNC', '1097 ')%0A @@ -431,11 +431,12 @@ == ' -ERK +BRAF ', r
563cd9183231f0087ace974bb67bd1123ba93bb2
label is singlar
notes/tests.py
notes/tests.py
import datetime from django.core.urlresolvers import reverse from django.utils import timezone from django.test import TestCase from .models import Note, Label class NoteMethodTests(TestCase): def test_was_published_recently_with_future_note(self): """ was_published_recently() should return False for notes...
Python
0.999981
@@ -5066,33 +5066,32 @@ _note_with_label -s (note_title=%22Dea @@ -5163,33 +5163,32 @@ _note_with_label -s (note_title=%22Feb @@ -5987,17 +5987,16 @@ th_label -s (note_ti
0c0c20229d91e183af61c2e243f50054336520f2
Handle title and alignment in reporter.
indra/tools/reading/util/reporter.py
indra/tools/reading/util/reporter.py
from reportlab.lib.enums import TA_JUSTIFY from reportlab.lib.pagesizes import letter from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch class Reporter(object): def __init__(self, name...
Python
0
@@ -504,21 +504,122 @@ elf. -sections = %7B%7D +title = name%0A self.sections = %7B%7D%0A return%0A%0A def set_title(self, title):%0A self.title = title %0A @@ -927,18 +927,149 @@ story = -%5B%5D +list(self._preformat_text(self.title, style='Title',%0A ...
d65abc2f75f327508683ee5329aa49aff61f702f
use sys.stdout.isatty instead of os.isatty
nutils/core.py
nutils/core.py
# -*- coding: utf8 -*- # # Module CORE # # Part of Nutils: open source numerical utilities for Python. Jointly developed # by HvZ Computational Engineering, TU/e Multiscale Engineering Fluid Dynamics, # and others. More info at http://nutils.org <info@nutils.org>. (c) 2014 """ The core module provides a collection of ...
Python
0.000003
@@ -566,19 +566,8 @@ ut': - os.isatty( sys @@ -578,17 +578,15 @@ out. -fileno() +isatty( ),%0A
fbbad4269e28d7763e79a52104566f53100323a8
Allow any iterable to be handled as Component.
astm/codec.py
astm/codec.py
# -*- coding: utf-8 -*- # # Copyright (C) 2012 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # STX = '\x02' ETX = '\x03' EOT = '\x04' ENQ = '\x05' ACK = '\x06' LF = '\x0A' CR = '\x0D' NAK = '\x15'...
Python
0
@@ -210,16 +210,50 @@ ion.%0A#%0A%0A +from collections import Iterable%0A%0A STX = '%5C @@ -5060,21 +5060,37 @@ if -field is None +isinstance(field, basestring) :%0A @@ -5099,34 +5099,37 @@ _append( -'' +field )%0A elif i @@ -5145,30 +5145,25 @@ (field, -(list, tup +Iterab le) -) :%0A ...
28c0e714149839351a6b67a504356f223563cb2f
add mode
obztak/auto.py
obztak/auto.py
#!/usr/bin/env python """ Base class for calling obztak through the AUTOOBS named pipe mechanism. Based on the Scheduler class by Eric Neilsen TODO: - Replace ConfigParser with Yaml for consistency """ import os from datetime import datetime, timedelta import logging import subprocess from ConfigParser import Config...
Python
0.000001
@@ -1106,16 +1106,41 @@ nk = 10%0A + self.mode = None%0A @@ -3084,24 +3084,40 @@ ess=tmp.name +, mode=self.mode )%0A%0A # @@ -3370,26 +3370,49 @@ -#cmd += %22 -m wide%22 +if self.mode: cmd += %22 -m %25(mode)%22%25params # h @@ -3428,16 +3428,17 @@ for now%0A +%0A
7fd2060f2241bcff6849d570406dc057b9c7f8d1
Fix the message string
satchless/cart/views.py
satchless/cart/views.py
# -*- coding: utf-8 -*- from django.contrib import messages from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.utils.translation import ugettext from django.views.decorators.http import require_POST from . import models from . import forms def ca...
Python
1
@@ -209,16 +209,21 @@ ugettext + as _ %0Afrom dj @@ -756,32 +756,23 @@ -ugettext +_ (%22Cart -'s content upd @@ -767,16 +767,22 @@ content +s were updated
80691fa6d517b39a6656a2afc0635f485fd49974
add dependencies (#18406)
var/spack/repos/builtin/packages/gconf/package.py
var/spack/repos/builtin/packages/gconf/package.py
# Copyright 2013-2020 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 Gconf(AutotoolsPackage): """GConf is a system for storing application preferences.""" ...
Python
0.000001
@@ -540,24 +540,66 @@ a04d784c')%0A%0A + depends_on('pkgconfig', type='build')%0A depends_ @@ -647,186 +647,137 @@ 2')%0A -%0A -# TODO: add missing dependencies%0A # gio-2.0 %3E= 2.31.0%0A # gthread-2.0%0A # gmodule-2.0 %3E= 2.7.0%0A # gobject-2.0 %3E= 2.7.0%0A # dbus-1 %3E= 1.0.0%0A #...
bd0960cda8a66b843035935c7caa9f20b38b4d0d
Add 0.16.0 and address test suite issues (#27604)
var/spack/repos/builtin/packages/gpgme/package.py
var/spack/repos/builtin/packages/gpgme/package.py
# Copyright 2013-2021 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 Gpgme(AutotoolsPackage): """GPGME is the standard library to access GnuPG functions...
Python
0
@@ -475,17 +475,17 @@ pgme-1.1 -2 +6 .0.tar.b @@ -527,16 +527,113 @@ fig$'%5D%0A%0A + version('1.16.0', sha256='6c8cc4aedb10d5d4c905894ba1d850544619ee765606ac43df7405865de29ed0')%0A vers @@ -730,256 +730,1427 @@ -depends_on('gnupg', type='build')%0A depends_on('libgpg-error', type='build')%0A dep...
cd7b72e67a3af4184ccaf3e3dce231c227392f45
Update Keras.py
History/Nesterov-Accelerated-Gradient/Keras.py
History/Nesterov-Accelerated-Gradient/Keras.py
import keras from keras.datasets import mnist from keras.initializers import RandomUniform from keras.layers import Dense from keras.models import Sequential from keras.optimizers import SGD batch_size = 128 epochs = 30 num_classes = 10 (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = ...
Python
0
@@ -1406,19 +1406,17 @@ momentum - = += 0.9, nes @@ -1697,8 +1697,10 @@ y_test)) +%0D%0A
d3047f76711fd04a069cf17ab7f3f6b6ac54e131
fix error
chainer/functions/loss/sigmoid_cross_entropy.py
chainer/functions/loss/sigmoid_cross_entropy.py
import numpy import chainer from chainer.backends import cuda from chainer import function_node from chainer.functions.activation import sigmoid from chainer import utils from chainer.utils import type_check class SigmoidCrossEntropy(function_node.FunctionNode): """Sigmoid activation followed by a sigmoid cross...
Python
0.000002
@@ -749,12 +749,12 @@ eck. -name +args (in_
891207f20edfeadaf7f56ff90942f45732cfd0bb
fix building with mkl (#24338)
var/spack/repos/builtin/packages/kaldi/package.py
var/spack/repos/builtin/packages/kaldi/package.py
# Copyright 2013-2021 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 * from os.path import join from fnmatch import fnmatch import os class Kaldi(Package): # Does not u...
Python
0
@@ -2961,32 +2961,36 @@ c%5B'blas'%5D.prefix +.mkl )%0A if
219ec7659b06aece8a738198799893de5f28c2b2
Add to/from string methods for Box
rain/engine.py
rain/engine.py
from ctypes import CFUNCTYPE, POINTER from ctypes import Structure from ctypes import byref from ctypes import c_char_p from ctypes import c_int from ctypes import c_uint16 from ctypes import c_uint32 from ctypes import c_uint64 from ctypes import c_uint8 from ctypes import c_void_p from ctypes import cast import llvm...
Python
0
@@ -459,16 +459,246 @@ nt32)%5D%0A%0A + @classmethod%0A def from_str(cls, string):%0A str_p = c_char_p(string.encode(%22utf-8%22))%0A return cls(4, cast(str_p, c_void_p).value, len(string))%0A%0A def as_str(self):%0A return cast(self.data, c_char_p).value.decode(%22utf-8%22)%0A%0A Arg = PO
b8c18068c2cc2afe169c750f25318c6ba92e2763
use Spack compilers and remove x86_64 opts from Makefile (#13877)
var/spack/repos/builtin/packages/prank/package.py
var/spack/repos/builtin/packages/prank/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 Prank(Package): """A powerful multiple sequence alignment browser.""" homepage = "htt...
Python
0
@@ -743,16 +743,409 @@ 'src'):%0A +%0A filter_file('gcc', '%7B0%7D'.format(spack_cc),%0A 'Makefile', string=True)%0A filter_file('g++', '%7B0%7D'.format(spack_cxx),%0A 'Makefile', string=True)%0A if not spec.target.family == 'x86_64':%0A ...
26933550f7a3c195669c61539151c5fedf26aaad
add version 1.0.0 to r-hms (#21045)
var/spack/repos/builtin/packages/r-hms/package.py
var/spack/repos/builtin/packages/r-hms/package.py
# Copyright 2013-2021 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 RHms(RPackage): """Implements an S3 class for storing and formatting time-of-day values, ...
Python
0
@@ -242,16 +242,40 @@ %0A %22%22%22 +Pretty Time of Day%0A%0A Implemen @@ -339,21 +339,18 @@ ues, -%0A based +%0A on @@ -574,16 +574,112 @@ e/hms%22%0A%0A + version('1.0.0', sha256='9704e903d724f0911d46e5ad18b469a7ed419c5b1f388bd064fd663cefa6c962')%0A vers @@ -861,16 +861,153 @@ ff88')...
6a68d7b46e039dacc8b136c252fd1ff57e719734
Remove psutil; Retrieve cmdline manually.
instana/fsm.py
instana/fsm.py
import subprocess import os import psutil import socket import threading as t import fysom as f import instana.log as l import instana.agent_const as a class Discovery(object): pid = 0 name = None args = None fd = -1 inode = "" def __init__(self, **kwds): self.__dict__.update(kwds) ...
Python
0
@@ -28,22 +28,19 @@ %0Aimport -psutil +sys %0Aimport @@ -3103,56 +3103,326 @@ -p = psutil.Process(os.getpid())%0A s = None +s = None%0A pid = os.getpid()%0A%0A if os.path.isfile(%22/proc/self/cmdline%22):%0A with open(%22/proc/self/cmdline%22) as cmd:%0A cmdinfo ...
91cb70a94cd41bb6404fb6f21361bb8a7f01c9d5
Rework thread model
irrexplorer.py
irrexplorer.py
#!/usr/bin/env python # Copyright (c) 2015, Job Snijders # # This file is part of IRR Explorer # # 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...
Python
0
@@ -1559,16 +1559,37 @@ tabases%0A +nrtm_queue = Queue()%0A %0A%0Adef co @@ -1605,16 +1605,28 @@ m(config +, nrtm_queue ):%0A f @@ -1734,16 +1734,17 @@ ontinue%0A +# @@ -1748,16 +1748,21 @@ print + cmd, obj%0A @@ -1762,30 +1762,40 @@ obj%0A -print +nrtm_queue.put(( cmd, serial, @@ ...
82d180324cc4bf22d7dc13c15b334efdae0f4a1b
Raise error if empty data when expecting data
isp2/packet.py
isp2/packet.py
"""One data packet in Innovate Serial Protocol version 2 (ISP2). For data format specifications, see http://www.innovatemotorsports.com/support/downloads/Seriallog-2.pdf """ import struct class InnovatePacket(object): """An packet in the Innovate Serial Protocol version 2 (ISP2). ISP2 packets are composed ...
Python
0.000031
@@ -3934,16 +3934,143 @@ s(data)%0A + if not data and self.packet_length:%0A raise Exception('No data in packet, expected %25i' %25 self.packet_length)%0A
03f33b099ec9adc480f599338b61214e870fedf6
Update iypm_domain export name to use a valid format
iypm_domain.py
iypm_domain.py
import sys try: from troposphere import Join, Sub, Output, Export from troposphere import Parameter, Ref, Template from troposphere.route53 import HostedZone from troposphere.certificatemanager import Certificate except ImportError: sys.exit('Unable to import troposphere. ' 'Try "pip i...
Python
0
@@ -1055,28 +1055,16 @@ ckName%7D- -$%7BZoneName%7D- R53Zone' @@ -1238,20 +1238,8 @@ me%7D- -$%7BZoneName%7D- Cert
03b13e38467a94e784c6cac6915203e9a8924580
update for kazoo api change
jones/jones.py
jones/jones.py
""" Copyright 2012 DISQUS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distrib...
Python
0
@@ -5654,18 +5654,8 @@ .zk. -recursive_ dele @@ -5662,24 +5662,40 @@ te(self.root +, recursive=True )%0A%0A def g
0665beccbca954df9a477119bb976441c29dd5eb
fix test
test/sphinxext/test_sphinxext.py
test/sphinxext/test_sphinxext.py
import tempfile import os from sequana.sphinxext import snakemakerule from sphinx.application import Sphinx def test_doc(): res = snakemakerule.get_rule_doc("dag") res = snakemakerule.get_rule_doc("fastqc") try: res = snakemakerule.get_rule_doc("dummy") assert False except FileNotFo...
Python
0.000002
@@ -208,16 +208,24 @@ (%22fastqc +_dynamic %22)%0A%0A
da40c9a7c8bc54099e6115cb5e545a4ed51a083c
Remove unused argument
test/test_sqlalchemy_bigquery.py
test/test_sqlalchemy_bigquery.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from sqlalchemy.engine import create_engine from sqlalchemy.schema import Table, MetaData, Column from sqlalchemy import types, func, case from sqlalchemy.sql import expression, select, literal_column from sqlalchemy.exc import NoSuchTableError from sqlal...
Python
0.000009
@@ -5218,31 +5218,24 @@ ables(engine -, query ):%0A table
477ac5bb540e2d5c511945c9ef579368d0c9b897
Update version of Google Java Format
run-google-java-format.py
run-google-java-format.py
#!/usr/bin/python # This script reformats each file supplied on the command line according to # the Google Java style (by calling out to the google-java-format program, # https://github.com/google/google-java-format), but with improvements to # the formatting of annotations in comments. from __future__ import print_f...
Python
0
@@ -953,17 +953,17 @@ -2016112 -1 +3 %22%0A%0Agjf_j
30e1f6ca2224cba216c2e08f2600ae55ba43cebb
update comment
test/unit/test_disco_aws_util.py
test/unit/test_disco_aws_util.py
""" Tests of disco_aws_util """ from unittest import TestCase from disco_aws_automation import disco_aws_util class DiscoAWSUtilTests(TestCase): '''Test disco_aws_util.py''' def test_size_as_rec_map_with_none(self): """_size_as_recurrence_map works with None""" self.assertEqual(disco_aws_uti...
Python
0
@@ -224,33 +224,32 @@ lf):%0A %22%22%22 -_ size_as_recurren @@ -270,24 +270,24 @@ ith None%22%22%22%0A + self @@ -485,33 +485,32 @@ lf):%0A %22%22%22 -_ size_as_recurren @@ -726,33 +726,32 @@ lf):%0A %22%22%22 -_ size_as_recurren @@ -1037,17 +1037,16 @@ %22%22%22 -_ size_as_ ...
82ff239e462338b89e1baa96d78f0f5efddab856
Add @jugmac00's Products.ZopeTree to integration test suite
tests/integration/test_projects_using_isort.py
tests/integration/test_projects_using_isort.py
"""Tests projects that use isort to see if any differences are found between their current imports and what isort suggest on the develop branch. This is an important early warning signal of regressions. NOTE: If you use isort within a public repository, please feel empowered to add your project here! It is important t...
Python
0
@@ -4194,16 +4194,158 @@ etup.py%22)%0A )%0A +%0A%0Adef test_products_zopetree(tmpdir):%0A git_clone(%22https://github.com/jugmac00/Products.ZopeTree.git%22, tmpdir)%0A run_isort(%5Bstr(tmpdir)%5D)%0A
0df416d66ee6c28512295de297f44597b45acf7a
Bump version for release
src/pip/__init__.py
src/pip/__init__.py
__version__ = "19.2.dev0"
Python
0
@@ -16,11 +16,6 @@ 19.2 -.dev0 %22%0A
e2ce9caa84d0932b72894f17dc2c4884cc285bb0
update test case for jaccard
tests/TestReleaseScoringAlice.py
tests/TestReleaseScoringAlice.py
from subfind.release.alice import ReleaseScoringAlice __author__ = 'hiepsimu' import logging import unittest logging.basicConfig(level=logging.DEBUG) class ReleaseScoringAliceTestCase(unittest.TestCase): def test_01(self): """ Release which match the movie title should be the higher priority ...
Python
0
@@ -1,8 +1,35 @@ +from pprint import pprint%0A%0A from sub @@ -856,16 +856,786 @@ ame'%5D)%0A%0A + def test_02(self):%0A %22%22%22%0A Test 100%25 match%0A%0A :return:%0A :rtype:%0A %22%22%22%0A scoring = ReleaseScoringAlice()%0A input_release_name = '400.Days.2015.1...
04b91b797de680a970d77de76bed31934a38ede0
remove "transition" markup
sphinxprettysearchresults/__init__.py
sphinxprettysearchresults/__init__.py
import pkg_resources, shutil, subprocess import docutils from docutils import nodes from docutils.nodes import * from sphinx.jinja2glue import SphinxFileSystemLoader def clean_txts(language, srcdir, outdir, source_suffix, use_old_search_snippets): if not isinstance(outdir, str) and isinstance(outdir, unicode):...
Python
0.001275
@@ -2036,17 +2036,16 @@ (strong) - %5C%0A @@ -2079,17 +2079,16 @@ st_item) - %5C%0A @@ -2122,16 +2122,61 @@ ference) + %5C%0A + doctree.traverse(transition) %0A @@ -2217,24 +2217,25 @@ new +_ node = parag @@ -2256,16 +2256,17 @@ new +_ node.app @@ -2327,16 +2327,1...
9a7eeb52704eb8d2d4034061edbd63251a8f1b9d
Improve name of test to fix for #623 indicating fresh row.
tests/test_loom_simulate_bivariate_gaussian.py
tests/test_loom_simulate_bivariate_gaussian.py
# -*- coding: utf-8 -*- # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # 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/LICENS...
Python
0
@@ -4255,16 +4255,22 @@ pulated_ +fresh_ row(seed
c535c22884dbb0df227d4ad142e4d4515415ca29
Switch to wav test files for gstreamer tests
tests/backends/gstreamer_test.py
tests/backends/gstreamer_test.py
import unittest import os from mopidy.models import Playlist, Track from mopidy.backends.gstreamer import GStreamerBackend from tests.backends.base import (BasePlaybackControllerTest, BaseCurrentPlaylistControllerTest) folder = os.path.dirname(__file__) folder = os.path.join(folder, ...
Python
0
@@ -400,11 +400,11 @@ g%25s. -mp3 +wav ')%0As
9e0725483e80a4e98d2635b90a268d00e4eae9f3
Update insertion-sort-1.py
hackerrank/insertion-sort-1.py
hackerrank/insertion-sort-1.py
''' https://www.hackerrank.com/challenges/insertionsort1 Sorting One common task for computers is to sort data. For example, people might want to see all their files on a computer sorted by size. Since sorting is a simple problem with many different possible solutions, it is often used to introduce the study of algor...
Python
0.000001
@@ -1710,32 +1710,47 @@ print -_list(ar +(' '.join(map(str, ar)) )%0A @@ -1838,16 +1838,31 @@ rint -_list(ar +(' '.join(map(str, ar)) )%0A @@ -2048,9 +2048,20 @@ inserti +on_sort(ar) %0A
5c5d85983ae32618d8e2e51ce38006389b054de3
fix missing slots in forms test domain
tests/core/actions/test_forms.py
tests/core/actions/test_forms.py
from aioresponses import aioresponses from rasa.core.actions.action import ACTION_LISTEN_NAME from rasa.core.actions.forms import FormAction, REQUESTED_SLOT from rasa.core.channels import CollectingOutputChannel from rasa.core.domain import Domain from rasa.core.events import ( Form, SlotSet, UserUttered, ...
Python
0.000002
@@ -1845,24 +1845,81 @@ %7Bslot_name%7D%0A + slots:%0A %7Bslot_name%7D:%0A type: unfeaturized%0A %22%22%22%0A @@ -1978,35 +1978,128 @@ action.run( -None, None, +%0A CollectingOutputChannel(),%0A TemplatedNaturalLanguageGenerator(domain.templates),%0A tracker, do @@ -208...
eac24cf987ce6eb88d943a6a26f9c135592e2f86
add columns for year, month, day
samples-train-analysis.py
samples-train-analysis.py
'''analyze WORKING/samples-train.csv INVOCATION: python samles-train-analys.py ARGS INPUT FILES: WORKING/samples-train.csv OUTPUT FILES: WORKING/ME/0log.txt log file containing what is printed WORKING/ME/transactions.csv with columns apn | date | sequence | actual_price ''' import argparse import collect...
Python
0.999863
@@ -1375,56 +1375,8 @@ ed,%0A - validation_month=Month.Month(2005, 12),%0A @@ -2419,140 +2419,571 @@ -new_df = pd.DataFrame(%0A data=%7B%0A 'apn': int(apn),%0A 'date': int(date) +date = int(date)%0A date_year = int(date ...
4d1fa4bee77eba19cb0a4c80032f30dcc89e6b98
Fix date check
dcache-billing/python/download_billing_logs.py
dcache-billing/python/download_billing_logs.py
#!/usr/bin/env python import sys import urllib2 import argparse FAXBOX_PROCESSED_CSV_URL = "http://login.usatlas.org/logs/mwt2/dcache-billing/processed/" FAXBOX_RAW_CSV_URL = "http://login.usatlas.org/logs/mwt2/dcache-billing/raw/" def download_log(date_string): """ Download job log files from Amazon EC2 ma...
Python
0.00106
@@ -1762,9 +1762,10 @@ != -8 +10 :%0A
6ed3d0d8f554e578b65db89e5c5f88cd14bfaea4
Update tools/hcluster_sg_parser/hcluster_sg_parser.py
tools/hcluster_sg_parser/hcluster_sg_parser.py
tools/hcluster_sg_parser/hcluster_sg_parser.py
""" A simple parser to convert the hcluster_sg output into lists of IDs, one list for each cluster. When a minimum and/or maximum number of cluster elements are specified, the IDs contained in the filtered-out clusters are collected in the "discarded IDS" output dataset. Usage: python hcluster_sg_parser.py [-m <N>] ...
Python
0
@@ -1692,14 +1692,8 @@ .dir - != %22%22 :%0A @@ -1733,53 +1733,41 @@ = o -ptions.dir + %22/%22 + cluster_id + '_output.txt' +s.path.join(options.dir, outfile) %0A
0f7cb25ea5a3fbb3c88f4fd7207144f29140f69c
Change happy_numbers to check for number 4.
happy_numbers/happy_numbers.py
happy_numbers/happy_numbers.py
""" Happy numbers solution, code eval. https://www.codeeval.com/open_challenges/39/ A happy number is defined by the following process. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endle...
Python
0
@@ -944,20 +944,11 @@ (num -, past=%5B%5D ):%0A + @@ -994,16 +994,68 @@ num -in past: +== 4: # all unhappy numbers end up in cycle including 4 %0A @@ -1082,33 +1082,8 @@ se:%0A - past.append(num)%0A @@ -1127,16 +1127,16 @@ (num)%5D)%0A + @@ -1162,14 +1162,8 @@ (num -, past ...
5af16432976f72de1d86f1d725205c4ec6a6caa2
Add warning when entity not found in reproduce_state
homeassistant/helpers/state.py
homeassistant/helpers/state.py
""" homeassistant.helpers.state ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Helpers that help with state related things. """ import logging from homeassistant.core import State import homeassistant.util.dt as dt_util from homeassistant.const import ( STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID) _LOGGE...
Python
0.000003
@@ -1525,16 +1525,134 @@ s None:%0A + _LOGGER.warning('reproduce_state: Unable to find entity %25s',%0A state.entity_id)%0A @@ -1860,16 +1860,33 @@ arning(%22 +reproduce_state: Unable t @@ -1907,16 +1907,40 @@ ate -for %25s%22, +%0A st...
6f3f171707d456c49167af381bd65dbbb0b3ce06
Add checksum for test_consistency (#9570)
tests/python/gpu/test_forward.py
tests/python/gpu/test_forward.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
0.000001
@@ -857,16 +857,46 @@ import * +%0Afrom mxnet.gluon import utils %0A%0Adef _g @@ -1796,98 +1796,516 @@ -download(%22http://data.mxnet.io/data/test_images_%25d_%25d.npy%22 %25 (shape), dirname='data' +hash_test_img = %22355e15800642286e7fe607d87c38aeeab085b0cc%22%0A hash_inception_v3 = %2291807dfdbd336eb3b265...
e2553fd92216c57faddb7f1a161a840b04e67e42
Add tests for market orders
tests/shipane_sdk/test_client.py
tests/shipane_sdk/test_client.py
# -*- coding: utf-8 -*- import logging import os import unittest import six from hamcrest import * from requests import HTTPError from six.moves import configparser from shipane_sdk import Client from shipane_sdk.client import MediaType from tests.shipane_sdk.matchers.dataframe_matchers import * if six.PY2: Con...
Python
0
@@ -2870,32 +2870,724 @@ urce'%5D, %22%E5%AE%9E%E7%9B%98%E6%98%93%22)%0A%0A + def test_buy_stock_at_market_price(self):%0A try:%0A order = self.client.buy(self.client_param, symbol='000001', type='MARKET', priceType=4, amount=100)%0A self.assertIsNotNone(order%5B'id'%5D)%0A excep...
a01efdffeb12d56c1e24932396ffd51b659cc8fd
Write a test for `metaclasses`.
tests/test_generic_decorators.py
tests/test_generic_decorators.py
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$Mar 25, 2015 13:30:52 EDT$" import functools import nanshe.nanshe.generic_decorators class TestGenericDecorators(object): def test_update_wrapper(self): def wrapper(a_callable): def wrapped(*args, **kwargs): ...
Python
0
@@ -3195,8 +3195,554 @@ bject__%0A +%0A%0A def test_metaclasses(self):%0A class Meta1(type):%0A pass%0A%0A class Meta2(type):%0A pass%0A%0A class Class(object):%0A pass%0A%0A ClassWrapped = nanshe.nanshe.generic_decorators.metaclasses(%0A Meta1...