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 |
|---|---|---|---|---|---|---|---|
f307070c89ed87944b5ac07aa89eaf8a91c49951 | add correct number of args for add | tests/test_api_actions.py | tests/test_api_actions.py | from vent.api.actions import Action
def test_add():
""" Test the add function """
instance = Action()
status = instance.add()
assert status[0] == False
status = instance.add('https://github.com/CyberReboot/vent-plugins', branch='experimental')
assert status[0] == True
def test_remove():
""... | Python | 0.00016 | @@ -126,26 +126,31 @@
nstance.add(
+'bad'
)%0A
-
assert s
@@ -429,32 +429,100 @@
%22%22%0A test_add(
+'https://github.com/CyberReboot/vent-plugins', branch='experimental'
)%0A instance =
@@ -797,32 +797,32 @@
ld function %22%22%22%0A
-
test_add()%0A
@@ -818,16 +818,84 @@
est_add(
+'https://github... |
49a515963c6e09d35c36041450d20b4024c10373 | disable flaky test | tests/test_deploy_reqs.py | tests/test_deploy_reqs.py | #!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
import unittest
import mock
import os
import tempfile
from click.testing import CliRunner
from shub import deploy_reqs
from .utils import mock_conf
class TestDeployReqs(unittest.TestCase):
def setUp(self):
self.runner = CliRu... | Python | 0.000001 | @@ -357,16 +357,44 @@
(self)%0A%0A
+ @unittest.skip('flaky')%0A
def
|
757ccb948d92c5699109cddadfa4b56cade60551 | swap back to check_call | tests/test_inheritance.py | tests/test_inheritance.py | import subprocess
from wizard_builder.models import (
Choice, Conditional, FormQuestion, MultipleChoice, PageBase, QuestionPage,
SingleLineText,
)
from django.test import TestCase
class InheritanceTest(TestCase):
def test_question_page_instance(self):
page = QuestionPage.objects.create()
... | Python | 0.000001 | @@ -2332,13 +2332,18 @@
ess.
-Popen
+check_call
('''
|
d87a54e03fa3923a73b044be012ec5f5d9344516 | Field value might be none | tk/material/filtersets.py | tk/material/filtersets.py | from django.contrib.postgres.fields import IntegerRangeField
from django.db import models
from django import forms
from django_filters import FilterSet
from django_filters.filters import ModelMultipleChoiceFilter, MultipleChoiceFilter, NumericRangeFilter
from .fields import get_languages
from .models import Subject, ... | Python | 0.999996 | @@ -546,32 +546,54 @@
s(self, value):%0A
+ if value:%0A
value =
@@ -718,32 +718,54 @@
n(self, value):%0A
+ if value:%0A
value =
|
9957f734a1023f694e5946ea7163f6f9eedfc8cb | fix uniform log prior evaluation | thejoker/distributions.py | thejoker/distributions.py | # Third-party
import astropy.units as u
import numpy as np
import pymc3 as pm
from pymc3.distributions import generate_samples
import theano.tensor as tt
import exoplanet.units as xu
__all__ = ['UniformLog', 'FixedCompanionMass']
class UniformLog(pm.Continuous):
def __init__(self, a, b, **kwargs):
"""A ... | Python | 0 | @@ -1266,21 +1266,9 @@
urn
-tt.ones_like(
+-
tt.a
@@ -1291,17 +1291,16 @@
e(value)
-)
* -np.l
|
2ac3fb000b9be2ea83c5c04019217c79d460a05d | fix some bugs | uctrl/load_balancer.py | uctrl/load_balancer.py | #!/usr/bin/env python
import random
# Not supposed to be something dynamic, for now.
class Load_Balancer(object):
def __init__(self):
# Edge output ports in order of preference
# It will be calculated in the load_balance method
self.edge_out_ports = {}
def lb_policy(self, edge_core):
... | Python | 0.000008 | @@ -4891,16 +4891,21 @@
mask =
+self.
get_ip_n
|
0056fd321b1d2082965b6a9452390ed86beffc86 | Add return type, rename operation | cate/ops/arithmetics.py | cate/ops/arithmetics.py | # The MIT License (MIT)
# Copyright (c) 2016 by the Cate Development Team and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation ... | Python | 0.000001 | @@ -1330,16 +1330,19 @@
'%5D)%0Adef
+ds_
arithmet
@@ -1385,16 +1385,30 @@
op: str)
+ -%3E xr.Dataset
:%0A %22%22
|
517dafafc80649bdbbbd38fc02f3cd1a734a3c85 | Fix reduce plugin function for reduce | ce/transformer/utils.py | ce/transformer/utils.py | import itertools
import ce.logger as logger
from ce.expr import Expr
from ce.transformer.core import TreeTransformer
from ce.transformer.biop import associativity, distribute_for_distributivity, \
BiOpTreeTransformer
from ce.analysis import expr_frontier
def closure(tree, depth=None):
return BiOpTreeTransfor... | Python | 0.000001 | @@ -995,32 +995,108 @@
pand(tree):%0A
+def pop(s):%0A if s:%0A return %5Bs.pop()%5D%0A return s%0A
return transform
@@ -1101,37 +1101,16 @@
rm(tree,
-%0A
reducti
@@ -1192,27 +1192,11 @@
gin=
-lambda s: %5Bs.pop()%5D
+pop
).po
|
2b04e1422ad5e6cceb375a5d3b8398f0c7273f4f | Replace tuple with list | apps/topics-map/bin/topics_map_worker.py | apps/topics-map/bin/topics_map_worker.py | #!/usr/bin/env python3
"""Topic Mapper job that generates timespan_maps for a timespans or all timespans in a snapshot."""
from mediawords.db import connect_to_db
from mediawords.job import JobBroker
from topics_map.map import generate_and_store_maps
from mediawords.util.log import create_logger
from mediawords.util.... | Python | 0.999999 | @@ -1579,17 +1579,17 @@
s_ids =
-(
+%5B
timespan
@@ -1596,10 +1596,9 @@
s_id
-,)
+%5D
%0A%0A
|
7c41d979f2d14a16b78a824528450965f384da78 | set saucelabs idle timeout to 2 mins | apps/webdriver_testing/webdriver_base.py | apps/webdriver_testing/webdriver_base.py | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program 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 your op... | Python | 0 | @@ -3837,16 +3837,52 @@
= True%0A
+ dc%5B'idle-timout'%5D = 120%0A
|
2636eed6872db77c14c2e15e1ac385ccf2ec8c55 | remove debug statement | src/c3nav/mapdata/render/base.py | src/c3nav/mapdata/render/base.py | import pickle
from django.core.cache import cache
from django.db import transaction
from django.db.models import Q
from shapely.ops import unary_union
from c3nav.mapdata.models import Level, MapUpdate
class LevelGeometries:
def __init__(self):
self.altitudeareas = []
self.walls = None
se... | Python | 0.000517 | @@ -1711,58 +1711,8 @@
eom)
-%0A print(level.pk, geoms.holes.area)
%0A%0A
|
92e30e279628e9aba46db4672fc228c363426db2 | Fix typo | chemtools/dataparser.py | chemtools/dataparser.py | from cStringIO import StringIO
import numpy as np
from scipy.optimize import curve_fit
import matplotlib
matplotlib.use('Cairo')
import matplotlib.pyplot as plot
np.seterr(all="ignore")
from utils import Output, catch
class DataParser(Output):
def __init__(self, f):
super(DataParser, self).__init__()
... | Python | 0.999999 | @@ -802,12 +802,23 @@
cos(
-math
+scipy.constants
.pi
|
31d1471e52c35155261a806eefc5a8934e8c661d | make uid generation static | ipynbsrv/core/auth/authentication_backends.py | ipynbsrv/core/auth/authentication_backends.py | from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import Group, User
from ipynbsrv.conf.helpers import *
from ipynbsrv.contract.backends import GroupBackend, UserBackend
from ipynbsrv.contract.errors import *
from ipynbsrv.core import settings
from ipynbsrv.core.models import Backend... | Python | 0.000002 | @@ -1980,20 +1980,42 @@
uid =
-self
+BackendProxyAuthentication
.generat
@@ -3681,16 +3681,33 @@
n user%0A%0A
+ @classmethod%0A
def
@@ -4042,24 +4042,484 @@
_django_id%0A%0A
+ @classmethod%0A def generate_internal_guid(self):%0A %22%22%22%0A Generate an internal group ID.%0A U... |
28400a6afaf200d9862e4652c5c345086f8c30cb | update version | jsonapi/__init__.py | jsonapi/__init__.py | """ JSON:API realization."""
__version = (0, 6, 3)
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
| Python | 0 | @@ -45,9 +45,9 @@
6,
-3
+4
)%0A%0A_
|
cae6c107c1fd8b7b995795e6cc89c7ef4154a5db | Remove debug line | plugins/feeds/public/cybercrime_ponytracker.py | plugins/feeds/public/cybercrime_ponytracker.py | from datetime import datetime, timedelta
import logging
import re
from core.observables import Hash, Url
from core.feed import Feed
from core.errors import ObservableValidationError
class CybercrimePonyTracker(Feed):
default_values = {
"frequency": timedelta(hours=1),
"name": "CybercrimePonyTrac... | Python | 0.000039 | @@ -577,31 +577,8 @@
%5D):%0A
- print dict%0A
|
7aef204876261e81d5950432753a0769f933f12c | Version 0.24.0 | jumeaux/__init__.py | jumeaux/__init__.py | __version__ = '0.23.0'
| Python | 0.000002 | @@ -15,9 +15,9 @@
'0.2
-3
+4
.0'%0A
|
5b7fe7b69ffb51d4c4fe5ecafa3e9cb583296a4f | fix log format | spirit/extra/project_template/project_name/settings/base.py | spirit/extra/project_template/project_name/settings/base.py | # -*- coding: utf-8 -*-
"""
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
http... | Python | 0.000005 | @@ -4698,17 +4698,18 @@
rmat': '
-%7B
+%25(
levelnam
@@ -4713,61 +4713,68 @@
name
-%7D %7B
+)s %25(
asctime
-%7D %7B
+)s %25(
module
-%7D %7B
+)s %25(
process
-:d%7D %7B
+)d %25(
thread
-:d%7D %7B
+)d %25(
message
-%7D
+)s
',%0A
|
2d01199e7194c91b2a488eccbff898ce7d1ead20 | Fix urn property to avoid infinite recursion. | src/omnilib/stitch/GENIObject.py | src/omnilib/stitch/GENIObject.py | #----------------------------------------------------------------------
# Copyright (c) 2013 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 witho... | Python | 0 | @@ -3506,16 +3506,17 @@
rn self.
+_
urn%0A%0A
|
a1f4130e6f38c5ea3a723cf1120804ffb88ba85c | Remove email pref which is no more valid for receipts | partner_compassion/models/partner_compassion.py | partner_compassion/models/partner_compassion.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | Python | 0.000008 | @@ -1034,47 +1034,8 @@
)),%0A
- ('email', _('By e-mail')),%0A
|
4c90bee05f13f6bba6a828ad9479df9afcb4bed2 | Add all flags for defaults set command | cli/bin/csv2_helpers.py | cli/bin/csv2_helpers.py | def generate_bash_completion_script(gvar):
"""
List settings.
"""
if gvar['retrieve_options']:
return []
options = get_option_list(gvar)
arguments = {
'-ce|--cloud-enabled': '-W "true false yes no 1 0"',
'-ct|--cloud-type': '-W "amazon azure google local opennebula ope... | Python | 0.000001 | @@ -3290,16 +3290,17 @@
if
+(
key%5B0%5D i
@@ -3314,16 +3314,43 @@
_options
+) or ('*' in short_options)
:%0A
|
0e6a56e953c37fad4a13145c114a166536445f72 | remove unused imports | pillowtop/management/commands/ptop_es_manage.py | pillowtop/management/commands/ptop_es_manage.py | from django.core.management.base import LabelCommand, CommandError
import sys
from casexml.apps.case.models import CommCareCase
from optparse import make_option
from corehq.elastic import get_es
from couchexport.models import SavedExportSchema
from dimagi.utils.couch.database import get_db
from pillowtop.listener impor... | Python | 0.000001 | @@ -75,58 +75,8 @@
sys%0A
-from casexml.apps.case.models import CommCareCase%0A
from
@@ -142,104 +142,8 @@
_es%0A
-from couchexport.models import SavedExportSchema%0Afrom dimagi.utils.couch.database import get_db%0A
from
|
402636a317bfda9295e4d84eb9de4210318729f5 | Clean up cache | xclib/roster_thread.py | xclib/roster_thread.py | import logging
import traceback
import unicodedata
import sys
from xclib.ejabberdctl import ejabberdctl
def sanitize(name):
name = unicode(name)
printable = set(('Lu', 'Ll', 'Lm', 'Lo', 'Nd', 'Nl', 'No', 'Pc', 'Pd', 'Ps', 'Pe', 'Pi', 'Pf', 'Po', 'Sm', 'Sc', 'Sk', 'So', 'Zs'))
return str(''.join(c for c in ... | Python | 0.000002 | @@ -4524,16 +4524,119 @@
cessary%0A
+ if not cleanname:%0A del self.ctx.shared_roster_db%5Bkey%5D%0A else:%0A
@@ -4691,24 +4691,28 @@
+
if previous
@@ -4719,16 +4719,20 @@
!= new:%0A
+
@@ -4808,16 +4808,46 @@
ays set%0A
+ ... |
5b0816539c8bf013cf695523b54059f71c91ba15 | Update to CloudML code. The service will not accept gs://bucket/directory as a valid staging bucket anymore | cloudml/trainer/task.py | cloudml/trainer/task.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | Python | 0 | @@ -1222,21 +1222,16 @@
o-martin
-/jobs
--confi
|
619be15e0eb86de091088d9935d832265b4e344d | add description of CloudVolume to __init__.py | cloudvolume/__init__.py | cloudvolume/__init__.py | from .connectionpools import ConnectionPool
from .cloudvolume import CloudVolume
from .lib import Bbox, Vec
from .provenance import DataLayerProvenance
from .skeletonservice import PrecomputedSkeleton, SkeletonEncodeError, SkeletonDecodeError
from .storage import Storage
from .threaded_queue import ThreadedQueue
from .... | Python | 0.000003 | @@ -1,12 +1,1910 @@
+%22%22%22%0AA %22serverless%22 Python client for reading and writing arbitrarily large %0ANeuroglancer Precomputed volumes both locally and on cloud services. %0APrecomputed volumes consist of chunked numpy arrays, meshes, and %0Askeletons and can be visualized using Neuroglancer. Typically these %... |
327e22084e315f46ab5b03b40f37469647b6a7e3 | Version 0.42.3 | cloudvolume/__init__.py | cloudvolume/__init__.py | from .connectionpools import ConnectionPool
from .cloudvolume import CloudVolume
from .lib import Bbox
from .provenance import DataLayerProvenance
from .skeletonservice import PrecomputedSkeleton, SkeletonEncodeError, SkeletonDecodeError
from .storage import Storage
from .threaded_queue import ThreadedQueue
from .excep... | Python | 0 | @@ -571,11 +571,11 @@
= '0.42.
-2
+3
'%0A
|
d1d74eb315174ab458d47a856780d6c61ecc0a6d | Version 0.32.0 | cloudvolume/__init__.py | cloudvolume/__init__.py | from .connectionpools import ConnectionPool
from .cloudvolume import CloudVolume
from .provenance import DataLayerProvenance
from .skeletonservice import PrecomputedSkeleton, SkeletonEncodeError, SkeletonDecodeError
from .storage import Storage
from .threaded_queue import ThreadedQueue
from .txrx import EmptyVolumeExce... | Python | 0.000001 | @@ -462,9 +462,9 @@
'0.3
-1.3
+2.0
'%0A
|
92c2dcaf253270e08fe078173f1977f6b8c99e81 | Improve type hint | src/pretix/base/services/mail.py | src/pretix/base/services/mail.py | import logging
from typing import Any, Dict
import bleach
import cssutils
import markdown
from django.conf import settings
from django.core.mail import EmailMultiAlternatives, get_connection
from django.template.loader import get_template
from django.utils.translation import ugettext as _
from inlinestyler.utils impor... | Python | 0.000002 | @@ -36,16 +36,23 @@
ny, Dict
+, Union
%0A%0Aimport
@@ -853,19 +853,42 @@
mplate:
-str
+Union%5Bstr, LazyI18nString%5D
,%0A
|
cf0c8140977728c2ac36471a5eb9202be608998b | debug filename_local for viz | cms/dists/likes_func.py | cms/dists/likes_func.py | ## helper functions for visualizing component score prior likelihoods
## last updated: 10.8.16 vitti@broadinstitute.org
import matplotlib as mp
mp.use('TkAgg') #set backend
import matplotlib.pyplot as plt
from random import choice
import numpy as np
import os
def get_hist_bins(score,numBins):
if score == "ihs":
sc... | Python | 0.000001 | @@ -2761,17 +2761,16 @@
(1,5)%0A%0A%09
-#
filename
|
889f9bdae15e315cbca090efb18eae7e512df051 | add printing to testLoadUrdf.py | src/python/tests/testLoadUrdf.py | src/python/tests/testLoadUrdf.py | from ddapp.consoleapp import ConsoleApp
from ddapp import visualization as vis
from ddapp import roboturdf
app = ConsoleApp()
view = app.createView()
robotStateModel, robotStateJointController = roboturdf.loadRobotModel('robot state model', view, parent='sensors', color=roboturdf.getRobotGrayColor(), visible=True)
r... | Python | 0 | @@ -312,16 +312,270 @@
=True)%0A%0A
+print 'urdf file:', robotStateModel.getProperty('Filename')%0A%0Afor joint in robotStateModel.model.getJointNames():%0A print 'joint:', joint%0A%0Afor link in robotStateModel.model.getLinkNames():%0A print 'link:', link%0A robotStateModel.getLinkFrame(link)%0A%0A
robotSta... |
84c6f128bb6ee2ef0a1dc69d2f514b2c6c9c8e07 | Improve parsing, catches a little bit more | codegen/scanvirtuals.py | codegen/scanvirtuals.py | #!/usr/bin/env python
import re
import sys
def main():
rx = re.compile(r'^\s*(\w+)\s*\(\s*\*\s*(\w+)\s*\)\s*\(([^()]*)\);',
re.DOTALL|re.MULTILINE)
for f in sys.argv[1:]:
#print ";; From", f
buf = file(f).read()
for m in rx.findall(buf):
return_type = m... | Python | 0 | @@ -77,23 +77,26 @@
(r'%5E%5Cs*(
+%5B
%5Cw
-+)%5Cs*
+%5Cs%5C*%5D+)
%5C(%5Cs*%5C*%5C
@@ -319,16 +319,90 @@
= m%5B0%5D
+.strip()%0A if 'typedef' in return_type:%0A continue
%0A
@@ -469,16 +469,71 @@
'none'%0A
+ return_type = return_type.replace(' ', '')%0A
@@... |
5a363ba5972d2b5da45412c2212c7edee22a77ef | Add percent increase to alert | src/sentry/tasks/check_alerts.py | src/sentry/tasks/check_alerts.py | """
sentry.tasks.check_alerts
~~~~~~~~~~~~~~~~~~~~~~~~~
- Store a sorted set per project
- Each sorted set contains the number of events seen in the interval (1 minute)
- An additional set contains the number of unique events seen
- Every minute we iterate this sorted set (we can exploit the queue just like buffers ... | Python | 0 | @@ -4384,18 +4384,30 @@
ON%0A%0A
-if
+pct_increase =
count /
@@ -4421,16 +4421,36 @@
us * 100
+%0A if pct_increase
%3E thres
@@ -4587,16 +4587,24 @@
%25d to %25d
+ (+%25d%25%25)
' %25 (pre
@@ -4615,16 +4615,30 @@
s, count
+, pct_increase
),%0A
|
4f935f4c7a1c750923c69eefe074be60db6d7da2 | move the standard flag to c++ only part. It is not applicable to c part. | ClangAutoComplete.py | ClangAutoComplete.py | #
# Provides completion suggestions for C/C++ languages
# based on clang output
#
import sublime, sublime_plugin, os, ntpath, subprocess, codecs, re, tempfile
import os.path as path
class ClangAutoComplete(sublime_plugin.EventListener):
compl_regex = re.compile("COMPLETION: ([^ ]+) : ([^\\n]+)")
file_ext = re.comp... | Python | 0 | @@ -3884,17 +3884,34 @@
flags =
-%22
+self.std_flag + %22
-x c++%22%0A
@@ -4507,30 +4507,8 @@
%22 +
- self.std_flag + %22 %22 +
syn
|
43cd62f4ece245a656543d3de30ce561f35418fb | add code comment | unihan_db/bootstrap.py | unihan_db/bootstrap.py | # -*- coding: utf8 - *-
from __future__ import (absolute_import, print_function, unicode_literals,
with_statement)
import logging
import sys
from datetime import datetime
from sqlalchemy import create_engine, event
from sqlalchemy.orm import class_mapper, mapper, scoped_session, sessionmaker
f... | Python | 0 | @@ -3592,16 +3592,156 @@
(items)%0A
+ # This takes a bit of time and doesn't provide progress, but it's by%0A # far the fastest way to insert as of SQLAlchemy 1.11.%0A
|
f4b5895bd8f20e3a73a36ad9b1f1ffce9e6de8c7 | corrige error en el 349 cuando se generan apuntes contables asociados a una factura que no apuntan directamente a una línea de factura. | l10n_es_aeat_mod349/models/account_invoice.py | l10n_es_aeat_mod349/models/account_invoice.py | # Copyright 2017 Tecnativa - Luis M. Ontalba
# Copyright 2017 Eficent Business & IT Consult. Services <contact@eficent.com>
# Copyright 2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class AccountInvoice(models.Model):
_inher... | Python | 0.000001 | @@ -1183,16 +1183,82 @@
_dicts:%0A
+ if 'invl_id' not in ml_dict:%0A continue%0A
|
34b61df7608f93aa6f4378944b487a947afaabf8 | Remove a bunch of fixed/wfm bugs from detect_leaks.py. Scary... | dom/automation/detect_leaks.py | dom/automation/detect_leaks.py | #!/usr/bin/env python
def ath(array):
hash = {}
for s in array:
hash[s] = True
return hash
knownHash = ath([
# bug 391976
"nsMathMLContainerFrame",
"nsMathMLmtableOuterFrame",
"nsMathMLmtdInnerFrame",
"nsMathMLmactionFrame",
# Bug 398462
"nsBaseAppShell",
"nsRunnable",
# Bug 403199
"nsSimpleN... | Python | 0 | @@ -326,89 +326,9 @@
URI%22
-,%0A%0A# Bug 415112%0A%22AtomImpl%22,%0A%22nsInstantiationNode%22,%0A%0A# Bug 427922%0A%22nsStringBuffer%22
+%0A
%0A%5D)%0A
@@ -485,35 +485,8 @@
th(%5B
-%0A# Bug 425821%0A%22nsDocument%22,
%0A%0A#
@@ -593,173 +593,8 @@
%22,%0A%0A
-# Bug 413582 and friends%0A%22nsGenericElement%22,%0A%... |
4831c4c9d6e008a1ad0c04d2f8f84c07d82d6406 | Remove wfm bug from detect_leaks.py | dom/automation/detect_leaks.py | dom/automation/detect_leaks.py | #!/usr/bin/env python
def ath(array):
hash = {}
for s in array:
hash[s] = True
return hash
knownHash = ath([
# Bug 403199
"nsSimpleNestedURI",
# Bug 467693
"nsStringBuffer",
# ...
"nsStorageStream"
])
# Things that are known to leak AND entrain smaller objects.
# If one of these leaks, leak... | Python | 0 | @@ -663,40 +663,8 @@
ger%22
-,%0A%0A# Bug 478185%0A%22nsStyleContext%22
%0A%5D)%0A
|
a345bd74716b3319a44c1768b25f9176e6d4a125 | Update donkey2.py (#126) | donkeycar/templates/donkey2.py | donkeycar/templates/donkey2.py | #!/usr/bin/env python3
"""
Scripts to drive a donkey 2 car and train a model for it.
Usage:
car.py (drive) [--model=<model>]
car.py (train) [--tub=<tub1,tub2,..tubn>] (--model=<model>)
car.py (calibrate)
"""
import os
from docopt import docopt
import donkeycar as dk
CAR_PATH = PACKAGE_PATH = os.path.... | Python | 0 | @@ -87,27 +87,30 @@
%0AUsage:%0A
-car
+manage
.py (drive)
@@ -127,27 +127,30 @@
model%3E%5D%0A
-car
+manage
.py (train)
@@ -198,19 +198,22 @@
l%3E)%0A
-car
+manage
.py (cal
|
b8cc7058e13d71f4e6714f5aa013815016525f5d | print info as strings, not numbers. will catch pending vms too. | src/tashi/accounting/accountingservice.py | src/tashi/accounting/accountingservice.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 0.000082 | @@ -1698,41 +1698,41 @@
id %25
-d
+s
host %25
-d
+s
vmId %25
-d
+s
user %25
-d
+s
cores %25
d me
@@ -1727,17 +1727,17 @@
cores %25
-d
+s
memory
@@ -1737,17 +1737,17 @@
memory %25
-d
+s
' %25 (ins
|
a8283f5d2c1d970b7b676d491ad8c9472abfe667 | Fix tests since we changed imports. | boardinghouse/tests/test_template_tag.py | boardinghouse/tests/test_template_tag.py | from django.test import TestCase
from .models import AwareModel, NaiveModel
from ..templatetags.boardinghouse import *
class TestTemplateTags(TestCase):
def test_is_schema_aware_filter(self):
self.assertTrue(is_schema_aware(AwareModel()))
self.assertFalse(is_schema_aware(NaiveModel()))
de... | Python | 0 | @@ -115,9 +115,81 @@
ort
-*
+schema_name, is_schema_aware, is_shared_model%0Afrom ..models import Schema
%0A%0Acl
|
fdd122645b71e9aa4fee24e9bf884b06c08d8ee3 | update model | common/models/models.py | common/models/models.py | import numpy as np
import math
import chainer.functions as F
import chainer
import chainer.links as L
from chainer import cuda, optimizers, serializers, Variable
from chainer import function
from chainer.utils import type_check
from .ops import *
from chainer import cuda, optimizers, serializers, Variable
class ThreeL... | Python | 0.000001 | @@ -520,24 +520,49 @@
+w_init=None%0A #
w_init=Chain
@@ -708,32 +708,57 @@
', w_init=w_init
+, activation=F.leaky_relu
),%0A l
@@ -824,32 +824,57 @@
', w_init=w_init
+, activation=F.leaky_relu
),%0A l
@@ -1762,16 +1762,17 @@
+#
if w_ini
@@ -1782,32 +1782,33... |
527f4edc598700e2679c74c47a61086c85757341 | Update download_arlo.py | download_arlo/download_arlo.py | download_arlo/download_arlo.py | #!/usr/bin/env python3
###############################################################################
# Name : download_arlo.py #
# Version : v. 1.0.0.0 #
# Author : Abel Gancsos ... | Python | 0 | @@ -3464,56 +3464,8 @@
/v3?
-eventId=FE!91b15979-6e3c-41b8-b115-e71c64f7ef81&
time
|
eb21ec1021b1447c5bb3be6104b0576a7426de7b | 更新 apps ELOs, 新增所有 functions 的註解 | commonrepo/elos/apps.py | commonrepo/elos/apps.py | # -*- coding: utf-8 -*-
#
# Copyright 2016 edX PDR Lab, National Central University, Taiwan.
#
# http://edxpdrlab.ncu.cc/
#
# 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://w... | Python | 0 | @@ -1023,16 +1023,62 @@
onfig):%0A
+ %22%22%22%0A Configs of ELOs packages.%0A %22%22%22%0A
name
@@ -1120,16 +1120,78 @@
(self):%0A
+ # Register the ELOs package to Activity Stream system%0A
@@ -1231,16 +1231,51 @@
'ELO'))%0A
+ # Load settings of signals%0A
|
ca1d308a4cc17758f11b4805f26caf0a5a443e39 | add set_logger() functions to MakeTarget | trackingshell/__init__.py | trackingshell/__init__.py | import argparse
import sys
import os
import subprocess
import logging
from .decorators import *
logger = logging.getLogger('trackingshell')
logger.addHandler(logging.NullHandler())
class MakeTarget(object):
WITHOUT_TARGET = 'no-target'
# MakeTarget
def __init__(self, target, command, **kwargs):
s... | Python | 0.000001 | @@ -452,16 +452,93 @@
= logger
+%0A self.set_logger()%0A%0A # void%0A def set_logger(self):%0A pass
%0A%0A #
|
188ab7b952cfea17d991d0df9387772bf91c3140 | Check groupnames for None as well as an empty string in add_host | lib/ansible/runner/action_plugins/add_host.py | lib/ansible/runner/action_plugins/add_host.py | # Copyright 2012, Seth Vidal <skvidal@fedoraproject.org>
#
# 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 ... | Python | 0.000001 | @@ -2965,14 +2965,8 @@
ames
- != ''
:%0A
|
48366b22067ce2fc097bedea90e12e6c8c920243 | Use globs for the ignore list (will need *.pyc imminently) | lib/mnemosyne/muse.py | lib/mnemosyne/muse.py | import os
import sys
import mailbox
import time
import stat
import shutil
import kid
import StringIO
from entry import Entry
from mnemosyne import get_conf, dwim_iter
class Muse:
def __init__(self, config, force):
self.force = force
self.path = []
self.conf = {
'entry_dir': ge... | Python | 0 | @@ -93,16 +93,31 @@
StringIO
+%0Aimport fnmatch
%0A%0Afrom e
@@ -511,21 +511,20 @@
: ('
-.hg', '_darcs
+*.pyc', '.hg
', '
@@ -533,28 +533,15 @@
it',
- 'MT',
'.svn'
-, 'CVS'
),%0A
@@ -2623,57 +2623,159 @@
-spath = os.p
+for pattern in self.conf%5B'ignore'%5D:%0A if fnm
at
+c
h.
-join(spat... |
21b1f9bd8e546151e1e183b41237337efcc0bbc3 | Add country code | libnamebench/geoip.py | libnamebench/geoip.py | # Copyright 2010 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.012275 | @@ -1529,24 +1529,83 @@
'country'),%0A
+ 'country_code': data%5B'address'%5D.get('country_code'),%0A
'city'
@@ -2066,16 +2066,32 @@
ngitude'
+, 'country_code'
%5D%0A resu
|
b65b5567e5cfddfdc10bc3a9a96647678916c3e6 | add copy logic | library-examples/read-replace-export-excel.py | library-examples/read-replace-export-excel.py | """
Proto type that does the following:
input:Excel file in language A
output 1:Copy of input file, with original strings replaced with serial numbers
output 2:Single xlsx file that contains serial numbers and original texts from input file.
"""
from openpyxl import load_workbook, Workbook
#point to the file to be r... | Python | 0 | @@ -242,16 +242,30 @@
. %0A%22%22%22%0A%0A
+import shutil%0A
from ope
@@ -301,16 +301,95 @@
orkbook%0A
+%0Ashutil.copyfile('sample-input-fortest.xlsx','sample-input-fortest-out.xlsx')%0A%0A
#point t
|
2ff4f372fe866a715289b45b1426c81c5c1a2db7 | Remove old GET LIMS reference | lims/shared/models.py | lims/shared/models.py | from django.db import models
import reversion
import six
from django.contrib.auth.models import User
from django.db.models.signals import post_save # noqa
from channels import Channel
@reversion.register()
class Organism(models.Model):
"""
Basic information on an Organism
"""
name = models.CharField(... | Python | 0 | @@ -1313,11 +1313,12 @@
rom
-GET
+Leaf
LIM
|
a16a2c490582ea9e78b81ccfc2355c5a4377ceec | Update S3Outposts per 2021-07-29 changes | troposphere/s3outposts.py | troposphere/s3outposts.py | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import integer
class ... | Python | 0 | @@ -202,11 +202,11 @@
n: 3
-1.0
+9.8
.0%0A%0A
@@ -1696,32 +1696,115 @@
%0A%0A props = %7B%0A
+ %22AccessType%22: (str, False),%0A %22CustomerOwnedIpv4Pool%22: (str, False),%0A
%22Outpost
|
ed60c16993a04ac74b8f78ab94544c67fbfd1439 | Update closest_points.py | tryalgo/closest_points.py | tryalgo/closest_points.py | #!/usr/bin/env python3
# Closest pair of points
# trouver la paire de points la plus proche
# jill-jenn vie et christoph durr - 2014-2015
from random import randint
# snip{
from math import hypot # hypot(dx, dy) = sqrt(dx * dx + dy * dy)
from random import shuffle
def dist(p, q):
return hypot(p[0] - q[0], p... | Python | 0.000001 | @@ -265,16 +265,46 @@
huffle%0A%0A
+__all__ = %5B%22closest_points%22%5D%0A%0A
%0Adef dis
@@ -1335,38 +1335,8 @@
p%7D%0A%0A
-__all__ = %5B%22closest_points%22%5D%0A%0A
%0Aif
|
d3f82fd4a913ad786e0ec5527c33fbbef6b04427 | Update loadtest. | loadtests/loadtest.py | loadtests/loadtest.py | from gevent import monkey
monkey.patch_all()
import json
import gevent
from requests_hawk import HawkAuth
from loads.case import TestCase
class TestLoop(TestCase):
def setUp(self):
self.wss = []
def tearDown(self):
for ws in self.wss:
ws.close()
# XXX this is miss... | Python | 0 | @@ -202,24 +202,72 @@
elf.wss = %5B%5D
+%0A self.base_url = self.server_url + %22/v0%22
%0A%0A def te
@@ -3760,38 +3760,36 @@
self.
+ba
se
-rver
_url + '/registr
@@ -4280,38 +4280,36 @@
self.
+ba
se
-rver
_url + '/call-ur
@@ -4864,38 +4864,36 @@
self.
+ba
se
-rver
_... |
88f96a3828ab9a2225a8cf86306a333cd53b8717 | Make rehashing work properly | txircd/modules/manhole.py | txircd/modules/manhole.py | from twisted.conch.manhole_tap import makeService
class Spawner(object):
def __init__(self, ircd):
self.manhole = makeService({
'namespace': {'ircd': ircd},
'passwd': 'manhole.passwd',
'telnetPort': None,
'sshPort': '65432'
})
def spawn(self)... | Python | 0.000061 | @@ -42,16 +42,53 @@
eService
+%0Afrom twisted.internet import reactor
%0A%0Aclass
@@ -351,32 +351,182 @@
n(self):%0A
+ # Wait 100ms in event of a rehash so that the old module%0A # has time to shut down. Could cause race conditions!%0A reactor.callLater(0.1,
self.manhole.st
@@ -535,17 +535,16... |
ece5aa474a824eb2dfee8199e176baf1cbc33ad5 | Move calibration into class and out of main. | treads.py | treads.py | #!/usr/bin/env python
import beaglebone_pru_adc as adc
import subprocess, os.path
import sys, time
class SpeedSensor(adc.Capture):
def __init__(self, *k, **kw):
super(SpeedSensor, self).__init__(*k, **kw)
def start(self, firmware_src):
fw_bin = os.path.splitext(firmware_src)[0]
cmd = [ 'pasm', '-V3', '-b', f... | Python | 0 | @@ -145,16 +145,26 @@
__(self,
+ firmware,
*k, **k
@@ -219,47 +219,11 @@
)%0A%0A%09
-def start(self, firmware_src):%0A%09%09fw_bin
+%09fw
= o
@@ -246,20 +246,16 @@
firmware
-_src
)%5B0%5D%0A%09%09c
@@ -294,20 +294,12 @@
ware
-_src, fw_bin
+, fw
%5D%0A%09
@@ -506,17 +506,30 @@
ware
-_src
)%0A%0A%09%09
+self... |
df17b27edc353f6a4bbbd50b44f4f17c50641d85 | use thread_progress in plugin updating | update.py | update.py | import sublime
import sublime_plugin
import threading
import zipfile
import os
import shutil
import time
import sys
try:
from . import requests
from .thread_progress import ThreadProgress
except:
import requests
from thread_progress import ThreadProgress
class UpdatePluginCommand(sublime_plugin.Window... | Python | 0 | @@ -2090,200 +2090,8 @@
ip%22)
-%0A message = %22%22%22%0A Your plugin is updated to newest. %0A In order to ensure plugin is working, please restart your sublime.%0A %22%22%22%0A sublime.message_dialog(message)
%0A%0A
|
4ca9be293e968ec11e07875021d21f20ca748332 | update posts function | update.py | update.py | from adn_news import *
from helpers import *
def get_posts_update_db():
last = Last.query.first()
t = tavorite.userStream(count=200, since_id=last.post_id)
if t.get('meta').get('code') == 200:
for x in t['data']:
if x['entities']['links']:
if x.get('id') == x.get('t... | Python | 0 | @@ -2777,19 +2777,20 @@
%22%22%22%0A
-six
+five
_days_ag
@@ -2877,11 +2877,12 @@
e %3E
-six
+five
_day
@@ -3324,37 +3324,37 @@
n()%0A
-update_posts_comments
+get_hashtag_update_db
()%0A r
@@ -3381,39 +3381,43 @@
e()%0A
-get_hashtag_update_db()
+update_posts_comments()
%0A upd
@@ -3583,28 ... |
c7df29198cc63834f56a9a2537b971e754df1a8f | Make update utility create new directories | update.py | update.py | #!/usr/bin/env python
# This file is part of Viper - https://github.com/botherder/viper
# See the file 'LICENSE' for copying permission.
import os
import hashlib
from StringIO import StringIO
from zipfile import ZipFile, ZIP_STORED
from viper.common.out import *
from viper.common.network import download
from viper.co... | Python | 0.000001 | @@ -2419,16 +2419,33 @@
ontent.%0A
+ try:%0A
@@ -2483,16 +2483,467 @@
h, 'w')%0A
+ except IOError as e:%0A if e.errno == 21:%0A # It's a new directory.%0A try:%0A os.mkdir(local_file_path)%0A except Exception as e:%... |
23cec52bc136773e3e54251ca30d08c0733bcf1f | Add --message option to stop | watson.py | watson.py | import os
import json
import datetime
import click
WATSON_FILE = os.path.join(os.path.expanduser('~'), '.watson')
def get_watson():
try:
with open(WATSON_FILE) as f:
return json.load(f)
except FileNotFoundError:
return {}
except ValueError:
return {}
def save_watson... | Python | 0 | @@ -1049,16 +1049,113 @@
mmand()%0A
+@click.option('-m', '--message', default=None,%0A help=%22Add a message to this frame%22)%0A
def stop
@@ -1155,16 +1155,23 @@
ef stop(
+message
):%0A w
@@ -1689,33 +1689,16 @@
-project%5B'frames'%5D.append(
+frame =
%7B%0A
@@ -1773,19 +1773,106 @@
()%0... |
515af2de443aef41c73c7b8d050d97772ad9a75d | fix iteration | src/Pyro4/socketserver/threadpool.py | src/Pyro4/socketserver/threadpool.py | """
Thread pool job processor with variable number of worker threads (between max/min amount).
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
from __future__ import with_statement
import time
import logging
import threading
from Pyro4.configuration import config
log ... | Python | 0.000002 | @@ -2409,24 +2409,29 @@
for w in
+list(
self.busy:%0D%0A
@@ -2419,32 +2419,33 @@
n list(self.busy
+)
:%0D%0A
@@ -2481,24 +2481,29 @@
for w in
+list(
self.idle:%0D%0A
@@ -2491,32 +2491,33 @@
n list(self.idle
+)
:%0D%0A
|
7ce419de1f39050940b8399401a77b2096b74ca2 | Increment version number to 0.11.0 | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.10.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Python | 0.999971 | @@ -51,19 +51,19 @@
_ = %220.1
-0.1
+1.0
%22%0A__vers
|
a7f9f241820a96dac5965f37563bc2359501f293 | format error | kino/kino/worker.py | kino/kino/worker.py | # -*- coding: utf-8 -*-
import json
import schedule
import threading
import skills
import nlp
import notifier
import slack
from slack import MsgResource
import utils
class Worker(object):
def __init__(self, text):
self.input = text
self.slackbot = slack.SlackerAdapter()
self.data_handler... | Python | 0.000027 | @@ -1467,24 +1467,26 @@
wake_up_time
+()
).do(%0A
@@ -1628,16 +1628,18 @@
our_time
+()
.split(%22
@@ -1966,24 +1966,26 @@
_to_bed_time
+()
).do(%0A
|
d50608143d6b16dd5a3f88b15c3db2f418657a3c | use ",".join() instead of manually adding the delim | mann/network_agent.py | mann/network_agent.py | #! /usr/bin/env python
import random
import networkx as nx
import matplotlib.pyplot as plt
import re
import mann.agent as agent
class NetworkAgent(object):
def __init__(self):
pass
def create_multidigraph_of_agents_from_edge_list(
self, number_of_agents, edge_list, fig_path,
... | Python | 0.000089 | @@ -3910,16 +3910,267 @@
f.write(
+%22,%22.join(%5Bstr(time_step),%0A node.get_key(),%0A node.num_update,%0A self.str_list_with_out_brackets(node.get_state())%5D%0A ))%0A%0A#
str(time
@@... |
e589ba39303b2d9c5587a6aca81843f4c90fefcd | Verify that the output can turn itself off at the end of calibration run | tools/powercalibration.py | tools/powercalibration.py | import serial, sys, TeensyRawhid, time, numpy as np
from scipy.optimize import curve_fit
class OutputMeasurementError(BaseException):
pass
class CalibrationError(BaseException):
pass
class LoadGenerator:
def __init__(self, device):
self.serial = serial.Serial(device, 115200)
def setLoad(self... | Python | 0.000002 | @@ -2643,24 +2643,175 @@
.setLoad(0)%0A
+ time.sleep(1)%0A current = komahub.measureCurrent(output)%0A%09if current != 0:%0A%09 print 'WARNING: output did not turn off (%25d)!' %25 current%0A
return (
|
7d0dbc4947ff7395a772d4849f34a100f31877ef | add arg in comment | src/plasoscaffolder/bll/mappings/init_mapping.py | src/plasoscaffolder/bll/mappings/init_mapping.py | # -*- coding: utf-8 -*-
""" Module representing function for the different files """
from plasoscaffolder.bll.mappings.mapping_helper import render_template
def get_formatter_init_create(plugin_name: str) -> str:
"""
renders formatter init if you want to create new init file
:param plugin_name: the plugin name
... | Python | 0 | @@ -1427,32 +1427,34 @@
) -%3E str:%0A %22%22%22%0A
+
renders parser
@@ -1496,38 +1496,97 @@
ng init file%0A%0A
-:param
+Args:%0A file_name: name of the file in the templates folder%0A
plugin_name: th
@@ -1574,32 +1574,44 @@
plugin_name:
+ the name of
the plugin name
@@ -1605,33 +1605,28 @@
e ... |
a29ad125d1662023231fef50e27ee697ded4c333 | remove unnecessary create_cal_seqs; fix Id call | src/python/qgl2/basic_sequences/DecouplingMin.py | src/python/qgl2/basic_sequences/DecouplingMin.py | # Copyright 2016 by Raytheon BBN Technologies Corp. All Rights Reserved.
# Simplified version of Decoupling.py for QGL2
from math import pi
import numpy as np
from qgl2.qgl2 import qgl2decl, sequence, qbit, pulse
from qgl2.qgl1 import QubitFactory, X90, Id, Y, U90, MEAS, X90
from qgl2.control import *
from qgl2.uti... | Python | 0 | @@ -327,16 +327,18 @@
rt init%0A
+#
from qgl
@@ -386,16 +386,16 @@
al_seqs%0A
-
%0A@qgl2de
@@ -1057,32 +1057,39 @@
)%0A Id(q,
+length=
0)%0A%0A Y(q)
@@ -1223,16 +1223,23 @@
Id(q,
+length=
0)%0A%0A
@@ -2037,16 +2037,16 @@
h'%5D)/2)%0A
-
Id(q
@@ -2039,32 +2039,39 @@
%5D)/2)%0A Id(... |
cb7c270db95136b06b327afcae4e1dbae447a97c | fix Milestone.__repr__ as Milestone.time may be None | adhocracy/model/milestone.py | adhocracy/model/milestone.py | from datetime import datetime
import logging
from sqlalchemy import Column, ForeignKey, Table, or_
from sqlalchemy import Integer, Unicode, UnicodeText, DateTime
import meta
log = logging.getLogger(__name__)
milestone_table = Table(
'milestone', meta.data,
Column('id', Integer, primary_key=True),
Column... | Python | 0.999999 | @@ -4092,23 +4092,8 @@
%25 (
-self.id, title,
%0A
@@ -4097,33 +4097,33 @@
-
+self.id,%0A
@@ -4114,32 +4114,39 @@
id,%0A
+title,%0A
self
@@ -4162,10 +4162,60 @@
format()
+ if self.time is not None else u'no date'%0A
)%0A
|
5ad0574226bc29d20cdbfc340de824bdf52a6ca5 | Fix incorrect super() reference | tracpro/orgs_ext/tasks.py | tracpro/orgs_ext/tasks.py | from celery import signature
from celery.utils.log import get_task_logger
from django.apps import apps
from django.conf import settings
from django.core.cache import cache
from django.utils.timezone import now as get_now
from djcelery_transactions import task, PostTransactionTask
from temba_client.base import TembaA... | Python | 0.000166 | @@ -864,39 +864,57 @@
return super(
-OrgTask
+ScheduleTaskForActiveOrgs
, self).apply_as
|
8142a48a10799f83d6d8a0d29c50afccd5e9fd68 | Add get_app_and_db function | url_shortener/__init__.py | url_shortener/__init__.py | # -*- coding: utf-8 -*-
"""
url-shortener
==============
An application for generating and storing shorter aliases for
requested URLs. Uses `spam-lists`__ to prevent generating a short URL
for an address recognized as spam, or to warn a user a pre-existing
short alias has a target that has been later recognized as spa... | Python | 0.000004 | @@ -814,24 +814,36 @@
stenceModule
+, SQLAlchemy
%0Afrom .valid
@@ -1862,8 +1862,1071 @@
e%0A )%0A
+%0A%0Adef get_app_and_db(configuration, from_envvar=False):%0A %22%22%22Get application instance and database object used by it%0A%0A :param configuration: a string value referring to a file from which%0A ... |
e4c1a72841b3be44bb34b3ff5dd768ad7da5416e | version bump to 0.1.3 | aldryn_accordion/__init__.py | aldryn_accordion/__init__.py | __version__ = '0.1.2'
| Python | 0.000001 | @@ -16,7 +16,7 @@
0.1.
-2
+3
'%0A
|
569ec687f9cd93d9e61a0063f9c570fa5b2c648a | Add test to make sure next meeting date is between start and end | studygroups/tests/test_models.py | studygroups/tests/test_models.py | from django.test import TestCase, override_settings
from django.test import Client
from django.core import mail
from django.contrib.auth.models import User
from django.utils import timezone
from mock import patch
from studygroups.models import StudyGroup
from studygroups.models import Application
from studygroups.mod... | Python | 0.000013 | @@ -2054,24 +2054,602 @@
e.time())%0A%0A%0A
+ def test_next_meeting_date_in_range(self):%0A sg = StudyGroup.objects.all()%5B0%5D%0A now = timezone.now()%0A sg.start_date = now + datetime.timedelta(weeks=4)%0A sg.end_date = now + datetime.timedelta(weeks=10)%0A next_date = next_mee... |
a8a8656818ef8db333a6c35dab0bb4903fb32802 | fix crash on serial ip addresses | subiquity/controllers/welcome.py | subiquity/controllers/welcome.py | # Copyright 2015 Canonical, Ltd.
#
# This program 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 your option) any later version.
#
# This program is distribute... | Python | 0 | @@ -1811,16 +1811,24 @@
dresses(
+self.app
)%0A
|
623269614fdcd42b27e2ccf21306595a2438646f | Fix stopline hash | src/sakia/data/entities/transaction.py | src/sakia/data/entities/transaction.py | import attr
import hashlib
from duniterpy.documents import block_uid
from duniterpy.documents import Transaction as TransactionDoc
from duniterpy.documents.transaction import reduce_base
from sakia.helpers import attrs_tuple_of_str
import math
STOPLINE_HASH = hashlib.sha256("Stopline").hexdigest()
def parse_transact... | Python | 0.000063 | @@ -276,16 +276,32 @@
6(%22S
-topline%22
+TOPLINE%22.encode(%22UTF-8%22)
).he
|
4874f3cb6d6f28e01b0d26998a96caf28fa3995c | make src/scripts/tls_scanner/tls_scanner.py python3-compatible | src/scripts/tls_scanner/tls_scanner.py | src/scripts/tls_scanner/tls_scanner.py | #!/usr/bin/env python3
# (C) 2017 Jack Lloyd
# Botan is released under the Simplified BSD License (see license.txt)
import sys
import time
import subprocess
import re
def format_report(client_output):
version_re = re.compile('TLS (v1\.[0-2]) using ([A-Z0-9_]+)')
version_match = version_re.search(client_outp... | Python | 0.000005 | @@ -238,17 +238,17 @@
(v1%5C.%5B0-
-2
+3
%5D) using
@@ -328,17 +328,17 @@
#print
-
+(
client_o
@@ -342,16 +342,17 @@
t_output
+)
%0A%0A if
@@ -601,17 +601,17 @@
print
-
+(
%22Error:
@@ -641,16 +641,17 @@
st_file%22
+)
%0A
@@ -1107,17 +1107,17 @@
print
-
+(
%22waiting
@@ -1126,16 +1126,... |
c082757de6f220a0c2f3aaef6f2f46302dbe93cb | Revert "Make sure the handle dict values are string. Looks" | sugar/activity/activityhandle.py | sugar/activity/activityhandle.py | # Copyright (C) 2006-2007 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is dis... | Python | 0 | @@ -2744,58 +2744,8 @@
= %7B
-%7D%0A if self.activity_id:%0A result%5B
'act
@@ -2749,32 +2749,27 @@
activity_id'
-%5D = str(
+ :
self.activit
@@ -2772,17 +2772,18 @@
ivity_id
-)
+ %7D
%0A
@@ -2836,28 +2836,24 @@
vice_id'%5D =
-str(
self.pservic
@@ -2848,33 +2848,32 @@
self.pservice_... |
a8dfb7b0b99dba554d7bc08aadc63cbc6a626dd7 | Fix tempest test path | aodh/tests/tempest/plugin.py | aodh/tests/tempest/plugin.py | #
# Copyright 2015 NEC Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | Python | 0 | @@ -922,16 +922,27 @@
_dir = %22
+aodh/tests/
tempest%22
|
0f49230309ac115ff78eddd36bcd153d7f3b75ea | Remove reference to "job" from ThreadPool | data_aggregator/threads.py | data_aggregator/threads.py | import queue
import threading
from multiprocessing import Queue
class ThreadPool():
def __init__(self, processes=20):
self.processes = processes
self.threads = [Thread() for _ in range(0, processes)]
self.mp_queue = Queue()
def yield_dead_threads(self):
for thread in self.thr... | Python | 0 | @@ -782,16 +782,34 @@
run
-next job
+thread with the next value
%0A
@@ -825,19 +825,21 @@
-job
+value
= next(
@@ -892,11 +892,13 @@
nc,
-job
+value
, se
|
f277b759609ecd7620b5fc159c232ccee808d6af | change taxonomy | api/preprints/serializers.py | api/preprints/serializers.py | from modularodm import Q
from modularodm.exceptions import ValidationValueError, NoResultsFound, MultipleResultsFound
from rest_framework import exceptions
from rest_framework import serializers as ser
from api.base.serializers import (
JSONAPISerializer, IDField, JSONAPIListField, LinksField, RelationshipField
)
... | Python | 0.000001 | @@ -1269,32 +1269,36 @@
=False, source='
+get_
preprint_subject
|
0cfed84f1423f01985bfd408747abf59081beaf8 | Disable feedplayback handlers to prevent bots from triggering exceptions. | app/feedplayback/handlers.py | app/feedplayback/handlers.py | import datetime
import logging
from google.appengine.api import taskqueue
from base.constants import CONSTANTS
import base.handlers
import data
_FREQUENCY_DISPLAY_NAMES = {
'1d': 'every day',
'2d': 'every other day',
'7d': 'every week',
}
class MainHandler(base.handlers.BaseHandler):
def get(self):
... | Python | 0 | @@ -434,32 +434,78 @@
def get(self):%0A
+ self._write_error(410)%0A return%0A
frequenc
@@ -538,16 +538,16 @@
uency')%0A
-
@@ -1406,32 +1406,78 @@
def post(self):%0A
+ self._write_error(410)%0A return%0A
subscrip
@@ -1720,32 +1720,78 @@
def get(self):%0A
+ ... |
7b736aa6ef1a8d39c1ad1509daaadaae682f17a5 | Fix MessageContainer having the wrong constructor id | telethon/tl/message_container.py | telethon/tl/message_container.py | from . import TLObject
from ..extensions import BinaryWriter
class MessageContainer(TLObject):
constructor_id = 0x8953ad37
# TODO Currently it's a bit of a hack, since the container actually holds
# messages (message id, sequence number, request body), not requests.
# Probably create a proper "Messag... | Python | 0.000003 | @@ -117,16 +117,16 @@
= 0x
-8953ad37
+73f1f8dc
%0A%0A
@@ -550,26 +550,47 @@
ite_int(
-0x73f1f8dc
+MessageContainer.constructor_id
, signed
|
2a77dcd669af5d0862d2a9d12a1be7a10c485486 | fix repo caching issue with hgmeta.py | yawt/plugins/hgmeta.py | yawt/plugins/hgmeta.py | import os.path
from flask import g
from mercurial import hg, ui, cmdutil
flask_app = None
default_config = {
'use_uncommitted': True
}
class HgStore(object):
def __init__(self, repopath, contentpath, ext):
self.repopath = repopath
self.contentpath = contentpath
self.ext = ext
... | Python | 0 | @@ -351,40 +351,8 @@
one%0A
- self._repo_init = False%0A
@@ -422,16 +422,16 @@
rectory%0A
+
@@ -737,49 +737,8 @@
f):%0A
- if self._repo_init == False:%0A
@@ -781,36 +781,32 @@
(self.repopath)%0A
-
if self.
@@ -831,36 +831,32 @@
ne:%0A
-
self._re... |
843e44394601443c66e6b3523167ebbfbb68fd98 | modify p2p_feefilter test to catch rounding error | test/functional/p2p_feefilter.py | test/functional/p2p_feefilter.py | #!/usr/bin/env python3
# Copyright (c) 2016-2019 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 processing of feefilter messages."""
from decimal import Decimal
import time
from test_framework... | Python | 0 | @@ -1274,16 +1274,411 @@
odes = 2
+%0A # We lower the various required feerates for this test%0A # to catch a corner-case where feefilter used to slightly undercut%0A # mempool and wallet feerate calculation based on GetFee%0A # rounding down 3 places, leading to stranded transactions.%0A ... |
68738a46d0cea8a46502f487af7d78533b0d771d | define __unicode__ for models | marketplace/models.py | marketplace/models.py | #-------------------------------------------------------------------------------
# Name: models
# Purpose: defines models for the system
# Usage: from models import *
#
# Author: Lumate, LLC
#
# Created: 10/25/2013
# Copyright: (c) Lumate, LLC
# Licence: Public/Private
#-----------------... | Python | 0.001297 | @@ -724,16 +724,60 @@
=True)%0A%0A
+%09def __unicode__(self):%0A%09%09return self.name%0A%0A
class Us
@@ -1029,16 +1029,60 @@
= True%0A%0A
+%09def __unicode__(self):%0A%09%09return self.name%0A%0A
class Bu
@@ -2300,16 +2300,61 @@
wargs)%0A%0A
+%09def __unicode__(self):%0A%09%09return self.title%0A%0A
class Tr
@@ ... |
1b83f85d26e181c53f687b2016823660aaf77e95 | Add source_position to AST nodes | edgedb/lang/common/ast/base.py | edgedb/lang/common/ast/base.py | ##
# Copyright (c) 2008-2010 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
import copy
import collections
from . import dump
class ASTError(Exception):
pass
class Field:
def __init__(self, name, type_, default, traverse, child_traverse=None):
self.name = name
self.t... | Python | 0.000071 | @@ -5458,16 +5458,185 @@
wargs)%0A%0A
+ def __deepcopy__(self, memo):%0A copied = super().__deepcopy__(memo)%0A copied.source_position = copy.deepcopy(self.source_position)%0A return copied%0A
%0Aclass A
|
d124f71017dbbe5af81592e76933809b5cdddb08 | fix maintenance mode (CRITICAL) | src/seedbox/config_renderer/ignition/__init__.py | src/seedbox/config_renderer/ignition/__init__.py | import itertools
import json
from flask import request
from seedbox import models
def render(node, indent=False):
return IgnitionConfig(node).render(indent)
class IgnitionConfig(object):
def __init__(self, node):
self.node = node
self.cluster = node.cluster
def render(self, indent=Fal... | Python | 0.000001 | @@ -3041,24 +3041,90 @@
%0A %7D%0A%0A
+ if self.node.maintenance_mode:%0A return config%0A%0A
root
|
7681fc9fd830c26f35a474384809e29c8a6e7e33 | fix tests | pymatgen/serializers/tests/test_json_coders.py | pymatgen/serializers/tests/test_json_coders.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Created on Apr 30, 2012
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "S... | Python | 0.000009 | @@ -536,99 +536,8 @@
try%0A
-from pymatgen.transformations.standard_transformations import %5C%0A IdentityTransformation%0A
impo
@@ -2336,248 +2336,8 @@
3)%0A%0A
- def test_transformations(self):%0A trans = IdentityTransformation()%0A jsonstr = json.dumps(trans, cls=MontyEncoder)%0A d = js... |
da7af78700fd4593055afa8c85f4a3a585729e67 | remove self | apdflash/odin.py | apdflash/odin.py | #!/bin/python2
from mpi4py import MPI
import time
import subprocess
import argparse
from mjolnir import Mjolnir
import numpy
import os
import json
def check_dir(directory):
if not os.path.exists(directory):
os.makedirs(directory)
class apdControl():
def __init__(self,binsize):
self.comm = MPI.COMM_WORLD
se... | Python | 0.000112 | @@ -2422,37 +2422,32 @@
e'%5D%7D%0A%09check_dir(
-self.
timestamp)%0A%09with
@@ -2465,21 +2465,16 @@
th.join(
-self.
timestam
|
61d6594a260db24759555093bd363b39f35d9bce | configure for higher threshold | python-modules/cis_crypto/cis_crypto/secret.py | python-modules/cis_crypto/cis_crypto/secret.py | """Class for following a default provider chain in the fetching of key material for sign/verify operations."""
import boto3
import json
import os
import logging
from cis_crypto import common
from jose import jwk
logger = logging.getLogger(__name__)
class Manager(object):
"""Top level manager object. Will insta... | Python | 0.000005 | @@ -154,16 +154,51 @@
logging%0A
+from botocore.config import Config%0A
from cis
@@ -2101,24 +2101,83 @@
egion_name)%0A
+ botoconfig = Config(retries=dict(max_attempts=30))%0A
self
@@ -2220,16 +2220,28 @@
nt(%22ssm%22
+, botoconfig
)%0A%0A d
|
cab0687f30ccac731497a5c723ba4fb6baa60435 | Reorder import list. | korail2/__init__.py | korail2/__init__.py | # -*- coding: utf-8 -*-
"""
korail2
~~~~~~~
Korail (www.letskorail.com) wrapper for Python.
:copyright: (c) 2014 by Taehoon Kim.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from .korail2 import Korail, AdultPassenger, Passenger, ChildPassenger, SeniorPas... | Python | 0 | @@ -261,21 +261,16 @@
Korail,
-Adult
Passenge
@@ -272,16 +272,21 @@
senger,
+Adult
Passenge
@@ -472,21 +472,16 @@
rail', '
-Adult
Passenge
@@ -481,24 +481,29 @@
assenger', '
+Adult
Passenger',
|
f9ca473abf7aea3cc146badf2d45ae715f635aac | Use correct parameter for HOST and PORT | kqueen_ui/server.py | kqueen_ui/server.py | from .config import current_config
from flask import Flask
from flask import redirect
from flask import url_for
from flask.ext.babel import Babel
from kqueen_ui.blueprints.registration.views import registration
from kqueen_ui.blueprints.ui.views import ui
from werkzeug.contrib.cache import SimpleCache
import logging
... | Python | 0.000012 | @@ -1088,26 +1088,16 @@
ig.get('
-KQUEEN_UI_
HOST'),%0A
@@ -1133,18 +1133,8 @@
et('
-KQUEEN_UI_
PORT
|
de4165e4b0e8598151d2b0a39e51701b6ccd86d5 | Test exclusions. | education/test/test_results.py | education/test/test_results.py | from unittest import TestCase
from education.results import NumericResponsesFor
from education.test.utils import create_attribute
from education.models import *
from rapidsms.models import *
from eav.models import *
from datetime import datetime, timedelta
now = datetime(2013, 9, 12)
class TestResults(TestCase):
... | Python | 0 | @@ -2948,24 +2948,456 @@
).mean())%0A%0A%0A
+ def test_excludes_zeros(self):%0A self.record_response(%220 boys%22, 0)%0A self.record_response(%2210 boys%22, 10)%0A self.assertEqual(1, NumericResponsesFor(self.poll).excludeZeros().query.count())%0A%0A%0A def test_excludes_greater_than(self):%... |
66522b64f61da31e35cafbfbb16fd0c176c1dbf9 | Add test for registering multiple methods | zorp/tests/registry.py | zorp/tests/registry.py | """
Registry tests
"""
import unittest
from registry import Registry, schema_from_function
class TestRegistry(unittest.TestCase):
"""
Test the registry
"""
def setUp(self):
"""
Create a new registry
"""
self.registry = Registry()
self.name = "my func"
... | Python | 0 | @@ -405,24 +405,155 @@
self.func)%0A%0A
+ self.name2 = %22my other func%22%0A self.func2 = lambda z: z * 2%0A self.schema2 = schema_from_function(self.func2)%0A%0A
def test
@@ -1467,8 +1467,537 @@
schema)%0A
+%0A def test_multiple_funcs(self):%0A %22%22%22%0A Test the regist... |
3dafe4aa10901a320b86a9b970442eefc1911ee0 | Fix in getProjectVersion | mint/django_rest/rbuilder/projects/manager.py | mint/django_rest/rbuilder/projects/manager.py | #!/usr/bin/python
#
# Copyright (c) 2011 rPath, Inc.
#
# All rights reserved.
#
from mint import helperfuncs
from mint import mint_error
from mint import userlevels
from mint.rest.db import reposmgr
from mint.django_rest.rbuilder import auth
from mint.django_rest.rbuilder import errors
from mint.django_rest.rbuilder.... | Python | 0.000002 | @@ -5897,20 +5897,18 @@
version
-Name
+Id
):%0A
@@ -5951,20 +5951,18 @@
get(
-name
+pk
=version
Name
@@ -5957,20 +5957,18 @@
=version
-Name
+Id
)%0A
|
329586768bc1f502f1e4cd7c41a9e956aa73aeaf | Make PEP8 happy | misp_modules/modules/import_mod/stiximport.py | misp_modules/modules/import_mod/stiximport.py | import json
import base64
from pymisp.tools import stix
misperrors = {'error': 'Error'}
userConfig = {}
inputSource = ['file']
moduleinfo = {'version': '0.2', 'author': 'Hannah Ward',
'description': 'Import some stix stuff',
'module-type': ['import']}
moduleconfig = []
def handler(q=Fa... | Python | 0.000005 | @@ -736,17 +736,16 @@
ackage)%0A
-%0A
for
@@ -803,17 +803,16 @@
nd(%7B
-
%22values%22
: %5B
@@ -807,17 +807,16 @@
%22values%22
-
: %5Battri
@@ -823,17 +823,16 @@
b.value%5D
-
, %22types
@@ -898,16 +898,17 @@
turn r%0A%0A
+%0A
def intr
|
901b68c85f41cd8459530037279a359ca6e2ee93 | Make test INSTALLED_APPS a tuple | wagtail/tests/settings.py | wagtail/tests/settings.py | import os
from django.conf import global_settings
WAGTAIL_ROOT = os.path.dirname(__file__)
STATIC_ROOT = os.path.join(WAGTAIL_ROOT, 'test-static')
MEDIA_ROOT = os.path.join(WAGTAIL_ROOT, 'test-media')
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': os.environ.get('DATABASE_ENGINE', 'django.d... | Python | 0.99961 | @@ -1616,17 +1616,17 @@
_APPS =
-%5B
+(
%0A 'dj
@@ -2314,12 +2314,13 @@
s',%0A
-%5D%0A%0A%0A
+%0A
# In
@@ -2361,16 +2361,20 @@
pconfig%0A
+
# Theres
@@ -2439,16 +2439,20 @@
ave one%0A
+
# app wh
@@ -2508,31 +2508,12 @@
rly%0A
-%0AINSTALLED_APPS.append(
+
'wag
@@ -2565,17 +2565,21 @@
pConf... |
de962f504db139500573457264a3dd1e257e8cc0 | Allow decorator to be called with optional args | wagtail_mvc/decorators.py | wagtail_mvc/decorators.py | # -*- coding: utf-8 -*-
"""
wagtail_mvc decorators
"""
from __future__ import unicode_literals
def wagtail_mvc_url(func):
"""
Decorates an existing method responsible for generating a url
prepends the parent url to the generated url to account for
:param func: The method to decorate
:return: Full... | Python | 0 | @@ -110,20 +110,51 @@
mvc_url(
-func
+*decorator_args, **decorator_kwargs
):%0A %22
@@ -353,24 +353,53 @@
url%0A %22%22%22%0A
+ def decorator(func):%0A
def oute
@@ -436,33 +436,237 @@
-parts = self.get_parent()
+ parent_attr = decorator_kwargs.get('parent_attr')%0A%0A if parent_... |
a67b97d1ae3917fb228c0576fb30c8098f5443c6 | make random return PageInfos instead of PageIdentifiers | wapiti/operations/rand.py | wapiti/operations/rand.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from base import QueryOperation, QueryLimit
from params import StaticParam
from models import PageIdentifier
from utils import OperationExample
class GetRandom(QueryOperation):
"""
Fetch random pages using MediaWiki's Special:Random.
"""
... | Python | 0 | @@ -157,25 +157,19 @@
rt PageI
-dentifier
+nfo
%0Afrom ut
@@ -537,25 +537,19 @@
= %5BPageI
-dentifier
+nfo
%5D%0A pe
@@ -758,29 +758,8 @@
():%0A
- try:%0A
@@ -776,20 +776,19 @@
ge_i
-dent
+nfo
= PageI
dent
@@ -787,17 +787,11 @@
ageI
-dentifier
+nfo
.fro
@@ -808,27 +808,16 @@
d_dict,%... |
705c88fa9237c558e4711934f5cebec733db5340 | debug comment | cla_backend/apps/legalaid/serializers.py | cla_backend/apps/legalaid/serializers.py | from legalaid.constants import CASELOGTYPE_SUBTYPES
from legalaid.fields import MoneyIntervalField
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer, WritableField
from core.serializers import UUIDSerializer
from cla_provider.models import Provider, OutOfHoursRota
from cla_... | Python | 0 | @@ -2862,63 +2862,8 @@
%0A
-# def to_native(self, value):%0A# print %22x%22%0A%0A
%0Acla
|
b2f39901ad9ab60244ba31df0a69d2e319b4008e | update proto | test/functional/feature_llmqsimplepose.py | test/functional/feature_llmqsimplepose.py | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import time
from test_framework.test_framework import DashTestFramework
from test_framework.util import *
... | Python | 0 | @@ -2378,17 +2378,17 @@
ion=7001
-4
+5
%22%5D)%0A
|
e91300c8ba46d6a59308ffacef5f18bf54700cdd | fix mock time | test/functional/feature_llmqsimplepose.py | test/functional/feature_llmqsimplepose.py | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import time
from test_framework.test_framework import DashTestFramework
from test_framework.util import con... | Python | 0.002459 | @@ -3532,23 +3532,17 @@
heduler(
-60 * 60
+5
)%0A
@@ -3566,25 +3566,25 @@
mp_mocktime(
-6
+9
0 * 60)%0A
|
b549bc3e46d309efa31a65160f7091c4869f34d2 | Enable debug | web/web/settings/arnes.py | web/web/settings/arnes.py | from common import *
SECRET_KEY = os.environ['SECRET_KEY']
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['www.projekt-tomo.si']
WSGI_APPLICATION = 'web.wsgi.dev.application'
INSTALLED_APPS += (
'shibboleth',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... | Python | 0.000001 | @@ -62,20 +62,19 @@
DEBUG =
-Fals
+Tru
e%0ATEMPLA
|
477768802107714bc40413888e0b97e27b738717 | Handle float images in cv2_imshow | arnheim_3/src/video_utils.py | arnheim_3/src/video_utils.py | # Copyright 2021 DeepMind Technologies Limited
#
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to i... | Python | 0 | @@ -1019,16 +1019,96 @@
ator%22):%0A
+ if img.dtype == np.float32 and img.max() %3E 1.:%0A img = img.astype(np.uint8)%0A
cv2.im
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.