code
stringlengths
1
1.49M
file_id
stringlengths
42
46
node_count
int64
0
7.38k
total_lines
int64
1
20.9k
vector_dim
int64
15
15
vector_labels
stringclasses
1 value
nodes
stringlengths
2
3.75M
connections
stringlengths
2
964k
'''Plugin Performance profiling module for ClearCutter Loads an OSSIM plugin and sample log data, and identifies the CPU cost for each SID in a plugin as a percentage of total runtime to process the entire file ''' __author__ = "CP Constantine" __email__ = "conrad@alienvault.com" __copyright__ = 'Copyright:Alienvault 2012' __credits__ = ["Conrad Constantine"] __version__ = "0.1" __license__ = "BSD" __status__ = "Prototype" __maintainer__ = "CP Constantine" import cProfile, pstats, re logdata = '' aliases = { 'IPV4' :"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", 'IPV6_MAP' : "::ffff:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", 'MAC': "\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}", 'PORT': "\d{1,5}", 'HOSTNAME' : "((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)([a-zA-Z])+)", 'TIME' : "\d\d:\d\d:\d\d", 'SYSLOG_DATE' : "\w{3}\s+\d{1,2}\s\d\d:\d\d:\d\d", 'SYSLOG_WY_DATE' : "\w+\s+\d{1,2}\s\d{4}\s\d\d:\d\d:\d\d", } def __init__(self, log): self.logdata = open(log, 'r').readlines() def ProfileRegexp(self, regexp): cProfile.run('self.Profilewrap(regexp)', 'profiler.out') profstats = pstats.Stats('profiler.out') profstats.print_stats() def ProfileWrap(self, regexp): for line in self.logdata: for alias in self.aliases: tmp_al = "" tmp_al = "\\" + alias; regexp = regexp.replace(tmp_al, self.aliases[alias]) result = re.findall(regexp, line) try: tmp = result[0] except IndexError: continue
ajibawa-2023/Python-Code-Large/train/row_99993
27
52
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0577, 0.0962, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''Plugin Performance profiling module for ClearCutter\n\nLoads an OSSIM plugin and sample log data, and identifies the CPU cost for each SID in a plugin\nas a percentage of total runtime to process the entire file\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L7_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1346, 0.0192, 0, 0.66, 0.0714, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = \"CP Constantine\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L8_C0", "label": "__email__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1538, 0.0192, 0, 0.66, 0.1429, 424, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__email__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__email__ = \"conrad@alienvault.com\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L9_C0", "label": "__copyright__ =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.1731, 0.0192, 0, 0.66, 0.2143, 200, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__copyright__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__copyright__ = 'Copyright:Alienvault 2012'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L10_C0", "label": "__credits__ =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.1923, 0.0192, 0, 0.66, 0.2857, 451, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__credits__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__credits__ = [\"Conrad Constantine\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L11_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2115, 0.0192, 0, 0.66, 0.3571, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"0.1\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L12_C0", "label": "__license__ =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2308, 0.0192, 0, 0.66, 0.4286, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__license__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__license__ = \"BSD\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L13_C0", "label": "__status__ =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0192, 0, 0.66, 0.5, 955, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__status__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__status__ = \"Prototype\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L14_C0", "label": "__maintainer__ =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.2692, 0.0192, 0, 0.66, 0.5714, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__maintainer__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__maintainer__ = \"CP Constantine\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Import_L17_C0", "label": "cProfile import cProfile, pstats, re", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3269, 0.0192, 0, 0.66, 0.6429, 686, 0, 3, 0, 0, 686, 0, 0], "semantic": {"name": "cProfile", "arg_names": [], "import_names": ["cProfile", "pstats", "re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cProfile, pstats, re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L19_C0", "label": "logdata =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.3654, 0.0192, 0, 0.66, 0.7143, 245, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "logdata", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "logdata = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L20_C0", "label": "aliases =", "type": "assigned_variable", "loc": [20, 29], "level": 0, "parent": null, "vector": [14, 0, 0.4712, 0.1923, 0, 0.66, 0.7857, 88, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "aliases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "aliases = {\n 'IPV4' :\"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\",\n 'IPV6_MAP' : \"::ffff:\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\",\n 'MAC': \"\\w{1,2}:\\w{1,2}:\\w{1,2}:\\w{1,2}:\\w{1,2}:\\w{1,2}\",\n 'PORT': \"\\d{1,5}\",\n 'HOSTNAME' : \"((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)([a-zA-Z])+)\",\n 'TIME' : \"\\d\\d:\\d\\d:\\d\\d\",\n 'SYSLOG_DATE' : \"\\w{3}\\s+\\d{1,2}\\s\\d\\d:\\d\\d:\\d\\d\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L31_C0", "label": "__init__", "type": "function", "loc": [31, 32], "level": 0, "parent": null, "vector": [2, 0, 0.6058, 0.0385, 0, 0.66, 0.8571, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def __init__(self, log):\n self.logdata = open(log, 'r').readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L32_C4", "label": "self.logdata = readlines()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L31_C0", "vector": [14, 1, 0.6154, 0.0192, 1, 0.18, 0.0, 758, 3, 0, 0, 0, 841, 10, 2], "semantic": {"name": "self.logdata", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": " self.logdata = open(log, 'r').readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L34_C0", "label": "ProfileRegexp", "type": "function", "loc": [34, 37], "level": 0, "parent": null, "vector": [2, 0, 0.6827, 0.0769, 0, 0.66, 0.9286, 408, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "ProfileRegexp", "arg_names": ["self", "regexp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ProfileRegexp(self, regexp):\n cProfile.run('self.Profilewrap(regexp)', 'profiler.out')\n profstats = pstats.Stats('profiler.out')\n profstats.print_stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Expr_L35_C4", "label": "run()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L34_C0", "vector": [8, 1, 0.6731, 0.0192, 1, 0.52, 0.0, 679, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " cProfile.run('self.Profilewrap(regexp)', 'profiler.out')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L36_C4", "label": "profstats = Stats()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L34_C0", "vector": [14, 1, 0.6923, 0.0192, 1, 0.52, 0.5, 862, 3, 1, 0, 0, 458, 10, 1], "semantic": {"name": "profstats", "arg_names": [], "import_names": [], "rhs_call_name": "Stats", "annotation": ""}, "snippet": " profstats = pstats.Stats('profiler.out')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Expr_L37_C4", "label": "print_stats()", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L34_C0", "vector": [8, 1, 0.7115, 0.0192, 1, 0.52, 1.0, 764, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " profstats.print_stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L39_C0", "label": "ProfileWrap", "type": "function", "loc": [39, 49], "level": 0, "parent": null, "vector": [2, 0, 0.8462, 0.2115, 0, 0.66, 1.0, 470, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "ProfileWrap", "arg_names": ["self", "regexp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ProfileWrap(self, regexp):\n for line in self.logdata:\n for alias in self.aliases:\n tmp_al = \"\"\n tmp_al = \"\\\\\" + alias;\n regexp = regexp.replace(tmp_al, self.aliases[alias])\n result = re.findall(regexp, line)\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L40_C4", "label": "for line", "type": "for", "loc": [40, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L39_C0", "vector": [6, 1, 0.8558, 0.1923, 1, 0.95, 0.0, 373, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in self.logdata:\n for alias in self.aliases:\n tmp_al = \"\"\n tmp_al = \"\\\\\" + alias;\n regexp = regexp.replace(tmp_al, self.aliases[alias])\n result = re.findall(regexp, line)\n try:\n tmp = result[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L41_C8", "label": "for alias", "type": "for", "loc": [41, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L40_C4", "vector": [6, 2, 0.8173, 0.0769, 2, 0.07, 0.0, 657, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for alias in self.aliases:\n tmp_al = \"\"\n tmp_al = \"\\\\\" + alias;\n regexp = regexp.replace(tmp_al, self.aliases[alias])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L42_C12", "label": "tmp_al =", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L41_C8", "vector": [14, 3, 0.8077, 0.0192, 3, 0.84, 0.0, 560, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tmp_al", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmp_al = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L43_C12", "label": "tmp_al =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L41_C8", "vector": [14, 3, 0.8269, 0.0192, 3, 0.84, 0.5, 560, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmp_al", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmp_al = \"\\\\\" + alias;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L44_C12", "label": "regexp = replace()", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L41_C8", "vector": [14, 3, 0.8462, 0.0192, 3, 0.84, 1.0, 982, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "regexp", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " regexp = regexp.replace(tmp_al, self.aliases[alias])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L45_C8", "label": "result = findall()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L40_C4", "vector": [14, 2, 0.8654, 0.0192, 2, 0.07, 0.5, 51, 3, 2, 0, 0, 737, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "findall", "annotation": ""}, "snippet": " result = re.findall(regexp, line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Try_L46_C8", "label": "try", "type": "try", "loc": [46, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L40_C4", "vector": [7, 2, 0.9135, 0.0769, 2, 0.07, 1.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n tmp = result[0]\n except IndexError:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L47_C12", "label": "tmp =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99993:Try_L46_C8", "vector": [14, 3, 0.9038, 0.0192, 3, 0.83, 0.0, 517, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmp = result[0]"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Try_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99993:Try_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99993:Assign_L47_C12"}]
#!/usr/bin/python # -*- coding: iso-8859-1 -*- # # progressbar - Text progressbar library for python. # Copyright (c) 2005 Nilton Volpato # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """Text progressbar library for python. This library provides a text mode progressbar. This is tipically used to display the progress of a long running operation, providing a visual clue that processing is underway. The ProgressBar class manages the progress, and the format of the line is given by a number of widgets. A widget is an object that may display diferently depending on the state of the progress. There are three types of widget: - a string, which always shows itself; - a ProgressBarWidget, which may return a diferent value every time it's update method is called; and - a ProgressBarWidgetHFill, which is like ProgressBarWidget, except it expands to fill the remaining width of the line. The progressbar module is very easy to use, yet very powerful. And automatically supports features like auto-resizing when available. """ __author__ = "Nilton Volpato" __author_email__ = "first-name dot last-name @ gmail.com" __date__ = "2006-05-07" __version__ = "2.2" # Changelog # # 2006-05-07: v2.2 fixed bug in windows # 2005-12-04: v2.1 autodetect terminal width, added start method # 2005-12-04: v2.0 everything is now a widget (wow!) # 2005-12-03: v1.0 rewrite using widgets # 2005-06-02: v0.5 rewrite # 2004-??-??: v0.1 first version import sys, time from array import array try: from fcntl import ioctl import termios except ImportError: pass import signal class ProgressBarWidget(object): """This is an element of ProgressBar formatting. The ProgressBar object will call it's update value when an update is needed. It's size may change between call, but the results will not be good if the size changes drastically and repeatedly. """ def update(self, pbar): """Returns the string representing the widget. The parameter pbar is a reference to the calling ProgressBar, where one can access attributes of the class for knowing how the update must be made. At least this function must be overriden.""" pass class ProgressBarWidgetHFill(object): """This is a variable width element of ProgressBar formatting. The ProgressBar object will call it's update value, informing the width this object must the made. This is like TeX \\hfill, it will expand to fill the line. You can use more than one in the same line, and they will all have the same width, and together will fill the line. """ def update(self, pbar, width): """Returns the string representing the widget. The parameter pbar is a reference to the calling ProgressBar, where one can access attributes of the class for knowing how the update must be made. The parameter width is the total horizontal width the widget must have. At least this function must be overriden.""" pass class ETA(ProgressBarWidget): "Widget for the Estimated Time of Arrival" def format_time(self, seconds): return time.strftime('%H:%M:%S', time.gmtime(seconds)) def update(self, pbar): if pbar.currval == 0: return 'ETA: --:--:--' elif pbar.finished: return 'Time: %s' % self.format_time(pbar.seconds_elapsed) else: elapsed = pbar.seconds_elapsed eta = elapsed * pbar.maxval / pbar.currval - elapsed return 'ETA: %s' % self.format_time(eta) class FileTransferSpeed(ProgressBarWidget): "Widget for showing the transfer speed (useful for file transfers)." def __init__(self): self.fmt = '%6.2f %s' self.units = ['B', 'K', 'M', 'G', 'T', 'P'] def update(self, pbar): if pbar.seconds_elapsed < 2e-6:#== 0: bps = 0.0 else: bps = float(pbar.currval) / pbar.seconds_elapsed spd = bps for u in self.units: if spd < 1000: break spd /= 1000 return self.fmt % (spd, u + '/s') class RotatingMarker(ProgressBarWidget): "A rotating marker for filling the bar of progress." def __init__(self, markers='|/-\\'): self.markers = markers self.curmark = -1 def update(self, pbar): if pbar.finished: return self.markers[0] self.curmark = (self.curmark + 1) % len(self.markers) return self.markers[self.curmark] class Percentage(ProgressBarWidget): "Just the percentage done." def update(self, pbar): return '%3d%%' % pbar.percentage() class SimpleProgress(ProgressBarWidget): "Simple Progress: returns what is already done and the total, e.g. '5 of 47'" def update(self, pbar): return '%d of %d' % (pbar.currval, pbar.maxval) class Bar(ProgressBarWidgetHFill): "The bar of progress. It will strech to fill the line." def __init__(self, marker='#', left='|', right='|'): self.marker = marker self.left = left self.right = right def _format_marker(self, pbar): if isinstance(self.marker, (str, unicode)): return self.marker else: return self.marker.update(pbar) def update(self, pbar, width): percent = pbar.percentage() cwidth = width - len(self.left) - len(self.right) marked_width = int(percent * cwidth / 100) m = self._format_marker(pbar) bar = (self.left + (m * marked_width).ljust(cwidth) + self.right) return bar class ReverseBar(Bar): "The reverse bar of progress, or bar of regress. :)" def update(self, pbar, width): percent = pbar.percentage() cwidth = width - len(self.left) - len(self.right) marked_width = int(percent * cwidth / 100) m = self._format_marker(pbar) bar = (self.left + (m * marked_width).rjust(cwidth) + self.right) return bar default_widgets = [Percentage(), ' ', Bar()] class ProgressBar(object): """This is the ProgressBar class, it updates and prints the bar. The term_width parameter may be an integer. Or None, in which case it will try to guess it, if it fails it will default to 80 columns. The simple use is like this: >>> pbar = ProgressBar().start() >>> for i in xrange(100): ... # do something ... pbar.update(i+1) ... >>> pbar.finish() But anything you want to do is possible (well, almost anything). You can supply different widgets of any type in any order. And you can even write your own widgets! There are many widgets already shipped and you should experiment with them. When implementing a widget update method you may access any attribute or function of the ProgressBar object calling the widget's update method. The most important attributes you would like to access are: - currval: current value of the progress, 0 <= currval <= maxval - maxval: maximum (and final) value of the progress - finished: True if the bar is have finished (reached 100%), False o/w - start_time: first time update() method of ProgressBar was called - seconds_elapsed: seconds elapsed since start_time - percentage(): percentage of the progress (this is a method) """ def __init__(self, maxval=100, widgets=default_widgets, term_width=None, fd=sys.stderr): assert maxval > 0 self.maxval = maxval self.widgets = widgets self.fd = fd self.signal_set = False if term_width is None: try: self.handle_resize(None, None) signal.signal(signal.SIGWINCH, self.handle_resize) self.signal_set = True except: self.term_width = 79 else: self.term_width = term_width self.currval = 0 self.finished = False self.prev_percentage = -1 self.start_time = None self.seconds_elapsed = 0 def handle_resize(self, signum, frame): h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\0' * 8))[:2] self.term_width = w def percentage(self): "Returns the percentage of the progress." return self.currval * 100.0 / self.maxval def _format_widgets(self): r = [] hfill_inds = [] num_hfill = 0 currwidth = 0 for i, w in enumerate(self.widgets): if isinstance(w, ProgressBarWidgetHFill): r.append(w) hfill_inds.append(i) num_hfill += 1 elif isinstance(w, (str, unicode)): r.append(w) currwidth += len(w) else: weval = w.update(self) currwidth += len(weval) r.append(weval) for iw in hfill_inds: r[iw] = r[iw].update(self, (self.term_width - currwidth) / num_hfill) return r def _format_line(self): return ''.join(self._format_widgets()).ljust(self.term_width) def _need_update(self): return int(self.percentage()) != int(self.prev_percentage) def update(self, value): "Updates the progress bar to a new value." assert 0 <= value <= self.maxval self.currval = value if not self._need_update() or self.finished: return if not self.start_time: self.start_time = time.time() self.seconds_elapsed = time.time() - self.start_time self.prev_percentage = self.percentage() if value != self.maxval: self.fd.write(self._format_line() + '\r') else: self.finished = True self.fd.write(self._format_line() + '\n') def start(self): """Start measuring time, and prints the bar at 0%. It returns self so you can use it like this: >>> pbar = ProgressBar().start() >>> for i in xrange(100): ... # do something ... pbar.update(i+1) ... >>> pbar.finish() """ self.update(0) return self def finish(self): """Used to tell the progress is finished.""" self.update(self.maxval) if self.signal_set: signal.signal(signal.SIGWINCH, signal.SIG_DFL) if __name__ == '__main__': import os def example1(): widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()), ' ', ETA(), ' ', FileTransferSpeed()] pbar = ProgressBar(widgets=widgets, maxval=10000000).start() for i in range(1000000): # do something pbar.update(10 * i + 1) pbar.finish() print def example2(): class CrazyFileTransferSpeed(FileTransferSpeed): "It's bigger between 45 and 80 percent" def update(self, pbar): if 45 < pbar.percentage() < 80: return 'Bigger Now ' + FileTransferSpeed.update(self, pbar) else: return FileTransferSpeed.update(self, pbar) widgets = [CrazyFileTransferSpeed(), ' <<<', Bar(), '>>> ', Percentage(), ' ', ETA()] pbar = ProgressBar(widgets=widgets, maxval=10000000) # maybe do something pbar.start() for i in range(2000000): # do something pbar.update(5 * i + 1) pbar.finish() print def example3(): widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')] pbar = ProgressBar(widgets=widgets, maxval=10000000).start() for i in range(1000000): # do something pbar.update(10 * i + 1) pbar.finish() print def example4(): widgets = ['Test: ', Percentage(), ' ', Bar(marker='0', left='[', right=']'), ' ', ETA(), ' ', FileTransferSpeed()] pbar = ProgressBar(widgets=widgets, maxval=500) pbar.start() for i in range(100, 500 + 1, 50): time.sleep(0.2) pbar.update(i) pbar.finish() print example1() example2() example3() example4()
ajibawa-2023/Python-Code-Large/train/row_99995
199
373
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L22_C0", "label": "expression", "type": "expression", "loc": [22, 40], "level": 0, "parent": null, "vector": [8, 0, 0.0831, 0.0509, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Text progressbar library for python.\n\nThis library provides a text mode progressbar. This is tipically used\nto display the progress of a long running operation, providing a\nvisual clue that processing is underway.\n\nThe ProgressBar class manages the progress, and the format of the line\nis given by a number of widgets. A widget is an object that may"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L42_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.1126, 0.0027, 0, 0.66, 0.05, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = \"Nilton Volpato\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L43_C0", "label": "__author_email__ =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.1153, 0.0027, 0, 0.66, 0.1, 827, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author_email__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author_email__ = \"first-name dot last-name @ gmail.com\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L44_C0", "label": "__date__ =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.118, 0.0027, 0, 0.66, 0.15, 763, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__date__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__date__ = \"2006-05-07\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L45_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.1206, 0.0027, 0, 0.66, 0.2, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"2.2\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Import_L57_C0", "label": "sys import sys, time", "type": "import", "loc": [57, 57], "level": 0, "parent": null, "vector": [1, 0, 0.1528, 0.0027, 0, 0.66, 0.25, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ImportFrom_L58_C0", "label": "from array import array", "type": "import", "loc": [58, 58], "level": 0, "parent": null, "vector": [1, 0, 0.1555, 0.0027, 0, 0.66, 0.3, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": ["array"], "rhs_call_name": "", "annotation": ""}, "snippet": "from array import array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L59_C0", "label": "try", "type": "try", "loc": [59, 63], "level": 0, "parent": null, "vector": [7, 0, 0.1635, 0.0134, 0, 0.66, 0.35, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from fcntl import ioctl\n import termios\nexcept ImportError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ImportFrom_L60_C4", "label": "from fcntl import ioctl", "type": "import", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L59_C0", "vector": [1, 1, 0.1609, 0.0027, 1, 0.94, 0.0, 488, 0, 1, 0, 0, 488, 0, 0], "semantic": {"name": "fcntl", "arg_names": [], "import_names": ["ioctl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from fcntl import ioctl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Import_L61_C4", "label": "termios import termios", "type": "import", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L59_C0", "vector": [1, 1, 0.1635, 0.0027, 1, 0.94, 1.0, 139, 0, 1, 0, 0, 139, 0, 0], "semantic": {"name": "termios", "arg_names": [], "import_names": ["termios"], "rhs_call_name": "", "annotation": ""}, "snippet": " import termios"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Import_L64_C0", "label": "signal import signal", "type": "import", "loc": [64, 64], "level": 0, "parent": null, "vector": [1, 0, 0.1716, 0.0027, 0, 0.66, 0.4, 621, 0, 1, 0, 0, 621, 0, 0], "semantic": {"name": "signal", "arg_names": [], "import_names": ["signal"], "rhs_call_name": "", "annotation": ""}, "snippet": "import signal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L66_C0", "label": "ProgressBarWidget", "type": "class", "loc": [66, 81], "level": 0, "parent": null, "vector": [3, 0, 0.1971, 0.0429, 0, 0.66, 0.45, 196, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "ProgressBarWidget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProgressBarWidget(object):\n \"\"\"This is an element of ProgressBar formatting.\n\n The ProgressBar object will call it's update value when an update\n is needed. It's size may change between call, but the results will\n not be good if the size changes drastically and repeatedly.\n \"\"\"\n def update(self, pbar):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L67_C4", "label": "expression", "type": "expression", "loc": [67, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L66_C0", "vector": [8, 1, 0.1863, 0.0161, 1, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This is an element of ProgressBar formatting.\n\n The ProgressBar object will call it's update value when an update\n is needed. It's size may change between call, but the results will\n not be good if the size changes drastically and repeatedly.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L73_C4", "label": "update", "type": "function", "loc": [73, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L66_C0", "vector": [2, 1, 0.2064, 0.0241, 1, 0.0, 1.0, 637, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n \"\"\"Returns the string representing the widget.\n\n The parameter pbar is a reference to the calling ProgressBar,\n where one can access attributes of the class for knowing how\n the update must be made.\n\n At least this function must be overriden.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L74_C8", "label": "expression", "type": "expression", "loc": [74, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L73_C4", "vector": [8, 2, 0.2064, 0.0188, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the string representing the widget.\n\n The parameter pbar is a reference to the calling ProgressBar,\n where one can access attributes of the class for knowing how\n the update must be made.\n\n At least this function must be overriden.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L83_C0", "label": "ProgressBarWidgetHFill", "type": "class", "loc": [83, 101], "level": 0, "parent": null, "vector": [3, 0, 0.2466, 0.0509, 0, 0.66, 0.5, 335, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "ProgressBarWidgetHFill", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProgressBarWidgetHFill(object):\n \"\"\"This is a variable width element of ProgressBar formatting.\n\n The ProgressBar object will call it's update value, informing the\n width this object must the made. This is like TeX \\\\hfill, it will\n expand to fill the line. You can use more than one in the same\n line, and they will all have the same width, and together will\n fill the line."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L84_C4", "label": "expression", "type": "expression", "loc": [84, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L83_C0", "vector": [8, 1, 0.2346, 0.0214, 1, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This is a variable width element of ProgressBar formatting.\n\n The ProgressBar object will call it's update value, informing the\n width this object must the made. This is like TeX \\\\hfill, it will\n expand to fill the line. You can use more than one in the same\n line, and they will all have the same width, and together will\n fill the line.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L92_C4", "label": "update", "type": "function", "loc": [92, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L83_C0", "vector": [2, 1, 0.2587, 0.0268, 1, 0.87, 1.0, 637, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "update", "arg_names": ["self", "pbar", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar, width):\n \"\"\"Returns the string representing the widget.\n\n The parameter pbar is a reference to the calling ProgressBar,\n where one can access attributes of the class for knowing how\n the update must be made. The parameter width is the total\n horizontal width the widget must have.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L93_C8", "label": "expression", "type": "expression", "loc": [93, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L92_C4", "vector": [8, 2, 0.2587, 0.0214, 2, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the string representing the widget.\n\n The parameter pbar is a reference to the calling ProgressBar,\n where one can access attributes of the class for knowing how\n the update must be made. The parameter width is the total\n horizontal width the widget must have.\n\n At least this function must be overriden.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L104_C0", "label": "ETA", "type": "class", "loc": [104, 116], "level": 0, "parent": null, "vector": [3, 0, 0.2949, 0.0349, 0, 0.66, 0.55, 292, 0, 2, 0, 0, 196, 0, 4], "semantic": {"name": "ETA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ETA(ProgressBarWidget):\n \"Widget for the Estimated Time of Arrival\"\n def format_time(self, seconds):\n return time.strftime('%H:%M:%S', time.gmtime(seconds))\n def update(self, pbar):\n if pbar.currval == 0:\n return 'ETA: --:--:--'\n elif pbar.finished:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L105_C4", "label": "expression", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L104_C0", "vector": [8, 1, 0.2815, 0.0027, 1, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Widget for the Estimated Time of Arrival\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L106_C4", "label": "format_time", "type": "function", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L104_C0", "vector": [2, 1, 0.2855, 0.0054, 1, 0.77, 0.5, 294, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "format_time", "arg_names": ["self", "seconds"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def format_time(self, seconds):\n return time.strftime('%H:%M:%S', time.gmtime(seconds))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L106_C4", "vector": [13, 2, 0.2869, 0.0027, 2, 0.17, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return time.strftime('%H:%M:%S', time.gmtime(seconds))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L108_C4", "label": "update", "type": "function", "loc": [108, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L104_C0", "vector": [2, 1, 0.3003, 0.0241, 1, 0.77, 1.0, 637, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n if pbar.currval == 0:\n return 'ETA: --:--:--'\n elif pbar.finished:\n return 'Time: %s' % self.format_time(pbar.seconds_elapsed)\n else:\n elapsed = pbar.seconds_elapsed\n eta = elapsed * pbar.maxval / pbar.currval - elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L109_C8", "label": "if", "type": "if", "loc": [109, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L108_C4", "vector": [4, 2, 0.3016, 0.0214, 2, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pbar.currval == 0:\n return 'ETA: --:--:--'\n elif pbar.finished:\n return 'Time: %s' % self.format_time(pbar.seconds_elapsed)\n else:\n elapsed = pbar.seconds_elapsed\n eta = elapsed * pbar.maxval / pbar.currval - elapsed\n return 'ETA: %s' % self.format_time(eta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L110_C12", "label": "return", "type": "return", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L109_C8", "vector": [13, 3, 0.2949, 0.0027, 3, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'ETA: --:--:--'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "label": "if", "type": "if", "loc": [111, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L109_C8", "vector": [4, 3, 0.3043, 0.0161, 3, 0.26, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif pbar.finished:\n return 'Time: %s' % self.format_time(pbar.seconds_elapsed)\n else:\n elapsed = pbar.seconds_elapsed\n eta = elapsed * pbar.maxval / pbar.currval - elapsed\n return 'ETA: %s' % self.format_time(eta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L112_C12", "label": "return", "type": "return", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "vector": [13, 4, 0.3003, 0.0027, 4, 0.23, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Time: %s' % self.format_time(pbar.seconds_elapsed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L114_C12", "label": "elapsed =", "type": "assigned_variable", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "vector": [14, 4, 0.3056, 0.0027, 4, 0.23, 0.3333, 61, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "elapsed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elapsed = pbar.seconds_elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L115_C12", "label": "eta =", "type": "assigned_variable", "loc": [115, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "vector": [14, 4, 0.3083, 0.0027, 4, 0.23, 0.6667, 870, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "eta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " eta = elapsed * pbar.maxval / pbar.currval - elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L116_C12", "label": "return", "type": "return", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "vector": [13, 4, 0.311, 0.0027, 4, 0.23, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'ETA: %s' % self.format_time(eta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L118_C0", "label": "FileTransferSpeed", "type": "class", "loc": [118, 133], "level": 0, "parent": null, "vector": [3, 0, 0.3365, 0.0429, 0, 0.66, 0.6, 29, 0, 2, 0, 0, 196, 0, 1], "semantic": {"name": "FileTransferSpeed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FileTransferSpeed(ProgressBarWidget):\n \"Widget for showing the transfer speed (useful for file transfers).\"\n def __init__(self):\n self.fmt = '%6.2f %s'\n self.units = ['B', 'K', 'M', 'G', 'T', 'P']\n def update(self, pbar):\n if pbar.seconds_elapsed < 2e-6:#== 0:\n bps = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L119_C4", "label": "expression", "type": "expression", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L118_C0", "vector": [8, 1, 0.319, 0.0027, 1, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Widget for showing the transfer speed (useful for file transfers).\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L120_C4", "label": "__init__", "type": "function", "loc": [120, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L118_C0", "vector": [2, 1, 0.3244, 0.008, 1, 0.57, 0.5, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.fmt = '%6.2f %s'\n self.units = ['B', 'K', 'M', 'G', 'T', 'P']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L121_C8", "label": "self.fmt =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L120_C4", "vector": [14, 2, 0.3244, 0.0027, 2, 0.86, 0.0, 111, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.fmt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fmt = '%6.2f %s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L122_C8", "label": "self.units =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L120_C4", "vector": [14, 2, 0.3271, 0.0027, 2, 0.86, 1.0, 508, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.units", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.units = ['B', 'K', 'M', 'G', 'T', 'P']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "label": "update", "type": "function", "loc": [123, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L118_C0", "vector": [2, 1, 0.3432, 0.0295, 1, 0.57, 1.0, 637, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n if pbar.seconds_elapsed < 2e-6:#== 0:\n bps = 0.0\n else:\n bps = float(pbar.currval) / pbar.seconds_elapsed\n spd = bps\n for u in self.units:\n if spd < 1000:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L124_C8", "label": "if", "type": "if", "loc": [124, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "vector": [4, 2, 0.3365, 0.0107, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pbar.seconds_elapsed < 2e-6:#== 0:\n bps = 0.0\n else:\n bps = float(pbar.currval) / pbar.seconds_elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L125_C12", "label": "bps =", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L124_C8", "vector": [14, 3, 0.3351, 0.0027, 3, 0.9, 0.0, 90, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bps = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L127_C12", "label": "bps =", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L124_C8", "vector": [14, 3, 0.3405, 0.0027, 3, 0.9, 1.0, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bps = float(pbar.currval) / pbar.seconds_elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L128_C8", "label": "spd =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "vector": [14, 2, 0.3432, 0.0027, 2, 0.02, 0.3333, 974, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "spd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " spd = bps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L129_C8", "label": "for u", "type": "for", "loc": [129, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "vector": [6, 2, 0.3499, 0.0107, 2, 0.02, 0.6667, 609, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "u", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for u in self.units:\n if spd < 1000:\n break\n spd /= 1000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L130_C12", "label": "if", "type": "if", "loc": [130, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L129_C8", "vector": [4, 3, 0.3499, 0.0054, 3, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if spd < 1000:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L133_C8", "label": "return", "type": "return", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "vector": [13, 2, 0.3566, 0.0027, 2, 0.02, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.fmt % (spd, u + '/s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L135_C0", "label": "RotatingMarker", "type": "class", "loc": [135, 144], "level": 0, "parent": null, "vector": [3, 0, 0.374, 0.0268, 0, 0.66, 0.65, 956, 0, 2, 0, 0, 196, 0, 1], "semantic": {"name": "RotatingMarker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RotatingMarker(ProgressBarWidget):\n \"A rotating marker for filling the bar of progress.\"\n def __init__(self, markers='|/-\\\\'):\n self.markers = markers\n self.curmark = -1\n def update(self, pbar):\n if pbar.finished:\n return self.markers[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L136_C4", "label": "expression", "type": "expression", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L135_C0", "vector": [8, 1, 0.3646, 0.0027, 1, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"A rotating marker for filling the bar of progress.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L137_C4", "label": "__init__", "type": "function", "loc": [137, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L135_C0", "vector": [2, 1, 0.37, 0.008, 1, 0.35, 0.5, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "markers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, markers='|/-\\\\'):\n self.markers = markers\n self.curmark = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L138_C8", "label": "self.markers =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L137_C4", "vector": [14, 2, 0.37, 0.0027, 2, 0.83, 0.0, 796, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.markers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.markers = markers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L139_C8", "label": "self.curmark =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L137_C4", "vector": [14, 2, 0.3727, 0.0027, 2, 0.83, 1.0, 123, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.curmark", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curmark = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L140_C4", "label": "update", "type": "function", "loc": [140, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L135_C0", "vector": [2, 1, 0.3807, 0.0134, 1, 0.35, 1.0, 637, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n if pbar.finished:\n return self.markers[0]\n self.curmark = (self.curmark + 1) % len(self.markers)\n return self.markers[self.curmark]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L141_C8", "label": "if", "type": "if", "loc": [141, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L140_C4", "vector": [4, 2, 0.3794, 0.0054, 2, 0.06, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pbar.finished:\n return self.markers[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L142_C12", "label": "return", "type": "return", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L141_C8", "vector": [13, 3, 0.3807, 0.0027, 3, 0.11, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.markers[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L143_C8", "label": "self.curmark =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L140_C4", "vector": [14, 2, 0.3834, 0.0027, 2, 0.06, 0.5, 123, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.curmark", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curmark = (self.curmark + 1) % len(self.markers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L144_C8", "label": "return", "type": "return", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L140_C4", "vector": [13, 2, 0.3861, 0.0027, 2, 0.06, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.markers[self.curmark]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L146_C0", "label": "Percentage", "type": "class", "loc": [146, 149], "level": 0, "parent": null, "vector": [3, 0, 0.3954, 0.0107, 0, 0.66, 0.7, 165, 0, 1, 0, 0, 196, 0, 1], "semantic": {"name": "Percentage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Percentage(ProgressBarWidget):\n \"Just the percentage done.\"\n def update(self, pbar):\n return '%3d%%' % pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L147_C4", "label": "expression", "type": "expression", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L146_C0", "vector": [8, 1, 0.3941, 0.0027, 1, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Just the percentage done.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L148_C4", "label": "update", "type": "function", "loc": [148, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L146_C0", "vector": [2, 1, 0.3981, 0.0054, 1, 0.76, 1.0, 637, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n return '%3d%%' % pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L149_C8", "label": "return", "type": "return", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L148_C4", "vector": [13, 2, 0.3995, 0.0027, 2, 0.27, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%3d%%' % pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L151_C0", "label": "SimpleProgress", "type": "class", "loc": [151, 154], "level": 0, "parent": null, "vector": [3, 0, 0.4088, 0.0107, 0, 0.66, 0.75, 930, 0, 1, 0, 0, 196, 0, 0], "semantic": {"name": "SimpleProgress", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimpleProgress(ProgressBarWidget):\n \"Simple Progress: returns what is already done and the total, e.g. '5 of 47'\"\n def update(self, pbar):\n return '%d of %d' % (pbar.currval, pbar.maxval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L152_C4", "label": "expression", "type": "expression", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L151_C0", "vector": [8, 1, 0.4075, 0.0027, 1, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Simple Progress: returns what is already done and the total, e.g. '5 of 47'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L153_C4", "label": "update", "type": "function", "loc": [153, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L151_C0", "vector": [2, 1, 0.4115, 0.0054, 1, 0.94, 1.0, 637, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n return '%d of %d' % (pbar.currval, pbar.maxval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L154_C8", "label": "return", "type": "return", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L153_C4", "vector": [13, 2, 0.4129, 0.0027, 2, 0.85, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%d of %d' % (pbar.currval, pbar.maxval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "label": "Bar", "type": "class", "loc": [156, 173], "level": 0, "parent": null, "vector": [3, 0, 0.441, 0.0483, 0, 0.66, 0.8, 854, 0, 3, 0, 0, 335, 0, 8], "semantic": {"name": "Bar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Bar(ProgressBarWidgetHFill):\n \"The bar of progress. It will strech to fill the line.\"\n def __init__(self, marker='#', left='|', right='|'):\n self.marker = marker\n self.left = left\n self.right = right\n def _format_marker(self, pbar):\n if isinstance(self.marker, (str, unicode)):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L157_C4", "label": "expression", "type": "expression", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "vector": [8, 1, 0.4209, 0.0027, 1, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"The bar of progress. It will strech to fill the line.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L158_C4", "label": "__init__", "type": "function", "loc": [158, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "vector": [2, 1, 0.4276, 0.0107, 1, 0.78, 0.3333, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "marker", "left", "right"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, marker='#', left='|', right='|'):\n self.marker = marker\n self.left = left\n self.right = right"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L159_C8", "label": "self.marker =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L158_C4", "vector": [14, 2, 0.4263, 0.0027, 2, 0.25, 0.0, 371, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.marker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.marker = marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L160_C8", "label": "self.left =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L158_C4", "vector": [14, 2, 0.429, 0.0027, 2, 0.25, 0.5, 643, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.left = left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L161_C8", "label": "self.right =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L158_C4", "vector": [14, 2, 0.4316, 0.0027, 2, 0.25, 1.0, 683, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right = right"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L162_C4", "label": "_format_marker", "type": "function", "loc": [162, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "vector": [2, 1, 0.4397, 0.0134, 1, 0.78, 0.6667, 142, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_format_marker", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_marker(self, pbar):\n if isinstance(self.marker, (str, unicode)):\n return self.marker\n else:\n return self.marker.update(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L163_C8", "label": "if", "type": "if", "loc": [163, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L162_C4", "vector": [4, 2, 0.441, 0.0107, 2, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(self.marker, (str, unicode)):\n return self.marker\n else:\n return self.marker.update(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L164_C12", "label": "return", "type": "return", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L163_C8", "vector": [13, 3, 0.4397, 0.0027, 3, 0.59, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L166_C12", "label": "return", "type": "return", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L163_C8", "vector": [13, 3, 0.445, 0.0027, 3, 0.59, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.marker.update(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "label": "update", "type": "function", "loc": [167, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "vector": [2, 1, 0.4558, 0.0188, 1, 0.78, 1.0, 637, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "update", "arg_names": ["self", "pbar", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar, width):\n percent = pbar.percentage()\n cwidth = width - len(self.left) - len(self.right)\n marked_width = int(percent * cwidth / 100)\n m = self._format_marker(pbar)\n bar = (self.left + (m * marked_width).ljust(cwidth) + self.right)\n return bar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L168_C8", "label": "percent = percentage()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "vector": [14, 2, 0.4504, 0.0027, 2, 0.7, 0.0, 948, 3, 0, 0, 0, 568, 10, 1], "semantic": {"name": "percent", "arg_names": [], "import_names": [], "rhs_call_name": "percentage", "annotation": ""}, "snippet": " percent = pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L169_C8", "label": "cwidth =", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "vector": [14, 2, 0.4531, 0.0027, 2, 0.7, 0.2, 217, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cwidth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cwidth = width - len(self.left) - len(self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L170_C8", "label": "marked_width = int()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "vector": [14, 2, 0.4558, 0.0027, 2, 0.7, 0.4, 478, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "marked_width", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " marked_width = int(percent * cwidth / 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L171_C8", "label": "m = _format_marker()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "vector": [14, 2, 0.4584, 0.0027, 2, 0.7, 0.6, 711, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "_format_marker", "annotation": ""}, "snippet": " m = self._format_marker(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L172_C8", "label": "bar =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "vector": [14, 2, 0.4611, 0.0027, 2, 0.7, 0.8, 300, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bar = (self.left + (m * marked_width).ljust(cwidth) + self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L173_C8", "label": "return", "type": "return", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "vector": [13, 2, 0.4638, 0.0027, 2, 0.7, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L175_C0", "label": "ReverseBar", "type": "class", "loc": [175, 183], "level": 0, "parent": null, "vector": [3, 0, 0.4799, 0.0241, 0, 0.66, 0.85, 205, 0, 1, 0, 0, 854, 0, 6], "semantic": {"name": "ReverseBar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ReverseBar(Bar):\n \"The reverse bar of progress, or bar of regress. :)\"\n def update(self, pbar, width):\n percent = pbar.percentage()\n cwidth = width - len(self.left) - len(self.right)\n marked_width = int(percent * cwidth / 100)\n m = self._format_marker(pbar)\n bar = (self.left + (m * marked_width).rjust(cwidth) + self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L176_C4", "label": "expression", "type": "expression", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L175_C0", "vector": [8, 1, 0.4718, 0.0027, 1, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"The reverse bar of progress, or bar of regress. :)\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "label": "update", "type": "function", "loc": [177, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L175_C0", "vector": [2, 1, 0.4826, 0.0188, 1, 0.61, 1.0, 637, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "update", "arg_names": ["self", "pbar", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar, width):\n percent = pbar.percentage()\n cwidth = width - len(self.left) - len(self.right)\n marked_width = int(percent * cwidth / 100)\n m = self._format_marker(pbar)\n bar = (self.left + (m * marked_width).rjust(cwidth) + self.right)\n return bar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L178_C8", "label": "percent = percentage()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "vector": [14, 2, 0.4772, 0.0027, 2, 0.06, 0.0, 948, 3, 0, 0, 0, 568, 10, 1], "semantic": {"name": "percent", "arg_names": [], "import_names": [], "rhs_call_name": "percentage", "annotation": ""}, "snippet": " percent = pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L179_C8", "label": "cwidth =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "vector": [14, 2, 0.4799, 0.0027, 2, 0.06, 0.2, 217, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cwidth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cwidth = width - len(self.left) - len(self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L180_C8", "label": "marked_width = int()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "vector": [14, 2, 0.4826, 0.0027, 2, 0.06, 0.4, 478, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "marked_width", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " marked_width = int(percent * cwidth / 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L181_C8", "label": "m = _format_marker()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "vector": [14, 2, 0.4853, 0.0027, 2, 0.06, 0.6, 711, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "_format_marker", "annotation": ""}, "snippet": " m = self._format_marker(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L182_C8", "label": "bar =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "vector": [14, 2, 0.4879, 0.0027, 2, 0.06, 0.8, 300, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bar = (self.left + (m * marked_width).rjust(cwidth) + self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "vector": [13, 2, 0.4906, 0.0027, 2, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L185_C0", "label": "default_widgets =", "type": "assigned_variable", "loc": [185, 185], "level": 0, "parent": null, "vector": [14, 0, 0.496, 0.0027, 0, 0.66, 0.9, 688, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "default_widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "default_widgets = [Percentage(), ' ', Bar()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "label": "ProgressBar", "type": "class", "loc": [186, 308], "level": 0, "parent": null, "vector": [3, 0, 0.6622, 0.3298, 0, 0.66, 0.95, 657, 0, 9, 0, 0, 186, 0, 32], "semantic": {"name": "ProgressBar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProgressBar(object):\n \"\"\"This is the ProgressBar class, it updates and prints the bar.\n\n The term_width parameter may be an integer. Or None, in which case\n it will try to guess it, if it fails it will default to 80 columns.\n\n The simple use is like this:\n >>> pbar = ProgressBar().start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L187_C4", "label": "expression", "type": "expression", "loc": [187, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [8, 1, 0.5389, 0.0777, 1, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This is the ProgressBar class, it updates and prints the bar.\n\n The term_width parameter may be an integer. Or None, in which case\n it will try to guess it, if it fails it will default to 80 columns.\n\n The simple use is like this:\n >>> pbar = ProgressBar().start()\n >>> for i in xrange(100):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "label": "__init__", "type": "function", "loc": [216, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.6072, 0.059, 1, 0.35, 0.1111, 555, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "maxval", "widgets", "term_width", "fd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, maxval=100, widgets=default_widgets, term_width=None,\n fd=sys.stderr):\n assert maxval > 0\n self.maxval = maxval\n self.widgets = widgets\n self.fd = fd\n self.signal_set = False\n if term_width is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L219_C8", "label": "self.maxval =", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.5871, 0.0027, 2, 0.52, 0.0, 380, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.maxval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.maxval = maxval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L220_C8", "label": "self.widgets =", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.5898, 0.0027, 2, 0.52, 0.1111, 22, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.widgets = widgets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L221_C8", "label": "self.fd =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.5925, 0.0027, 2, 0.52, 0.2222, 362, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.fd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fd = fd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L222_C8", "label": "self.signal_set =", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.5952, 0.0027, 2, 0.52, 0.3333, 467, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.signal_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.signal_set = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L223_C8", "label": "if", "type": "if", "loc": [223, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [4, 2, 0.6086, 0.0241, 2, 0.52, 0.4444, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if term_width is None:\n try:\n self.handle_resize(None, None)\n signal.signal(signal.SIGWINCH, self.handle_resize)\n self.signal_set = True\n except:\n self.term_width = 79\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "label": "try", "type": "try", "loc": [224, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L223_C8", "vector": [7, 3, 0.6072, 0.0161, 3, 0.07, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.handle_resize(None, None)\n signal.signal(signal.SIGWINCH, self.handle_resize)\n self.signal_set = True\n except:\n self.term_width = 79"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L225_C16", "label": "handle_resize()", "type": "expression", "loc": [225, 225], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "vector": [8, 4, 0.6032, 0.0027, 4, 0.85, 0.0, 222, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "handle_resize", "arg_names": [], "import_names": [], "rhs_call_name": "handle_resize", "annotation": ""}, "snippet": " self.handle_resize(None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L226_C16", "label": "signal()", "type": "expression", "loc": [226, 226], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "vector": [8, 4, 0.6059, 0.0027, 4, 0.85, 0.5, 621, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "signal", "arg_names": [], "import_names": [], "rhs_call_name": "signal", "annotation": ""}, "snippet": " signal.signal(signal.SIGWINCH, self.handle_resize)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L227_C16", "label": "self.signal_set =", "type": "assigned_variable", "loc": [227, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "vector": [14, 4, 0.6086, 0.0027, 4, 0.85, 1.0, 467, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.signal_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.signal_set = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L229_C16", "label": "self.term_width =", "type": "assigned_variable", "loc": [229, 229], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "vector": [14, 4, 0.6139, 0.0027, 4, 0.85, 0.0, 23, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.term_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.term_width = 79"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L231_C12", "label": "self.term_width =", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L223_C8", "vector": [14, 3, 0.6193, 0.0027, 3, 0.07, 1.0, 23, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.term_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.term_width = term_width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L233_C8", "label": "self.currval =", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.6247, 0.0027, 2, 0.52, 0.5556, 616, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.currval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.currval = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L234_C8", "label": "self.finished =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.6273, 0.0027, 2, 0.52, 0.6667, 742, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.finished", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.finished = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L235_C8", "label": "self.prev_percentage =", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.63, 0.0027, 2, 0.52, 0.7778, 810, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prev_percentage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prev_percentage = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L236_C8", "label": "self.start_time =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.6327, 0.0027, 2, 0.52, 0.8889, 387, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.start_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start_time = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L237_C8", "label": "self.seconds_elapsed =", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "vector": [14, 2, 0.6354, 0.0027, 2, 0.52, 1.0, 205, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.seconds_elapsed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seconds_elapsed = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L239_C4", "label": "handle_resize", "type": "function", "loc": [239, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.6434, 0.008, 1, 0.35, 0.2222, 222, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "handle_resize", "arg_names": ["self", "signum", "frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_resize(self, signum, frame):\n h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\\0' * 8))[:2]\n self.term_width = w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L240_C8", "label": "h, w =", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L239_C4", "vector": [14, 2, 0.6434, 0.0027, 2, 0.2, 0.0, 493, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h, w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\\0' * 8))[:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L241_C8", "label": "self.term_width =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L239_C4", "vector": [14, 2, 0.6461, 0.0027, 2, 0.2, 1.0, 23, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.term_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.term_width = w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L243_C4", "label": "percentage", "type": "function", "loc": [243, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.6542, 0.008, 1, 0.35, 0.3333, 568, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "percentage", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def percentage(self):\n \"Returns the percentage of the progress.\"\n return self.currval * 100.0 / self.maxval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L244_C8", "label": "expression", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L243_C4", "vector": [8, 2, 0.6542, 0.0027, 2, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns the percentage of the progress.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L245_C8", "label": "return", "type": "return", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L243_C4", "vector": [13, 2, 0.6568, 0.0027, 2, 0.73, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.currval * 100.0 / self.maxval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "label": "_format_widgets", "type": "function", "loc": [247, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.6877, 0.0536, 1, 0.35, 0.4444, 567, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "_format_widgets", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_widgets(self):\n r = []\n hfill_inds = []\n num_hfill = 0\n currwidth = 0\n for i, w in enumerate(self.widgets):\n if isinstance(w, ProgressBarWidgetHFill):\n r.append(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L248_C8", "label": "r =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "vector": [14, 2, 0.6649, 0.0027, 2, 0.34, 0.0, 436, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L249_C8", "label": "hfill_inds =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "vector": [14, 2, 0.6676, 0.0027, 2, 0.34, 0.1667, 534, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "hfill_inds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hfill_inds = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L250_C8", "label": "num_hfill =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "vector": [14, 2, 0.6702, 0.0027, 2, 0.34, 0.3333, 610, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_hfill", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_hfill = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L251_C8", "label": "currwidth =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "vector": [14, 2, 0.6729, 0.0027, 2, 0.34, 0.5, 966, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "currwidth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " currwidth = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L252_C8", "label": "for i, w", "type": "for", "loc": [252, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "vector": [6, 2, 0.6903, 0.0322, 2, 0.34, 0.6667, 517, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i, w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, w in enumerate(self.widgets):\n if isinstance(w, ProgressBarWidgetHFill):\n r.append(w)\n hfill_inds.append(i)\n num_hfill += 1\n elif isinstance(w, (str, unicode)):\n r.append(w)\n currwidth += len(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L253_C12", "label": "if", "type": "if", "loc": [253, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L252_C8", "vector": [4, 3, 0.6917, 0.0295, 3, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(w, ProgressBarWidgetHFill):\n r.append(w)\n hfill_inds.append(i)\n num_hfill += 1\n elif isinstance(w, (str, unicode)):\n r.append(w)\n currwidth += len(w)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L254_C16", "label": "append()", "type": "expression", "loc": [254, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L253_C12", "vector": [8, 4, 0.681, 0.0027, 4, 0.34, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " r.append(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L255_C16", "label": "append()", "type": "expression", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L253_C12", "vector": [8, 4, 0.6836, 0.0027, 4, 0.34, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hfill_inds.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L257_C12", "label": "if", "type": "if", "loc": [257, 263], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L253_C12", "vector": [4, 4, 0.6971, 0.0188, 4, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(w, (str, unicode)):\n r.append(w)\n currwidth += len(w)\n else:\n weval = w.update(self)\n currwidth += len(weval)\n r.append(weval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L258_C16", "label": "append()", "type": "expression", "loc": [258, 258], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L257_C12", "vector": [8, 5, 0.6917, 0.0027, 5, 0.46, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " r.append(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L261_C16", "label": "weval = update()", "type": "assigned_variable", "loc": [261, 261], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L257_C12", "vector": [14, 5, 0.6997, 0.0027, 5, 0.46, 0.5, 39, 3, 1, 0, 0, 637, 10, 1], "semantic": {"name": "weval", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " weval = w.update(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L263_C16", "label": "append()", "type": "expression", "loc": [263, 263], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L257_C12", "vector": [8, 5, 0.7051, 0.0027, 5, 0.46, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " r.append(weval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L264_C8", "label": "for iw", "type": "for", "loc": [264, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "vector": [6, 2, 0.7091, 0.0054, 2, 0.34, 0.8333, 366, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "iw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for iw in hfill_inds:\n r[iw] = r[iw].update(self, (self.term_width - currwidth) / num_hfill)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L265_C12", "label": " = update()", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L264_C8", "vector": [14, 3, 0.7105, 0.0027, 3, 0.8, 0.0, 0, 3, 2, 0, 0, 637, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " r[iw] = r[iw].update(self, (self.term_width - currwidth) / num_hfill)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L266_C8", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "vector": [13, 2, 0.7131, 0.0027, 2, 0.34, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L268_C4", "label": "_format_line", "type": "function", "loc": [268, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.7198, 0.0054, 1, 0.35, 0.5556, 66, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_format_line", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_line(self):\n return ''.join(self._format_widgets()).ljust(self.term_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L269_C8", "label": "return", "type": "return", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L268_C4", "vector": [13, 2, 0.7212, 0.0027, 2, 0.96, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join(self._format_widgets()).ljust(self.term_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L271_C4", "label": "_need_update", "type": "function", "loc": [271, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.7279, 0.0054, 1, 0.35, 0.6667, 994, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_need_update", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _need_update(self):\n return int(self.percentage()) != int(self.prev_percentage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L272_C8", "label": "return", "type": "return", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L271_C4", "vector": [13, 2, 0.7292, 0.0027, 2, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(self.percentage()) != int(self.prev_percentage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "label": "update", "type": "function", "loc": [274, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.7534, 0.0402, 1, 0.35, 0.7778, 637, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "update", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, value):\n \"Updates the progress bar to a new value.\"\n assert 0 <= value <= self.maxval\n self.currval = value\n if not self._need_update() or self.finished:\n return\n if not self.start_time:\n self.start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L275_C8", "label": "expression", "type": "expression", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "vector": [8, 2, 0.7373, 0.0027, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Updates the progress bar to a new value.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L277_C8", "label": "self.currval =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "vector": [14, 2, 0.7426, 0.0027, 2, 0.38, 0.1667, 616, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.currval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.currval = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L278_C8", "label": "if", "type": "if", "loc": [278, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "vector": [4, 2, 0.7466, 0.0054, 2, 0.38, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._need_update() or self.finished:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L279_C12", "label": "return", "type": "return", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L278_C8", "vector": [13, 3, 0.748, 0.0027, 3, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L280_C8", "label": "if", "type": "if", "loc": [280, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "vector": [4, 2, 0.752, 0.0054, 2, 0.38, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.start_time:\n self.start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L281_C12", "label": "self.start_time = time()", "type": "assigned_variable", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L280_C8", "vector": [14, 3, 0.7534, 0.0027, 3, 0.59, 0.0, 387, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L282_C8", "label": "self.seconds_elapsed =", "type": "assigned_variable", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "vector": [14, 2, 0.756, 0.0027, 2, 0.38, 0.6667, 205, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.seconds_elapsed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seconds_elapsed = time.time() - self.start_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L283_C8", "label": "self.prev_percentage = percentage()", "type": "assigned_variable", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "vector": [14, 2, 0.7587, 0.0027, 2, 0.38, 0.8333, 810, 3, 0, 0, 0, 568, 10, 1], "semantic": {"name": "self.prev_percentage", "arg_names": [], "import_names": [], "rhs_call_name": "percentage", "annotation": ""}, "snippet": " self.prev_percentage = self.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L284_C8", "label": "if", "type": "if", "loc": [284, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "vector": [4, 2, 0.7668, 0.0134, 2, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value != self.maxval:\n self.fd.write(self._format_line() + '\\r')\n else:\n self.finished = True\n self.fd.write(self._format_line() + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L285_C12", "label": "write()", "type": "expression", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L284_C8", "vector": [8, 3, 0.7641, 0.0027, 3, 0.26, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.fd.write(self._format_line() + '\\r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L287_C12", "label": "self.finished =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L284_C8", "vector": [14, 3, 0.7694, 0.0027, 3, 0.26, 0.5, 742, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.finished", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.finished = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L288_C12", "label": "write()", "type": "expression", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L284_C8", "vector": [8, 3, 0.7721, 0.0027, 3, 0.26, 1.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.fd.write(self._format_line() + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L290_C4", "label": "start", "type": "function", "loc": [290, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.7936, 0.0349, 1, 0.35, 0.8889, 511, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self):\n \"\"\"Start measuring time, and prints the bar at 0%.\n\n It returns self so you can use it like this:\n >>> pbar = ProgressBar().start()\n >>> for i in xrange(100):\n ... # do something\n ... pbar.update(i+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L291_C8", "label": "expression", "type": "expression", "loc": [291, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L290_C4", "vector": [8, 2, 0.7922, 0.0268, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Start measuring time, and prints the bar at 0%.\n\n It returns self so you can use it like this:\n >>> pbar = ProgressBar().start()\n >>> for i in xrange(100):\n ... # do something\n ... pbar.update(i+1)\n ..."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L301_C8", "label": "update()", "type": "expression", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L290_C4", "vector": [8, 2, 0.807, 0.0027, 2, 0.36, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L302_C8", "label": "return", "type": "return", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L290_C4", "vector": [13, 2, 0.8097, 0.0027, 2, 0.36, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L304_C4", "label": "finish", "type": "function", "loc": [304, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "vector": [2, 1, 0.8204, 0.0134, 1, 0.35, 1.0, 380, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "finish", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def finish(self):\n \"\"\"Used to tell the progress is finished.\"\"\"\n self.update(self.maxval)\n if self.signal_set:\n signal.signal(signal.SIGWINCH, signal.SIG_DFL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L305_C8", "label": "expression", "type": "expression", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L304_C4", "vector": [8, 2, 0.8177, 0.0027, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Used to tell the progress is finished.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L306_C8", "label": "update()", "type": "expression", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L304_C4", "vector": [8, 2, 0.8204, 0.0027, 2, 0.72, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update(self.maxval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L307_C8", "label": "if", "type": "if", "loc": [307, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L304_C4", "vector": [4, 2, 0.8244, 0.0054, 2, 0.72, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.signal_set:\n signal.signal(signal.SIGWINCH, signal.SIG_DFL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L308_C12", "label": "signal()", "type": "expression", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L307_C8", "vector": [8, 3, 0.8257, 0.0027, 3, 0.92, 0.0, 621, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "signal", "arg_names": [], "import_names": [], "rhs_call_name": "signal", "annotation": ""}, "snippet": " signal.signal(signal.SIGWINCH, signal.SIG_DFL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "label": "if", "type": "if", "loc": [315, 372], "level": 0, "parent": null, "vector": [4, 0, 0.9209, 0.1555, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 44], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import os\n\n def example1():\n widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()),\n ' ', ETA(), ' ', FileTransferSpeed()]\n pbar = ProgressBar(widgets=widgets, maxval=10000000).start()\n for i in range(1000000):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Import_L316_C4", "label": "os import os", "type": "import", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [1, 1, 0.8472, 0.0027, 1, 0.37, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": " import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "label": "example1", "type": "function", "loc": [318, 326], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [2, 1, 0.8633, 0.0241, 1, 0.37, 0.125, 57, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "example1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def example1():\n widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()),\n ' ', ETA(), ' ', FileTransferSpeed()]\n pbar = ProgressBar(widgets=widgets, maxval=10000000).start()\n for i in range(1000000):\n # do something\n pbar.update(10 * i + 1)\n pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L319_C8", "label": "widgets =", "type": "assigned_variable", "loc": [319, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "vector": [14, 2, 0.8566, 0.0054, 2, 0.1, 0.0, 178, 0, 0, 0, 0, 0, 5, 5], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()),\n ' ', ETA(), ' ', FileTransferSpeed()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L321_C8", "label": "pbar = start()", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "vector": [14, 2, 0.8606, 0.0027, 2, 0.1, 0.25, 378, 3, 0, 0, 0, 511, 10, 2], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " pbar = ProgressBar(widgets=widgets, maxval=10000000).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L322_C8", "label": "for i", "type": "for", "loc": [322, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "vector": [6, 2, 0.866, 0.008, 2, 0.1, 0.5, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1000000):\n # do something\n pbar.update(10 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L324_C12", "label": "update()", "type": "expression", "loc": [324, 324], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L322_C8", "vector": [8, 3, 0.8686, 0.0027, 3, 0.61, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " pbar.update(10 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L325_C8", "label": "finish()", "type": "expression", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "vector": [8, 2, 0.8713, 0.0027, 2, 0.1, 0.75, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L326_C8", "label": "expression", "type": "expression", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "vector": [8, 2, 0.874, 0.0027, 2, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "label": "example2", "type": "function", "loc": [328, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [2, 1, 0.9021, 0.0483, 1, 0.37, 0.25, 56, 0, 0, 1, 0, 0, 0, 12], "semantic": {"name": "example2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def example2():\n class CrazyFileTransferSpeed(FileTransferSpeed):\n \"It's bigger between 45 and 80 percent\"\n def update(self, pbar):\n if 45 < pbar.percentage() < 80:\n return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)\n else:\n return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L329_C8", "label": "CrazyFileTransferSpeed", "type": "class", "loc": [329, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "vector": [3, 2, 0.8901, 0.0188, 2, 0.96, 0.0, 503, 0, 1, 0, 0, 29, 0, 3], "semantic": {"name": "CrazyFileTransferSpeed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class CrazyFileTransferSpeed(FileTransferSpeed):\n \"It's bigger between 45 and 80 percent\"\n def update(self, pbar):\n if 45 < pbar.percentage() < 80:\n return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)\n else:\n return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L330_C12", "label": "expression", "type": "expression", "loc": [330, 330], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L329_C8", "vector": [8, 3, 0.8847, 0.0027, 3, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"It's bigger between 45 and 80 percent\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L331_C12", "label": "update", "type": "function", "loc": [331, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L329_C8", "vector": [2, 3, 0.8928, 0.0134, 3, 0.92, 1.0, 637, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n if 45 < pbar.percentage() < 80:\n return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)\n else:\n return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L332_C16", "label": "if", "type": "if", "loc": [332, 335], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L331_C12", "vector": [4, 4, 0.8941, 0.0107, 4, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 45 < pbar.percentage() < 80:\n return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)\n else:\n return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L333_C20", "label": "return", "type": "return", "loc": [333, 333], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L332_C16", "vector": [13, 5, 0.8928, 0.0027, 5, 0.21, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L335_C20", "label": "return", "type": "return", "loc": [335, 335], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L332_C16", "vector": [13, 5, 0.8981, 0.0027, 5, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L337_C8", "label": "widgets =", "type": "assigned_variable", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "vector": [14, 2, 0.9035, 0.0027, 2, 0.96, 0.1667, 178, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = [CrazyFileTransferSpeed(), ' <<<', Bar(), '>>> ', Percentage(), ' ', ETA()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L338_C8", "label": "pbar = ProgressBar()", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "vector": [14, 2, 0.9062, 0.0027, 2, 0.96, 0.3333, 378, 3, 2, 0, 0, 657, 10, 1], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "ProgressBar", "annotation": ""}, "snippet": " pbar = ProgressBar(widgets=widgets, maxval=10000000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L340_C8", "label": "start()", "type": "expression", "loc": [340, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "vector": [8, 2, 0.9115, 0.0027, 2, 0.96, 0.5, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " pbar.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L341_C8", "label": "for i", "type": "for", "loc": [341, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "vector": [6, 2, 0.9169, 0.008, 2, 0.96, 0.6667, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(2000000):\n # do something\n pbar.update(5 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L343_C12", "label": "update()", "type": "expression", "loc": [343, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L341_C8", "vector": [8, 3, 0.9196, 0.0027, 3, 0.16, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " pbar.update(5 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L344_C8", "label": "finish()", "type": "expression", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "vector": [8, 2, 0.9223, 0.0027, 2, 0.96, 0.8333, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L345_C8", "label": "expression", "type": "expression", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "vector": [8, 2, 0.9249, 0.0027, 2, 0.96, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "label": "example3", "type": "function", "loc": [347, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [2, 1, 0.9397, 0.0214, 1, 0.37, 0.375, 189, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "example3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def example3():\n widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')]\n pbar = ProgressBar(widgets=widgets, maxval=10000000).start()\n for i in range(1000000):\n # do something\n pbar.update(10 * i + 1)\n pbar.finish()\n print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L348_C8", "label": "widgets =", "type": "assigned_variable", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "vector": [14, 2, 0.933, 0.0027, 2, 0.11, 0.0, 178, 0, 0, 0, 0, 0, 5, 3], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L349_C8", "label": "pbar = start()", "type": "assigned_variable", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "vector": [14, 2, 0.9357, 0.0027, 2, 0.11, 0.25, 378, 3, 0, 0, 0, 511, 10, 2], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " pbar = ProgressBar(widgets=widgets, maxval=10000000).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L350_C8", "label": "for i", "type": "for", "loc": [350, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "vector": [6, 2, 0.941, 0.008, 2, 0.11, 0.5, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1000000):\n # do something\n pbar.update(10 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L352_C12", "label": "update()", "type": "expression", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L350_C8", "vector": [8, 3, 0.9437, 0.0027, 3, 0.81, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " pbar.update(10 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L353_C8", "label": "finish()", "type": "expression", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "vector": [8, 2, 0.9464, 0.0027, 2, 0.11, 0.75, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L354_C8", "label": "expression", "type": "expression", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "vector": [8, 2, 0.9491, 0.0027, 2, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "label": "example4", "type": "function", "loc": [356, 366], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [2, 1, 0.9678, 0.0295, 1, 0.37, 0.5, 11, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "example4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def example4():\n widgets = ['Test: ', Percentage(), ' ',\n Bar(marker='0', left='[', right=']'),\n ' ', ETA(), ' ', FileTransferSpeed()]\n pbar = ProgressBar(widgets=widgets, maxval=500)\n pbar.start()\n for i in range(100, 500 + 1, 50):\n time.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L357_C8", "label": "widgets =", "type": "assigned_variable", "loc": [357, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "vector": [14, 2, 0.9598, 0.008, 2, 0.18, 0.0, 178, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = ['Test: ', Percentage(), ' ',\n Bar(marker='0', left='[', right=']'),\n ' ', ETA(), ' ', FileTransferSpeed()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L360_C8", "label": "pbar = ProgressBar()", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "vector": [14, 2, 0.9651, 0.0027, 2, 0.18, 0.2, 378, 3, 2, 0, 0, 657, 10, 1], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "ProgressBar", "annotation": ""}, "snippet": " pbar = ProgressBar(widgets=widgets, maxval=500)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L361_C8", "label": "start()", "type": "expression", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "vector": [8, 2, 0.9678, 0.0027, 2, 0.18, 0.4, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " pbar.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L362_C8", "label": "for i", "type": "for", "loc": [362, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "vector": [6, 2, 0.9732, 0.008, 2, 0.18, 0.6, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(100, 500 + 1, 50):\n time.sleep(0.2)\n pbar.update(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L363_C12", "label": "sleep()", "type": "expression", "loc": [363, 363], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L362_C8", "vector": [8, 3, 0.9732, 0.0027, 3, 0.58, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L364_C12", "label": "update()", "type": "expression", "loc": [364, 364], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L362_C8", "vector": [8, 3, 0.9759, 0.0027, 3, 0.58, 1.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " pbar.update(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L365_C8", "label": "finish()", "type": "expression", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "vector": [8, 2, 0.9786, 0.0027, 2, 0.18, 0.8, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L366_C8", "label": "expression", "type": "expression", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "vector": [8, 2, 0.9812, 0.0027, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L369_C4", "label": "example1()", "type": "expression", "loc": [369, 369], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [8, 1, 0.9893, 0.0027, 1, 0.37, 0.625, 57, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "example1", "arg_names": [], "import_names": [], "rhs_call_name": "example1", "annotation": ""}, "snippet": " example1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L370_C4", "label": "example2()", "type": "expression", "loc": [370, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [8, 1, 0.992, 0.0027, 1, 0.37, 0.75, 56, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "example2", "arg_names": [], "import_names": [], "rhs_call_name": "example2", "annotation": ""}, "snippet": " example2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L371_C4", "label": "example3()", "type": "expression", "loc": [371, 371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [8, 1, 0.9946, 0.0027, 1, 0.37, 0.875, 189, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "example3", "arg_names": [], "import_names": [], "rhs_call_name": "example3", "annotation": ""}, "snippet": " example3()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L372_C4", "label": "example4()", "type": "expression", "loc": [372, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "vector": [8, 1, 0.9973, 0.0027, 1, 0.37, 1.0, 11, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "example4", "arg_names": [], "import_names": [], "rhs_call_name": "example4", "annotation": ""}, "snippet": " example4()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:ImportFrom_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Import_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L225_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L226_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L227_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:Try_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L229_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L252_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L254_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L258_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L261_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L263_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L264_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Import_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L324_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L329_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:ClassDef_L329_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L331_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L332_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L332_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L333_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L332_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Return_L335_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L341_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L343_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L350_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:For_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L364_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99995:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99995:Expr_L372_C4"}]
'''Levenshtein Distance Calculator for Clearcutter log identification module''' __author__ = "CP Constantine" __email__ = "conrad@alienvault.com" __copyright__ = 'Copyright:Alienvault 2012' __credits__ = ["Conrad Constantine"] __version__ = "0.1" __license__ = "BSD" __status__ = "Prototype" __maintainer__ = "CP Constantine" def levenshtein(s1, s2): l1 = len(s1) l2 = len(s2) matrix = [range(l1 + 1)] * (l2 + 1) for zz in range(l2 + 1): matrix[zz] = range(zz, zz + l1 + 1) for zz in range(0, l2): for sz in range(0, l1): if s1[sz] == s2[zz]: matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz]) else: matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz] + 1) return matrix[l2][l1]
ajibawa-2023/Python-Code-Large/train/row_99996
21
27
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.037, 0.037, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''Levenshtein Distance Calculator for Clearcutter log identification module'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L3_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.037, 0, 0.66, 0.1111, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = \"CP Constantine\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L4_C0", "label": "__email__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1481, 0.037, 0, 0.66, 0.2222, 424, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__email__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__email__ = \"conrad@alienvault.com\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L5_C0", "label": "__copyright__ =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1852, 0.037, 0, 0.66, 0.3333, 200, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__copyright__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__copyright__ = 'Copyright:Alienvault 2012'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L6_C0", "label": "__credits__ =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.2222, 0.037, 0, 0.66, 0.4444, 451, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__credits__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__credits__ = [\"Conrad Constantine\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L7_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2593, 0.037, 0, 0.66, 0.5556, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"0.1\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L8_C0", "label": "__license__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2963, 0.037, 0, 0.66, 0.6667, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__license__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__license__ = \"BSD\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L9_C0", "label": "__status__ =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.037, 0, 0.66, 0.7778, 955, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__status__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__status__ = \"Prototype\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L10_C0", "label": "__maintainer__ =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3704, 0.037, 0, 0.66, 0.8889, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__maintainer__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__maintainer__ = \"CP Constantine\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "label": "levenshtein", "type": "function", "loc": [13, 26], "level": 0, "parent": null, "vector": [2, 0, 0.7222, 0.5185, 0, 0.66, 1.0, 664, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "levenshtein", "arg_names": ["s1", "s2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def levenshtein(s1, s2):\n l1 = len(s1)\n l2 = len(s2)\n\n matrix = [range(l1 + 1)] * (l2 + 1)\n for zz in range(l2 + 1):\n matrix[zz] = range(zz, zz + l1 + 1)\n for zz in range(0, l2):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L14_C4", "label": "l1 = len()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "vector": [14, 1, 0.5185, 0.037, 1, 0.43, 0.0, 888, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " l1 = len(s1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L15_C4", "label": "l2 = len()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "vector": [14, 1, 0.5556, 0.037, 1, 0.43, 0.2, 40, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " l2 = len(s2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L17_C4", "label": "matrix =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "vector": [14, 1, 0.6296, 0.037, 1, 0.43, 0.4, 162, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "matrix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " matrix = [range(l1 + 1)] * (l2 + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L18_C4", "label": "for zz", "type": "for", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "vector": [6, 1, 0.6852, 0.0741, 1, 0.43, 0.6, 43, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "zz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for zz in range(l2 + 1):\n matrix[zz] = range(zz, zz + l1 + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L19_C8", "label": " = range()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L18_C4", "vector": [14, 2, 0.7037, 0.037, 2, 0.75, 0.0, 0, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " matrix[zz] = range(zz, zz + l1 + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L20_C4", "label": "for zz", "type": "for", "loc": [20, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "vector": [6, 1, 0.8333, 0.2222, 1, 0.43, 0.8, 43, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "zz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for zz in range(0, l2):\n for sz in range(0, l1):\n if s1[sz] == s2[zz]:\n matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz])\n else:\n matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz] + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L21_C8", "label": "for sz", "type": "for", "loc": [21, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L20_C4", "vector": [6, 2, 0.8519, 0.1852, 2, 0.04, 0.0, 780, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "sz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sz in range(0, l1):\n if s1[sz] == s2[zz]:\n matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz])\n else:\n matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz] + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:If_L22_C12", "label": "if", "type": "if", "loc": [22, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L21_C8", "vector": [4, 3, 0.8704, 0.1481, 3, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if s1[sz] == s2[zz]:\n matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz])\n else:\n matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz] + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L23_C16", "label": " = min()", "type": "assigned_variable", "loc": [23, 23], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:If_L22_C12", "vector": [14, 4, 0.8519, 0.037, 4, 0.36, 0.0, 0, 3, 3, 0, 0, 867, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L25_C16", "label": " = min()", "type": "assigned_variable", "loc": [25, 25], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:If_L22_C12", "vector": [14, 4, 0.9259, 0.037, 4, 0.36, 1.0, 0, 3, 3, 0, 0, 867, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " matrix[zz + 1][sz + 1] = min(matrix[zz + 1][sz] + 1, matrix[zz][sz + 1] + 1, matrix[zz][sz] + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99996:Return_L26_C4", "label": "return", "type": "return", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "vector": [13, 1, 0.963, 0.037, 1, 0.43, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return matrix[l2][l1]"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:For_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:If_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:If_L22_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L23_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:If_L22_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:Assign_L25_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99996:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99996:Return_L26_C4"}]
'''Extract calls to logging libraries from code Trees''' class CodeScrape(object): ''' classdocs ''' def __init__(self,params): ''' Constructor ''' pass
ajibawa-2023/Python-Code-Large/train/row_99997
5
15
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99997:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''Extract calls to logging libraries from code Trees'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99997:ClassDef_L3_C0", "label": "CodeScrape", "type": "class", "loc": [3, 13], "level": 0, "parent": null, "vector": [3, 0, 0.5333, 0.7333, 0, 0.66, 1.0, 888, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "CodeScrape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CodeScrape(object):\n '''\n classdocs\n '''\n\n\n def __init__(self,params):\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99997:Expr_L4_C4", "label": "expression", "type": "expression", "loc": [4, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99997:ClassDef_L3_C0", "vector": [8, 1, 0.3333, 0.2, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n classdocs\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99997:FunctionDef_L9_C4", "label": "__init__", "type": "function", "loc": [9, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99997:ClassDef_L3_C0", "vector": [2, 1, 0.7333, 0.3333, 1, 0.72, 1.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,params):\n '''\n Constructor\n '''\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99997:Expr_L10_C8", "label": "expression", "type": "expression", "loc": [10, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99997:FunctionDef_L9_C4", "vector": [8, 2, 0.7333, 0.2, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Constructor\n '''"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99997:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99997:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99997:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99997:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99997:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99997:Expr_L10_C8"}]
""" Clusters Locate clusters of test in Logfiles, to assist in processing discrete log messages, from any given log data sample and assist in the creation of Regular Expression to parse those log entries """ __author__ = "CP Constantine" __email__ = "conrad@alienvault.com" __copyright__ = 'Copyright:Alienvault 2012' __credits__ = ["Conrad Constantine"] __version__ = "0.2" __license__ = "BSD" __status__ = "Prototype" __maintainer__ = "CP Constantine" #TODO: More Regexp Patterns #TODO: Levenshtein distance grouping (recurse window groupings #TODO: Extract all unique words from a file #cat comment_file.txt | tr " " "\n" | sort | uniq -c #TODO: Print total matches for each identified log entry. import sys, progressbar, commonvars, levenshtein, plugingenerate from logfile import LogFile class ClusterNode(object): """ Linked list node for log patterns """ Children = [] Content = "" Parent = None ContentHash = "" def __init__(self, NodeContent="Not Provided"): self.Children = [] self.Content = NodeContent #if verbose > 3 : print "Created new Node " + str(id(self)) + " with content : " + self.Content self.ContentHash = hash(NodeContent) def GetChildren(self): return self.Children def GetContent(self): return self.Content def MatchChild(self, MatchContent): if len(self.Children) == 0: #print "No Children" return None else: for child in self.Children: if (child.ContentHash == hash(MatchContent)): #print "Found Child Match : " + child.Content return child else: return None def MatchNephew(self, MatchContent): """Find Nephew Match""" if self.Parent == None: #This node is the root node return None for sibling in self.Parent.Children: if len(sibling.Children) > 0 : # no point if sibling has no children for child in sibling.Children: #let's see which child node this matches if (child.Content == MatchContent): return child return None def AddChild(self, NodeContent): ChildContent = ClusterNode(NodeContent) ChildContent.Parent = self self.Children.append(ChildContent) return ChildContent def GeneratePath(self): #TODO: Compare siblings against regexps to suggest a regex replacement currentNode = self parentpath = "" while currentNode.Content != "ROOTNODE": if len(currentNode.Parent.Children) > ClusterGroup.VarThreshold: parentpath = "[VARIABLE]" + " " + parentpath else: parentpath = currentNode.Content + " " + parentpath currentNode = currentNode.Parent return parentpath class ClusterGroup(object): """ A Group of word cluster, representing the unique log types within a logfile """ Args = "" Log = "" VarThreshold = 10 #How many siblings a string node must have before it is considered to be variable data VarDistance = 20 rootNode = ClusterNode(NodeContent="ROOTNODE") entries = [] def __init__(self, args): self.rootNode = ClusterNode(NodeContent="ROOTNODE") self.Args = args def IsMatch(self, logline): ''' Test the incoming log line to see if it matches this clustergroup Return boolean match ''' logwords = commonvars.FindCommonRegex(logline).split() #TODO Split at '=' marks as well currentNode = self.rootNode for logword in logwords: #process logs a word at a time #match our own children first match = currentNode.MatchChild(MatchContent=logword) if match == None: #then try our siblings match = currentNode.MatchNephew(MatchContent=logword) if match == None: #then add a new child match = currentNode.AddChild(NodeContent=logword) if match == None: print "FAILED" else: currentNode = match def IsEndNode(self, Node): ''' Is This Node the final word of a log template? @return: True or False ''' endnode = False hasNephews = False if (len(Node.Children) is 0): #I'm an EndNode for a log wording cluster if Node.Parent is not None: #let's make sure our siblings are all endnodes too, and this is really var data for sibling in Node.Parent.Children: if len(sibling.Children) > 0 : hasNephews = True if (hasNephews is False) and (len(Node.Parent.Children) >= ClusterGroup.VarThreshold): #log event ends in a variable endnode = True if (hasNephews is False) and (len(Node.Parent.Children) == 1) : #log event ends in a fixed string endnode = True if endnode is True: entry = Node.GeneratePath() if entry not in self.entries: self.entries.append(entry) def BuildResultsTree(self, node): ''' Recurse through the Node Tree, identifying and printing complete log patterns' @return: None (recursive function) ''' if self.IsEndNode(node) == True : return None # no children so back up a level for childnode in node.Children: self.BuildResultsTree(childnode) def Results(self): ''' Display all identified unique log event types @return None ''' #if options.outfile == true: dump to file print "\n========== Potential Unique Log Events ==========\n" self.BuildResultsTree(self.rootNode) #Todo - commandline args to toggle levenshtein identification of dupes previous = '' for entry in self.entries: if levenshtein.levenshtein(entry, previous) < ClusterGroup.VarDistance : print "\t" + entry else: print entry previous = entry def Run(self): try: self.Log = LogFile(self.Args.logfile) except IOError: print "File: " + self.Log.Filename + " cannot be opened : " + str(sys.exc_info()[1]) #TODO: log to stderr raise IOError() #if args.v > 0 : print "Processing Log File " + log.Filename + ":" + str(log.Length) + " bytes" logline = self.Log.RetrieveCurrentLine() widgets = ['Processing potential messages: ', progressbar.Percentage(), ' ', progressbar.Bar(marker=progressbar.RotatingMarker()), ' ', progressbar.ETA()] if self.Args.quiet is False : pbar = progressbar.ProgressBar(widgets=widgets, maxval=100).start() while logline != "": #TODO: Make this actually exit on EOF self.IsMatch(logline) if self.Args.quiet is False : pbar.update((1.0 * self.Log.Position / self.Log.Length) * 100) logline = self.Log.RetrieveCurrentLine() if self.Args.quiet is False : pbar.finish() def GenPlugin(self): ''' Create a Template OSSIM agent plugin file using the identified log templates as SIDs @return: The filename of the generated plugin ''' generator = plugingenerate.Generator(self.entries) generator.WritePlugin() return generator.PluginFile #Take EndNode Strings #Calculate Levenshtein distance between them #Deduplicate from there.
ajibawa-2023/Python-Code-Large/train/row_99998
133
226
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0111, 0.0177, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nClusters Locate clusters of test in Logfiles, to assist in processing discrete log messages,\nfrom any given log data sample and assist in the creation of Regular Expression to parse those log entries\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L6_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0265, 0.0044, 0, 0.66, 0.0833, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = \"CP Constantine\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L7_C0", "label": "__email__ =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.031, 0.0044, 0, 0.66, 0.1667, 424, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__email__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__email__ = \"conrad@alienvault.com\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L8_C0", "label": "__copyright__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0354, 0.0044, 0, 0.66, 0.25, 200, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__copyright__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__copyright__ = 'Copyright:Alienvault 2012'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L9_C0", "label": "__credits__ =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0398, 0.0044, 0, 0.66, 0.3333, 451, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__credits__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__credits__ = [\"Conrad Constantine\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L10_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0442, 0.0044, 0, 0.66, 0.4167, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"0.2\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L11_C0", "label": "__license__ =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.0487, 0.0044, 0, 0.66, 0.5, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__license__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__license__ = \"BSD\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L12_C0", "label": "__status__ =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.0531, 0.0044, 0, 0.66, 0.5833, 955, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__status__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__status__ = \"Prototype\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L13_C0", "label": "__maintainer__ =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.0575, 0.0044, 0, 0.66, 0.6667, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__maintainer__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__maintainer__ = \"CP Constantine\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Import_L25_C0", "label": "sys import sys, progressbar, commonvars\u2026", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1106, 0.0044, 0, 0.66, 0.75, 509, 0, 5, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "progressbar", "commonvars", "levenshtein", "plugingenerate"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, progressbar, commonvars, levenshtein, plugingenerate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:ImportFrom_L26_C0", "label": "from logfile import LogFile", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.115, 0.0044, 0, 0.66, 0.8333, 554, 0, 1, 0, 0, 554, 0, 0], "semantic": {"name": "logfile", "arg_names": [], "import_names": ["LogFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from logfile import LogFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "label": "ClusterNode", "type": "class", "loc": [29, 96], "level": 0, "parent": null, "vector": [3, 0, 0.2765, 0.3009, 0, 0.66, 0.9167, 645, 0, 7, 0, 0, 186, 0, 7], "semantic": {"name": "ClusterNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ClusterNode(object):\n \"\"\"\n Linked list node for log patterns\n \"\"\"\n\n Children = []\n Content = \"\"\n Parent = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [8, 1, 0.1372, 0.0133, 1, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Linked list node for log patterns\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L34_C4", "label": "Children =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [14, 1, 0.1504, 0.0044, 1, 0.05, 0.0909, 409, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "Children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Children = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L35_C4", "label": "Content =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [14, 1, 0.1549, 0.0044, 1, 0.05, 0.1818, 758, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "Content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Content = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L36_C4", "label": "Parent =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [14, 1, 0.1593, 0.0044, 1, 0.05, 0.2727, 418, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "Parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Parent = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L37_C4", "label": "ContentHash =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [14, 1, 0.1637, 0.0044, 1, 0.05, 0.3636, 961, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ContentHash", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ContentHash = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L40_C4", "label": "__init__", "type": "function", "loc": [40, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [2, 1, 0.1858, 0.0221, 1, 0.05, 0.4545, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "NodeContent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, NodeContent=\"Not Provided\"):\n self.Children = []\n self.Content = NodeContent\n #if verbose > 3 : print \"Created new Node \" + str(id(self)) + \" with content : \" + self.Content \n self.ContentHash = hash(NodeContent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L41_C8", "label": "self.Children =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L40_C4", "vector": [14, 2, 0.1814, 0.0044, 2, 0.13, 0.0, 436, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.Children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Children = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L42_C8", "label": "self.Content =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L40_C4", "vector": [14, 2, 0.1858, 0.0044, 2, 0.13, 0.5, 332, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.Content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Content = NodeContent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L44_C8", "label": "self.ContentHash = hash()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L40_C4", "vector": [14, 2, 0.1947, 0.0044, 2, 0.13, 1.0, 297, 3, 1, 0, 0, 58, 10, 1], "semantic": {"name": "self.ContentHash", "arg_names": [], "import_names": [], "rhs_call_name": "hash", "annotation": ""}, "snippet": " self.ContentHash = hash(NodeContent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L47_C4", "label": "GetChildren", "type": "function", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [2, 1, 0.2102, 0.0088, 1, 0.05, 0.5455, 253, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "GetChildren", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetChildren(self):\n return self.Children"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L47_C4", "vector": [13, 2, 0.2124, 0.0044, 2, 0.61, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.Children"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L51_C4", "label": "GetContent", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [2, 1, 0.2279, 0.0088, 1, 0.05, 0.6364, 659, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "GetContent", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetContent(self):\n return self.Content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L51_C4", "vector": [13, 2, 0.2301, 0.0044, 2, 0.0, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.Content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L55_C4", "label": "MatchChild", "type": "function", "loc": [55, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [2, 1, 0.2655, 0.0487, 1, 0.05, 0.7273, 908, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "MatchChild", "arg_names": ["self", "MatchContent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def MatchChild(self, MatchContent):\n if len(self.Children) == 0:\n #print \"No Children\"\n return None\n else:\n for child in self.Children:\n if (child.ContentHash == hash(MatchContent)):\n #print \"Found Child Match : \" + child.Content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L56_C8", "label": "if", "type": "if", "loc": [56, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L55_C4", "vector": [4, 2, 0.2677, 0.0442, 2, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.Children) == 0:\n #print \"No Children\"\n return None\n else:\n for child in self.Children:\n if (child.ContentHash == hash(MatchContent)):\n #print \"Found Child Match : \" + child.Content\n return child"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L58_C12", "label": "return", "type": "return", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L56_C8", "vector": [13, 3, 0.2566, 0.0044, 3, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L60_C12", "label": "for child", "type": "for", "loc": [60, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L56_C8", "vector": [6, 3, 0.2765, 0.0265, 3, 0.19, 1.0, 967, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for child in self.Children:\n if (child.ContentHash == hash(MatchContent)):\n #print \"Found Child Match : \" + child.Content\n return child\n else:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L61_C16", "label": "if", "type": "if", "loc": [61, 65], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L60_C12", "vector": [4, 4, 0.2788, 0.0221, 4, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (child.ContentHash == hash(MatchContent)):\n #print \"Found Child Match : \" + child.Content\n return child\n else:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L63_C20", "label": "return", "type": "return", "loc": [63, 63], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L61_C16", "vector": [13, 5, 0.2788, 0.0044, 5, 0.58, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return child"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L65_C20", "label": "return", "type": "return", "loc": [65, 65], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L61_C16", "vector": [13, 5, 0.2876, 0.0044, 5, 0.58, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "label": "MatchNephew", "type": "function", "loc": [68, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [2, 1, 0.3208, 0.0442, 1, 0.05, 0.8182, 381, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "MatchNephew", "arg_names": ["self", "MatchContent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def MatchNephew(self, MatchContent):\n \"\"\"Find Nephew Match\"\"\"\n if self.Parent == None: #This node is the root node\n return None\n for sibling in self.Parent.Children:\n if len(sibling.Children) > 0 : # no point if sibling has no children\n for child in sibling.Children: #let's see which child node this matches \n if (child.Content == MatchContent):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L69_C8", "label": "expression", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "vector": [8, 2, 0.3053, 0.0044, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Find Nephew Match\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L70_C8", "label": "if", "type": "if", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "vector": [4, 2, 0.3119, 0.0088, 2, 0.19, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.Parent == None: #This node is the root node\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L71_C12", "label": "return", "type": "return", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L70_C8", "vector": [13, 3, 0.3142, 0.0044, 3, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L72_C8", "label": "for sibling", "type": "for", "loc": [72, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "vector": [6, 2, 0.3274, 0.0221, 2, 0.19, 0.6667, 667, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sibling", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sibling in self.Parent.Children:\n if len(sibling.Children) > 0 : # no point if sibling has no children\n for child in sibling.Children: #let's see which child node this matches \n if (child.Content == MatchContent):\n return child"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L73_C12", "label": "if", "type": "if", "loc": [73, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L72_C8", "vector": [4, 3, 0.3296, 0.0177, 3, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sibling.Children) > 0 : # no point if sibling has no children\n for child in sibling.Children: #let's see which child node this matches \n if (child.Content == MatchContent):\n return child"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L74_C16", "label": "for child", "type": "for", "loc": [74, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L73_C12", "vector": [6, 4, 0.3319, 0.0133, 4, 0.45, 0.0, 967, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for child in sibling.Children: #let's see which child node this matches \n if (child.Content == MatchContent):\n return child"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L75_C20", "label": "if", "type": "if", "loc": [75, 76], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L74_C16", "vector": [4, 5, 0.3341, 0.0088, 5, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (child.Content == MatchContent):\n return child"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L76_C24", "label": "return", "type": "return", "loc": [76, 76], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L75_C20", "vector": [13, 6, 0.3363, 0.0044, 6, 0.78, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return child"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L77_C8", "label": "return", "type": "return", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "vector": [13, 2, 0.3407, 0.0044, 2, 0.19, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "label": "AddChild", "type": "function", "loc": [80, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [2, 1, 0.3628, 0.0221, 1, 0.05, 0.9091, 570, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "AddChild", "arg_names": ["self", "NodeContent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def AddChild(self, NodeContent):\n ChildContent = ClusterNode(NodeContent)\n ChildContent.Parent = self\n self.Children.append(ChildContent)\n return ChildContent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L81_C8", "label": "ChildContent = ClusterNode()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "vector": [14, 2, 0.3584, 0.0044, 2, 0.21, 0.0, 568, 3, 1, 0, 0, 645, 10, 1], "semantic": {"name": "ChildContent", "arg_names": [], "import_names": [], "rhs_call_name": "ClusterNode", "annotation": ""}, "snippet": " ChildContent = ClusterNode(NodeContent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L82_C8", "label": "ChildContent.Parent =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "vector": [14, 2, 0.3628, 0.0044, 2, 0.21, 0.3333, 543, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ChildContent.Parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ChildContent.Parent = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L83_C8", "label": "append()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "vector": [8, 2, 0.3673, 0.0044, 2, 0.21, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.Children.append(ChildContent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "vector": [13, 2, 0.3717, 0.0044, 2, 0.21, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ChildContent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "label": "GeneratePath", "type": "function", "loc": [86, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "vector": [2, 1, 0.4027, 0.0487, 1, 0.05, 1.0, 397, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "GeneratePath", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GeneratePath(self):\n #TODO: Compare siblings against regexps to suggest a regex replacement\n currentNode = self\n parentpath = \"\"\n while currentNode.Content != \"ROOTNODE\":\n if len(currentNode.Parent.Children) > ClusterGroup.VarThreshold:\n parentpath = \"[VARIABLE]\" + \" \" + parentpath\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L88_C8", "label": "currentNode =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "vector": [14, 2, 0.3894, 0.0044, 2, 0.34, 0.0, 578, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "currentNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " currentNode = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L89_C8", "label": "parentpath =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "vector": [14, 2, 0.3938, 0.0044, 2, 0.34, 0.3333, 934, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "parentpath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parentpath = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L90_C8", "label": "while", "type": "while", "loc": [90, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "vector": [5, 2, 0.4093, 0.0265, 2, 0.34, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while currentNode.Content != \"ROOTNODE\":\n if len(currentNode.Parent.Children) > ClusterGroup.VarThreshold:\n parentpath = \"[VARIABLE]\" + \" \" + parentpath\n else:\n parentpath = currentNode.Content + \" \" + parentpath\n currentNode = currentNode.Parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L91_C12", "label": "if", "type": "if", "loc": [91, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L90_C8", "vector": [4, 3, 0.4093, 0.0177, 3, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(currentNode.Parent.Children) > ClusterGroup.VarThreshold:\n parentpath = \"[VARIABLE]\" + \" \" + parentpath\n else:\n parentpath = currentNode.Content + \" \" + parentpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L92_C16", "label": "parentpath =", "type": "assigned_variable", "loc": [92, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L91_C12", "vector": [14, 4, 0.4071, 0.0044, 4, 0.26, 0.0, 934, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "parentpath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parentpath = \"[VARIABLE]\" + \" \" + parentpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L94_C16", "label": "parentpath =", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L91_C12", "vector": [14, 4, 0.4159, 0.0044, 4, 0.26, 1.0, 934, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "parentpath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parentpath = currentNode.Content + \" \" + parentpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L95_C12", "label": "currentNode =", "type": "assigned_variable", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L90_C8", "vector": [14, 3, 0.4204, 0.0044, 3, 0.19, 1.0, 578, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "currentNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " currentNode = currentNode.Parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "vector": [13, 2, 0.4248, 0.0044, 2, 0.34, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parentpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "label": "ClusterGroup", "type": "class", "loc": [98, 219], "level": 0, "parent": null, "vector": [3, 0, 0.7013, 0.5398, 0, 0.66, 1.0, 645, 0, 7, 0, 0, 186, 0, 39], "semantic": {"name": "ClusterGroup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ClusterGroup(object):\n \"\"\"\n A Group of word cluster, representing the unique log types within a logfile\n \"\"\" \n \n Args = \"\"\n Log = \"\"\n VarThreshold = 10 #How many siblings a string node must have before it is considered to be variable data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L99_C8", "label": "expression", "type": "expression", "loc": [99, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [8, 1, 0.4425, 0.0133, 1, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A Group of word cluster, representing the unique log types within a logfile\n \"\"\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L103_C8", "label": "Args =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [14, 1, 0.4558, 0.0044, 1, 0.37, 0.0769, 718, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "Args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Args = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L104_C8", "label": "Log =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [14, 1, 0.4602, 0.0044, 1, 0.37, 0.1538, 281, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "Log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Log = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L105_C8", "label": "VarThreshold =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [14, 1, 0.4646, 0.0044, 1, 0.37, 0.2308, 811, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "VarThreshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " VarThreshold = 10 #How many siblings a string node must have before it is considered to be variable data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L106_C8", "label": "VarDistance =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [14, 1, 0.469, 0.0044, 1, 0.37, 0.3077, 127, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "VarDistance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " VarDistance = 20"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L107_C8", "label": "rootNode = ClusterNode()", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [14, 1, 0.4735, 0.0044, 1, 0.37, 0.3846, 76, 3, 1, 0, 0, 645, 10, 1], "semantic": {"name": "rootNode", "arg_names": [], "import_names": [], "rhs_call_name": "ClusterNode", "annotation": ""}, "snippet": " rootNode = ClusterNode(NodeContent=\"ROOTNODE\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L108_C8", "label": "entries =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [14, 1, 0.4779, 0.0044, 1, 0.37, 0.4615, 764, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "entries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " entries = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L110_C8", "label": "__init__", "type": "function", "loc": [110, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [2, 1, 0.4912, 0.0133, 1, 0.37, 0.5385, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, args):\n self.rootNode = ClusterNode(NodeContent=\"ROOTNODE\") \n self.Args = args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L111_C16", "label": "self.rootNode = ClusterNode()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L110_C8", "vector": [14, 2, 0.4912, 0.0044, 2, 0.29, 0.0, 151, 3, 1, 0, 0, 645, 10, 1], "semantic": {"name": "self.rootNode", "arg_names": [], "import_names": [], "rhs_call_name": "ClusterNode", "annotation": ""}, "snippet": " self.rootNode = ClusterNode(NodeContent=\"ROOTNODE\") "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L112_C16", "label": "self.Args =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L110_C8", "vector": [14, 2, 0.4956, 0.0044, 2, 0.29, 1.0, 391, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.Args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Args = args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "label": "IsMatch", "type": "function", "loc": [114, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [2, 1, 0.5531, 0.1018, 1, 0.37, 0.6154, 834, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "IsMatch", "arg_names": ["self", "logline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IsMatch(self, logline): \n '''\n Test the incoming log line to see if it matches this clustergroup\n Return boolean match\n '''\n logwords = commonvars.FindCommonRegex(logline).split()\n \n #TODO Split at '=' marks as well"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L115_C16", "label": "expression", "type": "expression", "loc": [115, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "vector": [8, 2, 0.5155, 0.0177, 2, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Test the incoming log line to see if it matches this clustergroup\n Return boolean match\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L119_C16", "label": "logwords = split()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "vector": [14, 2, 0.5265, 0.0044, 2, 0.83, 0.3333, 902, 3, 0, 0, 0, 908, 10, 2], "semantic": {"name": "logwords", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " logwords = commonvars.FindCommonRegex(logline).split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L123_C16", "label": "currentNode =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "vector": [14, 2, 0.5442, 0.0044, 2, 0.83, 0.6667, 578, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "currentNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " currentNode = self.rootNode "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "label": "for logword", "type": "for", "loc": [124, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "vector": [6, 2, 0.5752, 0.0575, 2, 0.83, 1.0, 101, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "logword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logword in logwords: #process logs a word at a time \n #match our own children first\n match = currentNode.MatchChild(MatchContent=logword)\n\n if match == None: #then try our siblings\n match = currentNode.MatchNephew(MatchContent=logword)\n if match == None: #then add a new child\n match = currentNode.AddChild(NodeContent=logword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L126_C24", "label": "match = MatchChild()", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "vector": [14, 3, 0.5575, 0.0044, 3, 0.28, 0.0, 36, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "MatchChild", "annotation": ""}, "snippet": " match = currentNode.MatchChild(MatchContent=logword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L128_C24", "label": "if", "type": "if", "loc": [128, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "vector": [4, 3, 0.5686, 0.0088, 3, 0.28, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if match == None: #then try our siblings\n match = currentNode.MatchNephew(MatchContent=logword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L129_C32", "label": "match = MatchNephew()", "type": "assigned_variable", "loc": [129, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L128_C24", "vector": [14, 4, 0.5708, 0.0044, 4, 0.13, 0.0, 36, 3, 1, 0, 0, 381, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "MatchNephew", "annotation": ""}, "snippet": " match = currentNode.MatchNephew(MatchContent=logword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L130_C24", "label": "if", "type": "if", "loc": [130, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "vector": [4, 3, 0.5774, 0.0088, 3, 0.28, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if match == None: #then add a new child\n match = currentNode.AddChild(NodeContent=logword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L131_C32", "label": "match = AddChild()", "type": "assigned_variable", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L130_C24", "vector": [14, 4, 0.5796, 0.0044, 4, 0.02, 0.0, 36, 3, 1, 0, 0, 570, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "AddChild", "annotation": ""}, "snippet": " match = currentNode.AddChild(NodeContent=logword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L133_C24", "label": "if", "type": "if", "loc": [133, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "vector": [4, 3, 0.5951, 0.0177, 3, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if match == None:\n print(\"FAILED\")\n else:\n currentNode = match"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L134_C32", "label": "print()", "type": "expression", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L133_C24", "vector": [8, 4, 0.5929, 0.0044, 4, 0.43, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"FAILED\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L136_C32", "label": "currentNode =", "type": "assigned_variable", "loc": [136, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L133_C24", "vector": [14, 4, 0.6018, 0.0044, 4, 0.43, 1.0, 578, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "currentNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " currentNode = match"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "label": "IsEndNode", "type": "function", "loc": [139, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [2, 1, 0.6593, 0.0929, 1, 0.37, 0.6923, 492, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "IsEndNode", "arg_names": ["self", "Node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IsEndNode(self, Node):\n '''\n Is This Node the final word of a log template?\n \n @return: True or False\n '''\n endnode = False\n hasNephews = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L140_C16", "label": "expression", "type": "expression", "loc": [140, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "vector": [8, 2, 0.6283, 0.0221, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Is This Node the final word of a log template?\n \n @return: True or False\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L145_C16", "label": "endnode =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "vector": [14, 2, 0.6416, 0.0044, 2, 0.42, 0.25, 60, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "endnode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " endnode = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L146_C16", "label": "hasNephews =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "vector": [14, 2, 0.646, 0.0044, 2, 0.42, 0.5, 597, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "hasNephews", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hasNephews = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L147_C16", "label": "if", "type": "if", "loc": [147, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "vector": [4, 2, 0.6681, 0.0398, 2, 0.42, 0.75, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (len(Node.Children) is 0): #I'm an EndNode for a log wording cluster \n if Node.Parent is not None: #let's make sure our siblings are all endnodes too, and this is really var data \n for sibling in Node.Parent.Children:\n if len(sibling.Children) > 0 : \n hasNephews = True \n if (hasNephews is False) and (len(Node.Parent.Children) >= ClusterGroup.VarThreshold): #log event ends in a variable \n endnode = True\n if (hasNephews is False) and (len(Node.Parent.Children) == 1) : #log event ends in a fixed string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L148_C24", "label": "if", "type": "if", "loc": [148, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L147_C16", "vector": [4, 3, 0.6704, 0.0354, 3, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if Node.Parent is not None: #let's make sure our siblings are all endnodes too, and this is really var data \n for sibling in Node.Parent.Children:\n if len(sibling.Children) > 0 : \n hasNephews = True \n if (hasNephews is False) and (len(Node.Parent.Children) >= ClusterGroup.VarThreshold): #log event ends in a variable \n endnode = True\n if (hasNephews is False) and (len(Node.Parent.Children) == 1) : #log event ends in a fixed string\n endnode = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L149_C32", "label": "for sibling", "type": "for", "loc": [149, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L148_C24", "vector": [6, 4, 0.6637, 0.0133, 4, 0.15, 0.0, 667, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sibling", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sibling in Node.Parent.Children:\n if len(sibling.Children) > 0 : \n hasNephews = True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L150_C40", "label": "if", "type": "if", "loc": [150, 151], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L149_C32", "vector": [4, 5, 0.6659, 0.0088, 5, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sibling.Children) > 0 : \n hasNephews = True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L151_C48", "label": "hasNephews =", "type": "assigned_variable", "loc": [151, 151], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L150_C40", "vector": [14, 6, 0.6681, 0.0044, 6, 0.72, 0.0, 597, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "hasNephews", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hasNephews = True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L152_C32", "label": "if", "type": "if", "loc": [152, 153], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L148_C24", "vector": [4, 4, 0.6748, 0.0088, 4, 0.15, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (hasNephews is False) and (len(Node.Parent.Children) >= ClusterGroup.VarThreshold): #log event ends in a variable \n endnode = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L153_C40", "label": "endnode =", "type": "assigned_variable", "loc": [153, 153], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L152_C32", "vector": [14, 5, 0.677, 0.0044, 5, 0.11, 0.0, 60, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "endnode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " endnode = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L154_C32", "label": "if", "type": "if", "loc": [154, 155], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L148_C24", "vector": [4, 4, 0.6836, 0.0088, 4, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (hasNephews is False) and (len(Node.Parent.Children) == 1) : #log event ends in a fixed string\n endnode = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L155_C40", "label": "endnode =", "type": "assigned_variable", "loc": [155, 155], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L154_C32", "vector": [14, 5, 0.6858, 0.0044, 5, 0.75, 0.0, 60, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "endnode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " endnode = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L156_C16", "label": "if", "type": "if", "loc": [156, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "vector": [4, 2, 0.6969, 0.0177, 2, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if endnode is True:\n entry = Node.GeneratePath()\n if entry not in self.entries: \n self.entries.append(entry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L157_C24", "label": "entry = GeneratePath()", "type": "assigned_variable", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L156_C16", "vector": [14, 3, 0.6947, 0.0044, 3, 0.89, 0.0, 812, 3, 0, 0, 0, 397, 10, 1], "semantic": {"name": "entry", "arg_names": [], "import_names": [], "rhs_call_name": "GeneratePath", "annotation": ""}, "snippet": " entry = Node.GeneratePath()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L158_C24", "label": "if", "type": "if", "loc": [158, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L156_C16", "vector": [4, 3, 0.7013, 0.0088, 3, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if entry not in self.entries: \n self.entries.append(entry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L159_C32", "label": "append()", "type": "expression", "loc": [159, 159], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L158_C24", "vector": [8, 4, 0.7035, 0.0044, 4, 0.12, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.entries.append(entry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L162_C8", "label": "BuildResultsTree", "type": "function", "loc": [162, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [2, 1, 0.7345, 0.0398, 1, 0.37, 0.7692, 890, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "BuildResultsTree", "arg_names": ["self", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def BuildResultsTree(self, node):\n '''\n Recurse through the Node Tree, identifying and printing complete log patterns'\n \n @return: None (recursive function)\n '''\n if self.IsEndNode(node) == True : return None # no children so back up a level\n for childnode in node.Children:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L163_C16", "label": "expression", "type": "expression", "loc": [163, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L162_C8", "vector": [8, 2, 0.7301, 0.0221, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Recurse through the Node Tree, identifying and printing complete log patterns'\n \n @return: None (recursive function)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L168_C16", "label": "if", "type": "if", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L162_C8", "vector": [4, 2, 0.7434, 0.0044, 2, 0.02, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.IsEndNode(node) == True : return None # no children so back up a level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L168_C50", "label": "return", "type": "return", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L168_C16", "vector": [13, 3, 0.7434, 0.0044, 3, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.IsEndNode(node) == True : return None # no children so back up a level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L169_C16", "label": "for childnode", "type": "for", "loc": [169, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L162_C8", "vector": [6, 2, 0.75, 0.0088, 2, 0.02, 1.0, 832, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "childnode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for childnode in node.Children:\n self.BuildResultsTree(childnode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L170_C24", "label": "BuildResultsTree()", "type": "expression", "loc": [170, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L169_C16", "vector": [8, 3, 0.7522, 0.0044, 3, 0.46, 0.0, 890, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "BuildResultsTree", "arg_names": [], "import_names": [], "rhs_call_name": "BuildResultsTree", "annotation": ""}, "snippet": " self.BuildResultsTree(childnode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "label": "Results", "type": "function", "loc": [173, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [2, 1, 0.8053, 0.0841, 1, 0.37, 0.8462, 206, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "Results", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Results(self):\n '''\n Display all identified unique log event types\n \n @return None\n '''\n #if options.outfile == true: dump to file \n print(\"\\n========== Potential Unique Log Events ==========\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L174_C16", "label": "expression", "type": "expression", "loc": [174, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "vector": [8, 2, 0.7788, 0.0221, 2, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Display all identified unique log event types\n \n @return None\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L180_C16", "label": "print()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "vector": [8, 2, 0.7965, 0.0044, 2, 0.01, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"\\n========== Potential Unique Log Events ==========\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L181_C16", "label": "BuildResultsTree()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "vector": [8, 2, 0.8009, 0.0044, 2, 0.01, 0.5, 890, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "BuildResultsTree", "arg_names": [], "import_names": [], "rhs_call_name": "BuildResultsTree", "annotation": ""}, "snippet": " self.BuildResultsTree(self.rootNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L185_C16", "label": "previous =", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "vector": [14, 2, 0.8186, 0.0044, 2, 0.01, 0.75, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "previous", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " previous = '' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L186_C16", "label": "for entry", "type": "for", "loc": [186, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "vector": [6, 2, 0.8341, 0.0265, 2, 0.01, 1.0, 812, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "entry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for entry in self.entries:\n if levenshtein.levenshtein(entry, previous) < ClusterGroup.VarDistance : \n print(\"\\t\" + entry)\n else:\n print(entry)\n previous = entry"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L187_C20", "label": "if", "type": "if", "loc": [187, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L186_C16", "vector": [4, 3, 0.8341, 0.0177, 3, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if levenshtein.levenshtein(entry, previous) < ClusterGroup.VarDistance : \n print(\"\\t\" + entry)\n else:\n print(entry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L188_C24", "label": "print()", "type": "expression", "loc": [188, 188], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L187_C20", "vector": [8, 4, 0.8319, 0.0044, 4, 0.61, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"\\t\" + entry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L190_C24", "label": "print()", "type": "expression", "loc": [190, 190], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L187_C20", "vector": [8, 4, 0.8407, 0.0044, 4, 0.61, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(entry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L191_C20", "label": "previous =", "type": "assigned_variable", "loc": [191, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L186_C16", "vector": [14, 3, 0.8451, 0.0044, 3, 0.29, 1.0, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "previous", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " previous = entry"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "label": "Run", "type": "function", "loc": [193, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [2, 1, 0.8894, 0.0752, 1, 0.37, 0.9231, 989, 0, 1, 0, 0, 0, 0, 16], "semantic": {"name": "Run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Run(self):\n try:\n self.Log = LogFile(self.Args.logfile)\n except IOError:\n print(\"File: \" + self.Log.Filename + \" cannot be opened : \" + str(sys.exc_info()[1]))\n #TODO: log to stderr\n raise IOError()\n #if args.v > 0 : print \"Processing Log File \" + log.Filename + \":\" + str(log.Length) + \" bytes\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Try_L194_C16", "label": "try", "type": "try", "loc": [194, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "vector": [7, 2, 0.8695, 0.0265, 2, 0.62, 0.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.Log = LogFile(self.Args.logfile)\n except IOError:\n print(\"File: \" + self.Log.Filename + \" cannot be opened : \" + str(sys.exc_info()[1]))\n #TODO: log to stderr\n raise IOError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L195_C20", "label": "self.Log = LogFile()", "type": "assigned_variable", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:Try_L194_C16", "vector": [14, 3, 0.8628, 0.0044, 3, 0.93, 0.0, 311, 3, 1, 0, 0, 387, 10, 1], "semantic": {"name": "self.Log", "arg_names": [], "import_names": [], "rhs_call_name": "LogFile", "annotation": ""}, "snippet": " self.Log = LogFile(self.Args.logfile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L197_C20", "label": "print()", "type": "expression", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:Try_L194_C16", "vector": [8, 3, 0.8717, 0.0044, 3, 0.93, 0.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"File: \" + self.Log.Filename + \" cannot be opened : \" + str(sys.exc_info()[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L201_C16", "label": "logline = RetrieveCurrentLine()", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "vector": [14, 2, 0.8894, 0.0044, 2, 0.62, 0.2, 830, 3, 0, 0, 0, 65, 10, 1], "semantic": {"name": "logline", "arg_names": [], "import_names": [], "rhs_call_name": "RetrieveCurrentLine", "annotation": ""}, "snippet": " logline = self.Log.RetrieveCurrentLine() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L202_C16", "label": "widgets =", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "vector": [14, 2, 0.8938, 0.0044, 2, 0.62, 0.4, 178, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = ['Processing potential messages: ', progressbar.Percentage(), ' ', progressbar.Bar(marker=progressbar.RotatingMarker()), ' ', progressbar.ETA()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L203_C16", "label": "if", "type": "if", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "vector": [4, 2, 0.8982, 0.0044, 2, 0.62, 0.6, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.Args.quiet is False : pbar = progressbar.ProgressBar(widgets=widgets, maxval=100).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L203_C46", "label": "pbar = start()", "type": "assigned_variable", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L203_C16", "vector": [14, 3, 0.8982, 0.0044, 3, 0.02, 0.0, 378, 3, 0, 0, 0, 511, 10, 2], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " if self.Args.quiet is False : pbar = progressbar.ProgressBar(widgets=widgets, maxval=100).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L204_C16", "label": "while", "type": "while", "loc": [204, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "vector": [5, 2, 0.9093, 0.0177, 2, 0.62, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while logline != \"\": #TODO: Make this actually exit on EOF\n self.IsMatch(logline)\n if self.Args.quiet is False : pbar.update((1.0 * self.Log.Position / self.Log.Length) * 100)\n logline = self.Log.RetrieveCurrentLine()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L205_C20", "label": "IsMatch()", "type": "expression", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L204_C16", "vector": [8, 3, 0.9071, 0.0044, 3, 0.02, 0.0, 834, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "IsMatch", "arg_names": [], "import_names": [], "rhs_call_name": "IsMatch", "annotation": ""}, "snippet": " self.IsMatch(logline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L206_C20", "label": "if", "type": "if", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L204_C16", "vector": [4, 3, 0.9115, 0.0044, 3, 0.02, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.Args.quiet is False : pbar.update((1.0 * self.Log.Position / self.Log.Length) * 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L206_C50", "label": "update()", "type": "expression", "loc": [206, 206], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L206_C20", "vector": [8, 4, 0.9115, 0.0044, 4, 0.36, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " if self.Args.quiet is False : pbar.update((1.0 * self.Log.Position / self.Log.Length) * 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L207_C20", "label": "logline = RetrieveCurrentLine()", "type": "assigned_variable", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L204_C16", "vector": [14, 3, 0.9159, 0.0044, 3, 0.02, 1.0, 830, 3, 0, 0, 0, 65, 10, 1], "semantic": {"name": "logline", "arg_names": [], "import_names": [], "rhs_call_name": "RetrieveCurrentLine", "annotation": ""}, "snippet": " logline = self.Log.RetrieveCurrentLine()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L209_C16", "label": "if", "type": "if", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "vector": [4, 2, 0.9248, 0.0044, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.Args.quiet is False : pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L209_C46", "label": "finish()", "type": "expression", "loc": [209, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L209_C16", "vector": [8, 3, 0.9248, 0.0044, 3, 0.09, 0.0, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " if self.Args.quiet is False : pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "label": "GenPlugin", "type": "function", "loc": [211, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "vector": [2, 1, 0.9513, 0.0398, 1, 0.37, 1.0, 399, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "GenPlugin", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GenPlugin(self):\n '''\n Create a Template OSSIM agent plugin file using the identified log templates as SIDs\n \n @return: The filename of the generated plugin\n '''\n generator = plugingenerate.Generator(self.entries)\n generator.WritePlugin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L212_C12", "label": "expression", "type": "expression", "loc": [212, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "vector": [8, 2, 0.9469, 0.0221, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Create a Template OSSIM agent plugin file using the identified log templates as SIDs\n \n @return: The filename of the generated plugin\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L217_C12", "label": "generator = Generator()", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "vector": [14, 2, 0.9602, 0.0044, 2, 0.4, 0.3333, 878, 3, 1, 0, 0, 260, 10, 1], "semantic": {"name": "generator", "arg_names": [], "import_names": [], "rhs_call_name": "Generator", "annotation": ""}, "snippet": " generator = plugingenerate.Generator(self.entries)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L218_C12", "label": "WritePlugin()", "type": "expression", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "vector": [8, 2, 0.9646, 0.0044, 2, 0.4, 0.6667, 406, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "WritePlugin", "arg_names": [], "import_names": [], "rhs_call_name": "WritePlugin", "annotation": ""}, "snippet": " generator.WritePlugin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L219_C12", "label": "return", "type": "return", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "vector": [13, 2, 0.969, 0.0044, 2, 0.4, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return generator.PluginFile"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L60_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L61_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L63_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L61_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L65_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L74_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L75_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L75_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L76_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L91_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L91_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L111_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L115_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L119_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L126_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L128_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L128_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L129_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L130_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L130_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L131_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L124_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L133_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L133_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L134_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L133_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L136_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L140_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L145_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L146_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L147_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L147_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L148_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L148_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L149_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L149_C32", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L150_C40"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L150_C40", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L151_C48"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L148_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L152_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L152_C32", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L153_C40"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L148_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L154_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L154_C32", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L155_C40"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L156_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L156_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L157_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L156_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L158_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L158_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L159_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L168_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L168_C50"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L169_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L169_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L170_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L180_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L181_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L185_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L186_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L187_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L187_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L188_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L187_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L190_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L191_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Try_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:Try_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L195_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:Try_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L197_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L201_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L202_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L203_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L203_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L203_C46"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L204_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L204_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L205_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L204_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L206_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L206_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L206_C50"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:While_L204_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L207_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L193_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L209_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:If_L209_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L209_C46"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Assign_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Expr_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99998:FunctionDef_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99998:Return_L219_C12"}]
#!/usr/bin/python # -*- coding: iso-8859-1 -*- # # progressbar - Text progressbar library for python. # Copyright (c) 2005 Nilton Volpato # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """Text progressbar library for python. This library provides a text mode progressbar. This is tipically used to display the progress of a long running operation, providing a visual clue that processing is underway. The ProgressBar class manages the progress, and the format of the line is given by a number of widgets. A widget is an object that may display diferently depending on the state of the progress. There are three types of widget: - a string, which always shows itself; - a ProgressBarWidget, which may return a diferent value every time it's update method is called; and - a ProgressBarWidgetHFill, which is like ProgressBarWidget, except it expands to fill the remaining width of the line. The progressbar module is very easy to use, yet very powerful. And automatically supports features like auto-resizing when available. """ __author__ = "Nilton Volpato" __author_email__ = "first-name dot last-name @ gmail.com" __date__ = "2006-05-07" __version__ = "2.2" # Changelog # # 2006-05-07: v2.2 fixed bug in windows # 2005-12-04: v2.1 autodetect terminal width, added start method # 2005-12-04: v2.0 everything is now a widget (wow!) # 2005-12-03: v1.0 rewrite using widgets # 2005-06-02: v0.5 rewrite # 2004-??-??: v0.1 first version import sys, time from array import array try: from fcntl import ioctl import termios except ImportError: pass import signal class ProgressBarWidget(object): """This is an element of ProgressBar formatting. The ProgressBar object will call it's update value when an update is needed. It's size may change between call, but the results will not be good if the size changes drastically and repeatedly. """ def update(self, pbar): """Returns the string representing the widget. The parameter pbar is a reference to the calling ProgressBar, where one can access attributes of the class for knowing how the update must be made. At least this function must be overriden.""" pass class ProgressBarWidgetHFill(object): """This is a variable width element of ProgressBar formatting. The ProgressBar object will call it's update value, informing the width this object must the made. This is like TeX \\hfill, it will expand to fill the line. You can use more than one in the same line, and they will all have the same width, and together will fill the line. """ def update(self, pbar, width): """Returns the string representing the widget. The parameter pbar is a reference to the calling ProgressBar, where one can access attributes of the class for knowing how the update must be made. The parameter width is the total horizontal width the widget must have. At least this function must be overriden.""" pass class ETA(ProgressBarWidget): "Widget for the Estimated Time of Arrival" def format_time(self, seconds): return time.strftime('%H:%M:%S', time.gmtime(seconds)) def update(self, pbar): if pbar.currval == 0: return 'ETA: --:--:--' elif pbar.finished: return 'Time: %s' % self.format_time(pbar.seconds_elapsed) else: elapsed = pbar.seconds_elapsed eta = elapsed * pbar.maxval / pbar.currval - elapsed return 'ETA: %s' % self.format_time(eta) class FileTransferSpeed(ProgressBarWidget): "Widget for showing the transfer speed (useful for file transfers)." def __init__(self): self.fmt = '%6.2f %s' self.units = ['B', 'K', 'M', 'G', 'T', 'P'] def update(self, pbar): if pbar.seconds_elapsed < 2e-6:#== 0: bps = 0.0 else: bps = float(pbar.currval) / pbar.seconds_elapsed spd = bps for u in self.units: if spd < 1000: break spd /= 1000 return self.fmt % (spd, u + '/s') class RotatingMarker(ProgressBarWidget): "A rotating marker for filling the bar of progress." def __init__(self, markers='|/-\\'): self.markers = markers self.curmark = -1 def update(self, pbar): if pbar.finished: return self.markers[0] self.curmark = (self.curmark + 1) % len(self.markers) return self.markers[self.curmark] class Percentage(ProgressBarWidget): "Just the percentage done." def update(self, pbar): return '%3d%%' % pbar.percentage() class SimpleProgress(ProgressBarWidget): "Simple Progress: returns what is already done and the total, e.g. '5 of 47'" def update(self, pbar): return '%d of %d' % (pbar.currval, pbar.maxval) class Bar(ProgressBarWidgetHFill): "The bar of progress. It will strech to fill the line." def __init__(self, marker='#', left='|', right='|'): self.marker = marker self.left = left self.right = right def _format_marker(self, pbar): if isinstance(self.marker, (str, unicode)): return self.marker else: return self.marker.update(pbar) def update(self, pbar, width): percent = pbar.percentage() cwidth = width - len(self.left) - len(self.right) marked_width = int(percent * cwidth / 100) m = self._format_marker(pbar) bar = (self.left + (m * marked_width).ljust(cwidth) + self.right) return bar class ReverseBar(Bar): "The reverse bar of progress, or bar of regress. :)" def update(self, pbar, width): percent = pbar.percentage() cwidth = width - len(self.left) - len(self.right) marked_width = int(percent * cwidth / 100) m = self._format_marker(pbar) bar = (self.left + (m * marked_width).rjust(cwidth) + self.right) return bar default_widgets = [Percentage(), ' ', Bar()] class ProgressBar(object): """This is the ProgressBar class, it updates and prints the bar. The term_width parameter may be an integer. Or None, in which case it will try to guess it, if it fails it will default to 80 columns. The simple use is like this: >>> pbar = ProgressBar().start() >>> for i in xrange(100): ... # do something ... pbar.update(i+1) ... >>> pbar.finish() But anything you want to do is possible (well, almost anything). You can supply different widgets of any type in any order. And you can even write your own widgets! There are many widgets already shipped and you should experiment with them. When implementing a widget update method you may access any attribute or function of the ProgressBar object calling the widget's update method. The most important attributes you would like to access are: - currval: current value of the progress, 0 <= currval <= maxval - maxval: maximum (and final) value of the progress - finished: True if the bar is have finished (reached 100%), False o/w - start_time: first time update() method of ProgressBar was called - seconds_elapsed: seconds elapsed since start_time - percentage(): percentage of the progress (this is a method) """ def __init__(self, maxval=100, widgets=default_widgets, term_width=None, fd=sys.stderr): assert maxval > 0 self.maxval = maxval self.widgets = widgets self.fd = fd self.signal_set = False if term_width is None: try: self.handle_resize(None, None) signal.signal(signal.SIGWINCH, self.handle_resize) self.signal_set = True except: self.term_width = 79 else: self.term_width = term_width self.currval = 0 self.finished = False self.prev_percentage = -1 self.start_time = None self.seconds_elapsed = 0 def handle_resize(self, signum, frame): h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\0' * 8))[:2] self.term_width = w def percentage(self): "Returns the percentage of the progress." return self.currval * 100.0 / self.maxval def _format_widgets(self): r = [] hfill_inds = [] num_hfill = 0 currwidth = 0 for i, w in enumerate(self.widgets): if isinstance(w, ProgressBarWidgetHFill): r.append(w) hfill_inds.append(i) num_hfill += 1 elif isinstance(w, (str, unicode)): r.append(w) currwidth += len(w) else: weval = w.update(self) currwidth += len(weval) r.append(weval) for iw in hfill_inds: r[iw] = r[iw].update(self, (self.term_width - currwidth) / num_hfill) return r def _format_line(self): return ''.join(self._format_widgets()).ljust(self.term_width) def _need_update(self): return int(self.percentage()) != int(self.prev_percentage) def update(self, value): "Updates the progress bar to a new value." assert 0 <= value <= self.maxval self.currval = value if not self._need_update() or self.finished: return if not self.start_time: self.start_time = time.time() self.seconds_elapsed = time.time() - self.start_time self.prev_percentage = self.percentage() if value != self.maxval: self.fd.write(self._format_line() + '\r') else: self.finished = True self.fd.write(self._format_line() + '\n') def start(self): """Start measuring time, and prints the bar at 0%. It returns self so you can use it like this: >>> pbar = ProgressBar().start() >>> for i in xrange(100): ... # do something ... pbar.update(i+1) ... >>> pbar.finish() """ self.update(0) return self def finish(self): """Used to tell the progress is finished.""" self.update(self.maxval) if self.signal_set: signal.signal(signal.SIGWINCH, signal.SIG_DFL) if __name__ == '__main__': import os def example1(): widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()), ' ', ETA(), ' ', FileTransferSpeed()] pbar = ProgressBar(widgets=widgets, maxval=10000000).start() for i in range(1000000): # do something pbar.update(10 * i + 1) pbar.finish() print def example2(): class CrazyFileTransferSpeed(FileTransferSpeed): "It's bigger between 45 and 80 percent" def update(self, pbar): if 45 < pbar.percentage() < 80: return 'Bigger Now ' + FileTransferSpeed.update(self, pbar) else: return FileTransferSpeed.update(self, pbar) widgets = [CrazyFileTransferSpeed(), ' <<<', Bar(), '>>> ', Percentage(), ' ', ETA()] pbar = ProgressBar(widgets=widgets, maxval=10000000) # maybe do something pbar.start() for i in range(2000000): # do something pbar.update(5 * i + 1) pbar.finish() print def example3(): widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')] pbar = ProgressBar(widgets=widgets, maxval=10000000).start() for i in range(1000000): # do something pbar.update(10 * i + 1) pbar.finish() print def example4(): widgets = ['Test: ', Percentage(), ' ', Bar(marker='0', left='[', right=']'), ' ', ETA(), ' ', FileTransferSpeed()] pbar = ProgressBar(widgets=widgets, maxval=500) pbar.start() for i in range(100, 500 + 1, 50): time.sleep(0.2) pbar.update(i) pbar.finish() print example1() example2() example3() example4()
ajibawa-2023/Python-Code-Large/train/row_99999
199
373
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L22_C0", "label": "expression", "type": "expression", "loc": [22, 40], "level": 0, "parent": null, "vector": [8, 0, 0.0831, 0.0509, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Text progressbar library for python.\n\nThis library provides a text mode progressbar. This is tipically used\nto display the progress of a long running operation, providing a\nvisual clue that processing is underway.\n\nThe ProgressBar class manages the progress, and the format of the line\nis given by a number of widgets. A widget is an object that may"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L42_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.1126, 0.0027, 0, 0.66, 0.05, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = \"Nilton Volpato\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L43_C0", "label": "__author_email__ =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.1153, 0.0027, 0, 0.66, 0.1, 827, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author_email__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author_email__ = \"first-name dot last-name @ gmail.com\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L44_C0", "label": "__date__ =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.118, 0.0027, 0, 0.66, 0.15, 763, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__date__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__date__ = \"2006-05-07\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L45_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.1206, 0.0027, 0, 0.66, 0.2, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"2.2\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Import_L57_C0", "label": "sys import sys, time", "type": "import", "loc": [57, 57], "level": 0, "parent": null, "vector": [1, 0, 0.1528, 0.0027, 0, 0.66, 0.25, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ImportFrom_L58_C0", "label": "from array import array", "type": "import", "loc": [58, 58], "level": 0, "parent": null, "vector": [1, 0, 0.1555, 0.0027, 0, 0.66, 0.3, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": ["array"], "rhs_call_name": "", "annotation": ""}, "snippet": "from array import array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L59_C0", "label": "try", "type": "try", "loc": [59, 63], "level": 0, "parent": null, "vector": [7, 0, 0.1635, 0.0134, 0, 0.66, 0.35, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from fcntl import ioctl\n import termios\nexcept ImportError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ImportFrom_L60_C4", "label": "from fcntl import ioctl", "type": "import", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L59_C0", "vector": [1, 1, 0.1609, 0.0027, 1, 0.71, 0.0, 488, 0, 1, 0, 0, 488, 0, 0], "semantic": {"name": "fcntl", "arg_names": [], "import_names": ["ioctl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from fcntl import ioctl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Import_L61_C4", "label": "termios import termios", "type": "import", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L59_C0", "vector": [1, 1, 0.1635, 0.0027, 1, 0.71, 1.0, 139, 0, 1, 0, 0, 139, 0, 0], "semantic": {"name": "termios", "arg_names": [], "import_names": ["termios"], "rhs_call_name": "", "annotation": ""}, "snippet": " import termios"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Import_L64_C0", "label": "signal import signal", "type": "import", "loc": [64, 64], "level": 0, "parent": null, "vector": [1, 0, 0.1716, 0.0027, 0, 0.66, 0.4, 621, 0, 1, 0, 0, 621, 0, 0], "semantic": {"name": "signal", "arg_names": [], "import_names": ["signal"], "rhs_call_name": "", "annotation": ""}, "snippet": "import signal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L66_C0", "label": "ProgressBarWidget", "type": "class", "loc": [66, 81], "level": 0, "parent": null, "vector": [3, 0, 0.1971, 0.0429, 0, 0.66, 0.45, 196, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "ProgressBarWidget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProgressBarWidget(object):\n \"\"\"This is an element of ProgressBar formatting.\n\n The ProgressBar object will call it's update value when an update\n is needed. It's size may change between call, but the results will\n not be good if the size changes drastically and repeatedly.\n \"\"\"\n def update(self, pbar):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L67_C4", "label": "expression", "type": "expression", "loc": [67, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L66_C0", "vector": [8, 1, 0.1863, 0.0161, 1, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This is an element of ProgressBar formatting.\n\n The ProgressBar object will call it's update value when an update\n is needed. It's size may change between call, but the results will\n not be good if the size changes drastically and repeatedly.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L73_C4", "label": "update", "type": "function", "loc": [73, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L66_C0", "vector": [2, 1, 0.2064, 0.0241, 1, 0.14, 1.0, 637, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n \"\"\"Returns the string representing the widget.\n\n The parameter pbar is a reference to the calling ProgressBar,\n where one can access attributes of the class for knowing how\n the update must be made.\n\n At least this function must be overriden.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L74_C8", "label": "expression", "type": "expression", "loc": [74, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L73_C4", "vector": [8, 2, 0.2064, 0.0188, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the string representing the widget.\n\n The parameter pbar is a reference to the calling ProgressBar,\n where one can access attributes of the class for knowing how\n the update must be made.\n\n At least this function must be overriden.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L83_C0", "label": "ProgressBarWidgetHFill", "type": "class", "loc": [83, 101], "level": 0, "parent": null, "vector": [3, 0, 0.2466, 0.0509, 0, 0.66, 0.5, 335, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "ProgressBarWidgetHFill", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProgressBarWidgetHFill(object):\n \"\"\"This is a variable width element of ProgressBar formatting.\n\n The ProgressBar object will call it's update value, informing the\n width this object must the made. This is like TeX \\\\hfill, it will\n expand to fill the line. You can use more than one in the same\n line, and they will all have the same width, and together will\n fill the line."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L84_C4", "label": "expression", "type": "expression", "loc": [84, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L83_C0", "vector": [8, 1, 0.2346, 0.0214, 1, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This is a variable width element of ProgressBar formatting.\n\n The ProgressBar object will call it's update value, informing the\n width this object must the made. This is like TeX \\\\hfill, it will\n expand to fill the line. You can use more than one in the same\n line, and they will all have the same width, and together will\n fill the line.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L92_C4", "label": "update", "type": "function", "loc": [92, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L83_C0", "vector": [2, 1, 0.2587, 0.0268, 1, 0.43, 1.0, 637, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "update", "arg_names": ["self", "pbar", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar, width):\n \"\"\"Returns the string representing the widget.\n\n The parameter pbar is a reference to the calling ProgressBar,\n where one can access attributes of the class for knowing how\n the update must be made. The parameter width is the total\n horizontal width the widget must have.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L93_C8", "label": "expression", "type": "expression", "loc": [93, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L92_C4", "vector": [8, 2, 0.2587, 0.0214, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the string representing the widget.\n\n The parameter pbar is a reference to the calling ProgressBar,\n where one can access attributes of the class for knowing how\n the update must be made. The parameter width is the total\n horizontal width the widget must have.\n\n At least this function must be overriden.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L104_C0", "label": "ETA", "type": "class", "loc": [104, 116], "level": 0, "parent": null, "vector": [3, 0, 0.2949, 0.0349, 0, 0.66, 0.55, 292, 0, 2, 0, 0, 196, 0, 4], "semantic": {"name": "ETA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ETA(ProgressBarWidget):\n \"Widget for the Estimated Time of Arrival\"\n def format_time(self, seconds):\n return time.strftime('%H:%M:%S', time.gmtime(seconds))\n def update(self, pbar):\n if pbar.currval == 0:\n return 'ETA: --:--:--'\n elif pbar.finished:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L105_C4", "label": "expression", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L104_C0", "vector": [8, 1, 0.2815, 0.0027, 1, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Widget for the Estimated Time of Arrival\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L106_C4", "label": "format_time", "type": "function", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L104_C0", "vector": [2, 1, 0.2855, 0.0054, 1, 0.17, 0.5, 294, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "format_time", "arg_names": ["self", "seconds"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def format_time(self, seconds):\n return time.strftime('%H:%M:%S', time.gmtime(seconds))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L106_C4", "vector": [13, 2, 0.2869, 0.0027, 2, 0.32, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return time.strftime('%H:%M:%S', time.gmtime(seconds))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L108_C4", "label": "update", "type": "function", "loc": [108, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L104_C0", "vector": [2, 1, 0.3003, 0.0241, 1, 0.17, 1.0, 637, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n if pbar.currval == 0:\n return 'ETA: --:--:--'\n elif pbar.finished:\n return 'Time: %s' % self.format_time(pbar.seconds_elapsed)\n else:\n elapsed = pbar.seconds_elapsed\n eta = elapsed * pbar.maxval / pbar.currval - elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L109_C8", "label": "if", "type": "if", "loc": [109, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L108_C4", "vector": [4, 2, 0.3016, 0.0214, 2, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pbar.currval == 0:\n return 'ETA: --:--:--'\n elif pbar.finished:\n return 'Time: %s' % self.format_time(pbar.seconds_elapsed)\n else:\n elapsed = pbar.seconds_elapsed\n eta = elapsed * pbar.maxval / pbar.currval - elapsed\n return 'ETA: %s' % self.format_time(eta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L110_C12", "label": "return", "type": "return", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L109_C8", "vector": [13, 3, 0.2949, 0.0027, 3, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'ETA: --:--:--'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "label": "if", "type": "if", "loc": [111, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L109_C8", "vector": [4, 3, 0.3043, 0.0161, 3, 0.75, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif pbar.finished:\n return 'Time: %s' % self.format_time(pbar.seconds_elapsed)\n else:\n elapsed = pbar.seconds_elapsed\n eta = elapsed * pbar.maxval / pbar.currval - elapsed\n return 'ETA: %s' % self.format_time(eta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L112_C12", "label": "return", "type": "return", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "vector": [13, 4, 0.3003, 0.0027, 4, 0.51, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Time: %s' % self.format_time(pbar.seconds_elapsed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L114_C12", "label": "elapsed =", "type": "assigned_variable", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "vector": [14, 4, 0.3056, 0.0027, 4, 0.51, 0.3333, 61, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "elapsed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elapsed = pbar.seconds_elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L115_C12", "label": "eta =", "type": "assigned_variable", "loc": [115, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "vector": [14, 4, 0.3083, 0.0027, 4, 0.51, 0.6667, 870, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "eta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " eta = elapsed * pbar.maxval / pbar.currval - elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L116_C12", "label": "return", "type": "return", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "vector": [13, 4, 0.311, 0.0027, 4, 0.51, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'ETA: %s' % self.format_time(eta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L118_C0", "label": "FileTransferSpeed", "type": "class", "loc": [118, 133], "level": 0, "parent": null, "vector": [3, 0, 0.3365, 0.0429, 0, 0.66, 0.6, 29, 0, 2, 0, 0, 196, 0, 1], "semantic": {"name": "FileTransferSpeed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FileTransferSpeed(ProgressBarWidget):\n \"Widget for showing the transfer speed (useful for file transfers).\"\n def __init__(self):\n self.fmt = '%6.2f %s'\n self.units = ['B', 'K', 'M', 'G', 'T', 'P']\n def update(self, pbar):\n if pbar.seconds_elapsed < 2e-6:#== 0:\n bps = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L119_C4", "label": "expression", "type": "expression", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L118_C0", "vector": [8, 1, 0.319, 0.0027, 1, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Widget for showing the transfer speed (useful for file transfers).\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L120_C4", "label": "__init__", "type": "function", "loc": [120, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L118_C0", "vector": [2, 1, 0.3244, 0.008, 1, 0.36, 0.5, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.fmt = '%6.2f %s'\n self.units = ['B', 'K', 'M', 'G', 'T', 'P']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L121_C8", "label": "self.fmt =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L120_C4", "vector": [14, 2, 0.3244, 0.0027, 2, 0.81, 0.0, 111, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.fmt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fmt = '%6.2f %s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L122_C8", "label": "self.units =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L120_C4", "vector": [14, 2, 0.3271, 0.0027, 2, 0.81, 1.0, 508, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.units", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.units = ['B', 'K', 'M', 'G', 'T', 'P']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "label": "update", "type": "function", "loc": [123, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L118_C0", "vector": [2, 1, 0.3432, 0.0295, 1, 0.36, 1.0, 637, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n if pbar.seconds_elapsed < 2e-6:#== 0:\n bps = 0.0\n else:\n bps = float(pbar.currval) / pbar.seconds_elapsed\n spd = bps\n for u in self.units:\n if spd < 1000:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L124_C8", "label": "if", "type": "if", "loc": [124, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "vector": [4, 2, 0.3365, 0.0107, 2, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pbar.seconds_elapsed < 2e-6:#== 0:\n bps = 0.0\n else:\n bps = float(pbar.currval) / pbar.seconds_elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L125_C12", "label": "bps =", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L124_C8", "vector": [14, 3, 0.3351, 0.0027, 3, 0.91, 0.0, 90, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bps = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L127_C12", "label": "bps =", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L124_C8", "vector": [14, 3, 0.3405, 0.0027, 3, 0.91, 1.0, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bps = float(pbar.currval) / pbar.seconds_elapsed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L128_C8", "label": "spd =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "vector": [14, 2, 0.3432, 0.0027, 2, 0.94, 0.3333, 974, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "spd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " spd = bps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L129_C8", "label": "for u", "type": "for", "loc": [129, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "vector": [6, 2, 0.3499, 0.0107, 2, 0.94, 0.6667, 609, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "u", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for u in self.units:\n if spd < 1000:\n break\n spd /= 1000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L130_C12", "label": "if", "type": "if", "loc": [130, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L129_C8", "vector": [4, 3, 0.3499, 0.0054, 3, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if spd < 1000:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L133_C8", "label": "return", "type": "return", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "vector": [13, 2, 0.3566, 0.0027, 2, 0.94, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.fmt % (spd, u + '/s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L135_C0", "label": "RotatingMarker", "type": "class", "loc": [135, 144], "level": 0, "parent": null, "vector": [3, 0, 0.374, 0.0268, 0, 0.66, 0.65, 956, 0, 2, 0, 0, 196, 0, 1], "semantic": {"name": "RotatingMarker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RotatingMarker(ProgressBarWidget):\n \"A rotating marker for filling the bar of progress.\"\n def __init__(self, markers='|/-\\\\'):\n self.markers = markers\n self.curmark = -1\n def update(self, pbar):\n if pbar.finished:\n return self.markers[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L136_C4", "label": "expression", "type": "expression", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L135_C0", "vector": [8, 1, 0.3646, 0.0027, 1, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"A rotating marker for filling the bar of progress.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L137_C4", "label": "__init__", "type": "function", "loc": [137, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L135_C0", "vector": [2, 1, 0.37, 0.008, 1, 0.52, 0.5, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "markers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, markers='|/-\\\\'):\n self.markers = markers\n self.curmark = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L138_C8", "label": "self.markers =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L137_C4", "vector": [14, 2, 0.37, 0.0027, 2, 0.51, 0.0, 796, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.markers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.markers = markers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L139_C8", "label": "self.curmark =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L137_C4", "vector": [14, 2, 0.3727, 0.0027, 2, 0.51, 1.0, 123, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.curmark", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curmark = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L140_C4", "label": "update", "type": "function", "loc": [140, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L135_C0", "vector": [2, 1, 0.3807, 0.0134, 1, 0.52, 1.0, 637, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n if pbar.finished:\n return self.markers[0]\n self.curmark = (self.curmark + 1) % len(self.markers)\n return self.markers[self.curmark]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L141_C8", "label": "if", "type": "if", "loc": [141, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L140_C4", "vector": [4, 2, 0.3794, 0.0054, 2, 0.41, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pbar.finished:\n return self.markers[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L142_C12", "label": "return", "type": "return", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L141_C8", "vector": [13, 3, 0.3807, 0.0027, 3, 0.76, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.markers[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L143_C8", "label": "self.curmark =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L140_C4", "vector": [14, 2, 0.3834, 0.0027, 2, 0.41, 0.5, 123, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.curmark", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.curmark = (self.curmark + 1) % len(self.markers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L144_C8", "label": "return", "type": "return", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L140_C4", "vector": [13, 2, 0.3861, 0.0027, 2, 0.41, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.markers[self.curmark]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L146_C0", "label": "Percentage", "type": "class", "loc": [146, 149], "level": 0, "parent": null, "vector": [3, 0, 0.3954, 0.0107, 0, 0.66, 0.7, 165, 0, 1, 0, 0, 196, 0, 1], "semantic": {"name": "Percentage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Percentage(ProgressBarWidget):\n \"Just the percentage done.\"\n def update(self, pbar):\n return '%3d%%' % pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L147_C4", "label": "expression", "type": "expression", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L146_C0", "vector": [8, 1, 0.3941, 0.0027, 1, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Just the percentage done.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L148_C4", "label": "update", "type": "function", "loc": [148, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L146_C0", "vector": [2, 1, 0.3981, 0.0054, 1, 0.84, 1.0, 637, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n return '%3d%%' % pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L149_C8", "label": "return", "type": "return", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L148_C4", "vector": [13, 2, 0.3995, 0.0027, 2, 0.28, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%3d%%' % pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L151_C0", "label": "SimpleProgress", "type": "class", "loc": [151, 154], "level": 0, "parent": null, "vector": [3, 0, 0.4088, 0.0107, 0, 0.66, 0.75, 930, 0, 1, 0, 0, 196, 0, 0], "semantic": {"name": "SimpleProgress", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimpleProgress(ProgressBarWidget):\n \"Simple Progress: returns what is already done and the total, e.g. '5 of 47'\"\n def update(self, pbar):\n return '%d of %d' % (pbar.currval, pbar.maxval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L152_C4", "label": "expression", "type": "expression", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L151_C0", "vector": [8, 1, 0.4075, 0.0027, 1, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Simple Progress: returns what is already done and the total, e.g. '5 of 47'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L153_C4", "label": "update", "type": "function", "loc": [153, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L151_C0", "vector": [2, 1, 0.4115, 0.0054, 1, 0.8, 1.0, 637, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n return '%d of %d' % (pbar.currval, pbar.maxval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L154_C8", "label": "return", "type": "return", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L153_C4", "vector": [13, 2, 0.4129, 0.0027, 2, 0.96, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%d of %d' % (pbar.currval, pbar.maxval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "label": "Bar", "type": "class", "loc": [156, 173], "level": 0, "parent": null, "vector": [3, 0, 0.441, 0.0483, 0, 0.66, 0.8, 854, 0, 3, 0, 0, 335, 0, 8], "semantic": {"name": "Bar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Bar(ProgressBarWidgetHFill):\n \"The bar of progress. It will strech to fill the line.\"\n def __init__(self, marker='#', left='|', right='|'):\n self.marker = marker\n self.left = left\n self.right = right\n def _format_marker(self, pbar):\n if isinstance(self.marker, (str, unicode)):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L157_C4", "label": "expression", "type": "expression", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "vector": [8, 1, 0.4209, 0.0027, 1, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"The bar of progress. It will strech to fill the line.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L158_C4", "label": "__init__", "type": "function", "loc": [158, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "vector": [2, 1, 0.4276, 0.0107, 1, 0.3, 0.3333, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "marker", "left", "right"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, marker='#', left='|', right='|'):\n self.marker = marker\n self.left = left\n self.right = right"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L159_C8", "label": "self.marker =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L158_C4", "vector": [14, 2, 0.4263, 0.0027, 2, 0.42, 0.0, 371, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.marker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.marker = marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L160_C8", "label": "self.left =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L158_C4", "vector": [14, 2, 0.429, 0.0027, 2, 0.42, 0.5, 643, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.left = left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L161_C8", "label": "self.right =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L158_C4", "vector": [14, 2, 0.4316, 0.0027, 2, 0.42, 1.0, 683, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right = right"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L162_C4", "label": "_format_marker", "type": "function", "loc": [162, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "vector": [2, 1, 0.4397, 0.0134, 1, 0.3, 0.6667, 142, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_format_marker", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_marker(self, pbar):\n if isinstance(self.marker, (str, unicode)):\n return self.marker\n else:\n return self.marker.update(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L163_C8", "label": "if", "type": "if", "loc": [163, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L162_C4", "vector": [4, 2, 0.441, 0.0107, 2, 0.93, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(self.marker, (str, unicode)):\n return self.marker\n else:\n return self.marker.update(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L164_C12", "label": "return", "type": "return", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L163_C8", "vector": [13, 3, 0.4397, 0.0027, 3, 0.9, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L166_C12", "label": "return", "type": "return", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L163_C8", "vector": [13, 3, 0.445, 0.0027, 3, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.marker.update(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "label": "update", "type": "function", "loc": [167, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "vector": [2, 1, 0.4558, 0.0188, 1, 0.3, 1.0, 637, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "update", "arg_names": ["self", "pbar", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar, width):\n percent = pbar.percentage()\n cwidth = width - len(self.left) - len(self.right)\n marked_width = int(percent * cwidth / 100)\n m = self._format_marker(pbar)\n bar = (self.left + (m * marked_width).ljust(cwidth) + self.right)\n return bar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L168_C8", "label": "percent = percentage()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "vector": [14, 2, 0.4504, 0.0027, 2, 0.33, 0.0, 948, 3, 0, 0, 0, 568, 10, 1], "semantic": {"name": "percent", "arg_names": [], "import_names": [], "rhs_call_name": "percentage", "annotation": ""}, "snippet": " percent = pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L169_C8", "label": "cwidth =", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "vector": [14, 2, 0.4531, 0.0027, 2, 0.33, 0.2, 217, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cwidth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cwidth = width - len(self.left) - len(self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L170_C8", "label": "marked_width = int()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "vector": [14, 2, 0.4558, 0.0027, 2, 0.33, 0.4, 478, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "marked_width", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " marked_width = int(percent * cwidth / 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L171_C8", "label": "m = _format_marker()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "vector": [14, 2, 0.4584, 0.0027, 2, 0.33, 0.6, 711, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "_format_marker", "annotation": ""}, "snippet": " m = self._format_marker(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L172_C8", "label": "bar =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "vector": [14, 2, 0.4611, 0.0027, 2, 0.33, 0.8, 300, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bar = (self.left + (m * marked_width).ljust(cwidth) + self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L173_C8", "label": "return", "type": "return", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "vector": [13, 2, 0.4638, 0.0027, 2, 0.33, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L175_C0", "label": "ReverseBar", "type": "class", "loc": [175, 183], "level": 0, "parent": null, "vector": [3, 0, 0.4799, 0.0241, 0, 0.66, 0.85, 205, 0, 1, 0, 0, 854, 0, 6], "semantic": {"name": "ReverseBar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ReverseBar(Bar):\n \"The reverse bar of progress, or bar of regress. :)\"\n def update(self, pbar, width):\n percent = pbar.percentage()\n cwidth = width - len(self.left) - len(self.right)\n marked_width = int(percent * cwidth / 100)\n m = self._format_marker(pbar)\n bar = (self.left + (m * marked_width).rjust(cwidth) + self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L176_C4", "label": "expression", "type": "expression", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L175_C0", "vector": [8, 1, 0.4718, 0.0027, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"The reverse bar of progress, or bar of regress. :)\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "label": "update", "type": "function", "loc": [177, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L175_C0", "vector": [2, 1, 0.4826, 0.0188, 1, 0.59, 1.0, 637, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "update", "arg_names": ["self", "pbar", "width"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar, width):\n percent = pbar.percentage()\n cwidth = width - len(self.left) - len(self.right)\n marked_width = int(percent * cwidth / 100)\n m = self._format_marker(pbar)\n bar = (self.left + (m * marked_width).rjust(cwidth) + self.right)\n return bar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L178_C8", "label": "percent = percentage()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "vector": [14, 2, 0.4772, 0.0027, 2, 0.03, 0.0, 948, 3, 0, 0, 0, 568, 10, 1], "semantic": {"name": "percent", "arg_names": [], "import_names": [], "rhs_call_name": "percentage", "annotation": ""}, "snippet": " percent = pbar.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L179_C8", "label": "cwidth =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "vector": [14, 2, 0.4799, 0.0027, 2, 0.03, 0.2, 217, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cwidth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cwidth = width - len(self.left) - len(self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L180_C8", "label": "marked_width = int()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "vector": [14, 2, 0.4826, 0.0027, 2, 0.03, 0.4, 478, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "marked_width", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " marked_width = int(percent * cwidth / 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L181_C8", "label": "m = _format_marker()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "vector": [14, 2, 0.4853, 0.0027, 2, 0.03, 0.6, 711, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "_format_marker", "annotation": ""}, "snippet": " m = self._format_marker(pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L182_C8", "label": "bar =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "vector": [14, 2, 0.4879, 0.0027, 2, 0.03, 0.8, 300, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bar = (self.left + (m * marked_width).rjust(cwidth) + self.right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "vector": [13, 2, 0.4906, 0.0027, 2, 0.03, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L185_C0", "label": "default_widgets =", "type": "assigned_variable", "loc": [185, 185], "level": 0, "parent": null, "vector": [14, 0, 0.496, 0.0027, 0, 0.66, 0.9, 688, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "default_widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "default_widgets = [Percentage(), ' ', Bar()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "label": "ProgressBar", "type": "class", "loc": [186, 308], "level": 0, "parent": null, "vector": [3, 0, 0.6622, 0.3298, 0, 0.66, 0.95, 657, 0, 9, 0, 0, 186, 0, 32], "semantic": {"name": "ProgressBar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProgressBar(object):\n \"\"\"This is the ProgressBar class, it updates and prints the bar.\n\n The term_width parameter may be an integer. Or None, in which case\n it will try to guess it, if it fails it will default to 80 columns.\n\n The simple use is like this:\n >>> pbar = ProgressBar().start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L187_C4", "label": "expression", "type": "expression", "loc": [187, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [8, 1, 0.5389, 0.0777, 1, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This is the ProgressBar class, it updates and prints the bar.\n\n The term_width parameter may be an integer. Or None, in which case\n it will try to guess it, if it fails it will default to 80 columns.\n\n The simple use is like this:\n >>> pbar = ProgressBar().start()\n >>> for i in xrange(100):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "label": "__init__", "type": "function", "loc": [216, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.6072, 0.059, 1, 0.71, 0.1111, 555, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "maxval", "widgets", "term_width", "fd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, maxval=100, widgets=default_widgets, term_width=None,\n fd=sys.stderr):\n assert maxval > 0\n self.maxval = maxval\n self.widgets = widgets\n self.fd = fd\n self.signal_set = False\n if term_width is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L219_C8", "label": "self.maxval =", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.5871, 0.0027, 2, 0.8, 0.0, 380, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.maxval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.maxval = maxval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L220_C8", "label": "self.widgets =", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.5898, 0.0027, 2, 0.8, 0.1111, 22, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.widgets = widgets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L221_C8", "label": "self.fd =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.5925, 0.0027, 2, 0.8, 0.2222, 362, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.fd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fd = fd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L222_C8", "label": "self.signal_set =", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.5952, 0.0027, 2, 0.8, 0.3333, 467, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.signal_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.signal_set = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L223_C8", "label": "if", "type": "if", "loc": [223, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [4, 2, 0.6086, 0.0241, 2, 0.8, 0.4444, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if term_width is None:\n try:\n self.handle_resize(None, None)\n signal.signal(signal.SIGWINCH, self.handle_resize)\n self.signal_set = True\n except:\n self.term_width = 79\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "label": "try", "type": "try", "loc": [224, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L223_C8", "vector": [7, 3, 0.6072, 0.0161, 3, 0.11, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.handle_resize(None, None)\n signal.signal(signal.SIGWINCH, self.handle_resize)\n self.signal_set = True\n except:\n self.term_width = 79"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L225_C16", "label": "handle_resize()", "type": "expression", "loc": [225, 225], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "vector": [8, 4, 0.6032, 0.0027, 4, 0.58, 0.0, 222, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "handle_resize", "arg_names": [], "import_names": [], "rhs_call_name": "handle_resize", "annotation": ""}, "snippet": " self.handle_resize(None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L226_C16", "label": "signal()", "type": "expression", "loc": [226, 226], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "vector": [8, 4, 0.6059, 0.0027, 4, 0.58, 0.5, 621, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "signal", "arg_names": [], "import_names": [], "rhs_call_name": "signal", "annotation": ""}, "snippet": " signal.signal(signal.SIGWINCH, self.handle_resize)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L227_C16", "label": "self.signal_set =", "type": "assigned_variable", "loc": [227, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "vector": [14, 4, 0.6086, 0.0027, 4, 0.58, 1.0, 467, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.signal_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.signal_set = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L229_C16", "label": "self.term_width =", "type": "assigned_variable", "loc": [229, 229], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "vector": [14, 4, 0.6139, 0.0027, 4, 0.58, 0.0, 23, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.term_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.term_width = 79"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L231_C12", "label": "self.term_width =", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L223_C8", "vector": [14, 3, 0.6193, 0.0027, 3, 0.11, 1.0, 23, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.term_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.term_width = term_width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L233_C8", "label": "self.currval =", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.6247, 0.0027, 2, 0.8, 0.5556, 616, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.currval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.currval = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L234_C8", "label": "self.finished =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.6273, 0.0027, 2, 0.8, 0.6667, 742, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.finished", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.finished = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L235_C8", "label": "self.prev_percentage =", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.63, 0.0027, 2, 0.8, 0.7778, 810, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prev_percentage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prev_percentage = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L236_C8", "label": "self.start_time =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.6327, 0.0027, 2, 0.8, 0.8889, 387, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.start_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start_time = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L237_C8", "label": "self.seconds_elapsed =", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "vector": [14, 2, 0.6354, 0.0027, 2, 0.8, 1.0, 205, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.seconds_elapsed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seconds_elapsed = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L239_C4", "label": "handle_resize", "type": "function", "loc": [239, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.6434, 0.008, 1, 0.71, 0.2222, 222, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "handle_resize", "arg_names": ["self", "signum", "frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_resize(self, signum, frame):\n h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\\0' * 8))[:2]\n self.term_width = w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L240_C8", "label": "h, w =", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L239_C4", "vector": [14, 2, 0.6434, 0.0027, 2, 0.64, 0.0, 493, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h, w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\\0' * 8))[:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L241_C8", "label": "self.term_width =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L239_C4", "vector": [14, 2, 0.6461, 0.0027, 2, 0.64, 1.0, 23, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.term_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.term_width = w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L243_C4", "label": "percentage", "type": "function", "loc": [243, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.6542, 0.008, 1, 0.71, 0.3333, 568, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "percentage", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def percentage(self):\n \"Returns the percentage of the progress.\"\n return self.currval * 100.0 / self.maxval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L244_C8", "label": "expression", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L243_C4", "vector": [8, 2, 0.6542, 0.0027, 2, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns the percentage of the progress.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L245_C8", "label": "return", "type": "return", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L243_C4", "vector": [13, 2, 0.6568, 0.0027, 2, 0.14, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.currval * 100.0 / self.maxval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "label": "_format_widgets", "type": "function", "loc": [247, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.6877, 0.0536, 1, 0.71, 0.4444, 567, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "_format_widgets", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_widgets(self):\n r = []\n hfill_inds = []\n num_hfill = 0\n currwidth = 0\n for i, w in enumerate(self.widgets):\n if isinstance(w, ProgressBarWidgetHFill):\n r.append(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L248_C8", "label": "r =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "vector": [14, 2, 0.6649, 0.0027, 2, 0.11, 0.0, 436, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L249_C8", "label": "hfill_inds =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "vector": [14, 2, 0.6676, 0.0027, 2, 0.11, 0.1667, 534, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "hfill_inds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hfill_inds = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L250_C8", "label": "num_hfill =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "vector": [14, 2, 0.6702, 0.0027, 2, 0.11, 0.3333, 610, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_hfill", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_hfill = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L251_C8", "label": "currwidth =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "vector": [14, 2, 0.6729, 0.0027, 2, 0.11, 0.5, 966, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "currwidth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " currwidth = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L252_C8", "label": "for i, w", "type": "for", "loc": [252, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "vector": [6, 2, 0.6903, 0.0322, 2, 0.11, 0.6667, 517, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i, w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, w in enumerate(self.widgets):\n if isinstance(w, ProgressBarWidgetHFill):\n r.append(w)\n hfill_inds.append(i)\n num_hfill += 1\n elif isinstance(w, (str, unicode)):\n r.append(w)\n currwidth += len(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L253_C12", "label": "if", "type": "if", "loc": [253, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L252_C8", "vector": [4, 3, 0.6917, 0.0295, 3, 0.98, 0.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(w, ProgressBarWidgetHFill):\n r.append(w)\n hfill_inds.append(i)\n num_hfill += 1\n elif isinstance(w, (str, unicode)):\n r.append(w)\n currwidth += len(w)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L254_C16", "label": "append()", "type": "expression", "loc": [254, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L253_C12", "vector": [8, 4, 0.681, 0.0027, 4, 0.51, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " r.append(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L255_C16", "label": "append()", "type": "expression", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L253_C12", "vector": [8, 4, 0.6836, 0.0027, 4, 0.51, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hfill_inds.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L257_C12", "label": "if", "type": "if", "loc": [257, 263], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L253_C12", "vector": [4, 4, 0.6971, 0.0188, 4, 0.51, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(w, (str, unicode)):\n r.append(w)\n currwidth += len(w)\n else:\n weval = w.update(self)\n currwidth += len(weval)\n r.append(weval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L258_C16", "label": "append()", "type": "expression", "loc": [258, 258], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L257_C12", "vector": [8, 5, 0.6917, 0.0027, 5, 0.25, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " r.append(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L261_C16", "label": "weval = update()", "type": "assigned_variable", "loc": [261, 261], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L257_C12", "vector": [14, 5, 0.6997, 0.0027, 5, 0.25, 0.5, 39, 3, 1, 0, 0, 637, 10, 1], "semantic": {"name": "weval", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " weval = w.update(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L263_C16", "label": "append()", "type": "expression", "loc": [263, 263], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L257_C12", "vector": [8, 5, 0.7051, 0.0027, 5, 0.25, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " r.append(weval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L264_C8", "label": "for iw", "type": "for", "loc": [264, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "vector": [6, 2, 0.7091, 0.0054, 2, 0.11, 0.8333, 366, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "iw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for iw in hfill_inds:\n r[iw] = r[iw].update(self, (self.term_width - currwidth) / num_hfill)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L265_C12", "label": " = update()", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L264_C8", "vector": [14, 3, 0.7105, 0.0027, 3, 0.14, 0.0, 0, 3, 2, 0, 0, 637, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " r[iw] = r[iw].update(self, (self.term_width - currwidth) / num_hfill)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L266_C8", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "vector": [13, 2, 0.7131, 0.0027, 2, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L268_C4", "label": "_format_line", "type": "function", "loc": [268, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.7198, 0.0054, 1, 0.71, 0.5556, 66, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_format_line", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_line(self):\n return ''.join(self._format_widgets()).ljust(self.term_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L269_C8", "label": "return", "type": "return", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L268_C4", "vector": [13, 2, 0.7212, 0.0027, 2, 0.07, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join(self._format_widgets()).ljust(self.term_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L271_C4", "label": "_need_update", "type": "function", "loc": [271, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.7279, 0.0054, 1, 0.71, 0.6667, 994, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_need_update", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _need_update(self):\n return int(self.percentage()) != int(self.prev_percentage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L272_C8", "label": "return", "type": "return", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L271_C4", "vector": [13, 2, 0.7292, 0.0027, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(self.percentage()) != int(self.prev_percentage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "label": "update", "type": "function", "loc": [274, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.7534, 0.0402, 1, 0.71, 0.7778, 637, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "update", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, value):\n \"Updates the progress bar to a new value.\"\n assert 0 <= value <= self.maxval\n self.currval = value\n if not self._need_update() or self.finished:\n return\n if not self.start_time:\n self.start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L275_C8", "label": "expression", "type": "expression", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "vector": [8, 2, 0.7373, 0.0027, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Updates the progress bar to a new value.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L277_C8", "label": "self.currval =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "vector": [14, 2, 0.7426, 0.0027, 2, 0.41, 0.1667, 616, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.currval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.currval = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L278_C8", "label": "if", "type": "if", "loc": [278, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "vector": [4, 2, 0.7466, 0.0054, 2, 0.41, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._need_update() or self.finished:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L279_C12", "label": "return", "type": "return", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L278_C8", "vector": [13, 3, 0.748, 0.0027, 3, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L280_C8", "label": "if", "type": "if", "loc": [280, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "vector": [4, 2, 0.752, 0.0054, 2, 0.41, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.start_time:\n self.start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L281_C12", "label": "self.start_time = time()", "type": "assigned_variable", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L280_C8", "vector": [14, 3, 0.7534, 0.0027, 3, 0.73, 0.0, 387, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L282_C8", "label": "self.seconds_elapsed =", "type": "assigned_variable", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "vector": [14, 2, 0.756, 0.0027, 2, 0.41, 0.6667, 205, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.seconds_elapsed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seconds_elapsed = time.time() - self.start_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L283_C8", "label": "self.prev_percentage = percentage()", "type": "assigned_variable", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "vector": [14, 2, 0.7587, 0.0027, 2, 0.41, 0.8333, 810, 3, 0, 0, 0, 568, 10, 1], "semantic": {"name": "self.prev_percentage", "arg_names": [], "import_names": [], "rhs_call_name": "percentage", "annotation": ""}, "snippet": " self.prev_percentage = self.percentage()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L284_C8", "label": "if", "type": "if", "loc": [284, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "vector": [4, 2, 0.7668, 0.0134, 2, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value != self.maxval:\n self.fd.write(self._format_line() + '\\r')\n else:\n self.finished = True\n self.fd.write(self._format_line() + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L285_C12", "label": "write()", "type": "expression", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L284_C8", "vector": [8, 3, 0.7641, 0.0027, 3, 0.99, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.fd.write(self._format_line() + '\\r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L287_C12", "label": "self.finished =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L284_C8", "vector": [14, 3, 0.7694, 0.0027, 3, 0.99, 0.5, 742, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.finished", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.finished = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L288_C12", "label": "write()", "type": "expression", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L284_C8", "vector": [8, 3, 0.7721, 0.0027, 3, 0.99, 1.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.fd.write(self._format_line() + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L290_C4", "label": "start", "type": "function", "loc": [290, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.7936, 0.0349, 1, 0.71, 0.8889, 511, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self):\n \"\"\"Start measuring time, and prints the bar at 0%.\n\n It returns self so you can use it like this:\n >>> pbar = ProgressBar().start()\n >>> for i in xrange(100):\n ... # do something\n ... pbar.update(i+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L291_C8", "label": "expression", "type": "expression", "loc": [291, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L290_C4", "vector": [8, 2, 0.7922, 0.0268, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Start measuring time, and prints the bar at 0%.\n\n It returns self so you can use it like this:\n >>> pbar = ProgressBar().start()\n >>> for i in xrange(100):\n ... # do something\n ... pbar.update(i+1)\n ..."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L301_C8", "label": "update()", "type": "expression", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L290_C4", "vector": [8, 2, 0.807, 0.0027, 2, 0.66, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L302_C8", "label": "return", "type": "return", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L290_C4", "vector": [13, 2, 0.8097, 0.0027, 2, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L304_C4", "label": "finish", "type": "function", "loc": [304, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "vector": [2, 1, 0.8204, 0.0134, 1, 0.71, 1.0, 380, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "finish", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def finish(self):\n \"\"\"Used to tell the progress is finished.\"\"\"\n self.update(self.maxval)\n if self.signal_set:\n signal.signal(signal.SIGWINCH, signal.SIG_DFL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L305_C8", "label": "expression", "type": "expression", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L304_C4", "vector": [8, 2, 0.8177, 0.0027, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Used to tell the progress is finished.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L306_C8", "label": "update()", "type": "expression", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L304_C4", "vector": [8, 2, 0.8204, 0.0027, 2, 0.38, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update(self.maxval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L307_C8", "label": "if", "type": "if", "loc": [307, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L304_C4", "vector": [4, 2, 0.8244, 0.0054, 2, 0.38, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.signal_set:\n signal.signal(signal.SIGWINCH, signal.SIG_DFL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L308_C12", "label": "signal()", "type": "expression", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L307_C8", "vector": [8, 3, 0.8257, 0.0027, 3, 0.55, 0.0, 621, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "signal", "arg_names": [], "import_names": [], "rhs_call_name": "signal", "annotation": ""}, "snippet": " signal.signal(signal.SIGWINCH, signal.SIG_DFL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "label": "if", "type": "if", "loc": [315, 372], "level": 0, "parent": null, "vector": [4, 0, 0.9209, 0.1555, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 44], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import os\n\n def example1():\n widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()),\n ' ', ETA(), ' ', FileTransferSpeed()]\n pbar = ProgressBar(widgets=widgets, maxval=10000000).start()\n for i in range(1000000):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Import_L316_C4", "label": "os import os", "type": "import", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [1, 1, 0.8472, 0.0027, 1, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": " import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "label": "example1", "type": "function", "loc": [318, 326], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [2, 1, 0.8633, 0.0241, 1, 0.66, 0.125, 57, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "example1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def example1():\n widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()),\n ' ', ETA(), ' ', FileTransferSpeed()]\n pbar = ProgressBar(widgets=widgets, maxval=10000000).start()\n for i in range(1000000):\n # do something\n pbar.update(10 * i + 1)\n pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L319_C8", "label": "widgets =", "type": "assigned_variable", "loc": [319, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "vector": [14, 2, 0.8566, 0.0054, 2, 0.55, 0.0, 178, 0, 0, 0, 0, 0, 5, 5], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()),\n ' ', ETA(), ' ', FileTransferSpeed()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L321_C8", "label": "pbar = start()", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "vector": [14, 2, 0.8606, 0.0027, 2, 0.55, 0.25, 378, 3, 0, 0, 0, 511, 10, 2], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " pbar = ProgressBar(widgets=widgets, maxval=10000000).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L322_C8", "label": "for i", "type": "for", "loc": [322, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "vector": [6, 2, 0.866, 0.008, 2, 0.55, 0.5, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1000000):\n # do something\n pbar.update(10 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L324_C12", "label": "update()", "type": "expression", "loc": [324, 324], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L322_C8", "vector": [8, 3, 0.8686, 0.0027, 3, 0.03, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " pbar.update(10 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L325_C8", "label": "finish()", "type": "expression", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "vector": [8, 2, 0.8713, 0.0027, 2, 0.55, 0.75, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L326_C8", "label": "expression", "type": "expression", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "vector": [8, 2, 0.874, 0.0027, 2, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "label": "example2", "type": "function", "loc": [328, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [2, 1, 0.9021, 0.0483, 1, 0.66, 0.25, 56, 0, 0, 1, 0, 0, 0, 12], "semantic": {"name": "example2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def example2():\n class CrazyFileTransferSpeed(FileTransferSpeed):\n \"It's bigger between 45 and 80 percent\"\n def update(self, pbar):\n if 45 < pbar.percentage() < 80:\n return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)\n else:\n return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L329_C8", "label": "CrazyFileTransferSpeed", "type": "class", "loc": [329, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "vector": [3, 2, 0.8901, 0.0188, 2, 0.98, 0.0, 503, 0, 1, 0, 0, 29, 0, 3], "semantic": {"name": "CrazyFileTransferSpeed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class CrazyFileTransferSpeed(FileTransferSpeed):\n \"It's bigger between 45 and 80 percent\"\n def update(self, pbar):\n if 45 < pbar.percentage() < 80:\n return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)\n else:\n return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L330_C12", "label": "expression", "type": "expression", "loc": [330, 330], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L329_C8", "vector": [8, 3, 0.8847, 0.0027, 3, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"It's bigger between 45 and 80 percent\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L331_C12", "label": "update", "type": "function", "loc": [331, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L329_C8", "vector": [2, 3, 0.8928, 0.0134, 3, 0.1, 1.0, 637, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": ["self", "pbar"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, pbar):\n if 45 < pbar.percentage() < 80:\n return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)\n else:\n return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L332_C16", "label": "if", "type": "if", "loc": [332, 335], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L331_C12", "vector": [4, 4, 0.8941, 0.0107, 4, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 45 < pbar.percentage() < 80:\n return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)\n else:\n return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L333_C20", "label": "return", "type": "return", "loc": [333, 333], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L332_C16", "vector": [13, 5, 0.8928, 0.0027, 5, 0.38, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Bigger Now ' + FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L335_C20", "label": "return", "type": "return", "loc": [335, 335], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L332_C16", "vector": [13, 5, 0.8981, 0.0027, 5, 0.38, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return FileTransferSpeed.update(self, pbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L337_C8", "label": "widgets =", "type": "assigned_variable", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "vector": [14, 2, 0.9035, 0.0027, 2, 0.98, 0.1667, 178, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = [CrazyFileTransferSpeed(), ' <<<', Bar(), '>>> ', Percentage(), ' ', ETA()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L338_C8", "label": "pbar = ProgressBar()", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "vector": [14, 2, 0.9062, 0.0027, 2, 0.98, 0.3333, 378, 3, 2, 0, 0, 657, 10, 1], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "ProgressBar", "annotation": ""}, "snippet": " pbar = ProgressBar(widgets=widgets, maxval=10000000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L340_C8", "label": "start()", "type": "expression", "loc": [340, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "vector": [8, 2, 0.9115, 0.0027, 2, 0.98, 0.5, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " pbar.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L341_C8", "label": "for i", "type": "for", "loc": [341, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "vector": [6, 2, 0.9169, 0.008, 2, 0.98, 0.6667, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(2000000):\n # do something\n pbar.update(5 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L343_C12", "label": "update()", "type": "expression", "loc": [343, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L341_C8", "vector": [8, 3, 0.9196, 0.0027, 3, 0.75, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " pbar.update(5 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L344_C8", "label": "finish()", "type": "expression", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "vector": [8, 2, 0.9223, 0.0027, 2, 0.98, 0.8333, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L345_C8", "label": "expression", "type": "expression", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "vector": [8, 2, 0.9249, 0.0027, 2, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "label": "example3", "type": "function", "loc": [347, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [2, 1, 0.9397, 0.0214, 1, 0.66, 0.375, 189, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "example3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def example3():\n widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')]\n pbar = ProgressBar(widgets=widgets, maxval=10000000).start()\n for i in range(1000000):\n # do something\n pbar.update(10 * i + 1)\n pbar.finish()\n print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L348_C8", "label": "widgets =", "type": "assigned_variable", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "vector": [14, 2, 0.933, 0.0027, 2, 0.61, 0.0, 178, 0, 0, 0, 0, 0, 5, 3], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L349_C8", "label": "pbar = start()", "type": "assigned_variable", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "vector": [14, 2, 0.9357, 0.0027, 2, 0.61, 0.25, 378, 3, 0, 0, 0, 511, 10, 2], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " pbar = ProgressBar(widgets=widgets, maxval=10000000).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L350_C8", "label": "for i", "type": "for", "loc": [350, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "vector": [6, 2, 0.941, 0.008, 2, 0.61, 0.5, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1000000):\n # do something\n pbar.update(10 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L352_C12", "label": "update()", "type": "expression", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L350_C8", "vector": [8, 3, 0.9437, 0.0027, 3, 0.68, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " pbar.update(10 * i + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L353_C8", "label": "finish()", "type": "expression", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "vector": [8, 2, 0.9464, 0.0027, 2, 0.61, 0.75, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L354_C8", "label": "expression", "type": "expression", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "vector": [8, 2, 0.9491, 0.0027, 2, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "label": "example4", "type": "function", "loc": [356, 366], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [2, 1, 0.9678, 0.0295, 1, 0.66, 0.5, 11, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "example4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def example4():\n widgets = ['Test: ', Percentage(), ' ',\n Bar(marker='0', left='[', right=']'),\n ' ', ETA(), ' ', FileTransferSpeed()]\n pbar = ProgressBar(widgets=widgets, maxval=500)\n pbar.start()\n for i in range(100, 500 + 1, 50):\n time.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L357_C8", "label": "widgets =", "type": "assigned_variable", "loc": [357, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "vector": [14, 2, 0.9598, 0.008, 2, 0.55, 0.0, 178, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = ['Test: ', Percentage(), ' ',\n Bar(marker='0', left='[', right=']'),\n ' ', ETA(), ' ', FileTransferSpeed()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L360_C8", "label": "pbar = ProgressBar()", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "vector": [14, 2, 0.9651, 0.0027, 2, 0.55, 0.2, 378, 3, 2, 0, 0, 657, 10, 1], "semantic": {"name": "pbar", "arg_names": [], "import_names": [], "rhs_call_name": "ProgressBar", "annotation": ""}, "snippet": " pbar = ProgressBar(widgets=widgets, maxval=500)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L361_C8", "label": "start()", "type": "expression", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "vector": [8, 2, 0.9678, 0.0027, 2, 0.55, 0.4, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " pbar.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L362_C8", "label": "for i", "type": "for", "loc": [362, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "vector": [6, 2, 0.9732, 0.008, 2, 0.55, 0.6, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(100, 500 + 1, 50):\n time.sleep(0.2)\n pbar.update(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L363_C12", "label": "sleep()", "type": "expression", "loc": [363, 363], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L362_C8", "vector": [8, 3, 0.9732, 0.0027, 3, 0.21, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L364_C12", "label": "update()", "type": "expression", "loc": [364, 364], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L362_C8", "vector": [8, 3, 0.9759, 0.0027, 3, 0.21, 1.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " pbar.update(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L365_C8", "label": "finish()", "type": "expression", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "vector": [8, 2, 0.9786, 0.0027, 2, 0.55, 0.8, 380, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finish", "arg_names": [], "import_names": [], "rhs_call_name": "finish", "annotation": ""}, "snippet": " pbar.finish()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L366_C8", "label": "expression", "type": "expression", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "vector": [8, 2, 0.9812, 0.0027, 2, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " print"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L369_C4", "label": "example1()", "type": "expression", "loc": [369, 369], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [8, 1, 0.9893, 0.0027, 1, 0.66, 0.625, 57, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "example1", "arg_names": [], "import_names": [], "rhs_call_name": "example1", "annotation": ""}, "snippet": " example1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L370_C4", "label": "example2()", "type": "expression", "loc": [370, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [8, 1, 0.992, 0.0027, 1, 0.66, 0.75, 56, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "example2", "arg_names": [], "import_names": [], "rhs_call_name": "example2", "annotation": ""}, "snippet": " example2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L371_C4", "label": "example3()", "type": "expression", "loc": [371, 371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [8, 1, 0.9946, 0.0027, 1, 0.66, 0.875, 189, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "example3", "arg_names": [], "import_names": [], "rhs_call_name": "example3", "annotation": ""}, "snippet": " example3()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L372_C4", "label": "example4()", "type": "expression", "loc": [372, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "vector": [8, 1, 0.9973, 0.0027, 1, 0.66, 1.0, 11, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "example4", "arg_names": [], "import_names": [], "rhs_call_name": "example4", "annotation": ""}, "snippet": " example4()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:ImportFrom_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Import_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L225_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L226_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L227_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:Try_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L229_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L252_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L254_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L258_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L261_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L263_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L264_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L284_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Import_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L324_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L318_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L329_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:ClassDef_L329_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L331_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L332_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L332_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L333_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L332_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Return_L335_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L341_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L343_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L350_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:For_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L364_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99999:If_L315_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99999:Expr_L372_C4"}]