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 |
|---|---|---|---|---|---|---|---|
07397e8ef7486a7d2133b218a0095c53688dc450 | Convert gettext to AutotoolsPackage (#3510) | var/spack/repos/builtin/packages/gettext/package.py | var/spack/repos/builtin/packages/gettext/package.py | ##############################################################################
# Copyright (c) 2013-2016, 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.004838 | @@ -1251,16 +1251,25 @@
Gettext(
+Autotools
Package)
@@ -1345,16 +1345,17 @@
ary.%22%22%22%0A
+%0A
home
@@ -2737,103 +2737,79 @@
def
-install(self, spec, prefix):%0A config_args = %5B%0A '--prefix=%7B0%7D'.format(prefix),
+configure_args(self):%0A spec = self.spec%0A%0A config_... |
741ef67787c0e49a6d506d077d5eb14c2e280805 | add tests for provision_configs with directories | tests/util.py | tests/util.py | import aminator.util.linux
import unittest
import os
import logging
import shutil
import tempfile
log = logging.getLogger(__name__)
logging.root.addHandler(logging.StreamHandler())
logging.root.setLevel(logging.DEBUG)
class linux_util(unittest.TestCase):
src_root = tempfile.mkdtemp(dir='/tmp', prefix='src_')
... | Python | 0 | @@ -401,16 +401,40 @@
'c', 'd'
+, 'Da', 'Db', 'Dc', 'Dd'
%5D%0A%0A d
@@ -794,32 +794,200 @@
n%0A
+ Da y y%0A Db y n%0A Dc n y%0A Dd n n%0A
%22%22%22%0A ... |
40b6ad4876991bb53afbc0da46c49d191a16f6f8 | Add `__str__` and `__unicode__` methods to `FakeFact` in test utils. | tests/util.py | tests/util.py | # pyinfra
# File: tests/util.py
# Desc: utilities for fake pyinfra state/host objects
from datetime import datetime
import six
from mock import patch
from pyinfra.api import Config, Inventory
from pyinfra.api.attrs import AttrData
class FakeState(object):
active = True
deploy_dir = '/'
in_op = True
... | Python | 0 | @@ -1759,16 +1759,118 @@
n item%0A%0A
+ def __str__(self):%0A return self.data%0A%0A def __unicode__(self):%0A return self.data%0A%0A
def
|
e0082e0564ccb1fc838e3248e6d8306132166364 | symlink libtool{ize} to glibtool{ize} (#7060) | var/spack/repos/builtin/packages/libtool/package.py | var/spack/repos/builtin/packages/libtool/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.999189 | @@ -2076,26 +2076,16 @@
endency,
-%0A #
so we a
@@ -2086,16 +2086,26 @@
o we add
+%0A #
the too
@@ -2142,16 +2142,201 @@
t module
+. Some build%0A # systems differentiate between BSD libtool (e.g., Darwin) and%0A # GNU libtool, so also add 'glibtool' and 'glibtoolize' to the%0A ... |
2de34ed940c6374f27d8bf7ac3b9523df8b315e9 | Set directory attribute on test-specific classes | packages/Python/lldbsuite/test/lldbinline.py | packages/Python/lldbsuite/test/lldbinline.py | from __future__ import print_function
from __future__ import absolute_import
# System modules
import os
# Third-party modules
# LLDB modules
import lldb
from .lldbtest import *
from . import configuration
from . import lldbutil
from .decorators import *
def source_type(filename):
_, extension = os.path.splitex... | Python | 0.999837 | @@ -6609,62 +6609,8 @@
ile)
-%0A InlineTest.mydir = TestBase.compute_mydir(__file)
%0A%0A
@@ -7081,24 +7081,78 @@
me = __file%0A
+ test_class.mydir = TestBase.compute_mydir(__file)%0A
return t
|
9a1a346999b77ef7485913c79d7d854c779ecd0d | add version 2.10.0 (#15205) | var/spack/repos/builtin/packages/py-h5py/package.py | var/spack/repos/builtin/packages/py-h5py/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 PyH5py(PythonPackage):
"""The h5py package provides both a high- and low-level interface t... | Python | 0 | @@ -453,17 +453,18 @@
/h5py-2.
-9
+10
.0.tar.g
@@ -506,24 +506,121 @@
h5py._hl'%5D%0A%0A
+ version('2.10.0', sha256='84412798925dc870ffd7107f045d7659e60f5d46d1c70c700375248bf6bf512d')%0A
version(
@@ -1546,32 +1546,97 @@
me dependencies%0A
+ depends_on('py-cached-property@1.5:', type=('build', 'run'))%0A
... |
4014a29d2b163aaa3906bee1adeb2ca778ddd620 | Use proper deptype so that spack activate works | var/spack/repos/builtin/packages/py-meep/package.py | var/spack/repos/builtin/packages/py-meep/package.py | ##############################################################################
# Copyright (c) 2013-2016, 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 | @@ -1688,16 +1688,29 @@
y-numpy'
+, type=nolink
)%0A de
@@ -1728,16 +1728,29 @@
y-scipy'
+, type=nolink
)%0A de
@@ -1773,16 +1773,29 @@
plotlib'
+, type=nolink
)%0A%0A d
|
6a7611c4c2a41d5bf316697df92636b2b43e9125 | add version 2.1.2 to r-gsodr (#21035) | var/spack/repos/builtin/packages/r-gsodr/package.py | var/spack/repos/builtin/packages/r-gsodr/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 RGsodr(RPackage):
"""A Global Surface Summary of the Day (GSOD) Weather Data Client for R"... | Python | 0 | @@ -312,16 +312,1264 @@
nt for R
+%0A%0A Provides automated downloading, parsing, cleaning, unit conversion and%0A formatting of Global Surface Summary of the Day ('GSOD') weather data from%0A the from the USA National Centers for Environmental Information ('NCEI').%0A Units are converted from from United ... |
2dce1ee2e37e314772467bfa150b57b8d4311598 | fix for unknown shape | tensorflow/contrib/kernel_methods/python/losses.py | tensorflow/contrib/kernel_methods/python/losses.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -3121,21 +3121,20 @@
logits_
-shape
+rank
= logit
@@ -3150,39 +3150,8 @@
pe()
-%0A logits_rank = logits_shape
.ndi
@@ -3316,24 +3316,67 @@
gits_rank))%0A
+ logits_shape = array_ops.shape(logits)%0A
batch_si
@@ -3408,22 +3408,16 @@
shape%5B0%5D
-.value
, logits
@@ -3429,14 +3429,8 @@
e%5B1%5D
-.v... |
d19b2af11c7b7942d81fb8aa68fe019409055a68 | Add atomic rewrite of the JSON file | ldform/cgi.py | ldform/cgi.py | #!/usr/bin/env python3
import cgi
import cgitb
import os
import datetime
import random
import string
import json
import importlib
# Python 3.2 compatibility
if __package__ is None:
__package__ = "ldform"
# Base path global variable
BASE_PATH = ""
class MyDict(dict):
"""
Dictionary with few convinience... | Python | 0.000001 | @@ -842,18 +842,19 @@
-with open(
+outfpath =
os.p
@@ -898,31 +898,72 @@
utfname)
-,
%0A
-
+outftmp = outfpath + %22.tmp%22%0A with open( outftmp,
%22w%22, en
@@ -1059,24 +1059,24 @@
scii=False)%0A
-
outf
@@ -1088,16 +1088,49 @@
e('%5Cn')%0A
+ os.rename(outftmp, outfpath)%0A
%... |
22428bcdbb095b407a0845c35e06c8ace0653a44 | Use MEDIA_URL instead of a hardcoded path | urls.py | urls.py | from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^', include('blangoblog.blango.urls')),
)
handler500 = 'blango.views.server_error'
handler404 = 'blango.views.page_not... | Python | 0.000002 | @@ -481,19 +481,10 @@
(r'%5E
+%25
s
-ite-media/
(?P%3C
@@ -493,16 +493,41 @@
th%3E.*)$'
+ %25 settings.MEDIA_URL%5B1:%5D
, 'djang
|
b30391c105e8aaa6533cbd043772983aad14a04a | remove bigbrother from urls | urls.py | urls.py | from django.conf.urls.defaults import patterns, url, include
from django.contrib.gis import admin
import settings
admin.autodiscover()
# Sitemaps
import venue.sitemaps
import band.sitemaps
import event.sitemaps
sitemaps = {}
sitemaps.update(venue.sitemaps.sitemaps)
sitemaps.update(band.sitemaps.sitemaps)
sitemaps.u... | Python | 0.000001 | @@ -1376,24 +1376,26 @@
gBrother%0A
+ #
(r'%5Ebb/', i
|
46666faa163fde00c29eca375398f20ee2b86154 | fix line splitting for diff generation | gitmagic/change.py | gitmagic/change.py | import difflib
from io import StringIO
import git
class Change(object):
def __init__(self, a_file_name: str, b_file_name: str, a_file_content: [str],
b_file_content: [str], a_hunk: (int, int), b_hunk: (int, int), diff: str):
self.a_file_name = a_file_name
self.b_file_name = b_fil... | Python | 0.000001 | @@ -773,36 +773,16 @@
ontent =
- %5B x + %22%5Cn%22 for x in
diff.a_
@@ -815,32 +815,44 @@
code().split
-('%5Cn') %5D
+lines(keepends=True)
%0A b_f
@@ -868,28 +868,8 @@
nt =
- %5B x + %22%5Cn%22 for x in
ope
@@ -899,16 +899,28 @@
plit
-('%5Cn') %5D
+lines(keepends=True)
%0A
@@ -995,29 +995,78 @@
he... |
d44c28a13649a46a7fe6eddc7413d66fc1a4acba | Fix module docstring | flocker/acceptance/endtoend/test_diagnostics.py | flocker/acceptance/endtoend/test_diagnostics.py | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Tests for the flocker-diagnostics.
"""
import os
import tarfile
from twisted.internet import reactor
from twisted.python.filepath import FilePath
from twisted.trial.unittest import TestCase
from ...common.runner import run_ssh, download_file
from ..testt... | Python | 0.000005 | @@ -66,20 +66,18 @@
sts for
-the
+%60%60
flocker-
@@ -87,16 +87,18 @@
gnostics
+%60%60
.%0A%22%22%22%0A%0Ai
|
224700aada7e7d80b4389b123ee00b5f14e88c99 | Fix HTML escaping of TextPlugin, by feature/text-filters branch | fluent_contents/plugins/text/content_plugins.py | fluent_contents/plugins/text/content_plugins.py | """
Definition of the plugin.
"""
from django.utils.html import format_html
from fluent_contents.extensions import ContentPlugin, plugin_pool, ContentItemForm
from fluent_contents.plugins.text.models import TextItem
class TextItemForm(ContentItemForm):
"""
Perform extra processing for the text item
"""
... | Python | 0 | @@ -49,31 +49,35 @@
ils.
-html import format_html
+safestring import mark_safe
%0Afro
@@ -1167,19 +1167,17 @@
urn
-format_html
+mark_safe
(u'%3C
@@ -1209,12 +1209,19 @@
%3E%5Cn'
-,
+.format(
text)
+)
%0A
|
dfaad557245d2774d58ada8cf0d151e31690a5b1 | Rename field_type to field_class to avoid breaking templates [Fixes: #36] | formulation/templatetags/formulation.py | formulation/templatetags/formulation.py |
from contextlib import contextmanager
from copy import copy
from django import template
try:
from django.forms.utils import flatatt
except ImportError: # Django 1.5 compatibility
from django.forms.util import flatatt
from django.template.loader import get_template
from django.template.loader_tags import (
... | Python | 0 | @@ -3743,20 +3743,21 @@
'field_
-type
+class
': field
|
919c2e5ea6a22ac7b24aa005e5ad3c7886b3feb7 | fix broadcaster display | panel/admin.py | panel/admin.py | from ccradio.panel.models import Broadcaster, Category, Stream
from django.contrib import admin
from django.contrib.auth.models import User
class BroadcasterAdmin(admin.ModelAdmin):
list_display = ('title', 'category', 'active', 'stream')
list_filter = ('category', 'stream', 'active')
ordering = ('title', ... | Python | 0.000003 | @@ -222,24 +222,21 @@
', '
-active', 'stream
+stream', 'url
')%0A
@@ -277,18 +277,8 @@
eam'
-, 'active'
)%0A
|
afe5e9a0a097d6b6615e01d574b42e6c996282d6 | Disable colore for @mrtazz | legit/core.py | legit/core.py | # -*- coding: utf-8 -*-
"""
legit.core
~~~~~~~~~~
This module provides the basic functionality of legit.
"""
# from clint import resources
__version__ = '0.0.9'
__author__ = 'Kenneth Reitz'
__license__ = 'BSD'
# resources.init('kennethreitz', 'legit')
# resources.user.write('config.ini', "we'll get there.") | Python | 0 | @@ -136,16 +136,56 @@
ources%0A%0A
+import os%0Aimport clint.textui.colored%0A%0A%0A
__versio
@@ -249,16 +249,99 @@
'BSD'%0A%0A%0A
+if 'LEGIT_NO_COLORS' in os.environ:%0A clint.textui.colored.DISABLE_COLOR = True%0A%0A
# resour
|
51ceb7e9dbca0fa2bcda835911112a02cb192f89 | remove useless setdefault | frasco/assets.py | frasco/assets.py | from frasco.ext import *
from flask_assets import Environment, _webassets_cmd
from flask import Blueprint, current_app
from flask.cli import with_appcontext, cli
from flask.signals import Namespace as SignalNamespace
import logging
import click
import os
import shutil
_signals = SignalNamespace()
before_build_assets ... | Python | 0.000002 | @@ -871,91 +871,8 @@
e):%0A
- if app.debug:%0A app.config.setdefault('ASSETS_AUTO_BUILD', True)%0A
|
570ee868afbf74ee22d07ff47c5f3a3f8353ebec | Update reset email adding app name | infosystem/subsystem/user/manager.py | infosystem/subsystem/user/manager.py | import os
import hashlib
import flask
from sparkpost import SparkPost
from infosystem.common import exception
from infosystem.common.subsystem import manager
from infosystem.common.subsystem import operation
_HTML_EMAIL_TEMPLATE = """
<div style="width: 100%; text-align: center">
<h1>{app_name}</h1>
... | Python | 0.000001 | @@ -1116,33 +1116,32 @@
infosystem_
-reset_url
+app_name
= os.enviro
@@ -1932,23 +1932,26 @@
pp_name=
-default
+infosystem
_app_nam
|
05cd983e108764d288798784508249726b0ffd70 | add version 0.6.2 to yaml-cpp (#7931) | var/spack/repos/builtin/packages/yaml-cpp/package.py | var/spack/repos/builtin/packages/yaml-cpp/package.py | ##############################################################################
# Copyright (c) 2013-2018, 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 | @@ -1458,16 +1458,73 @@
ar.gz%22%0A%0A
+ version('0.6.2', '5b943e9af0060d0811148b037449ef82')%0A
vers
@@ -1572,16 +1572,16 @@
a7211')%0A
-
vers
@@ -1872,16 +1872,25 @@
n('boost
+@:1.66.99
', when=
@@ -1897,24 +1897,637 @@
'@:0.5.3')%0A%0A
+ conflicts('%25gcc@:4.8', when='@0.6.0:', msg=%22versions 0... |
58d3d5fb4ae8fc081e5e503e2b6316dc81deb678 | Rewrite views.py | gpbot/bot/views.py | gpbot/bot/views.py | from django.shortcuts import render
from django.http import HttpResponse
import os
import json
import requests
REPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'
CHANNEL_ACCESS_TOKEN = os.environ['LINE_CHANNEL_ACCESS_TOKEN']
HEADER = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + C... | Python | 0.000023 | @@ -69,390 +69,1143 @@
onse
-%0Aimport os%0Aimport json%0Aimport requests%0A%0AREPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'%0ACHANNEL_ACCESS_TOKEN = os.environ%5B'LINE_CHANNEL_ACCESS_TOKEN'%5D%0AHEADER = %7B%0A 'Content-Type': 'application/json',%0A 'Authorization': 'Bearer ' + CHANNEL_ACCESS_TOKE... |
63f01e99acf8b365539c7d58d1acf86d70d03261 | Fix name-tests-test | pre_commit_hooks/tests_should_end_in_test.py | pre_commit_hooks/tests_should_end_in_test.py | from __future__ import print_function
import sys
def validate_files(argv=None):
retcode = 0
for filename in argv:
if (
not filename.endswith('_test.py') and
not filename.endswith('__init__.py') and
not filename.endswith('/conftest.py')
):
... | Python | 0.999993 | @@ -32,16 +32,32 @@
nction%0A%0A
+import argparse%0A
import s
@@ -92,16 +92,139 @@
=None):%0A
+ parser = argparse.ArgumentParser()%0A parser.add_argument('filenames', nargs='*')%0A args = parser.parse_args(argv)%0A%0A
retc
@@ -254,17 +254,27 @@
e in arg
-v
+s.filenames
:%0A
|
b3f7d4600d69f5ffea80f46a48c2412cfce76159 | add argument to specify path to sqlite3 db | lib/alchemy/__init__.py | lib/alchemy/__init__.py | import os
import ConfigParser
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from schema import *
def fetch_session(db=None):
"""
Read from config.ini file and load appropriate database
"""
echo = False
config = ConfigParser.ConfigParser()
config.read('{0}/config... | Python | 0 | @@ -149,16 +149,36 @@
(db=None
+, path_to_sqlite='.'
):%0A %22
@@ -480,16 +480,98 @@
qlite%22:%0A
+ sqlite_db_path = os.path.join(path_to_sqlite, config.get(db, 'database'))%0A
@@ -620,34 +620,22 @@
mat(
-config.get(db, 'database')
+sqlite_db_path
), e
|
edf96afa7045efa4d60d80edaef9a13226535892 | Fix typo in feature_blocksdir.py log message | test/functional/feature_blocksdir.py | test/functional/feature_blocksdir.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the blocksdir option.
"""
import os
import shutil
from test_framework.test_framework import BitcoinTe... | Python | 0.000984 | @@ -673,24 +673,24 @@
with non
-
exi
-ting
+stent
blocksd
@@ -1011,16 +1011,17 @@
with exi
+s
ting blo
|
cb0b197ccad0b49baa24f3dff374de2ff2572cde | Make ua_comment test pass on 0.16.0 | test/functional/feature_uacomment.py | test/functional/feature_uacomment.py | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -uacomment option."""
from test_framework.test_framework import BitcoinTestFramework
from test_fra... | Python | 0.000311 | @@ -976,53 +976,8 @@
= %22
-Total length of network version string (286)
exce
|
8de3db6cc6edb2b1c59e64e430797521a6f05f26 | make latent subgradient test more robust and faster. | tests/test_learners/test_subgradient_latent_svm.py | tests/test_learners/test_subgradient_latent_svm.py | import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_almost_equal)
from pystruct.models import LatentGridCRF, LatentDirectionalGridCRF, GridCRF
from pystruct.learners import LatentSubgradientSSVM, SubgradientSSVM
import pystruct.toy_datasets as... | Python | 0 | @@ -280,16 +280,61 @@
ientSSVM
+%0Afrom pystruct.inference import get_installed
%0A%0Aimport
@@ -1831,17 +1831,98 @@
mples=10
-)
+, noise=.3, seed=1)%0A inference_method = get_installed(%5B%22qpbo%22, %22ad3%22, %22lp%22%5D)%5B0%5D
%0A n_l
@@ -2031,36 +2031,48 @@
nference_method=
-'lp'
+inference_method
)%0... |
ccb6565de6bbbce012c9448c22aac13c6d38bdf6 | Add labels to distribution graph | lib/charts.py | lib/charts.py | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Python | 0 | @@ -6024,16 +6024,77 @@
lors)s'%0A
+ '&chxt=x,y,x,y&chxl=2:%7C%7CDuration+in+ms%7C%7C3:%7C%7C%25%2525%7C'%0A
|
e41dde0874ff40dde175830618b40ae3828865d6 | Update file paths to new location for trac, inside of irrigator_pro | irrigator_pro/trac/cgi-bin/trac.wsgi | irrigator_pro/trac/cgi-bin/trac.wsgi | import os, os.path, site, sys, socket
# Add django root dir to python path
PROJECT_ROOT = '/prod/irrigator_pro'
print "PROJECT_ROOT=", PROJECT_ROOT
sys.path.append(PROJECT_ROOT)
# Add virtualenv dirs to python path
if socket.gethostname()=='gregs-mbp':
VIRTUAL_ENV_ROOT = os.path.join( PROJECT_ROOT, 'Virtual... | Python | 0 | @@ -713,24 +713,38 @@
'%5D = '/prod/
+irrigator_pro/
trac'%0Aos.env
@@ -773,24 +773,38 @@
'%5D = '/prod/
+irrigator_pro/
trac/eggs'%0A%0A
@@ -940,16 +940,30 @@
'/prod/
+irrigator_pro/
trac')%0A
|
6b4a1d3dab678952c6e4452a5559c370841b1518 | Handle None as a value. Fixes #1500 | py/selenium/webdriver/remote/errorhandler.py | py/selenium/webdriver/remote/errorhandler.py | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Python | 0 | @@ -7020,16 +7020,33 @@
ue == ''
+ or value is None
:%0A
|
5148baee7f0cc5817af8dd366a91b93251c13b05 | Use dict instead of attidict as return result. | python-omega-client/omega_client/__init__.py | python-omega-client/omega_client/__init__.py | # -*- coding: utf-8 -*-
from beanbag.v2 import BeanBag, GET, POST, DELETE, BeanBagException
import requests
BASE_URL = '/api/v3'
class OmegaException(Exception):
pass
def check_return_code(function):
def with_code_check(*args, **kwargs):
# raise exception when omega get code big than zero;
... | Python | 0 | @@ -817,16 +817,36 @@
.session
+, use_attrdict=False
)%0A%0A
|
810fa4592d5c998d63362123e2e73dc99fa3c902 | remove unused imports | modules/residentadvisor/module.py | modules/residentadvisor/module.py | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Alexandre Morignot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | Python | 0.000001 | @@ -972,66 +972,8 @@
RIES
-, STATUS%0Afrom weboob.capabilities.base import NotAvailable
%0A%0Afr
@@ -1039,18 +1039,8 @@
port
- datetime,
tim
@@ -1049,14 +1049,8 @@
elta
-, time
%0A%0A%0A_
|
7ec93bd30e18d1020d3d802475018533cd84485f | fix some bugs in logkit | ganggu/logkit.py | ganggu/logkit.py | # -*- coding: UTF-8 -*-
# Copyright (C) 2012-2016 Xue Can <xuecan@gmail.com> and contributors.
# Licensed under the MIT license: http://opensource.org/licenses/mit-license
"""
# 日志工具
加载本模块后,将会扩展 Python 标准库的日志等级如下:
+-----------+-------+-----------------------------------+
| Level | Value | Defined ... | Python | 0.000001 | @@ -1303,16 +1303,60 @@
oredlogs
+%0Afrom logging import getLogger as get_logger
%0A%0A__vers
@@ -3360,24 +3360,57 @@
**kwargs)%0A%0A%0A
+logging.setLoggerClass(Logger)%0A%0A%0A
def setup_co
@@ -4127,21 +4127,26 @@
r =
+logging.get
Logger(
-'root'
)%0A
|
44e3643f9ddacce293feac2a2e9ca09799b7ff68 | Use options.rootdir instead of __file__ | citools/pavement.py | citools/pavement.py | import os
import sys
from os.path import join, abspath, dirname
from paver.easy import *
@task
@consume_args
@needs('unit', 'integrate')
def test():
""" Run whole testsuite """
def djangonize_test_environment(test_project_module):
sys.path.insert(0, abspath(join(dirname(__file__))))
sys.path.insert(0, ... | Python | 0 | @@ -260,95 +260,68 @@
(0,
-abspath(join(dirname(__file__))))%0A sys.path.insert(0, abspath(join(dirname(__file__)
+options.rootdir)%0A sys.path.insert(0, join(options.rootdir
, %22t
@@ -327,17 +327,16 @@
tests%22))
-)
%0A sys
@@ -355,38 +355,28 @@
(0,
-abspath(join(dirname(__file__)
+join(options.rootdi... |
a2d71e08f60c86961c4c89069cbb3c3700efd950 | Version bump | ivona_speak/__init__.py | ivona_speak/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
__version__ = '0.1.1'
| Python | 0.000001 | @@ -95,11 +95,11 @@
= '0.1.
-1
+2
'%0A
|
8ff877fe82ced94582ca48cb066a9363995b09cd | Fix flake8 | recipes/metaphlan2/download_metaphlan2_db.py | recipes/metaphlan2/download_metaphlan2_db.py | #!/usr/bin/env python3
import argparse
import tarfile
import os
import urllib2
import shutil
METAPHLAN2_URL = 'https://bitbucket.org/biobakery/metaphlan2/get/2.6.0.tar.gz'
def download_file(url, target=None, wd=None):
"""Download a file from a URL
Fetches a file from the specified URL.
If 'target' is s... | Python | 0 | @@ -195,30 +195,8 @@
(url
-, target=None, wd=None
):%0A
@@ -275,252 +275,8 @@
RL.%0A
- If 'target' is specified then the file is saved to this%0A name; otherwise it's saved as the basename of the URL.%0A If 'wd' is specified then it is used as the 'working%0A directory' where the file will be save on th... |
26c24e6c0015e7f8730f3ce22fbdc63e46ae9f79 | Add help command to /setcommands | src/handler.py | src/handler.py | import telegram
import time
import pytesseract
import config
import os
try:
import Image
except ImportError:
from PIL import Image
help_text = """
Send me an image and I will run Google's Tesseract OCR tool on it and send you back the results.
You can change the language I use on Tesseract by sending me `/lang <co... | Python | 0.000002 | @@ -547,16 +547,60 @@
language
+%0A# help - detailed information about the bot
%0A%0ADEFAUL
|
c9b84efef4d472f6190ffbfea38a7b2eaf864257 | Add alias var for all commands | gbot/commands.py | gbot/commands.py | #!/usr/bin/env python3
# Goshubot IRC Bot
# written by Daniel Oaks <daniel@danieloaks.net>
# licensed under the BSD 2-clause license
from .users import USER_LEVEL_NOPRIVS, USER_LEVEL_ADMIN
class BaseCommand:
"""Provides for a generic command backend."""
standard_command_privs = USER_LEVEL_NOPRIVS
def __i... | Python | 0.000001 | @@ -992,16 +992,106 @@
ption%5D%0A%0A
+ # defaults%0A if not hasattr(self, 'alias'):%0A self.alias = False%0A%0A
%0Aclass A
@@ -1345,78 +1345,8 @@
lts%0A
- if not hasattr(self, 'alias'):%0A self.alias = False%0A
|
d6432e9718a160bda79afe473adc9630d36a9ce5 | add v2.4.40 (#25065) | var/spack/repos/builtin/packages/bedops/package.py | var/spack/repos/builtin/packages/bedops/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 Bedops(MakefilePackage):
"""BEDOPS is an open-source command-line toolkit that performs hi... | Python | 0.000001 | @@ -617,16 +617,113 @@
ar.gz%22%0A%0A
+ version('2.4.40', sha256='0670f9ce2da4b68ab13f82c023c84509c7fce5aeb5df980c385fac76eabed4fb')%0A
vers
|
7b486fd84dfca220b1415fa2956a8c4bc32dc470 | add version 0.7 | var/spack/repos/builtin/packages/py-ics/package.py | var/spack/repos/builtin/packages/py-ics/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 PyIcs(PythonPackage):
"""Ics.py : iCalendar for Humans
Ics.py is a pythonic and easy ... | Python | 0.000001 | @@ -1053,16 +1053,110 @@
ar.gz%22%0A%0A
+ version('0.7', sha256='48c637e5eb8dfc817b1f3f6b3f662ba19cfcc25f8f71eb42f5d07e6f2c573994')%0A
vers
|
ec82d23af593afdd6fbff0b5f15cb79a77b01a5c | Add session auth to DRF settings (to log in to browsable API while debugging) | gwells/settings.py | gwells/settings.py | """
Django settings for this project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths i... | Python | 0 | @@ -6073,24 +6073,87 @@
ntication',%0A
+ 'rest_framework.authentication.SessionAuthentication',%0A
),%0A '
|
475f03b44209144f50b9d42632da4b82a26d3dfe | Remove trailing whitespace | plugins/chrm/CHv1PersistentImplementation.py | plugins/chrm/CHv1PersistentImplementation.py | #----------------------------------------------------------------------
# Copyright (c) 2011-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | Python | 0.999999 | @@ -1835,34 +1835,33 @@
ies(client_cert,
-
%0A
+
@@ -2156,33 +2156,32 @@
ies(client_cert,
-
%0A
@@ -2490,17 +2490,16 @@
nt_cert,
-
%0A
@@ -3479,17 +3479,16 @@
S_TABLE,
-
%0A
@@ -4385,17 +4385,16 @@
, list):
-
%0A
@@ -6620,24 +6620,24 @@
UTES'%5D = %7... |
45e4ab12fbca553118ed36420e8267e9f94270a7 | use relative import path | twitter_korean/util/KoreanDictionaryProvider.py | twitter_korean/util/KoreanDictionaryProvider.py | # -*- encoding: utf-8 -*-
'''
*
* Twitter Korean Text - Scala library to process Korean text
*
* Copyright 2014 Twitter, 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
*
* h... | Python | 0 | @@ -936,16 +936,17 @@
e%0A%0Afrom
+.
KoreanPo
|
4c5c7aa74b2dec2cbfb6b6bd7e24d5922e92c112 | Document 'repo status' output | subcmds/status.py | subcmds/status.py | #
# Copyright (C) 2008 The Android Open Source 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/LICENSE-2.0
#
# Unless required by applicable la... | Python | 0.000001 | @@ -763,16 +763,1588 @@
...%5D%0A%22%22%22
+%0A helpDescription = %22%22%22%0A'%25prog' compares the working tree to the staging area (aka index),%0Aand the most recent commit on this branch (HEAD), in each project%0Aspecified. A summary is displayed, one line per file where there%0Ais a difference between these thr... |
dfd6aeb95f2290f839b116f9439e69515fefcd14 | Read entire file instead of slice used for testing. | FindCleavageSites.py | FindCleavageSites.py | # IdentifyOffTargetSiteSequences.py
# Shengdar Tsai (stsai4@mgh.harvard.edu)
# A program to identify Cas9 off-target sites from in vitro GUIDE-seq data
from __future__ import print_function
__author__ = 'shengdar'
import argparse
import HTSeq
import itertools
import pyfaidx
import string
import swalign
import sys
... | Python | 0 | @@ -1126,24 +1126,26 @@
unt = 0%0A%0A
+ #
for read in
@@ -1216,26 +1216,24 @@
N reads%0A
- #
for read in
|
027632cbac1cfa42e2f66b53ae6c3f22bcce630e | Fix cdd package definition, dotted is a property (#2054) | var/spack/repos/builtin/packages/cdd/package.py | var/spack/repos/builtin/packages/cdd/package.py | ##############################################################################
# Copyright (c) 2013-2016, 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.007823 | @@ -1843,10 +1843,8 @@
tted
-()
).re
|
d0dc51bbb4f36d8b726124cac34c2b343aa25a15 | Add sudoku without solution. | sudoku_example.py | sudoku_example.py | #!/usr/bin/env python
import sys
sys.path.append("./src")
from sat import SAT_solver
from sudoku import sudoku, printSudoku, processResult
print "================================================="
print "SUDOKU"
print "================================================="
solver = SAT_solver()
# define bord as follows... | Python | 0.000076 | @@ -3343,28 +3343,829 @@
u(processResult(result%5B1%5D))%0A
+%0A#no solution sudoku%0Aevil_board = %5B%5BNone, 3, 6, None, 9, None, None, None, 3%5D,%0A %5BNone, None, None, None, None, None, None, 4, 1%5D,%0A %5BNone, None, None, 7, 4, None, None, None, 3%5D,%0A %5BNone, 9, 1, None, None, None, N... |
4bdf46a33bc86267247ea41824214454607f0084 | Simplify voltage display code | pcf8591read.py | pcf8591read.py | #! /usr/bin/env python3
import sys, time
from time import sleep
from quick2wire.parts.pcf8591 import *
from quick2wire.i2c import I2CMaster
#from vis import volt_plot
from writefile import *
from tkinter import *
class adc_reader():
def __init__(self):
self.address = int(sys.argv[1]) if len(sys.argv) > ... | Python | 0.001085 | @@ -2124,84 +2124,23 @@
-reading += str(%5Bbar for bar in strength%5D)%0A print (reading
+print (strength
)%0A
|
59d7854b8988c6525df8eb1ef7f2cde58c63eb0a | add build_directory, remove old hack (#10112) | var/spack/repos/builtin/packages/clp/package.py | var/spack/repos/builtin/packages/clp/package.py | # Copyright 2013-2018 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 Clp(AutotoolsPackage):
"""Clp (Coin-or linear programming) is an open-source
linear ... | Python | 0 | @@ -587,129 +587,36 @@
-def configure_args(self):%0A return %5B%0A '--with-clp-datadir=%7B0%7D/Data'.format(self.build_directory),%0A %5D
+build_directory = 'spack-build'
%0A
|
73ef49c54b1e928462a957aee196b70de0ec5d85 | revert data model for tests | tests/canonical_test.py | tests/canonical_test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from itertools import combinations
import csv
import exampleIO
import dedupe
import os
import time
import optparse
import logging
optp = optparse.OptionParser()
optp.add_option('-v', '--verbose', dest='verbose', action='count',
help='Increase verbosity (specify... | Python | 0 | @@ -2034,30 +2034,8 @@
ing'
-, 'Has Missing' : True
%7D,%0A
|
090ca0e14621d287e9f5d1d301589d99d95cd224 | Remove unused function | src/dynmen/cmd/__init__.py | src/dynmen/cmd/__init__.py | # -*- coding: utf-8 -*-
from collections import namedtuple as _namedtuple
ProcStatus = _namedtuple('ProcStatus', 'stdout stderr returncode')
def _to_bytes(obj, entry_sep=b''):
if isinstance(obj, bytes):
return obj
return entry_sep.join(obj)
| Python | 0.000004 | @@ -140,121 +140,4 @@
')%0A%0A
-%0Adef _to_bytes(obj, entry_sep=b''):%0A if isinstance(obj, bytes):%0A return obj%0A return entry_sep.join(obj)%0A
|
5fbb4ff5d3427c8f4050fc5b75d4a6a2c15351c6 | Set pygments style to monokai. | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Donne Martin'
SITENAME = 'Donne Martin'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/New_York'
DEFAULT_LANG = 'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM ... | Python | 0 | @@ -396,16 +396,17 @@
= None%0A
+%0A
HIDE_SID
@@ -412,24 +412,51 @@
DEBAR = True
+%0APYGMENTS_STYLE = 'monokai'
%0A%0A# Blogroll
|
b399761106bd81c40021a2710c39ae7fafe0ec1d | Add clang compiler (#15152) | var/spack/repos/builtin/packages/pdt/package.py | var/spack/repos/builtin/packages/pdt/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)
import os
from spack import *
class Pdt(AutotoolsPackage):
"""Program Database Toolkit (PDT) is a framework for anal... | Python | 0 | @@ -2389,16 +2389,97 @@
'-GNU')%0A
+ elif self.compiler.name == 'clang':%0A options.append('-clang')%0A
|
cde48aff408c0d2c413e4316a1ef5c808d2f444c | add DISPLAY_NAVBAR to configuration | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'jchen'
SITENAME = u'BURRITO 4 LYFE'
SITEURL = ''
TIMEZONE = 'ETC/UTC'
DEFAULT_LANG = u'en'
CSS_FILE = 'style.css'
# theme stuff
THEME = '/Users/jchen/git/pelican/burrito'
# plugins
PLUGIN_PATH = '/Users/jchen/git/pe... | Python | 0 | @@ -669,32 +669,55 @@
ON_MENU = False%0A
+DISPLAY_NAVBAR = False%0A
DISPLAY_PAGES_ON
|
a6ea16ded53bb688113012114a25b7d75e6460c0 | Fix PVM dependencies (#20951) | var/spack/repos/builtin/packages/pvm/package.py | var/spack/repos/builtin/packages/pvm/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 *
import subprocess
class Pvm(MakefilePackage):
"""PVM (Parallel Virtual Machine) is a software pa... | Python | 0 | @@ -695,16 +695,92 @@
da44')%0A%0A
+ depends_on('m4', type='build')%0A depends_on('libtirpc', type='link')%0A%0A
para
@@ -792,16 +792,16 @@
= False%0A
-
%0A @pr
@@ -1005,16 +1005,25 @@
.strip()
+.decode()
%0A%0A de
@@ -1162,32 +1162,32 @@
ere PVM resides%0A
-
env%5B'PVM
@@ -1220,16 +1220... |
0ee55bd73369c69638a401f4beef551a79bc820c | remove unneeded conf options | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'jchen'
SITENAME = u'BURRITO 4 LYFE'
SITEURL = ''
TIMEZONE = 'ETC/UTC'
DEFAULT_LANG = u'en'
CSS_FILE = 'style.css'
# theme stuff
THEME = '/Users/jchen/git/pelican/burrito'
# plugins
PLUGIN_PATH = '/Users/jchen/git/pe... | Python | 0.000025 | @@ -587,385 +587,8 @@
ne%0A%0A
-# Blogroll%0ALINKS = (('Pelican', 'http://getpelican.com/'),%0A ('Python.org', 'http://python.org/'),%0A ('Jinja2', 'http://jinja.pocoo.org/'),%0A ('You can modify those links in your config file', '#'),)%0A%0A# Social widget%0ASOCIAL = (('You can add links i... |
49f20c300035784834c3b15b896bba979c69d92a | Remove meaningless tests | testproject/djangomosqltest/tests.py | testproject/djangomosqltest/tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pkg_resources import get_distribution
from django.conf import settings
from django.test import TestCase
from django_nose import FastFixtureTestCase
from nose.tools import ok_, eq_, assert_not_equal, assert_false, assert_raises
import djangomosql
from djangomosql.funct... | Python | 0.000021 | @@ -44,51 +44,8 @@
*-%0A%0A
-from pkg_resources import get_distribution%0A
from
@@ -73,16 +73,16 @@
ettings%0A
+
from dja
@@ -233,27 +233,8 @@
ses%0A
-import djangomosql%0A
from
@@ -438,16 +438,16 @@
= str%0A%0A%0A
+
class Ba
@@ -470,116 +470,8 @@
e):%0A
- def test_version(self):%0A eq_(get_distribut... |
47b8887ff5fd2904d542da8563dcbfb6bcf92dc3 | fix error general error raise | addons/iap/models/iap.py | addons/iap/models/iap.py | # -*- coding: utf-8 -*-
import contextlib
import logging
import json
import uuid
import werkzeug.urls
import requests
from odoo import api, fields, models, exceptions
_logger = logging.getLogger(__name__)
DEFAULT_ENDPOINT = 'https://iap.odoo.com'
#----------------------------------------------------------
# Helpe... | Python | 0 | @@ -1576,26 +1576,46 @@
el
-se
+if name == 'UserError'
:%0A
@@ -1647,24 +1647,102 @@
s.UserError%0A
+ else:%0A raise requests.exceptions.ConnectionError()%0A
|
0f671516ed129d4b51fac2eec88272d6ed56b314 | Make sure excluded file extension case does not error out | mopidy/backends/local/commands.py | mopidy/backends/local/commands.py | from __future__ import unicode_literals
import logging
import os
import time
from mopidy import commands, exceptions
from mopidy.audio import scan
from mopidy.utils import path
from . import translator
logger = logging.getLogger('mopidy.backends.local.commands')
class LocalCommand(commands.Command):
def __ini... | Python | 0.000001 | @@ -2244,16 +2244,78 @@
a_dir):%0A
+ uri = translator.path_to_local_track_uri(relpath)%0A
@@ -2364,16 +2364,17 @@
ath)%5B1%5D%0A
+%0A
@@ -2536,70 +2536,8 @@
ue%0A%0A
- uri = translator.path_to_local_track_uri(relpath)%0A
|
1a44050dffb37a110346cf0809fc7e92234939e9 | raise an error when somebody sets hold on a show | mpf/config_players/show_player.py | mpf/config_players/show_player.py | from copy import deepcopy
from mpf.core.config_player import ConfigPlayer
class ShowPlayer(ConfigPlayer):
config_file_section = 'show_player'
show_section = 'shows'
device_collection = None
def play(self, settings, key=None, priority=0, **kwargs):
# todo should show_tokens be part of setting... | Python | 0 | @@ -528,16 +528,163 @@
tems():%0A
+ if 'hold' in s:%0A raise AssertionError(%22Setting 'hold' is no longer supported for shows. Use duration -1 in your show.%22)%0A
|
41dea616b22379fa2b7c1d00e21fe0288dc61622 | Fix whitespace incoherence, causing pylint errors. | codereview/middleware.py | codereview/middleware.py | # Copyright 2008 Google 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, ... | Python | 0.999987 | @@ -2618,26 +2618,24 @@
est):%0A
-
content = '%25
@@ -2662,34 +2662,32 @@
echnical)%0A
-
content_type = '
@@ -2704,26 +2704,24 @@
'%0A else:%0A
-
tpl =
@@ -2764,18 +2764,16 @@
)%0A
-
ctx = Co
@@ -2818,26 +2818,24 @@
cal%7D)%0A
-
content = tp
@@ -2848,18 +2848,16 @@
... |
5dc4641a40ff25b439541f6c3c02639a53346985 | Fix name of 'Betty' comic | comics/crawlers/betty.py | comics/crawlers/betty.py | from comics.crawler.base import BaseComicsComComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Get Fuzzy'
language = 'en'
url = 'http://comics.com/betty/'
start_date = '1991-01-01'
history_capable_date = '2008-10-13'
schedule = 'Mo,Tu,We,Th,Fr,Sa... | Python | 0.999991 | @@ -146,16 +146,12 @@
= '
-Get Fuzz
+Bett
y'%0A
|
4180c1aa0314ee86356f99a7f209459189fb4a5d | Correct dicts comparison | jet/tests/test_utils.py | jet/tests/test_utils.py | from django.test import TestCase
from jet.tests.models import TestModel
from jet.utils import JsonResponse, get_model_instance_label
class UtilsTestCase(TestCase):
def test_json_response(self):
response = JsonResponse({'str': 'string', 'int': 1})
self.assertEqual(response.content, '{"int": 1, "str... | Python | 0.000028 | @@ -1,12 +1,24 @@
+import json%0A
from django.
@@ -278,72 +278,158 @@
-self.assertEqual(response.content, '%7B%22int%22: 1, %22str%22: %22string%22%7D'
+response_dict = json.loads(response.content)%0A expected_dict = %7B%22int%22: 1, %22str%22: %22string%22%7D%0A self.assertEqual(response_dict, exp... |
8d28e56a2b0d48ef51836b54315f13dbfd3cac80 | clean up a touch | lava_scheduler_daemon/dbjobsource.py | lava_scheduler_daemon/dbjobsource.py | import datetime
import json
import logging
from django.core.files.base import ContentFile
from django.db import connection
from django.db import IntegrityError, transaction
from django.db.models import Q
from django.db.utils import DatabaseError
from twisted.internet.threads import deferToThread
from zope.interface ... | Python | 0.000001 | @@ -3605,357 +3605,8 @@
ED)%0A
- '''%0A (select count(*) from scheduler_app_testjob_tags%0A where testjob_id = %25s%0A and tag_id not in (select tag_id%0A from scheduler_app_device_tags%0A ... |
73866e1ea0066fe45fbbf8a654b438b554d18a26 | update hedwig version | hedwig/__init__.py | hedwig/__init__.py | """
(@,@)
_ _
/\ /\___ __| |_ _(_) __ _
/ /_/ / _ \/ _` \ \ /\ / / |/ _` |
/ __ / __/ (_| |\ V V /| | (_| |
\/ /_/ \___|\__,_| \_/\_/ |_|\__, |
|___/
"""
__title__ = 'Hedwig Python'
__version__ = '0.1.5'
__author__ = 'Piyush'
# Version synonym
VERSIO... | Python | 0 | @@ -267,9 +267,9 @@
0.1.
-5
+6
'%0A__
|
a311528f3c541ca4e7403aa9fca8fe48f1fdd330 | fix pylint reported problems | watson_developer_cloud/visual_recognition_v3.py | watson_developer_cloud/visual_recognition_v3.py | # Copyright 2015 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | Python | 0.000001 | @@ -4089,18 +4089,18 @@
es_file
-==
+is
None an
@@ -4116,10 +4116,10 @@
url
-==
+is
Non
@@ -4623,17 +4623,16 @@
ges_file
-
%7D, data=
@@ -6064,23 +6064,4 @@
ue)%0A
-%0A %0A %0A
|
771f1e31a9588129eb92b269ac94fb714780d400 | Rework the way ad-hoc filters inventory to match how cli/playbook does it | lib/ansible/cli/adhoc.py | lib/ansible/cli/adhoc.py | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | Python | 0.000001 | @@ -4414,45 +4414,233 @@
y)%0A%0A
-%0A if self.options.subset:%0A
+ no_hosts = False%0A if len(inventory.list_hosts(pattern)) == 0:%0A # Empty inventory%0A display.warning(%22provided hosts list is empty, only localhost is available%22)%0A no_hosts = True%0A%0A... |
e060b060817e72fc0559ea6c8e8e28b98aea191e | Allow hosts not in inventory to override inventory with -i "host1,host2:port" etc, which is the original intent of --override-hosts. | lib/ansible/inventory.py | lib/ansible/inventory.py | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | Python | 0 | @@ -1645,16 +1645,155 @@
False%0A%0A
+ if type(host_list) in %5B str, unicode %5D:%0A if host_list.find(%22,%22) != -1:%0A host_list = host_list.split(%22,%22)%0A%0A
|
82cd66c119f3d7fdce16cafdf23c85ee61dc99ad | Add ability to specify port at command line | herc/webservice.py | herc/webservice.py | from tornado.ioloop import IOLoop, PeriodicCallback
from tornado.web import RequestHandler, Application
from tornado import gen
from tornado import httpserver
import argparse
import os.path
import subprocess
import json
import time
import herc.async as async
import herc.jsonvalidate as jsonvalidate
import herc.aurora a... | Python | 0 | @@ -3608,16 +3608,108 @@
'%0A )%0A
+ parser.add_argument(%0A '-p', '--port', default=4372, help='Server TCP port'%0A )%0A
cli
@@ -3790,17 +3790,45 @@
BUG mode
-'
+ (port %7B0%7D)'.format(cli.port)
)%0A
@@ -4798,20 +4798,24 @@
.listen(
-4372
+cli.port
)%0A%0A #
|
c46dae64a8a257e3bd3b37aa1abd588de54584bf | Add missing self argument to handle method. | zerver/management/commands/fetch_tor_exit_nodes.py | zerver/management/commands/fetch_tor_exit_nodes.py | import os
from argparse import ArgumentParser
from typing import Any, Set
import orjson
from django.conf import settings
from requests.packages.urllib3.util.retry import Retry
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.outgoing_http import OutgoingSession
class TorDataSession(OutgoingSession... | Python | 0 | @@ -1309,16 +1309,22 @@
handle(
+self,
*args: A
|
6c55c5c960d8d3d34fd6bad7e58775602bd82084 | Refactor test for account linking service. | tests/satosa/test_account_linking.py | tests/satosa/test_account_linking.py | from unittest.mock import MagicMock
import requests
import pytest
import responses
from satosa.account_linking import AccountLinkingModule
from satosa.context import Context
from satosa.exception import SATOSAAuthenticationError
from satosa.internal_data import InternalResponse, AuthenticationInformation
from satosa.r... | Python | 0 | @@ -1,12 +1,22 @@
+import os%0A
from unittes
@@ -40,16 +40,30 @@
icMock%0A%0A
+import pytest%0A
import r
@@ -70,30 +70,16 @@
equests%0A
-import pytest%0A
import r
@@ -87,16 +87,17 @@
sponses%0A
+%0A
from sat
@@ -452,44 +452,21 @@
ort
-FileG
+g
enerat
-or, private_to_public_key
+e_cert
%0A%0A__
@@ -499,813 +4... |
b9eb6bcd93eea3e8d0804b83197a6ada30b8a778 | Remove unecessary code path | lib/filters/__init__.py | lib/filters/__init__.py | from decimal import Decimal, InvalidOperation, ROUND_HALF_UP
import locale
from re import match, sub
NO_DECIMAL_PLACE = Decimal('1')
ONE_DECIMAL_PLACE = Decimal('0.1')
TWO_DECIMAL_PLACES = Decimal('0.01')
locale.setlocale(locale.LC_ALL, 'en_GB.utf-8')
path_prefix = '/'
def as_number(num):
if num:
ju... | Python | 0.0005 | @@ -2490,14 +2490,8 @@
m =
-float(
as_n
@@ -2504,107 +2504,10 @@
num)
-)%0A %0A if num %3C 100:%0A num = '%25.02f' %25 num%0A return num.rstrip('0.')%0A else:%0A
+%0A%0A
@@ -2519,28 +2519,24 @@
round(num)%0A
-
return l
|
cb94f0c2c6445981933350927d7a2bb78439f98f | remove invalid comment | Contents/Libraries/Shared/subzero/history_storage.py | Contents/Libraries/Shared/subzero/history_storage.py | # coding=utf-8
import datetime
import logging
import traceback
import types
from constants import mode_map
logger = logging.getLogger(__name__)
class SubtitleHistoryItem(object):
item_title = None
section_title = None
rating_key = None
provider_name = None
lang_name = None
score = None
... | Python | 0 | @@ -2168,30 +2168,8 @@
e):%0A
- # create copy%0A
|
0ef44a5cbceddead46b46ce16667809afd462e1f | remove unused import. | hostman/hostman.py | hostman/hostman.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Hostman.
Usage:
hostman add [-fqbcvq] [--force] [--path=PATH]
( [ENTRY ...] | [--input-file=FILE] | [--input-url=URL] )
hostman remove [-qbcvq] ([--address=<address>] [--names=<names>]) [--path=PATH]
[--input-file=FILE] [--input-url=U... | Python | 0 | @@ -1302,20 +1302,8 @@
sts,
- HostsEntry,
uti
|
d8dda85c786c38ad2fbb2e40d44567b917431cb8 | Update zero_one_normalization.py | Data_collection_processing/zero_one_normalization.py | Data_collection_processing/zero_one_normalization.py | '''
Linearly scale the expression range of one gene to be between 0 and 1.
If a reference dataset is provided, then the scaling of one gene in the
target dataset in done using the minimun and range of that gene in the
reference dataset.
'''
import sys
import argparse
sys.path.insert(0, 'Data_collection_processing/')
f... | Python | 0.000004 | @@ -1810,16 +1810,20 @@
+
(tar_dat
|
b8596698beda8784308e1bad5a6b90382618b550 | Remove min call. | Examples/pairwise/tstep_compare/timestep_pairwise.py | Examples/pairwise/tstep_compare/timestep_pairwise.py |
'''
Pairwise comparisons between all sims at one timestep. Creates a distance
that may be compared to the other timesteps to look for clear trends in the
distance metric.
'''
from turbustat.statistics import stats_wrapper
from turbustat.data_reduction import Mask_and_Moments
from astropy.io.fits import getdata
from ... | Python | 0 | @@ -855,12 +855,8 @@
m =
-min(
len(
@@ -872,17 +872,16 @@
.keys())
-)
%0A%0A po
|
3b212f6ea6ba1ed355250b587f3d1c1cc462c7ed | send ctrl+c signal | tests/test_apiserver.py | tests/test_apiserver.py | # -*- coding: utf-8 -*-
"""
tests.apiserver
~~~~~~~~~~~~
Tests cobra.api
:author: 40huo <git@40huo.cn>
:homepage: https://github.com/wufeifei/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 Feei. All rights reserved
"""
import requests
import json
... | Python | 0.000006 | @@ -367,16 +367,30 @@
shutil%0A
+import signal%0A
from cob
@@ -1637,16 +1637,38 @@
p.
-terminate(
+send_signal(signal=signal.SIGINT
)%0A
|
759e50abb963fd854989cb79592f7cf6f9d0bc13 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/41b9d692dc31b2b95c47e8c56cb9cd4872adc511. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "cbc81d9ef4bcea56e841c1b8a84d07db04a926bf"
TFRT_SHA256 = "804f98fab72aa814701e9bc2b56435fce5b0f64af01ccf... | Python | 0.000002 | @@ -210,132 +210,132 @@
= %22
-cbc81d9ef4bcea56e841c1b8a84d07db04a926bf%22%0A TFRT_SHA256 = %22804f98fab72aa814701e9bc2b56435fce5b0f64af01ccfc5e4783d0e07e7b65
+41b9d692dc31b2b95c47e8c56cb9cd4872adc511%22%0A TFRT_SHA256 = %22b7ba9c34b81e53428a745453dc0ae0108a9510c6a7bd25bfc2b01694976ef63
6%22%0A%0A
|
b17700b9878a3999c2ad64f622d2ca8566043b2e | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/fb895960cc796437c6d516cc19027c94f2319b4d. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "1b5317be3621f2f9b6415696edb912ef75f54187"
TFRT_SHA256 = "7f430ad049f7270b7dad98787f04d1259b8b2cd1a068c5... | Python | 0.000001 | @@ -210,133 +210,133 @@
= %22
-1b5317be3621f2f9b6415696edb912ef75f54187%22%0A TFRT_SHA256 = %227f430ad049f7270b7dad98787f04d1259b8b2cd1a068c5ad38387b4574ffd9cc
+fb895960cc796437c6d516cc19027c94f2319b4d%22%0A TFRT_SHA256 = %229c5c10fa7b516554c8a6725e13c3d959609ad5d8fab2c66b1292f1f1ec447a1f
%22%0A%0A
|
a3afc651ba0efeef17293fa1e688a901453e1f05 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/379d33d44c64d5bd83eb4ca4d7a0928eb79b5f54. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ae8fb48248557568109089e96d1aaab760dada21"
TFRT_SHA256 = "fd64d9151ce25cda33a12ad1addbf52e853d2d13a74058... | Python | 0.000002 | @@ -210,133 +210,133 @@
= %22
-ae8fb48248557568109089e96d1aaab760dada21%22%0A TFRT_SHA256 = %22fd64d9151ce25cda33a12ad1addbf52e853d2d13a740586f40684947e845df27
+379d33d44c64d5bd83eb4ca4d7a0928eb79b5f54%22%0A TFRT_SHA256 = %227be6d4bc2d8ac5f2420249f2c2df645ad945ba5f51d2ef18b87668783a22b8df
%22%0A%0A
|
e6d4c2bb4ac83a5f573a2a6fc5ef77356cd70ef3 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/78c6401faaebc33df9cc2c78f21e5c235d1670f4. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "6e9c9d0a5c1bea5568c7fd837da88da67e71e3c3"
TFRT_SHA256 = "ec37cf4d732794f4a4032e5f25e9... | Python | 0.000001 | @@ -228,133 +228,133 @@
= %22
-6e9c9d0a5c1bea5568c7fd837da88da67e71e3c3%22%0A TFRT_SHA256 = %22ec37cf4d732794f4a4032e5f25e9ee4e3dd99580350ce3eed5c1369fcc2ce496
+78c6401faaebc33df9cc2c78f21e5c235d1670f4%22%0A TFRT_SHA256 = %226a17b2490d44b392ece0015bbc4d5166003651319906603e19ef000da0686f69
%22%0A%0A
|
5c823e1197f73701811cf449337c0c8bb970bc5c | Improve readability of tests | tests/test_datadicts.py | tests/test_datadicts.py | import pytest
from pytus2000 import diary, diaryepisode, individual, household, weightdiary, worksheet
@pytest.fixture(params=[
diary,
diaryepisode,
individual,
household,
weightdiary,
worksheet
])
def datadict_module(request):
return request.param
@pytest.fixture(params=[
diary,
... | Python | 0.000025 | @@ -1,12 +1,340 @@
+%22%22%22Tests for autogenerated data dictionaries.%0A%0AA data dictionary contains the following:%0A%0A* Variable Enum: An enum that contains all variables of the data dict as its members.%0A* Variable Value Enum: An enum containing all values of one variable. Only exists for variables%0A ... |
89844b7615e704410a9fa0dc6ae4cfe61ab8fefe | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/24d3f64ad78415f008af4bdde57079e331545dbf. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "af2213b972c9f736109d4249089c9398c09a8add"
TFRT_SHA256 = "ce588cd5aa843316c6b759315cbc... | Python | 0 | @@ -228,48 +228,48 @@
= %22
-af2213b972c9f736109d4249089c9398c09a8add
+24d3f64ad78415f008af4bdde57079e331545dbf
%22%0A
@@ -289,72 +289,72 @@
= %22
-ce588cd5aa843316c6b759315cbc0f018be3c4535ad7ef7d83a6bb49e6d3051b
+00afec2e99d50a817a9a3bdea6f7fdc88fd2c656bdb22def5c20e96308487656
%22%0A%0A
|
1ef4cc5ca233eabc8b7002b70b865aa0ed9ff409 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/f09caec27d101ea44157f209bcfdc62ab62da4e4. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ed84e5f6b49b52f7801e6030fb5ab26f41f2af28"
TFRT_SHA256 = "080d122bb57e5b5b51a8c8f3b1916d2f7ea768e09d9a29... | Python | 0.000003 | @@ -210,133 +210,133 @@
= %22
-ed84e5f6b49b52f7801e6030fb5ab26f41f2af28%22%0A TFRT_SHA256 = %22080d122bb57e5b5b51a8c8f3b1916d2f7ea768e09d9a29e67f04a1c34b3a8504
+f09caec27d101ea44157f209bcfdc62ab62da4e4%22%0A TFRT_SHA256 = %22cda2b7652b72ecdd55f1a33a6c3126f403f3e0ac007014b011c8a8280c1f28bf
%22%0A%0A
|
d1bb3815f694da6bf867d7b171f02554f874a737 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/553df8c12e9ba5930b9b8065f1d012ea07c6044c. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "2db6a815bd262da6d96d2398c4049230548d8c33"
TFRT_SHA256 = "dcc0b3bc54740cabb370d0d773d8... | Python | 0 | @@ -228,133 +228,133 @@
= %22
-2db6a815bd262da6d96d2398c4049230548d8c33%22%0A TFRT_SHA256 = %22dcc0b3bc54740cabb370d0d773d8026a5113ceab346d85ed22a9f6e46d9db850
+553df8c12e9ba5930b9b8065f1d012ea07c6044c%22%0A TFRT_SHA256 = %22477d0374b044c60cd018fdb17e7c6054e190e59e36e1a442eb5d1628efb2341d
%22%0A%0A
|
c4a4776a78b9f59bc52e799ffe28d17d0340278f | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0af176c97ea8e57671df14444c4c759211c70b1a. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "2f6de37d68a4c69e2ff9eec3cebbf1369e496940"
TFRT_SHA256 = "cf180c95c54d1132366996482a5c... | Python | 0.000002 | @@ -228,133 +228,133 @@
= %22
-2f6de37d68a4c69e2ff9eec3cebbf1369e496940%22%0A TFRT_SHA256 = %22cf180c95c54d1132366996482a5c853f41695be88a495ff9215a0ee20300e870
+0af176c97ea8e57671df14444c4c759211c70b1a%22%0A TFRT_SHA256 = %22be0251342fe9408261e10638787b4eddfeece73c446d12d75692bff26dc5d5c5
%22%0A%0A
|
f56dd27d3e94d15af6ca82e3e5a5c4fbaf34771d | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/d543fafbb8dfa546945c5eced829accec1b70b46. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "8678704dfcf48b2a7039e56fde0e9bd58bce7828"
TFRT_SHA256 = "46cd465aab34eec5f21f1ff74607... | Python | 0.000001 | @@ -228,133 +228,133 @@
= %22
-8678704dfcf48b2a7039e56fde0e9bd58bce7828%22%0A TFRT_SHA256 = %2246cd465aab34eec5f21f1ff746076b494cae3f3295b20265376a96745de29da8
+d543fafbb8dfa546945c5eced829accec1b70b46%22%0A TFRT_SHA256 = %22370f57dc668b4a44b7a0caa6a078cff1d17118356a665699e116f4cf585eb679
%22%0A%0A
|
4e0e42544237ce612d5ec3e4dc6a6a8ab8e58df2 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/06855ca4832377a2bdc8fdb3200415a219906c02. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "f66f87bad3576356f286662b0f4a742ffed33c0d"
TFRT_SHA256 = "b35a52bcd37a7aca08b0446b96eb... | Python | 0 | @@ -228,48 +228,48 @@
= %22
-f66f87bad3576356f286662b0f4a742ffed33c0d
+06855ca4832377a2bdc8fdb3200415a219906c02
%22%0A
@@ -289,72 +289,72 @@
= %22
-b35a52bcd37a7aca08b0446b96eb0a6f0276ea303779b9ce1c9292267996b5a3
+e0ca743f255e4f24e1a84b0fe60fcce59833b5145c25369f350fae121ea3eb67
%22%0A%0A
|
a087f78182e5d6c5ca89bc1ab357979f98d97270 | fix test_bad_template | tests/test_mailmerge.py | tests/test_mailmerge.py | """
System tests.
Andrew DeOrio <awdeorio@umich.edu>
"""
import re
import sh
from . import utils
# Python 2 pathlib support requires backport
try:
from pathlib2 import Path
except ImportError:
from pathlib import Path
# The sh library triggers lot of false no-member errors
# pylint: disable=no-member
def t... | Python | 0.000011 | @@ -6307,21 +6307,45 @@
assert
+%22Error in Jinja2 template%22 in
stdout
- == %22%22
%0A
|
1143b5cf44ac9314cc160ea55e56a6d04dad8691 | Set daemon attribute instead of using setDaemon method that was deprecated in Python 3.10 | tests/test_threading.py | tests/test_threading.py | """Test that mq sends don't wedge their threads.
Starts a number of sender threads, and runs for a set amount of
time. Each thread sends messages as fast as it can, and after each
send, pops from a Queue. Meanwhile, the Queue is filled with one
marker per second. If the Queue fills, the test fails, as that
indicates t... | Python | 0 | @@ -1411,20 +1411,21 @@
t.
-setD
+d
aemon
-(1)
+ = True
%0A
|
12e41349ceedfccc2dd1255bdd47208a07d6a7f6 | Refactor tests | tests/test_tictactoe.py | tests/test_tictactoe.py | import unittest
from games import TicTacToe
class TestTicTacToe(unittest.TestCase):
def setUp(self):
self.game = TicTacToe()
def test_copy(self):
self.game.make_moves([1, 3, 2])
clone = self.game.copy()
self.assertItemsEqual(self.game.legal_moves(), clone.legal_moves())
... | Python | 0.000001 | @@ -711,41 +711,16 @@
move
-(3)%0A self.game.make_move(7
+s(%5B3, 7%5D
)%0A
@@ -1924,41 +1924,16 @@
move
-(3)%0A self.game.make_move(7
+s(%5B3, 7%5D
)%0A
|
6fa685b1d2f93511aa76a2ff017636c271d91b01 | Add some more files to the exempt ones | tests/unit/perm_test.py | tests/unit/perm_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Mike Place <mp@saltstack.com`
Tests to ensure that the file permissions are set correctly when
importing from the git repo.
'''
# Import python libs
import os
import stat
import pprint
# Import salt testing libs
from salttesting import TestCase
from saltt... | Python | 0 | @@ -796,32 +796,56 @@
/git/PKGBUILD',%0A
+ 'pkg/rpm/build.py',%0A
'pkg/rpm/sal
@@ -905,24 +905,53 @@
lt-syndic',%0A
+ 'pkg/shar/build_shar.sh'%0A
'pkg/sma
@@ -1359,16 +1359,17 @@
ltsh.py'
+,
%0A%5D%0A%0AIGNO
|
658425a555f7fbdc53d02fd8aeb0a467bd377146 | Add explicit test for hg+file | tests/unit/test_link.py | tests/unit/test_link.py | import pytest
from pip._internal.models.link import Link
from pip._internal.utils.hashes import Hashes
class TestLink:
@pytest.mark.parametrize('url, expected', [
(
'https://user:password@example.com/path/page.html',
'<Link https://user:****@example.com/path/page.html>',
... | Python | 0 | @@ -4753,32 +4753,81 @@
roject', True),%0A
+ ('hg+file://hg.company.com/repo', True),%0A
('https:
|
b48e77b6b72bc072dbbc639bb7ad6abf60f878d4 | Version bumped to 1.0.2. | jsonobjects/__init__.py | jsonobjects/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .exceptions import GenericError, NotFound, ValidationError
from .fields import (
Field, BooleanField, StringField, IntegerField, FloatField, DecimalField,
DateField, DateTimeField, RegexField, ListField, DictField
)
from .validators import (
MinValue, MaxV... | Python | 0 | @@ -499,17 +499,17 @@
= '1.0.
-1
+2
'%0A%0A%0A__al
|
190b9ac1aa92c172b102ae7b0d6ff06b823c5a78 | add missing imports | FontNote.glyphsPalette/Contents/Resources/plugin.py | FontNote.glyphsPalette/Contents/Resources/plugin.py | # encoding: utf-8
#######################################################################################
#
# Palette Plugin
#
# Read the docs:
# https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Palette
#
#######################################################################################
... | Python | 0.000275 | @@ -314,16 +314,51 @@
######%0A%0A
+import objc%0Afrom GlyphsApp import *
%0Afrom Gl
@@ -410,16 +410,33 @@
rt NSLog
+%0Aimport traceback
%0A%0Aclass
|
1759e2bec03935e33fe15950e0b5457a0001aaa5 | fix conflict | school/migrations/0005_studentapplication.py | school/migrations/0005_studentapplication.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import sortedm2m.fields
class Migration(migrations.Migration):
dependencies = [
('assets', '0001_initial'),
('people', '0002_updatefresnoyprofile'),
('people', '0001_initial'),
... | Python | 0.031708 | @@ -275,44 +275,8 @@
'),%0A
- ('people', '0001_initial'),%0A
|
13fafcb00989e6d46e08465cc20e2c010b37068d | Add more log outputs during jupyterlab startup | jupyterlab/extension.py | jupyterlab/extension.py | # coding: utf-8
"""A tornado based Jupyter lab server."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
#-----------------------------------------------------------------------------
# Module globals
#--------------------------------------------------------------... | Python | 0 | @@ -1311,16 +1311,71 @@
Config()
+%0A app_dir = getattr(nbapp, 'app_dir', get_app_dir())
%0A%0A #
@@ -1470,62 +1470,74 @@
RE)%0A
-%0A
-app_dir = getattr(nbapp, 'app_dir', get_
+logger.info('JupyterLab application directory is %25s' %25
app_dir
-()
)%0A%0A
@@ -1783,32 +1783,87 @@
core_mode = True
+%... |
fbdaeff6f01ffaf0ac4f9a0d0d962a19c2865b32 | Add docstring documenting the intended use of LabHubApp. | jupyterlab/labhubapp.py | jupyterlab/labhubapp.py | import os
import warnings
from traitlets import default
from .labapp import LabApp
try:
from jupyterhub.singleuser import SingleUserNotebookApp
except ImportError:
SingleUserLabApp = None
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUser... | Python | 0 | @@ -6,24 +6,8 @@
t os
-%0Aimport warnings
%0A%0Afr
@@ -319,25 +319,24 @@
abApp):%0A
-%0A
@default
@@ -331,127 +331,276 @@
-@default(%22default_url%22)%0A def _default_url(self):%0A %22%22%22when using jupyter-labhub, jupyterlab is
+%22%22%22%0A A sublcass of JupyterHub's Sin... |
8cf24b479ca3602ac4471d29f90821c4edc56ad7 | Update CondenseLabel.py | histomicstk/segmentation/label/CondenseLabel.py | histomicstk/segmentation/label/CondenseLabel.py | import numpy as np
from skimage import measure as ms
def CondenseLabel(Label):
"""
Shifts labels in a label image to fill in gaps corresponding to missing
values.
Parameters
----------
Label : array_like
A label image generated by segmentation methods.
Returns
-------
Con... | Python | 0 | @@ -16,35 +16,41 @@
np%0A
-from skimage import
+import scipy.ndimage.
measure
+ments
as
@@ -692,118 +692,142 @@
d =
-np.zeros(Label.shape, dtype=np.uint32)%0A%0A # get pixel list for each object%0A Props = ms.regionprops(Label)
+Label.copy()%0A%0A # get extent of each object%0A Locations = ms.find_... |
ea08e0d62d6d652a53d39ca6b4d771edf5e3b719 | Set event data as dict in foursquare.checkin event (#63982) | homeassistant/components/foursquare/__init__.py | homeassistant/components/foursquare/__init__.py | """Support for the Foursquare (Swarm) API."""
from http import HTTPStatus
import logging
import requests
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.core import ServiceCall
import homeassistant.helpers.config... | Python | 0.000002 | @@ -265,16 +265,31 @@
e import
+ HomeAssistant,
Service
@@ -345,16 +345,68 @@
on as cv
+%0Afrom homeassistant.helpers.typing import ConfigType
%0A%0A_LOGGE
@@ -1305,17 +1305,52 @@
hass
-, config)
+: HomeAssistant, config: ConfigType) -%3E bool
:%0A
@@ -1983,16 +1983,25 @@
CHECKIN,
+ %7B%22text%22:
respons
@... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.