project_name
string
class_name
string
class_modifiers
string
class_implements
int64
class_extends
int64
function_name
string
function_body
string
cyclomatic_complexity
int64
NLOC
int64
num_parameter
int64
num_token
int64
num_variable
int64
start_line
int64
end_line
int64
function_index
int64
function_params
string
function_variable
string
function_return_type
string
function_body_line_type
string
function_num_functions
int64
function_num_lines
int64
outgoing_function_count
int64
outgoing_function_names
string
incoming_function_count
int64
incoming_function_names
string
lexical_representation
string
pasteorg_paste
public
public
0
0
text.reader
def reader(lnum=[lnum]):highlight[lnum[0]] = 1try:return linecache.getline(file, lnum[0])finally:lnum[0] += 1
2
6
1
40
0
229
234
229
null
[]
None
null
0
0
0
null
0
null
The function (text.reader) defined within the public class called public.The function start at line 229 and ends at 234. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
text
def text(einfo, context=5):"""Return a plain text document describing a given traceback."""etype, evalue, etb = einfoif isinstance(etype, type):etype = etype.__name__pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executabledate = time.ctime(time.time())head = f"{etype}\n{pyver}\n{date}\n" + '''A problem occurr...
15
58
2
412
16
202
274
202
einfo,context
['rows', 'num', 'file', 'highlight', 'value', 'i', 'date', 'pyver', 'records', 'etype', 'call', 'vars', 'head', 'name', 'exception', 'frames']
Returns
{"Assign": 23, "AugAssign": 3, "Expr": 7, "For": 4, "If": 8, "Return": 2, "Try": 1}
31
73
31
["isinstance", "sys.version.split", "time.ctime", "time.time", "inspect.getinnerframes", "os.path.abspath", "inspect.getargvalues", "inspect.formatargvalues", "pydoc.text.repr", "linecache.getline", "scanvars", "rows.append", "line.rstrip", "name.split", "dump.append", "pydoc.text.repr", "dump.append", "rows.append", "...
132
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.19906768_dragon_userbot_dragon_userbot.modules.admintool_py.ban_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.19906768_dragon_userbot_dragon_userbot.modules.admintool_py.delete_history", "_.content.gdrive....
The function (text) defined within the public class called public.The function start at line 202 and ends at 274. It contains 58 lines of code and it has a cyclomatic complexity of 15. It takes 2 parameters, represented as [202.0], and this function return a value. It declares 31.0 functions, It has 31.0 functions call...
pasteorg_paste
Hook
public
0
0
__init__
def __init__(self, display=1, logdir=None, context=5, file=None, format="html"):self.display = display# send tracebacks to browser if trueself.logdir = logdir# log tracebacks to files if not Noneself.context = context# number of source code lines per frameself.file = file or sys.stdout# place to send the outputself.for...
2
7
6
54
0
280
286
280
self,display,logdir,context,file,format
[]
None
{"Assign": 5}
0
7
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called Hook.The function start at line 280 and ends at 286. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [280.0] and does not return any value. It has 6814.0 functions calling this function which are ["...
pasteorg_paste
Hook
public
0
0
__call__
def __call__(self, etype, evalue, etb):self.handle((etype, evalue, etb))
1
2
4
23
0
288
289
288
self,etype,evalue,etb
[]
None
{"Expr": 1}
1
2
1
["self.handle"]
43
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.validators_py.PermissionValidator.__call__", "_.content...
The function (__call__) defined within the public class called Hook.The function start at line 288 and ends at 289. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [288.0] and does not return any value. It declare 1.0 function, It has 1.0 function called inside...
pasteorg_paste
Hook
public
0
0
handle
def handle(self, info=None):info = info or sys.exc_info()if self.format == "html":self.file.write(reset())formatter = html if self.format == "html" else textplain = Falsetry:doc = formatter(info, self.context)except Exception:# just in case something goes wrongdoc = ''.join(traceback.format_exception(*info))plain = Tru...
12
36
2
239
0
291
331
291
self,info
[]
None
{"Assign": 11, "Expr": 8, "If": 5, "Try": 3, "With": 1}
16
41
16
["sys.exc_info", "self.file.write", "reset", "formatter", "join", "traceback.format_exception", "pydoc.html.escape", "self.file.write", "self.file.write", "self.file.write", "tempfile.mkstemp", "os.fdopen", "file.write", "self.file.write", "self.file.write", "self.file.flush"]
22
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3636841_databio_pypiper.pypiper.utils_py.check_all_commands", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3670790_opencivicdata_pupa.pupa.cli.__main___py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creatio...
The function (handle) defined within the public class called Hook.The function start at line 291 and ends at 331. It contains 36 lines of code and it has a cyclomatic complexity of 12. It takes 2 parameters, represented as [291.0] and does not return any value. It declares 16.0 functions, It has 16.0 functions called i...
pasteorg_paste
ClassInitMeta
public
0
1
__new__
def __new__(meta, class_name, bases, new_attrs):cls = type.__new__(meta, class_name, bases, new_attrs)if (new_attrs.has_key('__classinit__')and not isinstance(cls.__classinit__, staticmethod)):setattr(cls, '__classinit__',staticmethod(cls.__classinit__.im_func))if hasattr(cls, '__classinit__'):cls.__classinit__(cls, ne...
4
9
4
78
0
6
14
6
meta,class_name,bases,new_attrs
[]
Returns
{"Assign": 1, "Expr": 2, "If": 2, "Return": 1}
7
9
7
["type.__new__", "new_attrs.has_key", "isinstance", "setattr", "staticmethod", "hasattr", "cls.__classinit__"]
113
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15217004_shayypy_guilded_py.guilded.enums_py.EnumMeta.__new__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537219_anthraxx_diffoscope.diffoscope.comparators.elf_py.ReadelfDebugDump.__new__", "_.content.gdrive.My...
The function (__new__) defined within the public class called ClassInitMeta, that inherit another class.The function start at line 6 and ends at 14. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [6.0], and this function return a value. It declares 7.0 functio...
pasteorg_paste
public
public
0
0
build_properties
def build_properties(cls, new_attrs):"""Given a class and a new set of attributes (as passed in by__classinit__), create or modify properties based on functionswith special names ending in __get, __set, and __del."""for name, value in new_attrs.items():if (name.endswith('__get') or name.endswith('__set')or name.endswit...
9
22
2
173
4
16
42
16
cls,new_attrs
['new_prop', 'attrs', 'base', 'old_prop']
None
{"Assign": 7, "Expr": 2, "For": 1, "If": 4}
12
27
12
["new_attrs.items", "name.endswith", "name.endswith", "name.endswith", "hasattr", "getattr", "isinstance", "ValueError", "type", "name.endswith", "property", "setattr"]
0
[]
The function (build_properties) defined within the public class called public.The function start at line 16 and ends at 42. It contains 22 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [16.0] and does not return any value. It declares 12.0 functions, and It has 12.0 funct...
pasteorg_paste
classinstancemethod
public
0
0
__init__
def __init__(self, func):self.func = funcself.__doc__ = func.__doc__
1
3
2
19
0
12
14
12
self,func
[]
None
{"Assign": 2}
0
3
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called classinstancemethod.The function start at line 12 and ends at 14. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [12.0] and does not return any value. It has 6814.0 functions calling this function ...
pasteorg_paste
classinstancemethod
public
0
0
__get__
def __get__(self, obj, type=None):return _methodwrapper(self.func, obj=obj, type=type)
1
2
3
26
0
16
17
16
self,obj,type
[]
Returns
{"Return": 1}
1
2
1
["_methodwrapper"]
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.abstractforeignfield_py.AbstractForeignField.__get__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.foreignfield...
The function (__get__) defined within the public class called classinstancemethod.The function start at line 16 and ends at 17. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [16.0], and this function return a value. It declare 1.0 function, It has 1.0 functio...
pasteorg_paste
classinstancemethod
public
0
0
__init__
def __init__(self, func, obj, type):self.func = funcself.obj = objself.type = type
1
4
4
26
0
21
24
21
self,func
[]
None
{"Assign": 2}
0
3
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called classinstancemethod.The function start at line 21 and ends at 24. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [21.0] and does not return any value. It has 6814.0 functions calling this function ...
pasteorg_paste
_methodwrapper
protected
0
0
__call__
def __call__(self, *args, **kw):assert 'self' not in kw and 'cls' not in kw, ("You cannot use 'self' or 'cls' arguments to a ""classinstancemethod")return self.func(*((self.obj, self.type) + args), **kw)
2
5
3
49
0
26
30
26
self,*args,**kw
[]
Returns
{"Return": 1}
1
5
1
["self.func"]
43
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.validators_py.PermissionValidator.__call__", "_.content...
The function (__call__) defined within the protected class called _methodwrapper.The function start at line 26 and ends at 30. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [26.0], and this function return a value. It declare 1.0 function, It has 1.0 function...
pasteorg_paste
_methodwrapper
protected
0
0
__repr__
def __repr__(self):if self.obj is None:return ('<bound class method %s.%s>'% (self.type.__name__, self.func.func_name))else:return ('<bound method %s.%s of %r>'% (self.type.__name__, self.func.func_name, self.obj))
2
7
1
54
0
32
38
32
self
[]
Returns
{"If": 1, "Return": 2}
0
7
0
[]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659669_pyopenapi_pyswagger.pyswagger.tests.v1_2.test_app_py.AppTestCase.test_ref", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3696868_turbogears_ming.ming.schema_py.Array.__repr__", "_.content.gdrive.MyDrive.Phd...
The function (__repr__) defined within the protected class called _methodwrapper.The function start at line 32 and ends at 38. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It has 29.0 functions calling this function whi...
pasteorg_paste
public
public
0
0
asbool
def asbool(obj):if isinstance(obj, (bytes, str)):obj = obj.strip().lower()if obj in ['true', 'yes', 'on', 'y', 't', '1']:return Trueelif obj in ['false', 'no', 'off', 'n', 'f', '0']:return Falseelse:raise ValueError("String is not true/false: %r" % obj)return bool(obj)
4
11
1
80
1
5
15
5
obj
['obj']
Returns
{"Assign": 1, "If": 3, "Return": 3}
5
11
5
["isinstance", "lower", "obj.strip", "ValueError", "bool"]
24
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3675202_galaxyproject_galaxy_lib.galaxy.jobs.metrics.instrumenters.cgroup_py.CgroupPlugin.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3675202_galaxyproject_galaxy_lib.galaxy.tools.deps.container_classes...
The function (asbool) defined within the public class called public.The function start at line 5 and ends at 15. It contains 11 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 5.0 functions, It has 5.0 functions called insid...
pasteorg_paste
public
public
0
0
aslist
def aslist(obj, sep=None, strip=True):if isinstance(obj, (bytes, str)):lst = obj.split(sep)if strip:lst = [v.strip() for v in lst]return lstelif isinstance(obj, (list, tuple)):return objelif obj is None:return []else:return [obj]
6
12
3
79
1
17
28
17
obj,sep,strip
['lst']
Returns
{"Assign": 2, "If": 4, "Return": 4}
4
12
4
["isinstance", "obj.split", "v.strip", "isinstance"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3684511_ckan_ckanext_dcat.ckanext.dcat.profiles.base_py.RDFProfile._add_spatial_value_to_graph", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.proxy_py.make_proxy"]
The function (aslist) defined within the public class called public.The function start at line 17 and ends at 28. It contains 12 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [17.0], and this function return a value. It declares 4.0 functions, It has 4.0 functions called i...
pasteorg_paste
public
public
0
0
interval_encode
def interval_encode(seconds, include_sign=False):"""Encodes a number of seconds (representing a time interval)into a form like 1h2d3s.>>> interval_encode(10)'10s'>>> interval_encode(493939)'5d17h12m19s'"""s = ''orig = secondsseconds = abs(seconds)for char, amount in timeOrdered:if seconds >= amount:i, seconds = divmod(...
6
15
2
79
3
37
59
37
seconds,include_sign
['s', 'seconds', 'orig']
Returns
{"Assign": 6, "AugAssign": 1, "Expr": 1, "For": 1, "If": 4, "Return": 2}
2
23
2
["abs", "divmod"]
0
[]
The function (interval_encode) defined within the public class called public.The function start at line 37 and ends at 59. It contains 15 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [37.0], and this function return a value. It declares 2.0 functions, and It has 2.0 func...
pasteorg_paste
public
public
0
0
interval_decode
def interval_decode(s):"""Decodes a number in the format 1h4d3m (1 hour, 3 days, 3 minutes)into a number of seconds>>> interval_decode('40s')40>>> interval_decode('10000s')10000>>> interval_decode('3d1w45s')864045"""time = 0sign = 1s = s.strip()if s.startswith('-'):s = s[1:]sign = -1elif s.startswith('+'):s = s[1:]for ...
5
15
1
109
4
62
87
62
s
['s', 'char', 'time', 'sign']
Returns
{"Assign": 7, "AugAssign": 1, "Expr": 1, "For": 1, "If": 3, "Return": 1}
8
26
8
["s.strip", "s.startswith", "s.startswith", "allMatches", "lower", "match.group", "int", "match.group"]
0
[]
The function (interval_decode) defined within the public class called public.The function start at line 62 and ends at 87. It contains 15 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. It declares 8.0 functions, and It has 8.0 functio...
pasteorg_paste
public
public
0
0
allMatches
def allMatches(source, regex):"""Return a list of matches for regex in source"""pos = 0end = len(source)rv = []match = regex.search(source, pos)while match:rv.append(match)match = regex.search(source, match.end() )return rv
2
9
2
56
4
90
100
90
source,regex
['end', 'pos', 'rv', 'match']
Returns
{"Assign": 5, "Expr": 2, "Return": 1, "While": 1}
5
11
5
["len", "regex.search", "rv.append", "regex.search", "match.end"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.dateinterval_py.interval_decode"]
The function (allMatches) defined within the public class called public.The function start at line 90 and ends at 100. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [90.0], and this function return a value. It declares 5.0 functions, It has 5.0 functions call...
pasteorg_paste
public
public
0
0
_number
def _number(val):try:return int(val)except Exception:return None
2
5
1
17
0
63
67
63
val
[]
Returns
{"Return": 2, "Try": 1}
1
5
1
["int"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.datetimeutil_py.parse_date"]
The function (_number) defined within the public class called public.The function start at line 63 and ends at 67. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0 function called inside ...
pasteorg_paste
public
public
0
0
parse_timedelta
def parse_timedelta(val):"""returns a ``timedelta`` object, or None"""if not val:return Noneval = val.lower()if "." in val:val = float(val)return timedelta(hours=int(val), minutes=60*(val % 1.0))fHour = ("h" in val or ":" in val)fMin= ("m" in val or ":" in val)for noise in "minu:teshour()":val = val.replace(noise, ' ')...
10
23
1
174
5
72
97
72
val
['hr', 'fHour', 'mi', 'val', 'fMin']
Returns
{"Assign": 12, "Expr": 2, "For": 1, "If": 5, "Return": 3}
16
26
16
["val.lower", "float", "timedelta", "int", "val.replace", "val.strip", "val.split", "val.reverse", "int", "val.pop", "int", "val.pop", "len", "int", "val.pop", "timedelta"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.datetimeutil_py.normalize_timedelta"]
The function (parse_timedelta) defined within the public class called public.The function start at line 72 and ends at 97. It contains 23 lines of code and it has a cyclomatic complexity of 10. The function does not take any parameters, and this function return a value. It declares 16.0 functions, It has 16.0 functions...
pasteorg_paste
public
public
0
0
normalize_timedelta
def normalize_timedelta(val):"""produces a normalized string value of the timedeltaThis module returns a normalized time span value consisting of thenumber of hours in fractional form. For example '1h 15min' isformatted as 01.25."""if type(val) == str:val = parse_timedelta(val)if not val:return ''hr = val.seconds/3600m...
3
8
1
56
3
99
113
99
val
['val', 'mn', 'hr']
Returns
{"Assign": 3, "Expr": 1, "If": 2, "Return": 2}
2
15
2
["type", "parse_timedelta"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_util.test_datetimeutil_py.test_timedelta"]
The function (normalize_timedelta) defined within the public class called public.The function start at line 99 and ends at 113. It contains 8 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 function...
pasteorg_paste
public
public
0
0
parse_time
def parse_time(val):if not val:return Nonehr = mi = 0val = val.lower()amflag = (-1 != val.find('a'))# set if AM is foundpmflag = (-1 != val.find('p'))# set if PM is foundfor noise in ":amp.":val = val.replace(noise, ' ')val = val.split()if len(val) > 1:hr = int(val[0])mi = int(val[1])else:val = val[0]if len(val) < 1:pa...
16
37
1
245
6
118
154
118
val
['hr', 'mi', 'amflag', 'tm', 'val', 'pmflag']
Returns
{"Assign": 19, "AugAssign": 1, "For": 1, "If": 10, "Return": 2}
17
37
17
["val.lower", "val.find", "val.find", "val.replace", "val.split", "len", "int", "int", "len", "localtime", "len", "int", "len", "int", "int", "int", "time"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3961526_tkrajina_gpxpy.gpxpy.gpxfield_py.TimeConverter.from_string", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69906343_ome_omero_py.src.omero.gateway.__init___py._BlitzGateway.searchObjects", "_.content.gdrive....
The function (parse_time) defined within the public class called public.The function start at line 118 and ends at 154. It contains 37 lines of code and it has a cyclomatic complexity of 16. The function does not take any parameters, and this function return a value. It declares 17.0 functions, It has 17.0 functions ca...
pasteorg_paste
public
public
0
0
normalize_time
def normalize_time(value, ampm):if not value:return ''if type(value) == str:value = parse_time(value)if not ampm:return "%02d:%02d" % (value.hour, value.minute)hr = value.houram = "AM"if hr < 1 or hr > 23:hr = 12elif hr >= 12:am = "PM"if hr > 12:hr = hr - 12return "%02d:%02d %s" % (hr, value.minute, am)
8
16
2
93
3
156
171
156
value,ampm
['hr', 'am', 'value']
Returns
{"Assign": 6, "If": 6, "Return": 3}
2
16
2
["type", "parse_time"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_util.test_datetimeutil_py.test_time"]
The function (normalize_time) defined within the public class called public.The function start at line 156 and ends at 171. It contains 16 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [156.0], and this function return a value. It declares 2.0 functions, It has 2.0 functio...
pasteorg_paste
public
public
0
0
_month
def _month(val):for (key, mon) in _str2num.items():if key in val:return monraise TypeError("unknown month '%s'" % val)
3
5
1
32
0
182
186
182
val
[]
Returns
{"For": 1, "If": 1, "Return": 1}
2
5
2
["_str2num.items", "TypeError"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.datetimeutil_py.parse_date"]
The function (_month) defined within the public class called public.The function start at line 182 and ends at 186. It contains 5 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 functions called ins...
pasteorg_paste
public
public
0
0
parse_date
def parse_date(val):if not(val):return Noneval = val.lower()now = None# optimized check for YYYY-MM-DDstrict = val.split("-")if len(strict) == 3:(y, m, d) = strictif "+" in d:d = d.split("+")[0]if " " in d:d = d.split(" ")[0]try:now = date(int(y), int(m), int(d))val = "xxx" + val[10:]except ValueError:pass# allow for '...
51
146
1
877
19
196
350
196
val
['now', 'dy', 'd', 'v', 'tail', 'out', 'last', 'a', 'b', 'tm', 'val', 'days', 'c', 'chk', 'ldig', 'strict', 'idx', 'yr', 'mo']
Returns
{"Assign": 76, "AugAssign": 2, "Expr": 3, "For": 4, "If": 35, "Return": 3, "Try": 2, "While": 1}
61
155
61
["val.lower", "val.split", "len", "d.split", "d.split", "date", "int", "int", "int", "date.today", "date.today", "index", "list", "now.isoweekday", "strip", "replace", "tail.replace", "tail.split", "int", "timedelta", "val.replace", "val.replace", "ch.isdigit", "out.append", "out.append", "out.append", "split", "join",...
96
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3675065_rouxrc_gazouilleur.gazouilleur.lib.feeds_py.FeederProtocol.process_tweets", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3684511_ckan_ckanext_dcat.ckanext.dcat.profiles.base_py.RDFProfile._add_date_triple",...
The function (parse_date) defined within the public class called public.The function start at line 196 and ends at 350. It contains 146 lines of code and it has a cyclomatic complexity of 51. The function does not take any parameters, and this function return a value. It declares 61.0 functions, It has 61.0 functions c...
pasteorg_paste
public
public
0
0
normalize_date
def normalize_date(val, iso8601=True):if not val:return ''if type(val) == str:val = parse_date(val)if iso8601:return "%4d-%02d-%02d" % (val.year, val.month, val.day)return "%02d %s %4d" % (val.day, _num2str[val.month], val.year)
4
8
2
67
1
352
359
352
val,iso8601
['val']
Returns
{"Assign": 1, "If": 3, "Return": 3}
2
8
2
["type", "parse_date"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_util.test_datetimeutil_py.test_date"]
The function (normalize_date) defined within the public class called public.The function start at line 352 and ends at 359. It contains 8 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [352.0], and this function return a value. It declares 2.0 functions, It has 2.0 function...
pasteorg_paste
public
public
0
0
_parseparam
def _parseparam(s):while s[:1] == ';':s = s[1:]end = s.find(';')while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:end = s.find(';', end + 1)if end < 0:end = len(s)f = s[:end]yield f.strip()s = s[end:]
5
11
1
103
3
31
41
31
s
['s', 'end', 'f']
None
{"Assign": 6, "Expr": 1, "If": 1, "While": 2}
6
11
6
["s.find", "s.count", "s.count", "s.find", "len", "f.strip"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.field_storage_py.parse_header"]
The function (_parseparam) defined within the public class called public.The function start at line 31 and ends at 41. It contains 11 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 6.0 functions, It has 6.0 functions called ins...
pasteorg_paste
public
public
0
0
parse_header
def parse_header(line):"""Parse a Content-type like header.Return the main content-type and a dictionary of options."""parts = _parseparam(';' + line)key = parts.__next__()pdict = {}for p in parts:i = p.find('=')if i >= 0:name = p[:i].strip().lower()value = p[i+1:].strip()if len(value) >= 2 and value[0] == value[-1] ==...
5
14
1
128
6
44
61
44
line
['pdict', 'value', 'key', 'i', 'name', 'parts']
Returns
{"Assign": 9, "Expr": 1, "For": 1, "If": 2, "Return": 1}
9
18
9
["_parseparam", "parts.__next__", "p.find", "lower", "strip", "strip", "len", "replace", "value.replace"]
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3514474_ntfreedom_neverendshadowsocks.shadowsocks.asyncdns_py.parse_response", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3514474_ntfreedom_neverendshadowsocks.shadowsocks.common_py.test_parse_header", "_.content...
The function (parse_header) defined within the public class called public.The function start at line 44 and ends at 61. It contains 14 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. It declares 9.0 functions, It has 9.0 functions calle...
pasteorg_paste
public
public
0
0
valid_boundary
def valid_boundary(s):import reif isinstance(s, bytes):_vb_pattern = b'^[ -~]{0,200}[!-~]$'else:_vb_pattern = '^[ -~]{0,200}[!-~]$'return re.match(_vb_pattern, s)
2
7
1
33
1
64
70
64
s
['_vb_pattern']
Returns
{"Assign": 2, "If": 1, "Return": 1}
2
7
2
["isinstance", "re.match"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.field_storage_py.FieldStorage.read_multi"]
The function (valid_boundary) defined within the public class called public.The function start at line 64 and ends at 70. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 functions call...
pasteorg_paste
MiniFieldStorage
public
0
0
__init__
def __init__(self, name, value):"""Constructor from field name and value."""self.name = nameself.value = value
1
3
3
20
0
86
89
86
self,name,value
[]
None
{"Assign": 2, "Expr": 1}
0
4
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called MiniFieldStorage.The function start at line 86 and ends at 89. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [86.0] and does not return any value. It has 6814.0 functions calling this function whi...
pasteorg_paste
MiniFieldStorage
public
0
0
__repr__
def __repr__(self):"""Return printable representation."""return f'MiniFieldStorage({self.name!r}, {self.value!r})'
1
2
1
9
0
92
94
92
self
[]
Returns
{"Expr": 1, "Return": 1}
0
3
0
[]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659669_pyopenapi_pyswagger.pyswagger.tests.v1_2.test_app_py.AppTestCase.test_ref", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3696868_turbogears_ming.ming.schema_py.Array.__repr__", "_.content.gdrive.MyDrive.Phd...
The function (__repr__) defined within the public class called MiniFieldStorage.The function start at line 92 and ends at 94. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 29.0 functions calling this function whic...
pasteorg_paste
MiniFieldStorage
public
0
0
__init__
def __init__(self, fp=None, headers=None, outerboundary=b'', environ=os.environ, keep_blank_values=False, strict_parsing=False, limit=None, encoding='utf-8', errors='replace', max_num_fields=None, separator='&'):"""Constructor.Read multipart/* until last part.Arguments, all optional:fp: file pointer; default: sys.stdin...
33
100
12
643
0
138
301
138
self,name,value
[]
None
{"Assign": 2, "Expr": 1}
0
4
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called MiniFieldStorage.The function start at line 138 and ends at 301. It contains 100 lines of code and it has a cyclomatic complexity of 33. It takes 12 parameters, represented as [138.0] and does not return any value. It has 6814.0 functions calling this funct...
pasteorg_paste
FieldStorage
public
0
0
__del__
def __del__(self):try:self.file.close()except AttributeError:pass
2
5
1
18
0
303
307
303
self
[]
None
{"Expr": 1, "Try": 1}
1
5
1
["self.file.close"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3958607_irods_python_irodsclient.irods.test.login_auth_test_must_run_manually_py.TestMiscellaneous.test_destruct_session_with_no_pool_315"]
The function (__del__) defined within the public class called FieldStorage.The function start at line 303 and ends at 307. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called ins...
pasteorg_paste
FieldStorage
public
0
0
__enter__
def __enter__(self):return self
1
2
1
7
0
309
310
309
self
[]
Returns
{"Return": 1}
0
2
0
[]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3918115_deschler_django_modeltranslation.modeltranslation.tests.tests_py.reload_override_settings.__enter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3928915_donnemartin_gitsome.xonsh.contexts_py.Functor.__ent...
The function (__enter__) defined within the public class called FieldStorage.The function start at line 309 and ends at 310. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 11.0 functions calling this function which...
pasteorg_paste
FieldStorage
public
0
0
__exit__
def __exit__(self, *args):self.file.close()
1
2
2
15
0
312
313
312
self,*args
[]
None
{"Expr": 1}
1
2
1
["self.file.close"]
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3918115_deschler_django_modeltranslation.modeltranslation.tests.tests_py.reload_override_settings.__exit__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3966383_jfilak_sapcli.test.unit.test_sap_cli_checkout_py.ass...
The function (__exit__) defined within the public class called FieldStorage.The function start at line 312 and ends at 313. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [312.0] and does not return any value. It declare 1.0 function, It has 1.0 function calle...
pasteorg_paste
MiniFieldStorage
public
0
0
__repr__
def __repr__(self):"""Return a printable representation."""value = '...' if self.file else self.value# avoid reading the filereturn f'FieldStorage({self.name!r}, {self.filename!r}, {value!r})'
2
3
1
20
0
315
318
315
self
[]
Returns
{"Expr": 1, "Return": 1}
0
3
0
[]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659669_pyopenapi_pyswagger.pyswagger.tests.v1_2.test_app_py.AppTestCase.test_ref", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3696868_turbogears_ming.ming.schema_py.Array.__repr__", "_.content.gdrive.MyDrive.Phd...
The function (__repr__) defined within the public class called MiniFieldStorage.The function start at line 315 and ends at 318. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It has 29.0 functions calling this function wh...
pasteorg_paste
FieldStorage
public
0
0
__iter__
def __iter__(self):return iter(self.keys())
1
2
1
14
0
320
321
320
self
[]
Returns
{"Return": 1}
2
2
2
["iter", "self.keys"]
17
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3593274_stevenproctor_planet_erlang.planet.vendor.html5lib.treebuilders.soup_py.AttrList.__iter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.BaseForei...
The function (__iter__) defined within the public class called FieldStorage.The function start at line 320 and ends at 321. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 functions ca...
pasteorg_paste
FieldStorage
public
0
0
__getattr__
def __getattr__(self, name):if name != 'value':raise AttributeError(name)if self.file:self.file.seek(0)value = self.file.read()self.file.seek(0)elif self.list is not None:value = self.listelse:value = Nonereturn value
4
12
2
67
0
323
334
323
self,name
[]
Returns
{"Assign": 3, "Expr": 2, "If": 3, "Return": 1}
4
12
4
["AttributeError", "self.file.seek", "self.file.read", "self.file.seek"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3966276_appimagecrafters_appimage_builder.appimagebuilder.recipe.roamer_py.Roamer.__getattr__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69693687_agnostiqhq_covalent.covalent._workflow.electron_py.Electron.__ge...
The function (__getattr__) defined within the public class called FieldStorage.The function start at line 323 and ends at 334. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [323.0], and this function return a value. It declares 4.0 functions, It has 4.0 func...
pasteorg_paste
FieldStorage
public
0
0
__getitem__
def __getitem__(self, key):"""Dictionary style indexing."""if self.list is None:raise TypeError('not indexable')found = []for item in self.list:if item.name == key:found.append(item)if not found:raise KeyError(key)if len(found) == 1:return found[0]else:return found
6
13
2
70
0
336
349
336
self,key
[]
Returns
{"Assign": 1, "Expr": 2, "For": 1, "If": 4, "Return": 2}
4
14
4
["TypeError", "found.append", "KeyError", "len"]
28
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.AbstractForeignList.__getitem__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.ForeignList.__g...
The function (__getitem__) defined within the public class called FieldStorage.The function start at line 336 and ends at 349. It contains 13 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [336.0], and this function return a value. It declares 4.0 functions, It has 4.0 func...
pasteorg_paste
FieldStorage
public
0
0
getvalue
def getvalue(self, key, default=None):"""Dictionary style get() method, including 'value' lookup."""if key in self:value = self[key]if isinstance(value, list):return [x.value for x in value]else:return value.valueelse:return default
4
9
3
51
0
351
360
351
self,key,default
[]
Returns
{"Assign": 1, "Expr": 1, "If": 2, "Return": 3}
1
10
1
["isinstance"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3546011_hashdist_hashdist.hashdist.deps.yaml.__init___py.dump_all", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3546011_hashdist_hashdist.hashdist.deps.yaml.__init___py.emit", "_.content.gdrive.MyDrive.Phd_Thesis....
The function (getvalue) defined within the public class called FieldStorage.The function start at line 351 and ends at 360. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [351.0], and this function return a value. It declare 1.0 function, It has 1.0 function c...
pasteorg_paste
FieldStorage
public
0
0
getfirst
def getfirst(self, key, default=None):""" Return the first value received."""if key in self:value = self[key]if isinstance(value, list):return value[0].valueelse:return value.valueelse:return default
3
9
3
48
0
362
371
362
self,key,default
[]
Returns
{"Assign": 1, "Expr": 1, "If": 2, "Return": 3}
1
10
1
["isinstance"]
0
[]
The function (getfirst) defined within the public class called FieldStorage.The function start at line 362 and ends at 371. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [362.0], and this function return a value. It declare 1.0 function, and It has 1.0 funct...
pasteorg_paste
FieldStorage
public
0
0
getlist
def getlist(self, key):""" Return list of received values."""if key in self:value = self[key]if isinstance(value, list):return [x.value for x in value]else:return [value.value]else:return []
4
9
2
50
0
373
382
373
self,key
[]
Returns
{"Assign": 1, "Expr": 1, "If": 2, "Return": 3}
1
10
1
["isinstance"]
0
[]
The function (getlist) defined within the public class called FieldStorage.The function start at line 373 and ends at 382. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [373.0], and this function return a value. It declare 1.0 function, and It has 1.0 functi...
pasteorg_paste
FieldStorage
public
0
0
keys
def keys(self):"""Dictionary style keys() method."""if self.list is None:raise TypeError('not indexable')return list(set(item.name for item in self.list))
3
4
1
34
0
384
388
384
self
[]
Returns
{"Expr": 1, "If": 1, "Return": 1}
3
5
3
["TypeError", "list", "set"]
420
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.dependencies", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.19906768_dragon_userbot_dragon_userbot.modules.filters_py.contains_filter", "_.conte...
The function (keys) defined within the public class called FieldStorage.The function start at line 384 and ends at 388. It contains 4 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 3.0 functions, It has 3.0 functions called...
pasteorg_paste
FieldStorage
public
0
0
__contains__
def __contains__(self, key):"""Dictionary style __contains__ method."""if self.list is None:raise TypeError('not indexable')return any(item.name == key for item in self.list)
3
4
2
35
0
390
394
390
self,key
[]
Returns
{"Expr": 1, "If": 1, "Return": 1}
2
5
2
["TypeError", "any"]
10
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3627162_cinpla_exdir.exdir.core.exdir_file_py.File.__contains__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.bravado_core.util_py.AliasKeyDict.__contains__", "_.content.gdrive.MyDrive.Ph...
The function (__contains__) defined within the public class called FieldStorage.The function start at line 390 and ends at 394. It contains 4 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [390.0], and this function return a value. It declares 2.0 functions, It has 2.0 func...
pasteorg_paste
FieldStorage
public
0
0
__len__
def __len__(self):"""Dictionary style len(x) support."""return len(self.keys())
1
2
1
15
0
396
398
396
self
[]
Returns
{"Expr": 1, "Return": 1}
2
3
2
["len", "self.keys"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3665918_alvinwan_neural_backed_decision_trees.nbdt.data.imagenet_py._TinyImagenet200Val.__len__"]
The function (__len__) defined within the public class called FieldStorage.The function start at line 396 and ends at 398. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 functions cal...
pasteorg_paste
FieldStorage
public
0
0
__bool__
def __bool__(self):if self.list is None:raise TypeError('Cannot be converted to bool.')return bool(self.list)
2
4
1
24
0
400
403
400
self
[]
Returns
{"If": 1, "Return": 1}
2
4
2
["TypeError", "bool"]
0
[]
The function (__bool__) defined within the public class called FieldStorage.The function start at line 400 and ends at 403. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 2.0 functions, and It has 2.0 functio...
pasteorg_paste
FieldStorage
public
0
0
read_urlencoded
def read_urlencoded(self):"""Internal: read data in query string format."""qs = self.fp.read(self.length)if not isinstance(qs, bytes):raise ValueError(f'{self.fp} should return bytes, got {type(qs).__name__}')qs = qs.decode(self.encoding, self.errors)if self.qs_on_post:qs += '&' + self.qs_on_postquery = urllib.parse.pa...
4
14
1
124
0
405
419
405
self
[]
None
{"Assign": 4, "AugAssign": 1, "Expr": 2, "If": 2}
8
15
8
["self.fp.read", "isinstance", "ValueError", "type", "qs.decode", "urllib.parse.parse_qsl", "MiniFieldStorage", "self.skip_lines"]
0
[]
The function (read_urlencoded) defined within the public class called FieldStorage.The function start at line 405 and ends at 419. It contains 14 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0 fun...
pasteorg_paste
FieldStorage
public
0
0
read_multi
def read_multi(self, environ, keep_blank_values, strict_parsing):"""Internal: read a part that is itself multipart."""ib = self.innerboundaryif not valid_boundary(ib):raise ValueError(f'Invalid boundary in multipart form: {ib!r}')self.list = []if self.qs_on_post:query = urllib.parse.parse_qsl(self.qs_on_post, self.keep...
20
56
4
407
0
423
491
423
self,environ,keep_blank_values,strict_parsing
[]
None
{"Assign": 13, "AugAssign": 8, "Expr": 5, "If": 11, "While": 3}
26
69
26
["valid_boundary", "ValueError", "urllib.parse.parse_qsl", "self.list.extend", "MiniFieldStorage", "self.fp.readline", "isinstance", "ValueError", "type", "len", "first_line.strip", "self.fp.readline", "len", "len", "FeedParser", "self.fp.readline", "data.strip", "len", "parser.feed", "hdr_text.decode", "parser.close",...
0
[]
The function (read_multi) defined within the public class called FieldStorage.The function start at line 423 and ends at 491. It contains 56 lines of code and it has a cyclomatic complexity of 20. It takes 4 parameters, represented as [423.0] and does not return any value. It declares 26.0 functions, and It has 26.0 f...
pasteorg_paste
FieldStorage
public
0
0
read_single
def read_single(self):"""Internal: read an atomic part."""if self.length >= 0:self.read_binary()self.skip_lines()else:self.read_lines()self.file.seek(0)
2
7
1
38
0
493
500
493
self
[]
None
{"Expr": 5, "If": 1}
4
8
4
["self.read_binary", "self.skip_lines", "self.read_lines", "self.file.seek"]
0
[]
The function (read_single) defined within the public class called FieldStorage.The function start at line 493 and ends at 500. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 function...
pasteorg_paste
FieldStorage
public
0
0
read_binary
def read_binary(self):"""Internal: read binary data."""self.file = self.make_file()todo = self.lengthif todo >= 0:while todo > 0:data = self.fp.read(min(todo, self.bufsize))# bytesif not isinstance(data, bytes):raise ValueError(f'{self.fp} should return bytes,'f' got {type(data).__name__}')self.bytes_read += len(data)i...
5
16
1
99
0
504
520
504
self
[]
None
{"Assign": 5, "AugAssign": 1, "Expr": 2, "If": 3, "While": 1}
9
17
9
["self.make_file", "self.fp.read", "min", "isinstance", "ValueError", "type", "len", "self.file.write", "len"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3984945_c4urself_bump2version.tests.test_cli_py.test_retain_newline"]
The function (read_binary) defined within the public class called FieldStorage.The function start at line 504 and ends at 520. It contains 16 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 9.0 functions, It has 9.0 functions ca...
pasteorg_paste
FieldStorage
public
0
0
read_lines
def read_lines(self):"""Internal: read lines until EOF or outerboundary."""if self._binary_file:self.file = self.__file = BytesIO()# store data as bytes for fileselse:self.file = self.__file = StringIO()# as strings for other fieldsif self.outerboundary:self.read_lines_to_outerboundary()else:self.read_lines_to_eof()
3
9
1
52
0
522
531
522
self
[]
None
{"Assign": 2, "Expr": 3, "If": 2}
4
10
4
["BytesIO", "StringIO", "self.read_lines_to_outerboundary", "self.read_lines_to_eof"]
0
[]
The function (read_lines) defined within the public class called FieldStorage.The function start at line 522 and ends at 531. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functions...
pasteorg_paste
FieldStorage
public
0
0
__write
def __write(self, line):"""line is always bytes, not string"""if self.__file is not None:if self.__file.tell() + len(line) > 1000:self.file = self.make_file()data = self.__file.getvalue()self.file.write(data)self.__file = Noneif self._binary_file:# keep bytesself.file.write(line)else:# decode to stringself.file.write(l...
4
11
2
97
0
533
546
533
self,line
[]
None
{"Assign": 3, "Expr": 4, "If": 3}
8
14
8
["self.__file.tell", "len", "self.make_file", "self.__file.getvalue", "self.file.write", "self.file.write", "self.file.write", "line.decode"]
0
[]
The function (__write) defined within the public class called FieldStorage.The function start at line 533 and ends at 546. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [533.0] and does not return any value. It declares 8.0 functions, and It has 8.0 functio...
pasteorg_paste
FieldStorage
public
0
0
read_lines_to_eof
def read_lines_to_eof(self):"""Internal: read lines until EOF."""while 1:line = self.fp.readline(1 << 16)# bytesself.bytes_read += len(line)if not line:self.done = -1breakself.__write(line)
3
8
1
47
0
548
556
548
self
[]
None
{"Assign": 2, "AugAssign": 1, "Expr": 2, "If": 1, "While": 1}
3
9
3
["self.fp.readline", "len", "self.__write"]
0
[]
The function (read_lines_to_eof) defined within the public class called FieldStorage.The function start at line 548 and ends at 556. It contains 8 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 fu...
pasteorg_paste
FieldStorage
public
0
0
read_lines_to_outerboundary
def read_lines_to_outerboundary(self):"""Internal: read lines until outerboundary.Data is read as bytes: boundaries and line ends must be convertedto bytes for comparisons."""next_boundary = b'--' + self.outerboundarylast_boundary = next_boundary + b'--'delim = b''last_line_lfend = True_read = 0while 1:if self.limit is...
13
42
1
230
0
558
606
558
self
[]
None
{"Assign": 23, "AugAssign": 2, "Expr": 2, "If": 9, "While": 1}
9
49
9
["self.fp.readline", "len", "len", "line.startswith", "line.rstrip", "line.endswith", "line.endswith", "line.endswith", "self.__write"]
0
[]
The function (read_lines_to_outerboundary) defined within the public class called FieldStorage.The function start at line 558 and ends at 606. It contains 42 lines of code and it has a cyclomatic complexity of 13. The function does not take any parameters and does not return any value. It declares 9.0 functions, and I...
pasteorg_paste
FieldStorage
public
0
0
skip_lines
def skip_lines(self):"""Internal: skip lines until outer boundary if defined."""if not self.outerboundary or self.done:returnnext_boundary = b'--' + self.outerboundarylast_boundary = next_boundary + b'--'last_line_lfend = Truewhile True:line = self.fp.readline(1 << 16)self.bytes_read += len(line)if not line:self.done =...
9
20
1
113
0
608
628
608
self
[]
None
{"Assign": 8, "AugAssign": 1, "Expr": 1, "If": 5, "Return": 1, "While": 1}
5
21
5
["self.fp.readline", "len", "line.endswith", "line.strip", "line.endswith"]
0
[]
The function (skip_lines) defined within the public class called FieldStorage.The function start at line 608 and ends at 628. It contains 20 lines of code and it has a cyclomatic complexity of 9. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 function...
pasteorg_paste
FieldStorage
public
0
0
make_file
def make_file(self):"""Overridable: return a readable & writable file.The file will be used as follows:- data is written to it- seek(0)- data is read from itThe file is opened in binary mode for files, in text modefor other fieldsThis version opens a temporary file for reading and writing,and immediately deletes (unlin...
2
6
1
37
0
630
657
630
self
[]
Returns
{"Expr": 1, "If": 1, "Return": 2}
2
28
2
["tempfile.TemporaryFile", "tempfile.TemporaryFile"]
0
[]
The function (make_file) defined within the public class called FieldStorage.The function start at line 630 and ends at 657. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 2.0 functions, and It has 2.0 functi...
pasteorg_paste
FileMixin
public
0
0
flush
def flush(self):pass
1
2
1
6
0
25
26
25
self
[]
None
{}
0
2
0
[]
9
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625987_abdur_rahmaanj_honeybot.honeybot.plugins.poker_assets.best5_py.hand_rank", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3675065_rouxrc_gazouilleur.gazouilleur.lib.filelogger_py.FileLogger.close", "_.content...
The function (flush) defined within the public class called FileMixin.The function start at line 25 and ends at 26. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 9.0 functions calling this function which are ["_.conte...
pasteorg_paste
FileMixin
public
0
0
next
def next(self):return self.readline()
1
2
1
11
0
28
29
28
self
[]
Returns
{"Return": 1}
1
2
1
["self.readline"]
984
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Package.build_system", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.endpoint_py.Endpoint.get", "_.content...
The function (next) defined within the public class called FileMixin.The function start at line 28 and ends at 29. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0 function called inside ...
pasteorg_paste
FileMixin
public
0
0
readline
def readline(self, size=None):# @@: This is a lame implementation; but a buffer would probably# be necessary for a better implementationoutput = []while 1:next = self.read(1)if not next:return ''.join(output)output.append(next)if size and size > 0 and len(output) >= size:return ''.join(output)if next == '\n':# @@: also...
7
11
2
74
0
31
44
31
self,size
[]
Returns
{"Assign": 2, "Expr": 1, "If": 3, "Return": 3, "While": 1}
6
14
6
["self.read", "join", "output.append", "len", "join", "join"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3928915_donnemartin_gitsome.xonsh.tokenize_py._tokenize", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3928915_donnemartin_gitsome.xonsh.tokenize_py.detect_encoding", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Cr...
The function (readline) defined within the public class called FileMixin.The function start at line 31 and ends at 44. It contains 11 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [31.0], and this function return a value. It declares 6.0 functions, It has 6.0 functions cal...
pasteorg_paste
FileMixin
public
0
0
xreadlines
def xreadlines(self):return self
1
2
1
7
0
46
47
46
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (xreadlines) defined within the public class called FileMixin.The function start at line 46 and ends at 47. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value..
pasteorg_paste
FileMixin
public
0
0
writelines
def writelines(self, lines):for line in lines:self.write(line)
2
3
2
18
0
49
51
49
self,lines
[]
None
{"Expr": 1, "For": 1}
1
3
1
["self.write"]
0
[]
The function (writelines) defined within the public class called FileMixin.The function start at line 49 and ends at 51. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [49.0] and does not return any value. It declare 1.0 function, and It has 1.0 function call...
pasteorg_paste
public
public
0
0
find_package_data
def find_package_data(where='.', package='',exclude=standard_exclude,exclude_directories=standard_exclude_directories,only_in_packages=True,show_ignored=False):"""Return a dictionary suitable for use in ``package_data``in a distutils ``setup.py`` file.The dictionary looks like::{'package': [files]}Where ``files`` is a ...
19
46
6
332
5
17
90
17
where,package,exclude,exclude_directories,only_in_packages,show_ignored
['stack', 'out', 'fn', 'bad_name', 'new_package']
Returns
{"Assign": 10, "Expr": 6, "For": 3, "If": 10, "Return": 1, "While": 1}
29
74
29
["Path", "stack.pop", "where.iterdir", "where.joinpath", "fn.is_dir", "fnmatchcase", "name.as_posix", "lower", "fn.as_posix", "pattern.lower", "print", "fn.as_posix", "is_file", "fn.joinpath", "name.as_posix", "name.as_posix", "stack.append", "stack.append", "name.as_posix", "fnmatchcase", "name.as_posix", "lower", "fn...
0
[]
The function (find_package_data) defined within the public class called public.The function start at line 17 and ends at 90. It contains 46 lines of code and it has a cyclomatic complexity of 19. It takes 6 parameters, represented as [17.0], and this function return a value. It declares 29.0 functions, and It has 29.0...
pasteorg_paste
public
public
0
0
find_package
def find_package(dir):"""Given a directory, finds the equivalent package name.If itis directly in sys.path, returns ''."""dir = os.path.abspath(dir)orig_dir = dirpath = map(os.path.abspath, sys.path)packages = []last_dir = Nonewhile 1:if dir in path:return '.'.join(packages)packages.insert(0, os.path.basename(dir))dir ...
4
15
1
95
5
7
25
7
dir
['packages', 'dir', 'path', 'orig_dir', 'last_dir']
Returns
{"Assign": 7, "Expr": 2, "If": 2, "Return": 1, "While": 1}
7
19
7
["os.path.abspath", "map", "join", "packages.insert", "os.path.basename", "os.path.dirname", "ValueError"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3694991_frostyx_tracer.tracer.resources.PackageManager_py.PackageManager.find_package", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3694991_frostyx_tracer.tracer.resources.system_py.System.running_kernel_package"]
The function (find_package) defined within the public class called public.The function start at line 7 and ends at 25. It contains 15 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 7.0 functions, It has 7.0 functions called...
pasteorg_paste
public
public
0
0
eval_import
def eval_import(s):"""Import a module, or import an object from a module.A module name like ``foo.bar:baz()`` can be used, where``foo.bar`` is the module, and ``baz()`` is an expressionevaluated in the context of that module.Note this is not safe onarbitrary strings because of the eval."""if ':' not in s:return simple_...
2
7
1
47
2
16
30
16
s
['obj', 'module']
Returns
{"Assign": 3, "Expr": 1, "If": 1, "Return": 2}
4
15
4
["simple_import", "s.split", "import_module", "eval"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.auth.basic_py.make_basic", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.auth.digest_py.make_digest", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation...
The function (eval_import) defined within the public class called public.The function start at line 16 and ends at 30. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 4.0 functions, It has 4.0 functions called ...
pasteorg_paste
public
public
0
0
simple_import
def simple_import(s):"""Import a module, or import an object from a module.A name like ``foo.bar.baz`` can be a module ``foo.bar.baz`` or amodule ``foo.bar`` with an object ``baz`` in it, or a module``foo`` with an object ``bar`` with an attribute ``baz``."""parts = s.split('.')module = import_module(parts[0])name = pa...
5
23
1
121
5
32
61
32
s
['obj', 'name', 'parts', 'module', 'last_import_error']
Returns
{"Assign": 11, "AugAssign": 1, "Expr": 1, "Return": 1, "Try": 2, "While": 2}
5
30
5
["s.split", "import_module", "import_module", "getattr", "ImportError"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.import_string_py.eval_import", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_doctests_py.test_doctest_mods"]
The function (simple_import) defined within the public class called public.The function start at line 32 and ends at 61. It contains 23 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. It declares 5.0 functions, It has 5.0 functions call...
pasteorg_paste
public
public
0
0
import_module
def import_module(s):"""Import a module."""mod = __import__(s)parts = s.split('.')for part in parts[1:]:mod = getattr(mod, part)return mod
2
6
1
39
2
63
71
63
s
['parts', 'mod']
Returns
{"Assign": 3, "Expr": 1, "For": 1, "Return": 1}
3
9
3
["__import__", "s.split", "getattr"]
68
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3495544_aio_libs_multidict.tests.conftest_py.MultidictImplementation.imported_module", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3495544_aio_libs_multidict.tests.gen_pickles_py.generate", "_.content.gdrive.MyDri...
The function (import_module) defined within the public class called public.The function start at line 63 and ends at 71. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 3.0 functions, It has 3.0 functions calle...
pasteorg_paste
public
public
0
0
try_import_module
def try_import_module(module_name):"""Imports a module, but catches import errors.Only catches errorswhen that module doesn't exist; if that module itself has animport error it will still get raised.Returns None if the moduledoesn't exist."""try:return import_module(module_name)except ImportError as e:if not getattr(e,...
6
15
1
94
2
73
95
73
module_name
['parts', 'desc']
Returns
{"Assign": 3, "Expr": 1, "For": 1, "If": 3, "Return": 2, "Try": 1}
8
23
8
["import_module", "getattr", "desc.startswith", "len", "module_name.split", "range", "len", "join"]
0
[]
The function (try_import_module) defined within the public class called public.The function start at line 73 and ends at 95. It contains 15 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters, and this function return a value. It declares 8.0 functions, and It has 8.0 funct...
pasteorg_paste
_Infinity
protected
0
0
__init__
def __init__(self,neg):self._neg = neg
1
2
2
12
0
26
27
26
self,neg
[]
None
{"Assign": 1}
0
2
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the protected class called _Infinity.The function start at line 26 and ends at 27. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [26.0] and does not return any value. It has 6814.0 functions calling this function which a...
pasteorg_paste
_Infinity
protected
0
0
__lt__
def __lt__(self,value):if not isinstance(value, _VALID_TYPES):return NotImplementedreturn ( self._neg and not ( isinstance(value,_Infinity) and value._neg ) )
4
5
2
38
0
29
33
29
self,value
[]
Returns
{"If": 1, "Return": 2}
2
5
2
["isinstance", "isinstance"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.55413314_dbbs_lab_bsb.libs.nrn_patch.patch.version_py.NeuronVersion.__lt__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69695072_nexb_univers.src.univers.version_constraint_py.VersionConstraint.__lt__", "_.conten...
The function (__lt__) defined within the protected class called _Infinity.The function start at line 29 and ends at 33. It contains 5 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [29.0], and this function return a value. It declares 2.0 functions, It has 2.0 functions cal...
pasteorg_paste
_Infinity
protected
0
0
__le__
def __le__(self,value):if not isinstance(value, _VALID_TYPES):return NotImplementedreturn self._neg
2
4
2
22
0
35
38
35
self,value
[]
Returns
{"If": 1, "Return": 2}
1
4
1
["isinstance"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.55413314_dbbs_lab_bsb.libs.nrn_patch.patch.version_py.NeuronVersion.__le__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.72771145_simphony_simphony_osp.simphony_osp.ontology.utils_py.DataStructureSet.__le__"]
The function (__le__) defined within the protected class called _Infinity.The function start at line 35 and ends at 38. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [35.0], and this function return a value. It declare 1.0 function, It has 1.0 function called...
pasteorg_paste
_Infinity
protected
0
0
__gt__
def __gt__(self,value):if not isinstance(value, _VALID_TYPES):return NotImplementedreturn not ( self._neg or ( isinstance(value,_Infinity) and not value._neg ) )
4
5
2
39
0
40
44
40
self,value
[]
Returns
{"If": 1, "Return": 2}
2
5
2
["isinstance", "isinstance"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.55413314_dbbs_lab_bsb.libs.nrn_patch.patch.version_py.NeuronVersion.__gt__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.72771145_simphony_simphony_osp.simphony_osp.ontology.utils_py.DataStructureSet.__gt__"]
The function (__gt__) defined within the protected class called _Infinity.The function start at line 40 and ends at 44. It contains 5 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [40.0], and this function return a value. It declares 2.0 functions, It has 2.0 functions cal...
pasteorg_paste
_Infinity
protected
0
0
__ge__
def __ge__(self,value):if not isinstance(value, _VALID_TYPES):return NotImplementedreturn not self._neg
2
4
2
23
0
46
49
46
self,value
[]
Returns
{"If": 1, "Return": 2}
1
4
1
["isinstance"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.55413314_dbbs_lab_bsb.libs.nrn_patch.patch.version_py.NeuronVersion.__ge__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.72771145_simphony_simphony_osp.simphony_osp.ontology.utils_py.DataStructureSet.__ge__"]
The function (__ge__) defined within the protected class called _Infinity.The function start at line 46 and ends at 49. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [46.0], and this function return a value. It declare 1.0 function, It has 1.0 function called...
pasteorg_paste
_Infinity
protected
0
0
__eq__
def __eq__(self,value):if not isinstance(value, _VALID_TYPES):return NotImplementedreturn isinstance(value,_Infinity) and self._neg == value._neg
3
4
2
33
0
51
54
51
self,value
[]
Returns
{"If": 1, "Return": 2}
2
4
2
["isinstance", "isinstance"]
26
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.frozen_py.FrozenDict.__eq__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.frozen_py.FrozenList.__eq__", "_.content.gdrive.MyD...
The function (__eq__) defined within the protected class called _Infinity.The function start at line 51 and ends at 54. It contains 4 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [51.0], and this function return a value. It declares 2.0 functions, It has 2.0 functions cal...
pasteorg_paste
_Infinity
protected
0
0
__ne__
def __ne__(self,value):if not isinstance(value, _VALID_TYPES):return NotImplementedreturn not isinstance(value,_Infinity) or self._neg != value._neg
3
4
2
34
0
56
59
56
self,value
[]
Returns
{"If": 1, "Return": 2}
2
4
2
["isinstance", "isinstance"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3966383_jfilak_sapcli.sap.adt.wb_py.CheckMessageText.__ne__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.72771145_simphony_simphony_osp.simphony_osp.ontology.utils_py.DataStructureSet.__ne__"]
The function (__ne__) defined within the protected class called _Infinity.The function start at line 56 and ends at 59. It contains 4 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [56.0], and this function return a value. It declares 2.0 functions, It has 2.0 functions cal...
pasteorg_paste
_Infinity
protected
0
0
__repr__
def __repr__(self):return "None"
1
2
1
7
0
61
62
61
self
[]
Returns
{"Return": 1}
0
2
0
[]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659669_pyopenapi_pyswagger.pyswagger.tests.v1_2.test_app_py.AppTestCase.test_ref", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3696868_turbogears_ming.ming.schema_py.Array.__repr__", "_.content.gdrive.MyDrive.Phd...
The function (__repr__) defined within the protected class called _Infinity.The function start at line 61 and ends at 62. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 29.0 functions calling this function which ar...
pasteorg_paste
_Infinity
protected
0
0
__init__
def __init__(self,*args,**kwargs):"""Initialize an integer set. The constructor accepts an unlimitednumber of arguments that may either be tuples in the form of(start,stop) where either start or stop may be a number or None torepresent maximum/minimum in that direction. The range specified by(start,stop) is always incl...
33
59
3
435
0
84
171
84
self,neg
[]
None
{"Assign": 1}
0
2
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the protected class called _Infinity.The function start at line 84 and ends at 171. It contains 59 lines of code and it has a cyclomatic complexity of 33. It takes 3 parameters, represented as [84.0] and does not return any value. It has 6814.0 functions calling this function whic...
pasteorg_paste
IntSet
public
0
0
_iterranges
def _iterranges(self,r1,r2,minval=_MININF,maxval=_MAXINF):curval = minvalcurstates = {"r1":False,"r2":False}imax, jmax = 2*len(r1), 2*len(r2)i, j = 0, 0while i < imax or j < jmax:if i < imax and ( ( j < jmax andr1[i>>1][i&1] < r2[j>>1][j&1] ) orj == jmax ):cur_r, newname, newstate = r1[i>>1][i&1], "r1", not (i&1)i += 1...
10
22
5
210
0
176
197
176
self,r1,r2,minval,maxval
[]
None
{"Assign": 8, "AugAssign": 2, "Expr": 2, "If": 4, "While": 1}
2
22
2
["len", "len"]
0
[]
The function (_iterranges) defined within the public class called IntSet.The function start at line 176 and ends at 197. It contains 22 lines of code and it has a cyclomatic complexity of 10. It takes 5 parameters, represented as [176.0] and does not return any value. It declares 2.0 functions, and It has 2.0 function...
pasteorg_paste
IntSet
public
0
0
_normalize
def _normalize(self):self._ranges.sort()i = 1while i < len(self._ranges):if self._ranges[i][0] < self._ranges[i-1][1]:self._ranges[i-1] = (self._ranges[i-1][0], max(self._ranges[i-1][1], self._ranges[i][1]))del self._ranges[i]else:i += 1self._ranges = tuple(self._ranges)self._hash = hash(self._ranges)
3
13
1
127
0
199
211
199
self
[]
None
{"Assign": 4, "AugAssign": 1, "Expr": 1, "If": 1, "While": 1}
5
13
5
["self._ranges.sort", "len", "max", "tuple", "hash"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3698202_csirtgadgets_bearded_avenger.cif.httpd.views.feed.ipv4_py.Ipv4.process", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3698222_fgnt_pb_bss.pb_bss.utils_py.reshape", "_.content.gdrive.MyDrive.Phd_Thesis.Datas...
The function (_normalize) defined within the public class called IntSet.The function start at line 199 and ends at 211. It contains 13 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 5.0 functions, It has 5.0 functions called in...
pasteorg_paste
IntSet
public
0
0
__coerce__
def __coerce__(self,other):if isinstance(other,IntSet):return self, otherelif isinstance(other, (int, tuple,)):try:return self, self.__class__(other)except TypeError:# Catch a type error, in that case the structure specified by# other is something we can't coerce, return NotImplemented.# ValueErrors are not caught, the...
6
14
2
75
0
213
232
213
self,other
[]
Returns
{"If": 3, "Return": 6, "Try": 2}
5
20
5
["isinstance", "isinstance", "self.__class__", "isinstance", "self.__class__"]
0
[]
The function (__coerce__) defined within the public class called IntSet.The function start at line 213 and ends at 232. It contains 14 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [213.0], and this function return a value. It declares 5.0 functions, and It has 5.0 functi...
pasteorg_paste
public
public
0
0
_make_function.f
def f(self,other):coerced = self.__coerce__(other)if coerced is NotImplemented:return NotImplementedother = coerced[1]newset = self.__class__.__new__(self.__class__)newset._min = min(self._min,other._min)newset._max = max(self._max,other._max)newset._ranges = []for states, (start,stop) in \self._iterranges(self._ranges...
6
20
2
187
0
250
269
250
null
[]
None
null
0
0
0
null
0
null
The function (_make_function.f) defined within the public class called public.The function start at line 250 and ends at 269. It contains 20 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [250.0] and does not return any value..
pasteorg_paste
public
public
0
0
_make_function.f
def f(self,other):coerced = self.__coerce__(other)if coerced is NotImplemented:return NotImplementedother = coerced[1]_min = min(self._min,other._min)_max = max(self._max,other._max)found = not panyfor states, (start,stop) in \self._iterranges(self._ranges,other._ranges,_min,_max):if not pall(states):return Falsefound ...
5
14
2
102
0
271
284
271
null
[]
None
null
0
0
0
null
0
null
The function (_make_function.f) defined within the public class called public.The function start at line 271 and ends at 284. It contains 14 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [271.0] and does not return any value..
pasteorg_paste
IntSet
public
0
0
_make_function
def _make_function(name,type,doc,pall,pany=None):"""Makes a function to match two ranges. Accepts two types: either'set', which defines a function which returns a set with all rangesmatching pall (pany is ignored), or 'bool', which returns True if pallmatches for all ranges and pany matches for any one range. doc is th...
4
13
5
55
0
237
292
237
name,type,doc,pall,pany
[]
Returns
{"Assign": 17, "Expr": 2, "For": 2, "If": 7, "Return": 6, "Try": 1}
16
56
16
["self.__coerce__", "self.__class__.__new__", "min", "max", "self._iterranges", "pall", "newset._ranges.append", "tuple", "hash", "self.__coerce__", "min", "max", "self._iterranges", "pall", "pany", "ValueError"]
0
[]
The function (_make_function) defined within the public class called IntSet.The function start at line 237 and ends at 292. It contains 13 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [237.0], and this function return a value. It declares 16.0 functions, and It has 16.0 ...
pasteorg_paste
IntSet
public
0
0
inverse
def inverse(self):"""Inverse of set as a new set."""newset = self.__class__.__new__(self.__class__)newset._min = self._minnewset._max = self._maxnewset._ranges = []laststop = self._minfor r in self._ranges:if laststop < r[0]:newset._ranges.append((laststop,r[0]))laststop = r[1]if laststop < self._max:newset._ranges.app...
4
13
1
102
0
374
388
374
self
[]
Returns
{"Assign": 6, "Expr": 3, "For": 1, "If": 2, "Return": 1}
3
15
3
["self.__class__.__new__", "newset._ranges.append", "newset._ranges.append"]
0
[]
The function (inverse) defined within the public class called IntSet.The function start at line 374 and ends at 388. It contains 13 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It has 3.0 functions cal...
pasteorg_paste
IntSet
public
0
0
__hash__
def __hash__(self):"""Returns a hash value representing this integer set. As the set isalways stored normalized, the hash value is guaranteed to match formatching ranges."""return self._hash
1
2
1
10
0
395
400
395
self
[]
Returns
{"Expr": 1, "Return": 1}
0
6
0
[]
12
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3922186_flacjacket_pywlroots.wlroots.__init___py.Ptr.__hash__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3966276_appimagecrafters_appimage_builder.appimagebuilder.modules.deploy.apt.package_py.Package.__hash__"...
The function (__hash__) defined within the public class called IntSet.The function start at line 395 and ends at 400. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 12.0 functions calling this function which are ["...
pasteorg_paste
IntSet
public
0
0
__len__
def __len__(self):"""Get length of this integer set. In case the length is larger than2**31 (including infinitely sized integer sets), it raises anOverflowError. This is due to len() restricting the size to0 <= len < 2**31."""if not self._ranges:return 0if self._ranges[0][0] is _MININF or self._ranges[-1][1] is _MAXINF...
6
11
1
80
0
405
420
405
self
[]
Returns
{"Assign": 1, "AugAssign": 1, "Expr": 1, "For": 1, "If": 3, "Return": 2}
2
16
2
["OverflowError", "OverflowError"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3665918_alvinwan_neural_backed_decision_trees.nbdt.data.imagenet_py._TinyImagenet200Val.__len__"]
The function (__len__) defined within the public class called IntSet.The function start at line 405 and ends at 420. It contains 11 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 functions called i...
pasteorg_paste
IntSet
public
0
0
len
def len(self):"""Returns the length of this integer set as an integer. In case thelength is infinite, returns -1. This function exists because of alimitation of the builtin len() function which expects values inthe range 0 <= len < 2**31. Use this function in case your integerset might be larger."""if not self._ranges:...
5
9
1
66
0
422
436
422
self
[]
Returns
{"Assign": 1, "AugAssign": 1, "Expr": 1, "For": 1, "If": 2, "Return": 3}
0
15
0
[]
22,583
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.config.gitlint.bad_signedoffby_py.BadSignedOffBy.validate", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.config.gitlint.block_comment_py...
The function (len) defined within the public class called IntSet.The function start at line 422 and ends at 436. It contains 9 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. It has 22583.0 functions calling this function which are ["_....
pasteorg_paste
IntSet
public
0
0
__nonzero__
def __nonzero__(self):"""Returns true if this integer set contains at least one item."""return bool(self._ranges)
1
2
1
13
0
438
441
438
self
[]
Returns
{"Expr": 1, "Return": 1}
1
4
1
["bool"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637706_disqus_gutter.tests.test_arguments_py.StringTest.test_nonzero_returns_if_truthy", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3641147_gamechanger_dusty.tests.unit.command_file_test_py.TestCommandFile.test_...
The function (__nonzero__) defined within the public class called IntSet.The function start at line 438 and ends at 441. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0 function called i...
pasteorg_paste
IntSet
public
0
0
__iter__
def __iter__(self):"""Iterate over all values in this integer set. Iteration always startsby iterating from lowest to highest over the ranges that are bounded.After processing these, all ranges that are unbounded (maximum 2) areyielded intermixed."""ubranges = []for r in self._ranges:if r[0] is _MININF:if r[1] is _MAXI...
9
18
1
137
0
443
465
443
self
[]
None
{"Assign": 1, "AugAssign": 1, "Expr": 6, "For": 3, "If": 4, "While": 1}
4
23
4
["ubranges.extend", "ubranges.append", "ubranges.append", "range"]
17
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3593274_stevenproctor_planet_erlang.planet.vendor.html5lib.treebuilders.soup_py.AttrList.__iter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.BaseForei...
The function (__iter__) defined within the public class called IntSet.The function start at line 443 and ends at 465. It contains 18 lines of code and it has a cyclomatic complexity of 9. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functions called insi...
pasteorg_paste
_Infinity
protected
0
0
__repr__
def __repr__(self):"""Return a representation of this integer set. The representation isexecutable to get an equal integer set."""rv = []for start, stop in self._ranges:if ( isinstance(start, int) and isinstance(stop, int) and stop-start == 1 ):rv.append("%r" % start)elif isinstance(stop, int):rv.append("(%r,%r)" % (st...
8
15
1
139
0
470
487
470
self
[]
Returns
{"Return": 1}
0
2
0
[]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659669_pyopenapi_pyswagger.pyswagger.tests.v1_2.test_app_py.AppTestCase.test_ref", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3696868_turbogears_ming.ming.schema_py.Array.__repr__", "_.content.gdrive.MyDrive.Phd...
The function (__repr__) defined within the protected class called _Infinity.The function start at line 470 and ends at 487. It contains 15 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters, and this function return a value. It has 29.0 functions calling this function which...
pasteorg_paste
IP4Range
public
0
1
__init__
def __init__(self,*args):"""Initialize an ip4range class. The constructor accepts an unlimitednumber of arguments that may either be tuples in the form (start,stop),integers, longs or strings, where start and stop in a tuple mayalso be of the form integer, long or string.Passing an integer or long means passing an IPv4...
14
31
2
275
0
37
100
37
self,*args
[]
None
{"Assign": 9, "Expr": 3, "For": 1, "If": 11, "Return": 1}
28
64
28
["len", "isinstance", "__init__", "super", "list", "range", "len", "isinstance", "self._parseRange", "argval.split", "self._parseMask", "argval.split", "self._parseAddrRange", "isinstance", "len", "ValueError", "isinstance", "self._parseAddrRange", "isinstance", "TypeError", "isinstance", "self._parseAddrRange", "isins...
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called IP4Range, that inherit another class.The function start at line 37 and ends at 100. It contains 31 lines of code and it has a cyclomatic complexity of 14. It takes 2 parameters, represented as [37.0] and does not return any value. It declares 28.0 functions...
pasteorg_paste
IP4Range
public
0
1
_parseRange
def _parseRange(self,addr1,addr2):naddr1, naddr1len = _parseAddr(addr1)naddr2, naddr2len = _parseAddr(addr2)if naddr2len < naddr1len:naddr2 += naddr1&(((1<<((naddr1len-naddr2len)*8))-1)<<(naddr2len*8))naddr2len = naddr1lenelif naddr2len > naddr1len:raise ValueError("Range has more dots than address.")naddr1 <<= (4-nadd...
3
13
3
116
0
105
117
105
self,addr1,addr2
[]
Returns
{"Assign": 3, "AugAssign": 4, "If": 2, "Return": 1}
3
13
3
["_parseAddr", "_parseAddr", "ValueError"]
0
[]
The function (_parseRange) defined within the public class called IP4Range, that inherit another class.The function start at line 105 and ends at 117. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [105.0], and this function return a value. It declares 3.0 fu...
pasteorg_paste
IP4Range
public
0
1
_parseMask
def _parseMask(self,addr,mask):naddr, naddrlen = _parseAddr(addr)naddr <<= (4-naddrlen)*8try:if not mask:masklen = 0else:masklen = int(mask)if not 0 <= masklen <= 32:raise ValueErrorexcept ValueError:try:mask = _parseAddr(mask,False)except ValueError:raise ValueError("Mask isn't parseable.")remaining = 0masklen = 0if n...
9
30
3
170
0
119
148
119
self,addr,mask
[]
Returns
{"Assign": 9, "AugAssign": 4, "If": 4, "Return": 1, "Try": 2, "While": 2}
5
30
5
["_parseAddr", "int", "_parseAddr", "ValueError", "ValueError"]
0
[]
The function (_parseMask) defined within the public class called IP4Range, that inherit another class.The function start at line 119 and ends at 148. It contains 30 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [119.0], and this function return a value. It declares 5.0 fun...
pasteorg_paste
IP4Range
public
0
1
_parseAddrRange
def _parseAddrRange(self,addr):naddr, naddrlen = _parseAddr(addr)naddr1 = naddr<<((4-naddrlen)*8)naddr2 = ( (naddr<<((4-naddrlen)*8)) + (1<<((4-naddrlen)*8)) - 1 )return (naddr1,naddr2)
1
6
2
70
0
150
155
150
self,addr
[]
Returns
{"Assign": 3, "Return": 1}
1
6
1
["_parseAddr"]
0
[]
The function (_parseAddrRange) defined within the public class called IP4Range, that inherit another class.The function start at line 150 and ends at 155. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [150.0], and this function return a value. It declare 1.0 ...
pasteorg_paste
IP4Range
public
0
1
_int2ip
def _int2ip(self,num):rv = []for i in range(4):rv.append(str(num&255))num >>= 8return ".".join(reversed(rv))
2
6
2
43
0
160
165
160
self,num
[]
Returns
{"Assign": 1, "AugAssign": 1, "Expr": 1, "For": 1, "Return": 1}
5
6
5
["range", "rv.append", "str", "join", "reversed"]
0
[]
The function (_int2ip) defined within the public class called IP4Range, that inherit another class.The function start at line 160 and ends at 165. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [160.0], and this function return a value. It declares 5.0 functio...
pasteorg_paste
IP4Range
public
0
1
iteraddresses
def iteraddresses(self):"""Returns an iterator which iterates over ips in this iprange. AnIP is returned in string form (e.g. '1.2.3.4')."""for v in super(IP4Range,self).__iter__():yield self._int2ip(v)
2
3
1
27
0
170
175
170
self
[]
None
{"Expr": 2, "For": 1}
3
6
3
["__iter__", "super", "self._int2ip"]
0
[]
The function (iteraddresses) defined within the public class called IP4Range, that inherit another class.The function start at line 170 and ends at 175. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions...
pasteorg_paste
IP4Range
public
0
1
iterranges
def iterranges(self):"""Returns an iterator which iterates over ip-ip ranges which buildthis iprange if combined. An ip-ip pair is returned in string form(e.g. '1.2.3.4-2.3.4.5')."""for r in self._ranges:if r[1]-r[0] == 1:yield self._int2ip(r[0])else:yield '%s-%s' % (self._int2ip(r[0]),self._int2ip(r[1]-1))
3
6
1
64
0
177
186
177
self
[]
None
{"Expr": 3, "For": 1, "If": 1}
3
10
3
["self._int2ip", "self._int2ip", "self._int2ip"]
0
[]
The function (iterranges) defined within the public class called IP4Range, that inherit another class.The function start at line 177 and ends at 186. It contains 6 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 3.0 functions, a...
pasteorg_paste
IP4Range
public
0
1
itermasks
def itermasks(self):"""Returns an iterator which iterates over ip/mask pairs which buildthis iprange if combined. An IP/Mask pair is returned in string form(e.g. '1.2.3.0/24')."""for r in self._ranges:for v in self._itermasks(r):yield v
3
4
1
25
0
188
195
188
self
[]
None
{"Expr": 2, "For": 2}
1
8
1
["self._itermasks"]
0
[]
The function (itermasks) defined within the public class called IP4Range, that inherit another class.The function start at line 188 and ends at 195. It contains 4 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declare 1.0 function, and ...
pasteorg_paste
IP4Range
public
0
1
_itermasks
def _itermasks(self,r):ranges = [r]while ranges:cur = ranges.pop()curmask = 0while True:curmasklen = 1<<(32-curmask)start = (cur[0]+curmasklen-1)&(((1<<curmask)-1)<<(32-curmask))if start >= cur[0] and start+curmasklen <= cur[1]:breakelse:curmask += 1yield "%s/%s" % (self._int2ip(start),curmask)if cur[0] < start:ranges....
7
17
2
152
0
197
213
197
self,r
[]
None
{"Assign": 5, "AugAssign": 1, "Expr": 3, "If": 3, "While": 2}
4
17
4
["ranges.pop", "self._int2ip", "ranges.append", "ranges.append"]
0
[]
The function (_itermasks) defined within the public class called IP4Range, that inherit another class.The function start at line 197 and ends at 213. It contains 17 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [197.0] and does not return any value. It declares 4.0 functio...
pasteorg_paste
IP4Range
public
0
1
__repr__
def __repr__(self):"""Returns a string which can be used to reconstruct this iprange."""rv = []for start, stop in self._ranges:if stop-start == 1:rv.append("%r" % (self._int2ip(start),))else:rv.append("(%r,%r)" % (self._int2ip(start), self._int2ip(stop-1)))return "%s(%s)" % (self.__class__.__name__,",".join(rv))
3
9
1
85
0
220
230
220
self
[]
Returns
{"Assign": 1, "Expr": 3, "For": 1, "If": 1, "Return": 1}
6
11
6
["rv.append", "self._int2ip", "rv.append", "self._int2ip", "self._int2ip", "join"]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659669_pyopenapi_pyswagger.pyswagger.tests.v1_2.test_app_py.AppTestCase.test_ref", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3696868_turbogears_ming.ming.schema_py.Array.__repr__", "_.content.gdrive.MyDrive.Phd...
The function (__repr__) defined within the public class called IP4Range, that inherit another class.The function start at line 220 and ends at 230. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 6.0 functions,...
pasteorg_paste
public
public
0
0
_parseAddr
def _parseAddr(addr,lookup=True):if lookup and any(ch not in IP4Range._IPREMOVE for ch in addr):try:addr = socket.gethostbyname(addr)except socket.error:raise ValueError("Invalid Hostname as argument.")naddr = 0for naddrpos, part in enumerate(addr.split(".")):if naddrpos >= 4:raise ValueError("Address contains more tha...
10
22
2
121
3
232
253
232
addr,lookup
['addr', 'naddr', 'part']
Returns
{"Assign": 4, "AugAssign": 2, "For": 1, "If": 4, "Return": 1, "Try": 2}
8
22
8
["any", "socket.gethostbyname", "ValueError", "enumerate", "addr.split", "ValueError", "int", "ValueError"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.ip4_py.IP4Range._parseAddrRange", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.util.ip4_py.IP4Range._parseMask", "_.content.gdrive.MyDrive.Phd_Thesis...
The function (_parseAddr) defined within the public class called public.The function start at line 232 and ends at 253. It contains 22 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [232.0], and this function return a value. It declares 8.0 functions, It has 8.0 functions ...
pasteorg_paste
public
public
0
0
ip2int
def ip2int(addr, lookup=True):return _parseAddr(addr, lookup=lookup)[0]
1
2
2
21
0
255
256
255
addr,lookup
[]
Returns
{"Return": 1}
1
2
1
["_parseAddr"]
0
[]
The function (ip2int) defined within the public class called public.The function start at line 255 and ends at 256. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [255.0], and this function return a value. It declare 1.0 function, and It has 1.0 function call...