The following issues were found
src/third_party/mozjs-60/extract/js/src/gc/GenerateStatsPhases.py
48 issues
Line: 53
Column: 1
# +---+ +---+
import re
import sys
import collections
class PhaseKind():
def __init__(self, name, descr, bucket, children = []):
self.name = name
Reported by Pylint.
Line: 57
Column: 5
import collections
class PhaseKind():
def __init__(self, name, descr, bucket, children = []):
self.name = name
self.descr = descr
self.bucket = bucket
self.children = children
Reported by Pylint.
Line: 177
Column: 5
# generate the PhaseKind enum.
def findAllPhaseKinds():
phases = []
seen = set()
def dfs(phase):
if phase in seen:
return
Reported by Pylint.
Line: 180
Column: 13
phases = []
seen = set()
def dfs(phase):
if phase in seen:
return
phases.append(phase)
seen.add(phase)
for child in phase.children:
Reported by Pylint.
Line: 188
Column: 9
for child in phase.children:
dfs(child)
for phase in PhaseKindGraphRoots:
dfs(phase)
return phases
AllPhaseKinds = findAllPhaseKinds()
Reported by Pylint.
Line: 198
Column: 24
# one parent.
class Phase:
def __init__(self, phaseKind, parent):
self.phaseKind = phaseKind
self.parent = parent
self.depth = parent.depth + 1 if parent else 0
self.children = []
self.nextSibling = None
Reported by Pylint.
Line: 211
Column: 5
self.path = parent.path + '.' + self.path
def expandPhases():
phases = []
phasesForKind = collections.defaultdict(list)
def traverse(phaseKind, parent):
ep = Phase(phaseKind, parent)
phases.append(ep)
Reported by Pylint.
Line: 214
Column: 18
phases = []
phasesForKind = collections.defaultdict(list)
def traverse(phaseKind, parent):
ep = Phase(phaseKind, parent)
phases.append(ep)
# Update list of expanded phases for this phase kind.
if phasesForKind[phaseKind]:
Reported by Pylint.
Line: 231
Column: 9
ep.children.append(child_ep)
return ep
for phaseKind in PhaseKindGraphRoots:
traverse(phaseKind, None)
return phases, phasesForKind
AllPhases, PhasesForPhaseKind = expandPhases()
Reported by Pylint.
Line: 259
Column: 31
if items:
out.write(",\n".join(" " + item for item in items) + "\n")
def writeEnumClass(out, name, type, items, extraItems):
items = [ "FIRST" ] + items + [ "LIMIT" ] + extraItems
items[1] += " = " + items[0]
out.write("enum class %s : %s {\n" % (name, type));
writeList(out, items)
out.write("};\n")
Reported by Pylint.
src/third_party/wiredtiger/bench/workgen/runner/split_stress.py
48 issues
Line: 35
Column: 1
# splits in order to catch split races.
#
from runner import *
from wiredtiger import *
from workgen import *
context = Context()
# Connection configuration.
conn_config = "cache_size=100MB,log=(enabled=false),statistics=[fast],statistics_log=(wait=1,json=false)"
Reported by Pylint.
Line: 36
Column: 1
#
from runner import *
from wiredtiger import *
from workgen import *
context = Context()
# Connection configuration.
conn_config = "cache_size=100MB,log=(enabled=false),statistics=[fast],statistics_log=(wait=1,json=false)"
conn = context.wiredtiger_open("create," + conn_config)
Reported by Pylint.
Line: 38
Column: 11
from wiredtiger import *
from workgen import *
context = Context()
# Connection configuration.
conn_config = "cache_size=100MB,log=(enabled=false),statistics=[fast],statistics_log=(wait=1,json=false)"
conn = context.wiredtiger_open("create," + conn_config)
s = conn.open_session("")
Reported by Pylint.
Line: 50
Column: 13
table_count = 3
for i in range(0, table_count):
tname = "file:test" + str(i)
table = Table(tname)
s.create(tname, 'key_format=S,value_format=S,' + table_config)
table.options.key_size = 64
table.options.value_size = 200
table.options.range = 100000000 # 100 million
tables.append(table)
Reported by Pylint.
Line: 62
Column: 21
icount = 50000
# There are multiple tables to be filled during populate,
# the icount is split between them all.
pop_ops = Operation(Operation.OP_INSERT, tables[0])
pop_ops = op_multi_table(pop_ops, tables)
nops_per_thread = icount // (populate_threads * table_count)
pop_thread = Thread(pop_ops * nops_per_thread)
pop_workload = Workload(context, populate_threads * pop_thread)
print('populate:')
Reported by Pylint.
Line: 62
Column: 11
icount = 50000
# There are multiple tables to be filled during populate,
# the icount is split between them all.
pop_ops = Operation(Operation.OP_INSERT, tables[0])
pop_ops = op_multi_table(pop_ops, tables)
nops_per_thread = icount // (populate_threads * table_count)
pop_thread = Thread(pop_ops * nops_per_thread)
pop_workload = Workload(context, populate_threads * pop_thread)
print('populate:')
Reported by Pylint.
Line: 65
Column: 14
pop_ops = Operation(Operation.OP_INSERT, tables[0])
pop_ops = op_multi_table(pop_ops, tables)
nops_per_thread = icount // (populate_threads * table_count)
pop_thread = Thread(pop_ops * nops_per_thread)
pop_workload = Workload(context, populate_threads * pop_thread)
print('populate:')
pop_workload.run(conn)
# Run phase.
Reported by Pylint.
Line: 66
Column: 16
pop_ops = op_multi_table(pop_ops, tables)
nops_per_thread = icount // (populate_threads * table_count)
pop_thread = Thread(pop_ops * nops_per_thread)
pop_workload = Workload(context, populate_threads * pop_thread)
print('populate:')
pop_workload.run(conn)
# Run phase.
ops = Operation(Operation.OP_INSERT, tables[0])
Reported by Pylint.
Line: 71
Column: 7
pop_workload.run(conn)
# Run phase.
ops = Operation(Operation.OP_INSERT, tables[0])
ops = op_multi_table(ops, tables, False)
thread0 = Thread(ops)
workload = Workload(context, 20 * thread0)
workload.options.report_interval=5
Reported by Pylint.
Line: 71
Column: 17
pop_workload.run(conn)
# Run phase.
ops = Operation(Operation.OP_INSERT, tables[0])
ops = op_multi_table(ops, tables, False)
thread0 = Thread(ops)
workload = Workload(context, 20 * thread0)
workload.options.report_interval=5
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Warnings.py
48 issues
Line: 174
Column: 21
raise warning
if _warningOut:
_warningOut(warning)
break
def process_warn_strings(arguments):
"""Process requests to enable/disable warnings.
Reported by Pylint.
Line: 36
Column: 1
import SCons.Errors
class Warning(SCons.Errors.UserError):
pass
class WarningOnByDefault(Warning):
pass
Reported by Pylint.
Line: 158
Column: 5
def warningAsException(flag=1):
"""Turn warnings into exceptions. Returns the old value of the flag."""
global _warningAsException
old = _warningAsException
_warningAsException = flag
return old
def warn(clazz, *args):
Reported by Pylint.
Line: 164
Column: 5
return old
def warn(clazz, *args):
global _enabled, _warningAsException, _warningOut
warning = clazz(args)
for cls, flag in _enabled:
if isinstance(warning, cls):
if flag:
Reported by Pylint.
Line: 1
Column: 1
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
Reported by Pylint.
Line: 30
Column: 1
"""
__revision__ = "src/engine/SCons/Warnings.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"
import sys
import SCons.Errors
Reported by Pylint.
Line: 36
Column: 1
import SCons.Errors
class Warning(SCons.Errors.UserError):
pass
class WarningOnByDefault(Warning):
pass
Reported by Pylint.
Line: 39
Column: 1
class Warning(SCons.Errors.UserError):
pass
class WarningOnByDefault(Warning):
pass
# NOTE: If you add a new warning class, add it to the man page, too!
class TargetNotBuiltWarning(Warning): # Should go to OnByDefault
Reported by Pylint.
Line: 44
Column: 1
# NOTE: If you add a new warning class, add it to the man page, too!
class TargetNotBuiltWarning(Warning): # Should go to OnByDefault
pass
class CacheVersionWarning(WarningOnByDefault):
pass
Reported by Pylint.
Line: 47
Column: 1
class TargetNotBuiltWarning(Warning): # Should go to OnByDefault
pass
class CacheVersionWarning(WarningOnByDefault):
pass
class CacheWriteErrorWarning(Warning):
pass
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_join08.py
48 issues
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
# test_join08.py
# Test join error paths
class test_join08(wttest.WiredTigerTestCase):
nentries = 100
Reported by Pylint.
Line: 115
Column: 9
ic1.next()
# This succeeds.
self.session.join(jc, ic1, 'compare=ge'),
# With bloom filters, a count is required
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: self.session.join(jc, ic0, 'compare=ge,strategy=bloom'),
'/count must be nonzero/')
Reported by Pylint.
Line: 123
Column: 9
'/count must be nonzero/')
# This succeeds.
self.session.join(jc, ic0, 'compare=ge,strategy=bloom,count=1000'),
bloom_config = ',strategy=bloom,count=1000'
# Cannot use the same index cursor
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: self.session.join(jc, ic0,
Reported by Pylint.
Line: 157
Column: 13
# Need to do initial next() before getting key/values
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: jc.get_keys(),
'/join cursor must be advanced with next/')
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: jc.get_values(),
'/join cursor must be advanced with next/')
Reported by Pylint.
Line: 161
Column: 13
'/join cursor must be advanced with next/')
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: jc.get_values(),
'/join cursor must be advanced with next/')
# Operations on the joined cursor are frozen until the join is closed.
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: ic0.next(),
Reported by Pylint.
Line: 166
Column: 13
# Operations on the joined cursor are frozen until the join is closed.
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: ic0.next(),
'/cursor is being used in a join/')
# Operations on the joined cursor are frozen until the join is closed.
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: ic0.prev(),
Reported by Pylint.
Line: 171
Column: 13
# Operations on the joined cursor are frozen until the join is closed.
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: ic0.prev(),
'/cursor is being used in a join/')
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: ic0.reset(),
'/cursor is being used in a join/')
Reported by Pylint.
Line: 175
Column: 13
'/cursor is being used in a join/')
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: ic0.reset(),
'/cursor is being used in a join/')
# Only a small number of operations allowed on a join cursor
msg = "/Unsupported cursor/"
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
Reported by Pylint.
Line: 181
Column: 13
# Only a small number of operations allowed on a join cursor
msg = "/Unsupported cursor/"
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: jc.search(), msg)
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: jc.prev(), msg)
self.assertEquals(jc.next(), 0)
Reported by Pylint.
Line: 184
Column: 13
lambda: jc.search(), msg)
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: jc.prev(), msg)
self.assertEquals(jc.next(), 0)
self.assertEquals(jc.next(), wiredtiger.WT_NOTFOUND)
# Only after the join cursor is closed can we use the index cursor
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Conftest.py
47 issues
Line: 235
Column: 5
# The compiler construction variable is not set or empty
return 1
lang, suffix, msg = _lang2suffix(language)
if msg:
return 1
if use_shared:
return context.CompileSharedObject(text, suffix)
Reported by Pylint.
Line: 456
Column: 5
if not header:
header = ""
lang, suffix, msg = _lang2suffix(language)
if msg:
context.Display("Cannot check for %s type: %s\n" % (type_name, msg))
return msg
src = includetext + header
Reported by Pylint.
Line: 558
Column: 5
if not includes:
includes = ""
lang, suffix, msg = _lang2suffix(language)
if msg:
context.Display("Cannot check for declaration %s: %s\n" % (symbol, msg))
return msg
src = includetext + includes
Reported by Pylint.
Line: 1
Column: 1
"""SCons.Conftest
Autoconf-like configuration support; low level implementation of tests.
"""
#
# Copyright (c) 2003 Stichting NLnet Labs
# Copyright (c) 2001, 2002, 2003 Steven Knight
#
Reported by Pylint.
Line: 109
Column: 1
# PUBLIC VARIABLES
#
LogInputFiles = 1 # Set that to log the input files in case of a failed test
LogErrorMessages = 1 # Set that to log Conftest-generated error messages
#
# PUBLIC FUNCTIONS
#
Reported by Pylint.
Line: 110
Column: 1
#
LogInputFiles = 1 # Set that to log the input files in case of a failed test
LogErrorMessages = 1 # Set that to log Conftest-generated error messages
#
# PUBLIC FUNCTIONS
#
Reported by Pylint.
Line: 122
Column: 1
# message are available yet (chicken-egg problem).
def CheckBuilder(context, text = None, language = None):
"""
Configure check to see if the compiler works.
Note that this uses the current value of compiler and linker flags, make
sure $CFLAGS, $CPPFLAGS and $LIBS are set correctly.
"language" should be "C" or "C++" and is used to select the compiler.
Reported by Pylint.
Line: 149
Column: 1
_YesNoResult(context, ret, None, text)
return ret
def CheckCC(context):
"""
Configure check for a working C compiler.
This checks whether the C compiler, as defined in the $CC construction
variable, can compile a C source file. It uses the current $CCCOM value
Reported by Pylint.
Line: 169
Column: 1
_YesNoResult(context, ret, None, text)
return ret
def CheckSHCC(context):
"""
Configure check for a working shared C compiler.
This checks whether the C compiler, as defined in the $SHCC construction
variable, can compile a C source file. It uses the current $SHCCCOM value
Reported by Pylint.
Line: 189
Column: 1
_YesNoResult(context, ret, None, text)
return ret
def CheckCXX(context):
"""
Configure check for a working CXX compiler.
This checks whether the CXX compiler, as defined in the $CXX construction
variable, can compile a CXX source file. It uses the current $CXXCOM value
Reported by Pylint.
src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/deferredruntest.py
47 issues
Line: 35
Column: 1
from twisted.internet import defer
from twisted.python import log
from twisted.trial.unittest import _LogObserver
class _DeferredRunTest(RunTest):
"""Base for tests that return Deferreds."""
Reported by Pylint.
Line: 172
Column: 20
if result is not None:
self._exceptions.append(result)
fails.append(None)
return d.addCallback(clean_up_done)
def set_up_done(exception_caught):
"""Set up is done, either clean up or run the test."""
if self.exception_caught == exception_caught:
fails.append(None)
Reported by Pylint.
Line: 25
Column: 1
)
from testtools.content_type import UTF8_TEXT
from testtools.runtest import RunTest
from testtools._spinner import (
extract_result,
NoResultError,
Spinner,
TimeoutError,
trap_unhandled_errors,
Reported by Pylint.
Line: 51
Column: 5
class SynchronousDeferredRunTest(_DeferredRunTest):
"""Runner for tests that return synchronous Deferreds."""
def _run_user(self, function, *args):
d = defer.maybeDeferred(function, *args)
d.addErrback(self._got_user_failure)
result = extract_result(d)
return result
Reported by Pylint.
Line: 127
Column: 5
return AsynchronousDeferredRunTestFactory()
@defer.deferredGenerator
def _run_cleanups(self):
"""Run the cleanups on the test case.
We expect that the cleanups on the test case can also return
asynchronous Deferreds. As such, we take the responsibility for
running the cleanups, rather than letting TestCase do it.
Reported by Pylint.
Line: 134
Column: 15
asynchronous Deferreds. As such, we take the responsibility for
running the cleanups, rather than letting TestCase do it.
"""
while self.case._cleanups:
f, args, kwargs = self.case._cleanups.pop()
d = defer.maybeDeferred(f, *args, **kwargs)
thing = defer.waitForDeferred(d)
yield thing
try:
Reported by Pylint.
Line: 135
Column: 31
running the cleanups, rather than letting TestCase do it.
"""
while self.case._cleanups:
f, args, kwargs = self.case._cleanups.pop()
d = defer.maybeDeferred(f, *args, **kwargs)
thing = defer.waitForDeferred(d)
yield thing
try:
thing.getResult()
Reported by Pylint.
Line: 141
Column: 20
yield thing
try:
thing.getResult()
except Exception:
exc_info = sys.exc_info()
self.case._report_traceback(exc_info)
last_exception = exc_info[1]
yield last_exception
Reported by Pylint.
Line: 143
Column: 17
thing.getResult()
except Exception:
exc_info = sys.exc_info()
self.case._report_traceback(exc_info)
last_exception = exc_info[1]
yield last_exception
def _make_spinner(self):
"""Make the `Spinner` to be used to run the tests."""
Reported by Pylint.
Line: 165
Column: 22
if self.exception_caught == exception_caught:
fails.append(None)
def clean_up(ignored=None):
"""Run the cleanups."""
d = self._run_cleanups()
def clean_up_done(result):
if result is not None:
self._exceptions.append(result)
Reported by Pylint.
src/third_party/wiredtiger/bench/workgen/runner/example_simple.py
47 issues
Line: 31
Column: 1
#
from runner import *
from wiredtiger import *
from workgen import *
def show(tname, s, args):
if not args.verbose:
return
Reported by Pylint.
Line: 32
Column: 1
from runner import *
from wiredtiger import *
from workgen import *
def show(tname, s, args):
if not args.verbose:
return
print('')
Reported by Pylint.
Line: 46
Column: 11
print('<><><><><><><><><><><><>')
c.close()
context = Context()
# Using the context's wiredtiger_open() method has benefits:
# * there is a default home directory (WT_TEST), which is automatically cleared before the open.
# * the args on the python command line are parsed, allowing for:
# --home homedir
Reported by Pylint.
Line: 61
Column: 7
tname = 'table:simple'
s.create(tname, 'key_format=S,value_format=S')
ops = Operation(Operation.OP_INSERT, Table(tname), Key(Key.KEYGEN_APPEND, 10), Value(40))
thread = Thread(ops)
workload = Workload(context, thread)
workload.run(conn)
show(tname, s, context.args)
Reported by Pylint.
Line: 61
Column: 80
tname = 'table:simple'
s.create(tname, 'key_format=S,value_format=S')
ops = Operation(Operation.OP_INSERT, Table(tname), Key(Key.KEYGEN_APPEND, 10), Value(40))
thread = Thread(ops)
workload = Workload(context, thread)
workload.run(conn)
show(tname, s, context.args)
Reported by Pylint.
Line: 61
Column: 56
tname = 'table:simple'
s.create(tname, 'key_format=S,value_format=S')
ops = Operation(Operation.OP_INSERT, Table(tname), Key(Key.KEYGEN_APPEND, 10), Value(40))
thread = Thread(ops)
workload = Workload(context, thread)
workload.run(conn)
show(tname, s, context.args)
Reported by Pylint.
Line: 61
Column: 17
tname = 'table:simple'
s.create(tname, 'key_format=S,value_format=S')
ops = Operation(Operation.OP_INSERT, Table(tname), Key(Key.KEYGEN_APPEND, 10), Value(40))
thread = Thread(ops)
workload = Workload(context, thread)
workload.run(conn)
show(tname, s, context.args)
Reported by Pylint.
Line: 61
Column: 38
tname = 'table:simple'
s.create(tname, 'key_format=S,value_format=S')
ops = Operation(Operation.OP_INSERT, Table(tname), Key(Key.KEYGEN_APPEND, 10), Value(40))
thread = Thread(ops)
workload = Workload(context, thread)
workload.run(conn)
show(tname, s, context.args)
Reported by Pylint.
Line: 61
Column: 52
tname = 'table:simple'
s.create(tname, 'key_format=S,value_format=S')
ops = Operation(Operation.OP_INSERT, Table(tname), Key(Key.KEYGEN_APPEND, 10), Value(40))
thread = Thread(ops)
workload = Workload(context, thread)
workload.run(conn)
show(tname, s, context.args)
Reported by Pylint.
Line: 62
Column: 10
s.create(tname, 'key_format=S,value_format=S')
ops = Operation(Operation.OP_INSERT, Table(tname), Key(Key.KEYGEN_APPEND, 10), Value(40))
thread = Thread(ops)
workload = Workload(context, thread)
workload.run(conn)
show(tname, s, context.args)
thread = Thread(ops * 5)
Reported by Pylint.
src/third_party/wiredtiger/dist/api_config.py
47 issues
Line: 4
Column: 1
#!/usr/bin/env python
from __future__ import print_function
import os, re, sys, textwrap
from dist import compare_srcfile, format_srcfile
test_config = False
# This file serves two purposes, it can generate configuration for the main wiredtiger library and,
Reported by Pylint.
Line: 32
Column: 13
whitespace_re = re.compile(r'\s+')
cbegin_re = re.compile(r'(\s*\*\s*)@config(?:empty|start)\{(.*?),.*\}')
def gettype(c):
'''Derive the type of a config item'''
checks = c.flags
ctype = checks.get('type', None)
if not ctype and ('min' in checks or 'max' in checks):
ctype = 'int'
Reported by Pylint.
Line: 40
Column: 14
ctype = 'int'
return ctype or 'string'
def typedesc(c):
'''Descripe what type of value is expected for the given config item'''
checks = c.flags
cmin = str(checks.get('min', ''))
cmax = str(checks.get('max', ''))
choices = checks.get('choices', [])
Reported by Pylint.
Line: 70
Column: 17
desc += ' of strings'
return desc
def parseconfig(c, method_name, name_indent=''):
c.method_name = method_name
ctype = gettype(c)
desc = whitespace_re.sub(' ', c.desc.strip())
desc = desc.strip('.') + '.'
desc = desc.replace(',', '\\,')
Reported by Pylint.
Line: 78
Column: 5
desc = desc.replace(',', '\\,')
default = '\\c ' + str(c.default) if c.default or ctype == 'int' \
else 'empty'
name = name_indent + c.name
tdesc = typedesc(c)
if ctype != 'category':
tdesc += '; default ' + default
else:
Reported by Pylint.
Line: 87
Column: 5
name += ' = ('
tdesc += '.'
tdesc = tdesc.replace(',', '\\,')
output = '@config{' + ', '.join((name, desc, tdesc)) + '}\n'
if ctype == 'category':
for subc in sorted(c.subconfig):
output += parseconfig(subc, method_name, \
name_indent + (' ' * 4))
output += '@config{ ),,}\n'
Reported by Pylint.
Line: 95
Column: 18
output += '@config{ ),,}\n'
return output
def getconfcheck(c):
check = '{ "' + c.name + '", "' + gettype(c) + '",'
cstr = checkstr(c)
sstr = getsubconfigstr(c)
if cstr != 'NULL':
cstr = '"\n\t "'.join(w.wrap(cstr))
Reported by Pylint.
Line: 183
Column: 14
ws = textwrap.TextWrapper(width=64, break_on_hyphens=False,
break_long_words=False)
def checkstr(c):
'''Generate the function reference and JSON string used by __wt_config_check
to validate the config string'''
checks = c.flags
cfunc = str(checks.get('func', ''))
if not cfunc:
Reported by Pylint.
Line: 189
Column: 1
checks = c.flags
cfunc = str(checks.get('func', ''))
if not cfunc:
cfunc = 'NULL';
cmin = str(checks.get('min', ''))
cmax = str(checks.get('max', ''))
choices = checks.get('choices', [])
result = []
if cmin:
Reported by Pylint.
Line: 206
Column: 17
else:
return cfunc + ', NULL'
def get_default(c):
t = gettype(c)
if c.default == 'false':
return 'false'
elif c.default == 'true':
return 'true'
Reported by Pylint.
src/third_party/wiredtiger/bench/workgen/runner/example_prepare.py
47 issues
Line: 31
Column: 1
#
from runner import *
from wiredtiger import *
from workgen import *
import time
context = Context()
conn = context.wiredtiger_open("create,cache_size=500MB")
Reported by Pylint.
Line: 32
Column: 1
from runner import *
from wiredtiger import *
from workgen import *
import time
context = Context()
conn = context.wiredtiger_open("create,cache_size=500MB")
s = conn.open_session()
Reported by Pylint.
Line: 35
Column: 11
from workgen import *
import time
context = Context()
conn = context.wiredtiger_open("create,cache_size=500MB")
s = conn.open_session()
tname = "table:test"
config = "key_format=S,value_format=S,"
s.create(tname, config)
Reported by Pylint.
Line: 41
Column: 9
tname = "table:test"
config = "key_format=S,value_format=S,"
s.create(tname, config)
table = Table(tname)
table.options.key_size = 20
table.options.value_size = 10
start_time = time.time()
Reported by Pylint.
Line: 47
Column: 16
start_time = time.time()
op = Operation(Operation.OP_INSERT, table)
thread = Thread(op * 5000)
pop_workload = Workload(context, thread)
print('populate:')
pop_workload.run(conn)
Reported by Pylint.
Line: 47
Column: 6
start_time = time.time()
op = Operation(Operation.OP_INSERT, table)
thread = Thread(op * 5000)
pop_workload = Workload(context, thread)
print('populate:')
pop_workload.run(conn)
Reported by Pylint.
Line: 48
Column: 10
start_time = time.time()
op = Operation(Operation.OP_INSERT, table)
thread = Thread(op * 5000)
pop_workload = Workload(context, thread)
print('populate:')
pop_workload.run(conn)
opread = Operation(Operation.OP_SEARCH, table)
Reported by Pylint.
Line: 49
Column: 16
op = Operation(Operation.OP_INSERT, table)
thread = Thread(op * 5000)
pop_workload = Workload(context, thread)
print('populate:')
pop_workload.run(conn)
opread = Operation(Operation.OP_SEARCH, table)
read_txn = txn(opread * 5, 'read_timestamp')
Reported by Pylint.
Line: 53
Column: 20
print('populate:')
pop_workload.run(conn)
opread = Operation(Operation.OP_SEARCH, table)
read_txn = txn(opread * 5, 'read_timestamp')
# read_timestamp_lag is the lag to the read_timestamp from current time
read_txn.transaction.read_timestamp_lag = 2
treader = Thread(read_txn)
Reported by Pylint.
Line: 53
Column: 10
print('populate:')
pop_workload.run(conn)
opread = Operation(Operation.OP_SEARCH, table)
read_txn = txn(opread * 5, 'read_timestamp')
# read_timestamp_lag is the lag to the read_timestamp from current time
read_txn.transaction.read_timestamp_lag = 2
treader = Thread(read_txn)
Reported by Pylint.
src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/compat.py
47 issues
Line: 31
Column: 1
import traceback
import unicodedata
from extras import try_imports
BytesIO = try_imports(['StringIO.StringIO', 'io.BytesIO'])
StringIO = try_imports(['StringIO.StringIO', 'io.StringIO'])
try:
Reported by Pylint.
Line: 71
Column: 5
return (type,)
str_is_unicode = True
else:
import __builtin__ as builtins
def _u(s):
# The double replace mangling going on prepares the string for
# unicode-escape - \foo is preserved, \u and \U are decoded.
return (s.replace("\\", "\\\\").replace("\\\\u", "\\u")
.replace("\\\\U", "\\U").decode("unicode-escape"))
Reported by Pylint.
Line: 82
Column: 30
return s
advance_iterator = lambda it: it.next()
def istext(x):
return isinstance(x, basestring)
def classtypes():
import types
return (type, types.ClassType)
str_is_unicode = sys.platform == "cli"
Reported by Pylint.
Line: 85
Column: 23
return isinstance(x, basestring)
def classtypes():
import types
return (type, types.ClassType)
str_is_unicode = sys.platform == "cli"
_u.__doc__ = __u_doc
Reported by Pylint.
Line: 312
Column: 16
def _exception_to_text(evalue):
"""Try hard to get a sensible text value out of an exception instance"""
try:
return unicode(evalue)
except KeyboardInterrupt:
raise
except:
# Apparently this is what traceback._some_str does. Sigh - RBC 20100623
pass
Reported by Pylint.
Line: 92
Column: 5
if sys.version_info > (2, 5):
all = all
_error_repr = BaseException.__repr__
def isbaseexception(exception):
"""Return whether exception inherits from BaseException only"""
return (isinstance(exception, BaseException)
and not isinstance(exception, Exception))
Reported by Pylint.
Line: 92
Column: 5
if sys.version_info > (2, 5):
all = all
_error_repr = BaseException.__repr__
def isbaseexception(exception):
"""Return whether exception inherits from BaseException only"""
return (isinstance(exception, BaseException)
and not isinstance(exception, Exception))
Reported by Pylint.
Line: 126
Column: 18
return isinstance(x, bytes)
else:
# Never return True on Pythons that provide the name but not the real type
def _isbytes(x):
return False
def _slow_escape(text):
"""Escape unicode ``text`` leaving printable characters unmodified
Reported by Pylint.
Line: 250
Column: 44
_default_source_encoding = "ascii"
# Pattern specified in <http://www.python.org/dev/peps/pep-0263/>
_cookie_search=re.compile("coding[:=]\s*([-\w.]+)").search
def _detect_encoding(lines):
"""Get the encoding of a Python source file from a list of lines as bytes
This function does less than tokenize.detect_encoding added in Python 3 as
Reported by Pylint.
Line: 250
Column: 38
_default_source_encoding = "ascii"
# Pattern specified in <http://www.python.org/dev/peps/pep-0263/>
_cookie_search=re.compile("coding[:=]\s*([-\w.]+)").search
def _detect_encoding(lines):
"""Get the encoding of a Python source file from a list of lines as bytes
This function does less than tokenize.detect_encoding added in Python 3 as
Reported by Pylint.