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
51ae4907ce5e2c3352ebe8e9a2a7b41a243cab3d
Add note about pattern constraint use
jsontableschema/constraints.py
jsontableschema/constraints.py
import re from dateutil.parser import parse as date_parse from . import compat from . import exceptions class NoConstraintsSupportedMixin(object): '''All constraints raise a ConstraintNotSupported exception''' def _raise_constraint_not_supported(self, field_type, constraint): raise exceptions.Cons...
Python
0
@@ -3937,32 +3937,127 @@ Mixin(object):%0A%0A + '''Pattern constraint should be checked as a string value before the value%0A is cast'''%0A%0A def check_pa
f3578096219dbb82572063c8a6dbb75be4da07ac
Update P03_combinePDFs fixed reading encrypted files
books/AutomateTheBoringStuffWithPython/Chapter13/P03_combinePDFs.py
books/AutomateTheBoringStuffWithPython/Chapter13/P03_combinePDFs.py
#! python3 # combinePdfs.py - Combines all the PDFs in the current working directory into # a single PDF. import PyPDF4, os # Get all the PDF filenames. pdfFiles = [] for filename in os.listdir('.'): if filename.endswith(".pdf"): pdfFiles.append(filename) pdfFiles.sort(key=str.lower) pdfWriter = PyPDF4.P...
Python
0
@@ -476,16 +476,223 @@ ileObj)%0A + if pdfReader.isEncrypted and filename == %22encrypted.pdf%22:%0A pdfReader.decrypt(%22rosebud%22)%0A if pdfReader.isEncrypted and filename == %22encryptedminutes.pdf%22:%0A pdfReader.decrypt(%22swordfish%22)%0A # Lo
7bd54dda24f26662a1525c4b5a76374dbdbc1686
add test for watch
test/test_blacklists.py
test/test_blacklists.py
#!/usr/bin/env python3 # coding=utf-8 import yaml from os import unlink import pytest from blacklists import * from helpers import files_changed, blacklist_integrity_check def test_blacklist_integrity(): errors = blacklist_integrity_check() if len(errors) == 1: pytest.fail(errors[0]) elif len(...
Python
0
@@ -4127,28 +4127,816 @@ ed_nses.yml', YAMLParserNS)%0A +%0A%0Adef test_tsv_watchlist():%0A with open('test_watched_keywords.txt', 'w') as t:%0A t.write('%5Ct'.join(%5B'1495006487', 'tripleee', 'one two%5Cn'%5D))%0A t.write('%5Ct'.join(%5B'1495006488', 'tripleee', 'three four%5Cn'%5D))%0A watchlist...
4726cd620bb764ecb7a2b2b5848842a45437f63b
Add `check_status` to config parameter [aws add-on]
jumeaux/addons/final/aws.py
jumeaux/addons/final/aws.py
# -*- coding:utf-8 -*- """For example of config final: - name: jumeaux.addons.final.aws config: table: jumeaux-report bucket: jumeaux-report cache_max_age: 600 """ import logging import shutil from decimal import Decimal import boto3 import os import json from owlmixin import OwlMixin from jumeaux.ad...
Python
0
@@ -2374,16 +2374,52 @@ try_hash +,%0A %22check_status%22: 'todo' %0A
f71ab4f8db04a569543fa5aa6ce05ee9f95479e9
Add Neutron CLI tests to tempest
tempest/cli/__init__.py
tempest/cli/__init__.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 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.apach...
Python
0.000001
@@ -2959,32 +2959,270 @@ dmin, fail_ok)%0A%0A + def neutron(self, action, flags='', params='', admin=True, fail_ok=False):%0A %22%22%22Executes neutron command for the given action.%22%22%22%0A return self.cmd_with_auth(%0A 'neutron', action, flags, params, admin, fail_ok)%0A%0A def cm...
8827f00e5359489aec1bda25c250fc59b02dca43
Add prefix flag and refactor prefix check
ggd/list_files.py
ggd/list_files.py
#------------------------------------------------------------------------------------------------------------- ## Import Statements #------------------------------------------------------------------------------------------------------------- from __future__ import print_function import sys import os import glob import...
Python
0
@@ -1790,16 +1790,30 @@ prefix%22, + default=None, help=%22( @@ -3954,124 +3954,19 @@ T = -conda_root()%0A%0A ## Check if prefix paramter is set, and if so check that the prefix is a real conda enviroment%0A +args.prefix if @@ -3980,20 +3980,20 @@ efix -:%0A if + != None and pre @@ -4021,49 +402...
24b39e457519f45df55a90a6c6c92fa8df5128b7
Disable abc metaclass due to issues with pickling.
sdks/python/apache_beam/utils/urns.py
sdks/python/apache_beam/utils/urns.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 us...
Python
0
@@ -1999,16 +1999,97 @@ %22%22%22%0A%0A + # TODO(robertwb): Figure out issue with dill + local classes + abc metaclass%0A # __metac
c958fed31b7ab7fedb51c23eee40f781b6e09075
Fix error checking in git mirroring commands
git/mirror/gitmirror.py
git/mirror/gitmirror.py
#!/usr/bin/env python """ Mirror repos between github and bitbucket for safety. Uses a bare checkout and a mirror push. Assumes you have git access via SSH key and that the key passphrase is held in an agent. EXAMPLES Mirror Github neilhwatson/nustuff to Bitbucket neilhwatson/nustuff gitmirror.py --git2bit neilhwa...
Python
0.000003
@@ -3097,12 +3097,14 @@ ess. -PIPE +STDOUT , sh @@ -3129,16 +3129,21 @@ t_code = + int( proc.wa @@ -3146,16 +3146,18 @@ c.wait() + ) %0A if @@ -3185,16 +3185,27 @@ raise + Exception( proc.st @@ -3208,16 +3208,18 @@ c.stderr + ) %0A%0A re
26ce46c14f3fc5d38253617822974c21b488dd95
Set priority to 0, set viability to permanently null. Add test to ensure keyring can render itself. Ref #358.
keyring/backends/chainer.py
keyring/backends/chainer.py
""" Implementation of a keyring backend chainer. This is specifically not a viable backend, and must be instantiated directly with a list of ordered backends. """ from __future__ import absolute_import from ..backend import KeyringBackend class ChainerBackend(KeyringBackend): def __init__(self, backends): ...
Python
0
@@ -271,24 +271,165 @@ ngBackend):%0A + %22%22%22%0A %3E%3E%3E ChainerBackend(())%0A %3Ckeyring.backends.chainer.ChainerBackend object at ...%3E%0A %22%22%22%0A%0A priority = 0%0A viable = False%0A%0A def __in
239ad90ccc3faff0bfaaa5059305a93649978e93
this is duplicated
simplui/container.py
simplui/container.py
# ---------------------------------------------------------------------- # Copyright (c) 2009 Tristam MacDonald # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source...
Python
0.999434
@@ -2666,136 +2666,8 @@ )%0A%09%0A -%09def update_global_coords(self):%0A%09%09Widget.update_global_coords(self)%0A%09%09%0A%09%09for c in self.children:%0A%09%09%09c.update_global_coords()%0A%09%0A %09def
d6ef946df0497868de9d035ab0d56d0d828c2be1
Disable failing assertion in python test
tests/query_test/test_hdfs_fd_caching.py
tests/query_test/test_hdfs_fd_caching.py
# Copyright 2012 Cloudera 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 agreed to in writing, so...
Python
0.000001
@@ -2753,24 +2753,263 @@ vector)%0A%0A + # TODO This assertion fails reliably in the Kudu feature branch build for reasons yet%0A # unknown, since it seems unrelated to other changes. Once the root cause for the%0A # failure is known this assertion should be uncommented.%0A # assert num_
56598776ce6588445cf0d76b5faaea507d5d1405
Update Labels for consistency
github3/issues/label.py
github3/issues/label.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from json import dumps from ..decorators import requires_auth from ..models import GitHubCore class Label(GitHubCore): """The :class:`Label <Label>` object. Succintly represents a label that exists in a repository. See also: http://develope...
Python
0
@@ -17,16 +17,62 @@ f-8 -*-%0A +%22%22%22Module containing the logic for labels.%22%22%22%0A from __f @@ -236,52 +236,9 @@ %22%22%22 -The :class:%60Label %3CLabel%3E%60 object. Succintly +A rep @@ -243,17 +243,24 @@ epresent -s +ation of a label @@ -264,25 +264,24 @@ bel -that%0A exists i +object defined ...
50ad60f45466a3e547174130fa06107f47b1a77b
Make EMPTY actually send an empty string
requestbuilder/__init__.py
requestbuilder/__init__.py
# Copyright (c) 2012, Eucalyptus Systems, Inc. # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the # above copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DIS...
Python
0.000066
@@ -4367,16 +4367,72 @@ lf: %22''%22 +,%0A '__str__': lambda self: '' %7D)()%0A%0A#
9626736dc94c85987472b7d7ad5951363883a5dc
Disable Facter plugin if yaml import fails
JsonStats/FetchStats/Plugins/Facter.py
JsonStats/FetchStats/Plugins/Facter.py
import datetime from JsonStats.FetchStats import Fetcher import os.path class Facter(Fetcher): """ Facter plugin for `jsonstats`. Returns key-value pairs of general system information provided by the `facter` command. Load conditions: * Plugin will load if the `facter` command is found Opera...
Python
0
@@ -538,16 +538,61 @@ cter-101 +%0A * PyYAML - http://pyyaml.org/wiki/PyYAML %0A%0A Op @@ -688,19 +688,76 @@ -import yaml +try:%0A import yaml%0A except ImportError:%0A yaml = None %0A%0A @@ -859,16 +859,126 @@ /null'%0A%0A + if self.yaml is None:%0A self._loaded(Fal...
4f4216b56bef952fda37fb2ef35765bb53cba54a
Result.__repr__ should indicate properties in proper case
couchbase/_bootstrap.py
couchbase/_bootstrap.py
# # Copyright 2013, Couchbase, 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 l...
Python
0.999998
@@ -1523,10 +1523,10 @@ = %22 -RC +rc =0x%7B @@ -1725,17 +1725,17 @@ append(%22 -K +k ey=%7B0%7D%22. @@ -1847,17 +1847,17 @@ append(%22 -V +v alue=%7B0%7D @@ -1969,19 +1969,19 @@ append(%22 -CAS +cas =0x%7Bcas: @@ -2093,17 +2093,17 @@ append(%22 -F +f lags=0x%7B @@ -2238,12 +2238,19 @@ nd(%22 -HTTP +http_st...
9a4b3dbaba3f32a27f4cc5eaf74ef9b44a051472
Fix some formatting
tests/integration/cloud/providers/test_vmware.py
tests/integration/cloud/providers/test_vmware.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Megan Wilhite <mwilhite@saltstack.com>` ''' # Import Python Libs from __future__ import absolute_import import os import random import string # Import Salt Libs from salt.config import cloud_providers_config, cloud_config # Import Salt Testing LIbs from tests.sup...
Python
0.999998
@@ -271,17 +271,16 @@ config%0A%0A -%0A # Import @@ -3383,16 +3383,42 @@ nstance, +%0A msg='Ha
764f785bfa34d99dc2633db78a0d80407e401993
Implement a client instance
zuora/client.py
zuora/client.py
""" Client for Zuora SOAP API """ # TODO: # - Handle debug # - Handle error # - Session policy from suds.client import Client from suds.sax.element import Element class ZuoraException(Exception): """ Base Zuora Exception. """ pass class Zuora(object): """ SOAP Client based on Suds """...
Python
0.000426
@@ -160,16 +160,72 @@ lement%0A%0A +from zuora.transport import HttpTransportWithKeepAlive%0A%0A %0Aclass Z @@ -503,8 +503,275 @@ assword%0A +%0A self.session = None%0A self.wsdl_path = 'file://%25s' %25 os.path.abspath(self.wsdl)%0A%0A self.client = Client(%0A self.wsdl_path,%0A ...
88206513d4a04a99832ac8461a3209b2d1d7d2c8
make test work
tests/test_quality/test_restoringbeam.py
tests/test_quality/test_restoringbeam.py
import os import unittest2 as unittest from tkp.quality.restoringbeam import beam_invalid from tkp.testutil.decorators import requires_data from tkp import accessors from tkp.testutil.data import DATAPATH fits_file = os.path.join(DATAPATH, 'quality/noise/bad/home-pcarrol-msss-3C196a-analysis-band6.corr.fits') ...
Python
0.000195
@@ -553,16 +553,23 @@ semimin +, theta ))%0A%0A
716ffae543838af6de7b83723ac6048a9f8f390a
improve test list latest articles
knowledge/tests/tests_views.py
knowledge/tests/tests_views.py
from __future__ import unicode_literals from model_mommy import mommy from knowledge.base import choices from knowledge.base.test import ViewTestCase from knowledge.models import Article class HomepageTestCase(ViewTestCase): from knowledge.views import Homepage view_class = Homepage view_name = 'knowl...
Python
0.000001
@@ -1060,23 +1060,19 @@ est_ -count_published +list_latest _art @@ -1096,248 +1096,184 @@ -response = self.get()%0A category_list = response.context_data%5B'category_list'%5D%0A%0A self.assertHttpOK(response)%0A self.assertEqual(category_list%5B0%5D.get_articles_count(), 1)%0A%0A def tes...
f739b25c199fe44a6fd672ac8a01a3fc16f72e82
Add test that expects fatal error when passing `filter` with too many `.`
test/test_run_script.py
test/test_run_script.py
import subprocess import pytest def test_filter(tmp_path): unit_test = tmp_path.joinpath('some_unit_test.sv') unit_test.write_text(''' module some_unit_test; import svunit_pkg::*; `include "svunit_defines.svh" string name = "some_ut"; svunit_testcase svunit_ut; function void build(); svunit_...
Python
0
@@ -3390,28 +3390,708 @@ 'fatal' in log.read_text()%0A +%0A%0A%0Adef test_filter_with_extra_dot(tmp_path):%0A dummy_unit_test = tmp_path.joinpath('dummy_unit_test.sv')%0A dummy_unit_test.write_text('''%0Amodule dummy_unit_test;%0A%0A import svunit_pkg::*;%0A %60include %22svunit_defines.svh%22%0A%0A string n...
faa912ed8d2cb68b2f8661ed3550745967f58ba1
fix broken config path
test/test_transports.py
test/test_transports.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 datetime import ssl from datetime import date import pytest from wampy.peers.clients import Client from wampy.p...
Python
0.000004
@@ -721,20 +721,8 @@ bar. -config.ipv4. json
ea3e4dea51d4daa7381a19b65553f2526d0b4760
correct docstring reference.
balloon_learning_environment/utils/sampling_test.py
balloon_learning_environment/utils/sampling_test.py
# coding=utf-8 # Copyright 2021 The Balloon Learning Environment Authors. # # 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 require...
Python
0.001089
@@ -660,14 +660,13 @@ ent. -google +utils .sam
1112495ae59542ad76d1cc72f40ab91e7e562f1c
Simplify mac_epoch_diff
Lib/fontTools/ttLib/tables/_h_e_a_d.py
Lib/fontTools/ttLib/tables/_h_e_a_d.py
from __future__ import print_function, division from fontTools.misc.py23 import * from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval, num2binary, binary2num from . import DefaultTable import time import calendar headFormat = """ > # big endian tableVersion: 16.16F fontRevisio...
Python
0.999998
@@ -2177,54 +2177,11 @@ )%0A%0A%0A -def calc_mac_epoch_diff():%0A%09%22%22%22calculate the d +# D iffe @@ -2223,18 +2223,17 @@ h (1904) -%0A%09 + to the e @@ -2258,411 +2258,71 @@ ne.%0A -%09%22%22%22%0A%09safe_epoch_t = (1972, 1, 1, 0, 0, 0, 0, 0, 0)%0A%09safe_epoch = time.mktime(safe_epoch_t) - time.timezone%0A...
c69ac39ee650445533d31a4a476f6f3b14cb43ca
Update roles.py
site/models/roles.py
site/models/roles.py
import datetime, re; from sqlalchemy.orm import validates; from server import DB, FlaskServer; class Roles(DB.Model): id = DB.Column(DB.Integer, primary_key=True, autoincrement=True); name = DB.Column(DB.String(20); district_id = DB.relationship(DB.Integer, DB.ForeignKey('district.id')); created_by = DB....
Python
0.000001
@@ -473,31 +473,16 @@ ers.id') -, nullable=True );%0D%0A%09upd
a39dcc1548bea483225635292c5e1f489a3288a2
support direct line navigation shorthand (submission from RUBY-12579 improved) #RUBY-12579 fixed
platform/platform-resources/src/launcher.py
platform/platform-resources/src/launcher.py
#!/usr/bin/python import socket import struct import sys import os import os.path import time # see com.intelij.idea.SocketLock for the server side of this interface RUN_PATH = '$RUN_PATH$' CONFIG_PATH = '$CONFIG_PATH$' args = [] skip_next = False for arg in sys.argv[1:]: if arg == '-l' or arg == '--line': ...
Python
0
@@ -289,162 +289,682 @@ = '- -l' or arg == '--line':%0A args.append(arg)%0A skip_next = True%0A elif skip_next:%0A args.append(arg)%0A skip_next = False%0A else:%0A +h' or arg == '-?' or arg == '--help':%0A print 'Usage: ' + sys.argv%5B0%5D + ' %5B-h%7C-?%7C--help%5D %5B-l%7C--...
7d81f6000e9b29059eafdc7f82598ea78c048119
Fix linter
tests/unit/modules/test_libcloud_loadbalancer.py
tests/unit/modules/test_libcloud_loadbalancer.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Anthony Shaw <anthonyshaw@apache.org>` ''' # Import Python Libs from __future__ import absolute_import, unicode_literals, print_function # Import Salt Testing Libs from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase, skipI...
Python
0.000002
@@ -640,42 +640,16 @@ alse -%0A MockLBDriver = object %0A%0Aif HAS LIBC @@ -644,16 +644,17 @@ %0A%0Aif HAS +_ LIBCLOUD @@ -714,24 +714,49 @@ nit__(self): + # pylint: disable=W0231 %0A @@ -2623,16 +2623,50 @@ MBER%5D%0A%0A%0A +else:%0A MockLBDriver = object%0A%0A%0A def get_
c22a0c795e5856279090ff12db435b45c1515100
increase count time on ip retrieval within ansible utils
kvirt/ansibleutils/__init__.py
kvirt/ansibleutils/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ interact with a local/remote libvirt daemon """ import os import time from kvirt.common import pprint from yaml import dump def play(k, name, playbook, variables=[], verbose=False, user=None, tunnel=False, tunnelhost=None, tunnelport=None, tunneluser=None, y...
Python
0
@@ -659,33 +659,34 @@ hile counter != -8 +12 0:%0A ip = @@ -3124,17 +3124,18 @@ nter != -8 +12 0:%0A
15c4d677af6e2aabf757bc5d0b8df88413581c67
Fix filename of cuDNN 8.1 for CUDA 10.2 on Windows
cupyx/tools/install_library.py
cupyx/tools/install_library.py
#!/usr/bin/env python """ CUDA Library Installer Installs the latest CUDA library supported by CuPy. """ # This script will also be used as a standalone script when building wheels. # Keep the script runnable without CuPy dependency. import argparse import json import os import platform import shutil import sys imp...
Python
0.000784
@@ -1778,32 +1778,34 @@ dnn-10.2-windows +10 -x64-v8.1.0.77.z
8a5d931cb66dc452e9db6f52ac7fcc371a855608
Update curate_teleco_performance_data.py
lab-01/cell-tower-anomaly-detection/00-scripts/curate_teleco_performance_data.py
lab-01/cell-tower-anomaly-detection/00-scripts/curate_teleco_performance_data.py
# ====================================================================================== # ABOUT # In this PySpark script, we augment the Telecom data with curated customer data (prior # job), curate it and persist to GCS # ====================================================================================== import c...
Python
0
@@ -2672,16 +2672,44 @@ riginal%0A +telecomCustomerChurnFinalDF= telecomC @@ -2844,32 +2844,60 @@ mn, customer_ID%0A +telecomCustomerChurnFinalDF= telecomCustomerC
ea542282911cbc7b3cf594a20175fbddcbd75a89
Use absolute import
restapi_logging_handler/__init__.py
restapi_logging_handler/__init__.py
from loggly_handler import LogglyHandler from restapi_logging_handler import RestApiHandler
Python
0.000045
@@ -1,13 +1,77 @@ from +__future__ import absolute_import%0A%0Afrom restapi_logging_handler. loggly_h @@ -118,32 +118,56 @@ _logging_handler +.restapi_logging_handler import RestApiH
128c54529da80d5f84a0bf8a9bca6e83ed14a342
Delete unused import
simplesqlite/loader/html/formatter.py
simplesqlite/loader/html/formatter.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import bs4 import dataproperty from ..constant import TableNameTemplate as tnt from ..data import TableData from ..error import InvalidDataError from ..formatter import TableFormatter class Htm...
Python
0.000001
@@ -230,45 +230,8 @@ ata%0A -from ..error import InvalidDataError%0A from
980f39eb6f17eb2469573dba71c4d7ac3d72220d
Order users by date joined
resrc/userprofile/views.py
resrc/userprofile/views.py
# -*- coding: utf-8 -*-: from django.shortcuts import redirect, get_object_or_404 from django.http import Http404 from django.contrib.auth.models import User, SiteProfileNotAvailable from django.contrib.auth.decorators import login_required from django.contrib.auth import authenticate, login, logout from django.contri...
Python
0
@@ -827,16 +827,40 @@ ='root') +.order_by('date_joined') %0A ret
de69aa9c04ea34bd31b5cf17e8e3cfdf17b0b9df
Naive user/password login w.o. encryption
1wire/publish.py
1wire/publish.py
#!/usr/bin/env python import os import argparse import time import threading from Queue import Queue import mosquitto queue = Queue(100) def main(host, port, sensors): print "#######################" print "Temperature poller v0.2" print "#######################" print "Using sensors:" pollers =...
Python
0.99999
@@ -153,16 +153,32 @@ t, port, + user, password, sensors @@ -180,16 +180,16 @@ nsors):%0A - prin @@ -531,16 +531,46 @@ st, port +, user=user, password=password )%0A pu @@ -1711,16 +1711,42 @@ st, port +, user=None, password=None ):%0A @@ -1920,16 +1920,125 @@ died.%22)%0A + if user is not N...
77bd24b0efa3c53b4c4cfdf5b6db00db8cf69063
Replace HOST_CFG with "host" as the former has been marked as deprecated.
tools/build_defs/apple/apple_genrule.bzl
tools/build_defs/apple/apple_genrule.bzl
# Copyright 2016 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Python
0.000332
@@ -2795,16 +2795,14 @@ cfg= -HOST_CFG +%22host%22 , al
7f02d1f2b23bbf27e99d87ef23c491823875c3d1
fix bin none subprocess.TimeoutExpired
bin/virt.py
bin/virt.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import yaml import subprocess import os import sys def proc(cmd,time = 120,sh = True ): print("$".format(cmd)) p = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE, shell=sh) try: outs, errs = p.communicate(timeout=time) except sub...
Python
0.000001
@@ -245,21 +245,8 @@ sh)%0A - try:%0A @@ -290,100 +290,8 @@ me)%0A - except subprocess.TimeoutExpired:%0A p.kill()%0A outs, errs = p.communicate()%0A
939cc5adba6f5a95aac317134eb841838a0bff3f
Tweak inheritance
rest_framework/viewsets.py
rest_framework/viewsets.py
""" ViewSets are essentially just a type of class based view, that doesn't provide any method handlers, such as `get()`, `post()`, etc... but instead has actions, such as `list()`, `retrieve()`, `create()`, etc... Actions are only bound to methods at the point of instantiating the views. user_list = UserViewSet.a...
Python
0.000001
@@ -4428,72 +4428,22 @@ -ViewSetMixin,%0A generics. Generic -API View +Set ):%0A @@ -4788,65 +4788,22 @@ -ViewSetMixin,%0A generics. Generic -API View +Set ):%0A
45e9ddce96b4fdadca63a50bf2808c7f98520d99
print query on error
data_upload/util/bq_wrapper.py
data_upload/util/bq_wrapper.py
''' Created on Jan 22, 2017 Copyright 2017, Institute for Systems Biology. 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.000446
@@ -1008,16 +1008,30 @@ legacy%0D%0A + try:%0D%0A quer @@ -1047,16 +1047,108 @@ .run()%0D%0A + except:%0D%0A log.exception('problem with query:%5Cn%7B%7D'.format(query))%0D%0A raise%0D%0A log.
8928d1987dd05def51b4d7abddbbd3658b300adb
Add handler for django.request logger to get reports of 5xx errors
learnwithpeople/settings.py
learnwithpeople/settings.py
""" Django settings for learnwithpeople project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ from __future__ import absolute_import # Build paths inside the pr...
Python
0
@@ -5136,32 +5136,174 @@ 'loggers': %7B%0A + 'django.request': %7B%0A 'handlers': %5B'mail_admins'%5D,%0A 'level': 'ERROR',%0A 'propagate': False,%0A %7D,%0A '': %7B%0A
1a417f83847030d47ac3eb596f61145b9768bc85
bump the schema version for samples
crits/samples/sample.py
crits/samples/sample.py
import json from mongoengine import Document from mongoengine import StringField, ListField from mongoengine import IntField from django.conf import settings from crits.samples.migrate import migrate_sample from crits.core.crits_mongoengine import CritsBaseAttributes from crits.core.crits_mongoengine import CritsSour...
Python
0
@@ -779,17 +779,17 @@ rsion%22: -4 +5 ,%0A
d590307b0d59ac7163016197e3de0e8bced377d2
Fix form typo
account_verification_flask/forms/forms.py
account_verification_flask/forms/forms.py
from flask_wtf import Form from wtforms import TextField, PasswordField, IntegerField from wtforms.validators import DataRequired, Length, Email, EqualTo class RegisterForm(Form): name = TextField( 'Tell us your name', validators = [DataRequired(message = "Name is required"), Length(min = 3,messag...
Python
0.000191
@@ -676,17 +676,16 @@ 'Coun -d try Code
a1826e5507a083cdcb906c411e97031bb5546eae
Remove debug print
cax/qsub.py
cax/qsub.py
""" Access the cluster. Easy to use functions to make use of the cluster facilities. This checks the available slots on the requested queue, creates the scripts to submit, submits the jobs, and cleans up afterwards. Example usage:: >>> import qsub >>> qsub.submit_job('touch /data/hisp...
Python
0.000003
@@ -2333,16 +2333,18 @@ ''):%0A + # print (
55e67e6c2d230530726c59c11615cbf4e16786fb
Fix RedirectView import
base/views.py
base/views.py
# -*- coding: utf-8 -*- """ This file contains some generic purpouse views """ # standard library # django from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.shortc...
Python
0
@@ -789,37 +789,32 @@ go.views.generic -.list import Redirect
ddaa9a687019794f61c019c5e3139a0b9ceaf521
enable C++ exception-handling
binding.gyp
binding.gyp
{ "target_defaults": { "conditions": [ ['OS=="win"', { }, { 'cflags' : [ "-fexceptions" ], 'cflags_cc' : [ "-fexceptions" ] } ] ], "configurations": { "Release": { 'msvs_settings': { 'VCCLCompilerTool': { 'WholeProgramOptimization': ...
Python
0.000012
@@ -643,16 +643,25 @@ '/MP' +, '/EHsc' %0A
ac6c5799307541c6de646addcbf103da1033a830
Correct html coding error.
smth_worklife_hot.py
smth_worklife_hot.py
#!/usr/bin/env python # coding=utf-8 import requests as rq import random as rd from BeautifulSoup import BeautifulSoup as bs from collections import namedtuple import datetime, time import sys reload(sys) sys.setdefaultencoding('utf-8') Topic = namedtuple('Topic', ['href', 'title', 'published_date', 'num_pages']) Ho...
Python
0.000006
@@ -2944,15 +2944,13 @@ set= -GB18030 +utf-8 '%3E%0A%09 @@ -3030,16 +3030,34 @@ le_page%0A +%09print type(page)%0A %09%0A%09f.wri
7998477a627a78b83f96894e72ec2f121c4b9606
Update binding.gyp
binding.gyp
binding.gyp
{ "targets": [ { 'target_name': 'LDAP', 'sources': [ 'src/LDAP.cc' ], 'include_dirs': [ '/usr/local/include' ], 'defines': [ 'LDAP_DEPRECATED' ], 'cflags': [ '-Wall', '-g' ], 'ldflags': [ '-L/usr/local...
Python
0
@@ -273,37 +273,39 @@ %5D,%0A 'l -dflag +ibrarie s': %5B%0A '- @@ -308,41 +308,75 @@ '- -L/usr/local/lib',%0A '-lldap +llber -lldap'%0A %5D,%0A 'ldflags': %5B%0A '-L/usr/local/lib '%0A
a101c98fff343cd283fc5f5ade555d4bf6187f20
Enable build on Windows 64bits.
binding.gyp
binding.gyp
{ 'variables': { 'source_root_dir': '<!(python tools/source_root_dir.py)', 'steamworks_sdk_dir': 'deps/steamworks_sdk', 'target_dir': 'lib' }, 'conditions': [ ['OS=="win"', { 'conditions': [ ['target_arch=="ia32"', { 'variables': { 'project_name': 'greenworks-w...
Python
0
@@ -2759,32 +2759,179 @@ %7D,%0A %5D,%0A + %5B'OS== %22win%22 and target_arch==%22x64%22',%0A %7B%0A 'defines': %5B%0A '_AMD64_',%0A %5D,%0A %7D,%0A %5D,%0A # For zl
996c8d4e9a65f411341f0c5f349ff3788cca0209
Use unittest assertions.
rinse/tests/test_client.py
rinse/tests/test_client.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Unit tests for rinse.client module.""" import unittest from lxml import etree from mock import MagicMock, patch from rinse.client import SoapClient from rinse.message import SoapMessage from .utils import captured_stdout class TestSoapMessage(unittest.TestCase): ...
Python
0
@@ -1156,16 +1156,53 @@ eaders)%0A + self.assertTrue(msg.etree())%0A %0A%0Aclass @@ -3170,31 +3170,41 @@ =1)%0A +self. assert - +Equal( client.timeo @@ -3205,21 +3205,20 @@ .timeout - == +, 1 +) %0A%0A @@ -3321,39 +3321,49 @@ r)%0A +self. assert - +Equal( client._session...
1d9808071e436d306f236856efe837a33f00fa96
Put keyboard visualizations on the rotary switch
gui-supervisor.py
gui-supervisor.py
#!/usr/bin/env python """Master program for the Organ Donor "Organelle" This program is mainly responsible for monitoring the physical rotary switch that allows users to select a major mode of operation for the Organelle. When it detects that the switch has been moved, it asks the current program to clean up and exit ...
Python
0.000001
@@ -2189,111 +2189,85 @@ : (%22 -xterm%22, %22-fullscreen -e ./organelle.py 4%22),%0A 13: (%22xterm%22, %22-fullscreen -e ./organe +./gui-play-keyboards.py%22, %22%22),%0A 13: (%22./gui-play-waterfa ll -e .py - 4 +%22, %22 %22),%0A @@ -2289,49 +2289,34 @@ : (%22 -xterm%22, %22-fullscreen -e...
c6fefc19b0bb64c19d85cce0750c3d94fb608d76
Fix path building for csv source files in team app.
django_football/teams/utils.py
django_football/teams/utils.py
import os import csv import json import pickle import logging from random import choice, randint from django.core.exceptions import ObjectDoesNotExist import python_football from .models import Playbook, City, Nickname, Team from people import names from people.models import Coach, Player from teams.models import g...
Python
0
@@ -171,16 +171,53 @@ otball%0A%0A +from settings.base import SITE_ROOT%0A%0A from .mo @@ -259,16 +259,16 @@ e, Team%0A - from peo @@ -375,16 +375,86 @@ _order%0A%0A +CSV_SOURCE_DIR = os.path.join(SITE_ROOT, 'teams', 'csv_source_files')%0A %0A## Init @@ -717,53 +717,24 @@ oin( -'django_football','teams','csv_sou...
182c2ea095dc5207b6d66ce1ad8e2ad2dc986da2
Fix test skipper
skimage/_shared/tests/test_testing.py
skimage/_shared/tests/test_testing.py
""" Testing decorators module """ import numpy as np from nose.tools import (assert_true, assert_raises, assert_equal) from skimage._shared.testing import doctest_skip_parser, test_parallel def test_skipper(): def f(): pass class c(): def __init__(self): self.me = "I think, ther...
Python
0.000003
@@ -362,32 +362,36 @@ Header%0A%0A + %3E%3E%3E something # @@ -407,32 +407,36 @@ ot HAVE_AMODULE%0A + %3E%3E%3E some @@ -448,32 +448,36 @@ + else%0A + %3E%3E%3E a = 1 # skip @@ -493,24 +493,28 @@ AVE_BMODULE%0A + %3E%3E%3E @@ -825,42 +825,21 @@ -assert_eq...
01bee58d06a2af3f94e3a1be954abd845da52ba1
Update language.py
language_detection/language.py
language_detection/language.py
import pickle import os from sklearn.decomposition import TruncatedSVD from sklearn.metrics import pairwise class language_detection: def __init__(self): # ''' Constructor for this class. ''' __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) ...
Python
0.000001
@@ -1183,18 +1183,18 @@ def lang -a u +a ge_id(se @@ -1383,10 +1383,10 @@ lang -a u +a ge_n
2a65b1715e469e11ed73faf7f3446f81c836c42e
Add fetch domain logic
handler/domain.py
handler/domain.py
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio # Domain Page from BaseHandler import BaseHandler from tornado.web import authenticated as Auth class IndexHandler(BaseHandler): @Auth def get(self): self.render('domain/index.html') class GroupHandler(BaseHandler): @Auth def g...
Python
0.000001
@@ -154,16 +154,64 @@ as Auth%0A +from model.models import Domain, Groups, Record%0A %0A%0Aclass @@ -258,32 +258,236 @@ def get(self):%0A + page = int(self.get_argument('page', 1))%0A line = int(self.get_argument('line', 20))%0A offset = (page - 1) * line%0A data = self.db.query(Domain)...
c7412824c1e9edb7c386f111ce30b5d76952f861
Remove 'reviews' from Context API return
mendel/serializers.py
mendel/serializers.py
from .models import Keyword, Category, Document, Context, Review, User from rest_auth.models import TokenModel from rest_framework import serializers class KeywordSerializer(serializers.ModelSerializer): class Meta: model = Keyword fields = ('id', 'name', 'definition') def create(self, valid...
Python
0.000006
@@ -1072,19 +1072,8 @@ id', - 'reviews', 'us
f471441bde9940e46badd0ec506c18e8587de004
Optimize the rebuild admin
metaci/build/admin.py
metaci/build/admin.py
from django.contrib import admin from metaci.build.models import Build from metaci.build.models import BuildFlow from metaci.build.models import FlowTask from metaci.build.models import Rebuild class BuildAdmin(admin.ModelAdmin): list_display = ( 'repo', 'plan', 'branch', 'commit',...
Python
0.000003
@@ -1325,32 +1325,84 @@ d__repo', 'build +__plan')%0A raw_id_fields = ('build', 'org_instance ')%0Aadmin.site.re
206f76026504219ed52f2fcca1b6b64b78bdcf21
Add some print statements
software/lightpowertool/csv_export.py
software/lightpowertool/csv_export.py
import csv class CSVExport(object): """docstring for CSVExport""" def __init__(self, filename): super(CSVExport, self).__init__() self._filename = filename def export_data(self, data): with open(self._filename, "w", newline='') as csvfile: csvwriter = csv.writer(csvfile...
Python
0.006669
@@ -208,16 +208,66 @@ data):%0A + print(%22Beginning exportation of data...%22)%0A @@ -471,8 +471,52 @@ _data))%0A + print(%22Exportation has been done!%22)%0A
3121a02c6174a31b64974d57a3ec2d7df760a7ae
Ajoute une référence législative au taux d'incapacité
openfisca_france/model/caracteristiques_socio_demographiques/capacite_travail.py
openfisca_france/model/caracteristiques_socio_demographiques/capacite_travail.py
# -*- coding: utf-8 -*- from openfisca_france.model.base import * class taux_capacite_travail(Variable): value_type = float default_value = 1.0 entity = Individu label = u"Taux de capacité de travail, appréciée par la commission des droits et de l'autonomie des personnes handicapées (CDAPH)" defi...
Python
0.000012
@@ -458,28 +458,323 @@ definition_period = MONTH%0A + reference = %22https://www.legifrance.gouv.fr/affichCodeArticle.do;jsessionid=BD54F4B28313142C87FC8B96013E0441.tplgfr44s_1?idArticle=LEGIARTI000023097719&cidTexte=LEGITEXT000006073189&dateTexte=20190312%22%0A documentation = %22Taux d'incapacit%C3%A9 retenu...
a279cb4340c6da5ed64b39660cfcb5ef53d0bb74
Fix test
tests/core/test_node.py
tests/core/test_node.py
from common import auth_check def test_node_fields(mc): cclient = mc.client fields = { 'nodeTaints': 'r', 'nodeLabels': 'r', 'nodeAnnotations': 'r', 'namespaceId': 'cr', 'conditions': 'r', 'allocatable': 'r', 'capacity': 'r', 'hostname': 'r', ...
Python
0.000004
@@ -502,25 +502,24 @@ 'etcd': 'cr -u ',%0A ' @@ -532,25 +532,24 @@ lPlane': 'cr -u ',%0A ' @@ -556,25 +556,24 @@ worker': 'cr -u ',%0A '
7b67ae8910b90dda49d370dd95fb5969a9a5d16b
Fix restrict_quadrants and add all 4 corners
cell.py
cell.py
from __future__ import division import collections import itertools import math Spoke = collections.namedtuple('Spoke', 'start, end') def get_neighbours(cell, include_self=False): """ Get 8 neighbouring cell coords to a start cell. If `include_self` is True, returns the current (center) cell as well. ...
Python
0.000001
@@ -587,24 +587,50 @@ tart, end):%0A + cells = neighbours%5B:%5D%0A if end%5B0 @@ -667,33 +667,111 @@ %5Bx for x in -neighbour +cells if x%5B0%5D %3E= start%5B0%5D%5D%0A elif end%5B0%5D %3C start%5B0%5D:%0A cells = %5Bx for x in cell s if x%5B0%5D %3E= @@ -760,33 +760,33 @@ n cells if x%5B0%5D -...
1bf3e893e45e0dc16e2e820f5f073a63600217c3
Fix errors in PeriodicFilter
robotpy_ext/misc/periodic_filter.py
robotpy_ext/misc/periodic_filter.py
import logging import wpilib class PeriodicFilter: """ Periodic Filter to help keep down clutter in the console. Simply add this filter to your logger and the logger will only print periodically. The logger will always print logging levels of WARNING or higher """ def __i...
Python
0.000119
@@ -15,22 +15,20 @@ %0Aimport -wpilib +time %0A%0A%0Aclass @@ -538,16 +538,17 @@ self. +_ period = @@ -560,32 +560,33 @@ od%0A self. +_ loggingLoop = Tr @@ -630,24 +630,25 @@ self. +_ bypassLevel @@ -798,15 +798,9 @@ elf. -parent. +_ logg @@ -833,16 +833,17 @@ %3E= self. +_ bypassLe @@ -9...
881b5c56e89fb2fdb7d4af3a9ec5c5044a25b878
declare dummy functions
ansible/lib/modules/rally/library/test.py
ansible/lib/modules/rally/library/test.py
from ansible.module_utils.basic import * DOCUMENTATION = ''' --- module: rally short_description: Executes rally commands ''' def main(): fields = { "scenario_file" : {"required": True, "type": "str"}, "scenario_args" : {"required" : False, "type": "str"}, } commands = {'create_db', ...
Python
0.000034
@@ -370,11 +370,27 @@ ask' + , 'task_report' %7D%0A - @@ -519,39 +519,199 @@ se)%0A - %0Aif __name__ == '__main__': +def create_db:%0A%09pass%0A%0Adef create_deployment:%0A%09pass%0A%0Adef check_deployment:%0A%09pass%0A%0Adef start_task:%0A%09pass%0A%0Adef task_report:%0A%09pass%0A%0A%09%0Aif __name__ == '...
13fde1fc881e2a89a7332790d497ac67b32cdb14
remove print line :/
ansible/roles/common/files/gather_data.py
ansible/roles/common/files/gather_data.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Gather data from logs. Gather data from the logs following certain criteria given by a json file and finally putting the data in org-mode tables in a output file. """ __author__ = "joe di castro <joe@joedicastro.com>" __license__ = "MIT" __date__ = "2017-04-16" __v...
Python
0.000017
@@ -4092,27 +4092,8 @@ s)%0A%0A - print(tables)%0A%0A %0Aif
07a500eaa758e2bc51d2860d5b0d3f8108f9e1ee
Include password for redis
chat.py
chat.py
import asyncio import json import os import random import string import time from urllib.parse import urlparse from aiohttp import web from asyncio_redis import Connection, ZScoreBoundary import bleach BASE_DIR = os.path.dirname(__file__) RATE_LIMIT_DURATION = 60 RATE_LIMIT = 10 def make_key(*args): return':...
Python
0
@@ -4960,16 +4960,39 @@ url.port +, password=url.password )%0A%0A
27330e69226f36b49f5d5eca5a67af29ee8d679b
Normalize the weasyl link.
conbadge.py
conbadge.py
from fractions import Fraction from cStringIO import StringIO from PIL import Image, ImageDraw, ImageFont import qrcode import requests museo = ImageFont.truetype('Museo500-Regular.otf', 424) badge_back = Image.open('badge-back.png') logo_stamp = Image.open('logo-stamp.png') qr_size = 975, 975 qr_offset = 75, 75 na...
Python
0.000002
@@ -1261,16 +1261,104 @@ ffset)%0A%0A +def weasyl_sysname(target):%0A return ''.join(i for i in target if i.isalnum()).lower()%0A%0A def weas @@ -1779,16 +1779,31 @@ /~%25s' %25 +(weasyl_sysname (usernam @@ -1803,16 +1803,17 @@ username +) ,))%0A
12ff7545dc08484414edd28bb70bababd5e89c59
bump gitlab protocol version to 4
runbot_gitlab/models/runbot_repo.py
runbot_gitlab/models/runbot_repo.py
# Copyright <2017> <Vauxoo info@vauxoo.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging import re import urllib.parse import requests from odoo import fields, models _logger = logging.getLogger(__name__) def _get_url(url, base): """When get is URL_GITHUB/api/v3/User/keys mus...
Python
0
@@ -298,17 +298,17 @@ UB/api/v -3 +4 /User/ke @@ -615,17 +615,17 @@ %25s/api/v -3 +4 %25s'%0A
90678692ec85ec90d454b1a3b255dae834bb24ba
trim space
tests/mocks/postgres.py
tests/mocks/postgres.py
from psycopg2.extensions import connection, cursor class MockConnection(connection): def __init__(self, *args, **kwargs): self._cursor = MockCursor() def cursor(self, *args, **kwargs): return self._cursor class MockCursor(cursor): def __init__(self, *args, **kwargs): self.queries ...
Python
0.000001
@@ -1,9 +1,8 @@ -%0A from psy
3160ab66db8bb0321ff2fd4a77de84526e8beefa
set boost constraint (#27806)
var/spack/repos/builtin/packages/3dtk/package.py
var/spack/repos/builtin/packages/3dtk/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 _3dtk(CMakePackage): """The 3D Toolkit provides algorithms and methods to process 3D point...
Python
0
@@ -1805,16 +1805,22 @@ n('boost +@:1.75 +seriali
4c5ebbabcf54b1f23459da7ddf85adf5e5de22d8
Update add-lore.py to serve legacy lorebot needs
add-lore.py
add-lore.py
#!/usr/bin/env python3 import argparse import datetime from peewee import peewee db = peewee.SqliteDatabase(None) class BaseModel(peewee.Model): class Meta: database = db class Lore(BaseModel): time = peewee.DateTimeField(null=True, index=True) author = peewee.CharField(null=True, index=True) ...
Python
0
@@ -377,16 +377,109 @@ ield()%0A%0A + def __str__(self):%0A return %22%5B%25s%5D %5B%25s%5D%5Cn%25s%22 %25 (self.time, self.author, self.lore)%0A%0A %0Adef mai @@ -576,42 +576,8 @@ r()%0A - parser.add_argument('author')%0A @@ -679,21 +679,31 @@ s()%0A -pr +lore = ' '.jo in -t (args.lo @@ -7...
5f21305d1736322064aa9f5e503965b102a6c086
Add Ending class
hairball/plugins/neu.py
hairball/plugins/neu.py
"""This module provides plugins for NEU metrics.""" import kurt from hairball.plugins import HairballPlugin from PIL import Image import os class Variables(HairballPlugin): """Plugin that counts the number of variables in a project.""" def __init__(self): super(Variables, self).__init__() s...
Python
0.000011
@@ -624,33 +624,38 @@ es)%0A for -x +sprite in scratch.spri @@ -689,17 +689,22 @@ += len( -x +sprite .variabl @@ -1166,17 +1166,22 @@ for -x +sprite in scra @@ -1223,17 +1223,22 @@ += len( -x +sprite .lists)%0A @@ -1741,16 +1741,20 @@ for b +lock in self @@ -2892,32 +2892,32 @@ unts plug...
6ed282bb2da04790e6e399faad4d2ba8dfc214c4
add v0.20210330 (#28111)
var/spack/repos/builtin/packages/ccls/package.py
var/spack/repos/builtin/packages/ccls/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 Ccls(CMakePackage): """C/C++ language server""" homepage = "https://github.com/MaskRa...
Python
0
@@ -485,16 +485,117 @@ rson'%5D%0A%0A + version('0.20210330', sha256='28c228f49dfc0f23cb5d581b7de35792648f32c39f4ca35f68ff8c9cb5ce56c2')%0A vers
f230e69780823f4ceb48a68015cd5bd4af94cba0
Add in some settings for email
ml_service_api/aws.py
ml_service_api/aws.py
""" Deployment settings file """ from settings import * import json DEBUG=False TIME_BETWEEN_INDEX_REBUILDS = 60 * 30 # seconds #Tastypie throttle settings THROTTLE_AT = 100 #Throttle requests after this number in below timeframe THROTTLE_TIMEFRAME= 60 * 60 #Timeframe in which to throttle N requests, seconds THROTT...
Python
0.000001
@@ -1270,16 +1270,203 @@ CKEND)%0A%0A +AWS_SES_REGION_NAME = ENV_TOKENS.get('AWS_SES_REGION_NAME', None)%0Aif AWS_SES_REGION_NAME is not None:%0A AWS_SES_REGION_ENDPOINT = 'email.%7B0%7D.amazonaws.com'.format(AWS_SES_REGION_NAME)%0A%0A if ELB_H
e4fff83666ee6e3ce63145f84a550f6fb361096d
Fix Enum hack situation
nycodex/db.py
nycodex/db.py
from enum import Enum import os import typing import sqlalchemy from sqlalchemy.dialects import postgresql from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() # type: typing.Any engine = sqlalchemy.create_engine(os.environ["DATABASE_URI"]) Session = sqlalchemy.orm.sessionmaker(bind=eng...
Python
0.000013
@@ -1,22 +1,12 @@ -from enum import -E +e num%0A @@ -306,24 +306,37 @@ d=engine)%0A%0A%0A +@enum.unique%0A class Domain @@ -344,16 +344,21 @@ ategory( +enum. Enum):%0A @@ -728,16 +728,29 @@ tion%22%0A%0A%0A +@enum.unique%0A class As @@ -757,16 +757,21 @@ setType( +enum. Enum):%0A @@ -954,18 +954,16 @@ D...
b84eb5f015a53a84975955a2b239e577d539f338
Fix for q-dtype
cupyx/jit/_typerules.py
cupyx/jit/_typerules.py
import ast import numpy from cupy._logic import ops from cupy._math import arithmetic from cupy._logic import comparison from cupy._binary import elementwise from cupy import core from cupyx.jit import _types _numpy_scalar_true_divide = core.create_ufunc( 'numpy_scalar_true_divide', ('??->d', '?i->d', 'i?-...
Python
0.000002
@@ -4180,24 +4180,59 @@ 64'): 'll',%0A + numpy.dtype('longlong'): 'll',%0A numpy.dt @@ -4279,24 +4279,61 @@ 4'): 'ull',%0A + numpy.dtype('ulonglong'): 'ull',%0A numpy.dt
6ac28c1daa0173ae5baa66c9cb020e9c673973ff
Add info for lftp@4.8.1 (#5452)
var/spack/repos/builtin/packages/lftp/package.py
var/spack/repos/builtin/packages/lftp/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
@@ -1514,16 +1514,73 @@ ar.gz%22%0A%0A + version('4.8.1', '419b27c016d968a0226b2e5df1454c22')%0A vers
e2be8a486c9d13f98d9f14ae7b0cddf8225cf1b3
Add boolswitch test
test/test_apv_rename.py
test/test_apv_rename.py
""" Copyright (c) 2017, Michael Sonntag (sonntag@bio.lmu.de) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted under the terms of the BSD License. See LICENSE file in the root of the project. """ import os import shutil import tempfile import unittest...
Python
0.000001
@@ -327,16 +327,57 @@ t uuid%0A%0A +from bren.bulk_rename import BulkRename%0A%0A %0Aclass R @@ -914,8 +914,160 @@ r)), 3)%0A +%0A def test_bool_switch(self):%0A self.assertEqual(BulkRename._bool_switch(1), True)%0A self.assertEqual(BulkRename._bool_switch(2), False)%0A
59faede78ad5d763c7c9fa1763e3e7cac67c1ca6
Move Circle inside CxDeriv
cxroots/CxDerivative.py
cxroots/CxDerivative.py
from __future__ import division import numpy as np from numpy import inf, pi import scipy.integrate import math from cxroots.Contours import Circle, Rectangle def CxDeriv(f, contour=None): """ Compute derivaive of an analytic function using Cauchy's Integral Formula for Derivatives """ if contour is None: C = l...
Python
0
@@ -110,56 +110,8 @@ th%0A%0A -from cxroots.Contours import Circle, Rectangle%0A%0A def @@ -258,16 +258,54 @@ s None:%0A +%09%09from cxroots.Contours import Circle%0A %09%09C = la
2df7947f02fd39e05bf18a89f904e273d17c63ca
add v0.9.29 (#23606)
var/spack/repos/builtin/packages/lmdb/package.py
var/spack/repos/builtin/packages/lmdb/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 Lmdb(MakefilePackage): """Symas LMDB is an extraordinarily fast, memory-efficient database...
Python
0
@@ -634,16 +634,113 @@ ar.gz%22%0A%0A + version('0.9.29', sha256='22054926b426c66d8f2bc22071365df6e35f3aacf19ad943bc6167d4cae3bebb')%0A vers
418d9f07dcda2e0c141be0bca4595447fa09c280
Add 19.0.4 (#11415)
var/spack/repos/builtin/packages/mesa/package.py
var/spack/repos/builtin/packages/mesa/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 * import sys class Mesa(MesonPackage): """Mesa is an open-source implementation of the OpenGL spe...
Python
0.000002
@@ -902,17 +902,17 @@ n('19.0. -3 +4 ', tag=' @@ -921,17 +921,17 @@ sa-19.0. -3 +4 ', prefe @@ -941,16 +941,57 @@ d=True)%0A + version('19.0.3', tag='mesa-19.0.3')%0A vers @@ -3037,16 +3037,76 @@ sts/806%0A + # Was included in the upstream patch release for 19.0.4%0A patc @@ -3153,11 +3153,9 @@ 9...
7abc503d6aa492f2340ab0b98d1f66892180ba19
Fix some test error
tests/test_blueprint.py
tests/test_blueprint.py
from wood import Wood from wood.support import Blueprint def make_example_blueprint(): b = Blueprint() b.empty(r"/example","example") return b def test_blueprint_can_add_empty_handler(): b = make_example_blueprint() assert b != None def test_blueprint_can_add_handlers_to_wood(): w = Wood(...
Python
0.002705
@@ -485,16 +485,20 @@ )%0A%0A w + = b .get_woo
d5438347980b4ed3f4a798b8c1019b87691f28bd
Bump version
oi/version.py
oi/version.py
VERSION = '0.2.0'
Python
0
@@ -8,11 +8,11 @@ = '0.2. -0 +1 '%0A
676440a464d695146361eb1bdb684e121bf41a42
fix simple_date parsing
solution/__init__.py
solution/__init__.py
# coding=utf-8 """ ============================= Solution ============================= An amazing form solution :copyright: `Juan-Pablo Scaletti <http://jpscaletti.com>`_. :license: MIT, see LICENSE for more details. """ from .form import Form # noqa from .formset import FormSet # noqa fro...
Python
0.000345
@@ -457,11 +457,11 @@ = '5.2. -5 +6 '%0A
0a1a8a5bcea081b2b3f86f8d7f4ee39e261efad2
Add license to kzip writer
verilog/tools/kythe/verilog_kythe_kzip_writer.py
verilog/tools/kythe/verilog_kythe_kzip_writer.py
"""Produces Kythe KZip from the given SystemVerilog source files.""" import hashlib import os import sys import zipfile from absl import app from absl import flags from absl import logging from collections.abc import Sequence from third_party.proto.kythe import analysis_pb2 from verilog.tools.kythe import filelist_p...
Python
0
@@ -1,8 +1,621 @@ +#!/usr/bin/env python3%0A# Copyright 2017-2020 The Verible Authors.%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 the License at%0A#%0A# http://www.apache.org/licenses/...
b3526d2818b423b6fd6e49ca157781794812ec4b
Remove unused fixture
test/test_csv_writer.py
test/test_csv_writer.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import collections import itertools import pytablewriter as ptw import pytablereader as ptr import pytest from .data import header_list from .data import value_matrix from .data import value_matr...
Python
0.000001
@@ -2374,32 +2374,24 @@ _normal(self -, capsys ):%0A w
c9f634ccea4b034907bb403a683945ace373c97d
Add unary + - support for atoms
solver/core/atoms.py
solver/core/atoms.py
class Atom(object): """ Base class for any atomic type """ def __add__(self, other): from .operations import Add return Add(self, other) def __radd__(self, other): return self.__add__(other) def __mul__(self, other): from .operations import Mul return Mul(s...
Python
0.001074
@@ -61,16 +61,109 @@ %22%22%22%0A%0A + def __pos__(self):%0A return self%0A%0A def __neg__(self):%0A return -1 * self%0A%0A def
f6c6ff376974f604b2b4a7b62ad28fd56a264c55
Add empty testing scaffolding.
test/test_exceptions.py
test/test_exceptions.py
#!/usr/bin/env python3 import pyglab.exceptions as ex
Python
0
@@ -48,8 +48,228 @@ s as ex%0A +import unittest as ut%0A%0Aclass TestBadRequest(ut.TestCase):%0A def test_throw(self):%0A pass%0A def test_statuscode(self):%0A pass%0A def test_message(self):%0A pass%0A def test_body(self):%0A pass%0A
b0581aef251a3bc03e1a49e89c3b214114e20828
add unit test
tests/test_migration.py
tests/test_migration.py
import os import asyncio from migration.migration import Migration import pytest from pytest_lamp import asyncserver import whisper def test_migration_example(): pass def test_extract_wsp(monkeypatch): worker = Migration('/opt/graphite/storage/whisper/zon', '127.0.0.1', 2003) def ...
Python
0.000001
@@ -2691,76 +2691,953 @@ )%0A%0A%0A -@pytest.mark.asyncio%0Aasync def test_send_one_wsp(monkeypatch):%0A pass +async def handler(reader, writer):%0A data = (await reader.read())%0A assert data == 'mondev 7 1483668388%5Cn'%0A writer.write(data)%0A await writer.drain()%0A writer.close()%0A%0A%0A@pytest...
0a438f1d10e9e0e31e5c430f921b618b8a625154
Fix line endings on Windows
building.py
building.py
import subprocess import threading import os import sublime from .fuse_util import getFusePathFromSettings, getSetting from .log import log class BuildManager: def __init__(self, fuseNotFoundHandler): self.builds = {} self.fuseNotFoundHandler = fuseNotFoundHandler self.previousBuildCommand = None def preview...
Python
0.000071
@@ -2664,16 +2664,33 @@ %22utf-8%22) +.replace('%5Cr','') )%0A%09%09self
f13982144a2a0710af8e082dd01d73f036f026fd
Use clean_system fixture on pypackage test
tests/test_pypackage.py
tests/test_pypackage.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_pypackage -------------- Tests formerly known from a unittest residing in test_generate.py named TestPyPackage.test_cookiecutter_pypackage """ from __future__ import unicode_literals import os import subprocess import pytest from cookiecutter import utils from ...
Python
0
@@ -867,16 +867,32 @@ ixtures( +'clean_system', 'remove_
55bc60570fec684905132c4899c1830cbfed428c
add the missing setup for logging
volttron/platform/vip/agent/subsystems/health.py
volttron/platform/vip/agent/subsystems/health.py
# Copyright (c) 2015, Battelle Memorial Institute # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of ...
Python
0.000001
@@ -2850,16 +2850,58 @@ eakref%0A%0A +from volttron.platform.agent import utils%0A from vol @@ -3167,16 +3167,38 @@ ay.%0A%22%22%22%0A +utils.setup_logging()%0A _log = l @@ -3224,16 +3224,44 @@ name__)%0A +_log.setLevel(logging.DEBUG) %0A%0Aclass
07e8fada20776f8b67a97e2487d6ec36b2cac1da
unified the error norm
src/analysis.py
src/analysis.py
from __future__ import division import random import math import numpy as np from scipy import linalg from matplotlib.pyplot import plot, subplot, legend import example2sys as e2s import pod import time def runAnalysis(n, k, N=1, example='butter', T=20, sigma=1., integrator='dopri5'): sys = e2s.example2sys(example...
Python
0.998442
@@ -3624,24 +3624,49 @@ timeSteps)%0A%0A + norm_order = np.inf%0A%0A eps_auto @@ -3696,37 +3696,41 @@ rm(y-yhat, ord=n -p.inf +orm_order )%0A @@ -3856,37 +3856,41 @@ rm(y-yhat, ord=n -p.inf +orm_order )%0A @@ -4035,21 +4035,25 @@ t, ord=n -p.inf +orm_order )%0A
247e8f8ce8ed4677c629affec6b9a291c730e3a2
Use assert_equal instead of assertEqual in fail testcase.
tests/testcases/fail.py
tests/testcases/fail.py
from systest import TestCase class FailTest(TestCase): """A test that always fails. """ count = 0 def __init__(self, name): super(FailTest, self).__init__() self.name = "fail_" + name def run(self): FailTest.count += 1 self.assertEqual(1, 0)
Python
0
@@ -286,9 +286,10 @@ sert -E +_e qual
3c2d290452a07946880fc25af917b32766f9529d
Update test script to include deposit
testsuite/front_test.py
testsuite/front_test.py
#!/usr/bin/env python2 import gevent import requests import json import time import hashlib ip_address = "vm" port = "3000" url = ''.join(['http://', ip_address, ':', port]) def secret(params, secret): keys = params.keys() keys.sort() hash_str = "" for key in keys: hash_str += (params[key]) ...
Python
0
@@ -968,25 +968,8 @@ y))%0A - print r.text%0A @@ -1056,8 +1056,443 @@ n info%0A%0A +def test_deposit(login):%0A body = %7B%7D%0A body%5B'username'%5D = login%5B'username'%5D%0A body%5B'time'%5D = str(time.time())%0A body%5B'sign'%5D = secret(body, login%5B'secret'%5D)%0A r = requests.post(url ...
50c4b312a27b61725885ee84d45a0f07f94a8ec6
Handle interactive-on-error also when error is from contextmanager exit.
teuthology/run_tasks.py
teuthology/run_tasks.py
import sys import logging log = logging.getLogger(__name__) def _run_one_task(taskname, **kwargs): submod = taskname subtask = 'task' if '.' in taskname: (submod, subtask) = taskname.rsplit('.', 1) parent = __import__('teuthology.task', globals(), locals(), [submod], 0) mod = getattr(paren...
Python
0
@@ -2077,32 +2077,296 @@ = sys.exc_info() +%0A%0A if ctx.config.get('interactive-on-error'):%0A from .task import interactive%0A log.warning('Saw failure, going into interactive mode...')%0A interactive.task(ctx=ctx, config=None) ...
e8eaa2e4bd6cc7fe51e3c4c15a5bf392a24d5b92
generate index
hodge/__init__.py
hodge/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import io import shutil import click from cookiecutter.main import cookiecutter from slugify import slugify from jinja2 import Template, Environment, FileSystemLoader from datetime import datetime import markdown2 from .utils import walk_dir @click.group() def ...
Python
0.999996
@@ -2311,16 +2311,24 @@ template +_content = env.g @@ -2344,13 +2344,15 @@ te(' -index +content .htm @@ -2406,16 +2406,32 @@ =True)%0A%0A + index = %5B%5D%0A%0A for @@ -2829,16 +2829,24 @@ template +_content .render( @@ -2911,16 +2911,230 @@ ug%22)))%0A%0A + index.append(content)%0A%0A templ...
f6c0258e257aa537dbb64bb8c5f10c87ec32dcf9
Update my_hooks.py
hooks/my_hooks.py
hooks/my_hooks.py
#!/usr/bin/python """ Example Diaphora export hooks script. In this example script the following fake scenario is considered: 1) There is a something-user.i64 database, for user-land stuff. 2) There is a something-kernel.i64 database, for kernel-land stuff. 3) We export all functions from the something-user.i64...
Python
0.000001
@@ -1733,20 +1733,20 @@ # I -t is +s it a sysca @@ -1751,61 +1751,88 @@ call +? %0A -if %22syscall_%25s%22 %25 func_name in SYSCALL_NAMES:%0A +for prefix in FUNC_PREFIXES:%0A if func_name.startswith(prefix):%0A
4ab33cec7c0f4ee9fee7a7dce1c28466780b7074
Add hoomd.box.Box to main namespace
hoomd/__init__.py
hoomd/__init__.py
# Copyright (c) 2009-2019 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. """ HOOMD-blue python API :py:mod:`hoomd` provides a high level user interface for defining and executing simulations using HOOMD. .. rubric:: API stability :...
Python
0.000003
@@ -1863,16 +1863,42 @@ Logger%0A +from hoomd.box import Box%0A from hoo
602ad51f9d3f9577bf805ca317ecf0dfb31b5994
Create config from ena ftp
conf.py
conf.py
import logging import multiprocessing import re import os import tempfile import yaml from collections import OrderedDict # Adapted from: https://github.com/pnnl/atlas/blob/master/atlas/conf.py # http://stackoverflow.com/a/3675423 def replace_last(source_string, replace_what, replace_with): head, _sep, tail = so...
Python
0
@@ -189,16 +189,55 @@ onf.py%0A%0A +ena = True%0Ahost = %22ftp.sra.ebi.ac.uk%22%0A%0A # http:/ @@ -563,70 +563,222 @@ -for dir_name, sub_dirs, files in +walker = %22%22%0A if ena:%0A import ftputil%0A ftphost = ftputil.FTPHost(host, %22anonymous%22,%22%22)%0A walker = ftph os +t .walk...
53881ce561802c13fe66d73203333322a138b57c
fix sphinx pngmath bug
conf.py
conf.py
# -*- coding: utf-8 -*- # # scikit-rf-web documentation build configuration file, created by # sphinx-quickstart on Sat Dec 18 17:03 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
Python
0.999877
@@ -1073,10 +1073,10 @@ ext. -pn +im gmat
4c9f32da941ae76d8eaf68f9673d7763af8c74f0
Create train directory if not exists
data.py
data.py
# -*- coding: utf-8 -*- import sugartensor as tf import numpy as np import pandas as pd import librosa import glob import os import string import itertools __author__ = 'buriburisuri@gmail.com' __vocabulary_save_dir__ = "asset/train/" class VCTK(object): def __init__(self, batch_size=16, data_path='asset/data/...
Python
0.000001
@@ -4071,36 +4071,35 @@ vocabulary_ -file +dir = __vocabulary_ @@ -4126,32 +4126,353 @@ class__.__name__ +%0A if not os.path.exists(os.path.dirname(vocabulary_dir)):%0A try:%0A os.makedirs(os.path.dirname(vocabulary_dir))%0A except OSError as exc: # Guard against rac...
c7ecf728e12dd3a59f4ef45e30b61ce5c52ceca5
Fix corpus to Polish language
analysis/textclassification/bagofwords.py
analysis/textclassification/bagofwords.py
import functools from nltk import ngrams from nltk.collocations import BigramCollocationFinder from nltk.metrics import BigramAssocMeasures import nltk.corpus import re import definitions INVALID_TOKEN_PATTERN = r'^[!%"%\*\(\)\+,&#-\.\$/\d:;\?\<\>\=@\[\]].*' NEGATION_TOKEN_PATTERN = r'^nie$' def get_stopwords_list()...
Python
0.999998
@@ -1648,16 +1648,26 @@ ize(text +, 'polish' )%0A wo
de027652a4bb12c6d1a4cb7bc85448c8c2a0d321
use argparse to get arguments from command line
sortroms/__main__.py
sortroms/__main__.py
from sortroms import main if __name__ == '__main__': main()
Python
0.000001
@@ -18,16 +18,232 @@ ort main +%0Aimport argparse%0A%0Aparser = argparse.ArgumentParser(%0A%09description='Sort emulator ROM files',%0A%09prog='sortroms'%0A)%0A%0Aparser.add_argument(%0A%09'folder',%0A%09metavar='DIR',%0A%09type=str,%0A%09nargs='?',%0A%09help='The ROM folder to sort.'%0A) %0A%0Aif __n @@ -267,12 +267...